diff --git a/.next/app-build-manifest.json b/.next/app-build-manifest.json index 86cea48a..82f6f3b5 100644 --- a/.next/app-build-manifest.json +++ b/.next/app-build-manifest.json @@ -6,15 +6,10 @@ "static/css/app/layout.css", "static/chunks/app/layout.js" ], - "/page": [ + "/_not-found/page": [ "static/chunks/webpack.js", "static/chunks/main-app.js", - "static/chunks/app/page.js" - ], - "/api/monitor/route": [ - "static/chunks/webpack.js", - "static/chunks/main-app.js", - "static/chunks/app/api/monitor/route.js" + "static/chunks/app/_not-found/page.js" ] } } \ No newline at end of file diff --git a/.next/cache/webpack/client-development-fallback/0.pack.gz b/.next/cache/webpack/client-development-fallback/0.pack.gz new file mode 100644 index 00000000..5aac7cf0 Binary files /dev/null and b/.next/cache/webpack/client-development-fallback/0.pack.gz differ diff --git a/.next/cache/webpack/client-development-fallback/index.pack.gz b/.next/cache/webpack/client-development-fallback/index.pack.gz new file mode 100644 index 00000000..bc4861e1 Binary files /dev/null and b/.next/cache/webpack/client-development-fallback/index.pack.gz differ diff --git a/.next/cache/webpack/client-development/0.pack.gz b/.next/cache/webpack/client-development/0.pack.gz index 5e414be2..35762471 100644 Binary files a/.next/cache/webpack/client-development/0.pack.gz and b/.next/cache/webpack/client-development/0.pack.gz differ diff --git a/.next/cache/webpack/client-development/10.pack.gz b/.next/cache/webpack/client-development/10.pack.gz index be464bf0..85f1a341 100644 Binary files a/.next/cache/webpack/client-development/10.pack.gz and b/.next/cache/webpack/client-development/10.pack.gz differ diff --git a/.next/cache/webpack/client-development/11.pack.gz b/.next/cache/webpack/client-development/11.pack.gz index 5895b7de..d711491b 100644 Binary files a/.next/cache/webpack/client-development/11.pack.gz and b/.next/cache/webpack/client-development/11.pack.gz differ diff --git a/.next/cache/webpack/client-development/13.pack.gz b/.next/cache/webpack/client-development/13.pack.gz new file mode 100644 index 00000000..3b091952 Binary files /dev/null and b/.next/cache/webpack/client-development/13.pack.gz differ diff --git a/.next/cache/webpack/client-development/14.pack.gz b/.next/cache/webpack/client-development/14.pack.gz new file mode 100644 index 00000000..98728a00 Binary files /dev/null and b/.next/cache/webpack/client-development/14.pack.gz differ diff --git a/.next/cache/webpack/client-development/2.pack.gz b/.next/cache/webpack/client-development/2.pack.gz index 0a0cc2bb..4aa0ced3 100644 Binary files a/.next/cache/webpack/client-development/2.pack.gz and b/.next/cache/webpack/client-development/2.pack.gz differ diff --git a/.next/cache/webpack/client-development/3.pack.gz b/.next/cache/webpack/client-development/3.pack.gz index c3ee7f0f..6165c8d5 100644 Binary files a/.next/cache/webpack/client-development/3.pack.gz and b/.next/cache/webpack/client-development/3.pack.gz differ diff --git a/.next/cache/webpack/client-development/4.pack.gz b/.next/cache/webpack/client-development/4.pack.gz index 1430a989..a8c91c97 100644 Binary files a/.next/cache/webpack/client-development/4.pack.gz and b/.next/cache/webpack/client-development/4.pack.gz differ diff --git a/.next/cache/webpack/client-development/5.pack.gz b/.next/cache/webpack/client-development/5.pack.gz index 6869ba8f..215f7568 100644 Binary files a/.next/cache/webpack/client-development/5.pack.gz and b/.next/cache/webpack/client-development/5.pack.gz differ diff --git a/.next/cache/webpack/client-development/6.pack.gz b/.next/cache/webpack/client-development/6.pack.gz index 913483b1..df1f4c0e 100644 Binary files a/.next/cache/webpack/client-development/6.pack.gz and b/.next/cache/webpack/client-development/6.pack.gz differ diff --git a/.next/cache/webpack/client-development/7.pack.gz b/.next/cache/webpack/client-development/7.pack.gz index d48628db..7fb94620 100644 Binary files a/.next/cache/webpack/client-development/7.pack.gz and b/.next/cache/webpack/client-development/7.pack.gz differ diff --git a/.next/cache/webpack/client-development/index.pack.gz b/.next/cache/webpack/client-development/index.pack.gz index 5fc6cbb6..d128cfeb 100644 Binary files a/.next/cache/webpack/client-development/index.pack.gz and b/.next/cache/webpack/client-development/index.pack.gz differ diff --git a/.next/cache/webpack/client-development/index.pack.gz.old b/.next/cache/webpack/client-development/index.pack.gz.old index 5b0beb62..00d4eb13 100644 Binary files a/.next/cache/webpack/client-development/index.pack.gz.old and b/.next/cache/webpack/client-development/index.pack.gz.old differ diff --git a/.next/cache/webpack/server-development/1.pack.gz b/.next/cache/webpack/server-development/1.pack.gz index 7c77069b..e060fd96 100644 Binary files a/.next/cache/webpack/server-development/1.pack.gz and b/.next/cache/webpack/server-development/1.pack.gz differ diff --git a/.next/cache/webpack/server-development/10.pack.gz b/.next/cache/webpack/server-development/10.pack.gz index a8c3a3e6..91fc5048 100644 Binary files a/.next/cache/webpack/server-development/10.pack.gz and b/.next/cache/webpack/server-development/10.pack.gz differ diff --git a/.next/cache/webpack/server-development/11.pack.gz b/.next/cache/webpack/server-development/11.pack.gz index 78630cf0..7a932e02 100644 Binary files a/.next/cache/webpack/server-development/11.pack.gz and b/.next/cache/webpack/server-development/11.pack.gz differ diff --git a/.next/cache/webpack/server-development/2.pack.gz b/.next/cache/webpack/server-development/2.pack.gz index 05090f3f..7b7160f1 100644 Binary files a/.next/cache/webpack/server-development/2.pack.gz and b/.next/cache/webpack/server-development/2.pack.gz differ diff --git a/.next/cache/webpack/server-development/3.pack.gz b/.next/cache/webpack/server-development/3.pack.gz index 610f5f84..f1fcfeee 100644 Binary files a/.next/cache/webpack/server-development/3.pack.gz and b/.next/cache/webpack/server-development/3.pack.gz differ diff --git a/.next/cache/webpack/server-development/4.pack.gz b/.next/cache/webpack/server-development/4.pack.gz index 9fbe0129..d40ca31c 100644 Binary files a/.next/cache/webpack/server-development/4.pack.gz and b/.next/cache/webpack/server-development/4.pack.gz differ diff --git a/.next/cache/webpack/server-development/6.pack.gz b/.next/cache/webpack/server-development/6.pack.gz index 8c373d5a..dae9eb3d 100644 Binary files a/.next/cache/webpack/server-development/6.pack.gz and b/.next/cache/webpack/server-development/6.pack.gz differ diff --git a/.next/cache/webpack/server-development/7.pack.gz b/.next/cache/webpack/server-development/7.pack.gz index 81f99e01..63a28e65 100644 Binary files a/.next/cache/webpack/server-development/7.pack.gz and b/.next/cache/webpack/server-development/7.pack.gz differ diff --git a/.next/cache/webpack/server-development/8.pack.gz b/.next/cache/webpack/server-development/8.pack.gz index bb055ba8..752201ff 100644 Binary files a/.next/cache/webpack/server-development/8.pack.gz and b/.next/cache/webpack/server-development/8.pack.gz differ diff --git a/.next/cache/webpack/server-development/9.pack.gz b/.next/cache/webpack/server-development/9.pack.gz index 43905a01..2981610c 100644 Binary files a/.next/cache/webpack/server-development/9.pack.gz and b/.next/cache/webpack/server-development/9.pack.gz differ diff --git a/.next/cache/webpack/server-development/index.pack.gz b/.next/cache/webpack/server-development/index.pack.gz index 5f1c7e68..e29ed0af 100644 Binary files a/.next/cache/webpack/server-development/index.pack.gz and b/.next/cache/webpack/server-development/index.pack.gz differ diff --git a/.next/cache/webpack/server-development/index.pack.gz.old b/.next/cache/webpack/server-development/index.pack.gz.old index 363981f0..dd09e012 100644 Binary files a/.next/cache/webpack/server-development/index.pack.gz.old and b/.next/cache/webpack/server-development/index.pack.gz.old differ diff --git a/.next/fallback-build-manifest.json b/.next/fallback-build-manifest.json new file mode 100644 index 00000000..25ac001c --- /dev/null +++ b/.next/fallback-build-manifest.json @@ -0,0 +1,28 @@ +{ + "polyfillFiles": [ + "static/chunks/polyfills.js" + ], + "devFiles": [ + "static/chunks/fallback/react-refresh.js" + ], + "ampDevFiles": [ + "static/chunks/fallback/webpack.js", + "static/chunks/fallback/amp.js" + ], + "lowPriorityFiles": [], + "rootMainFiles": [], + "rootMainFilesTree": {}, + "pages": { + "/_app": [ + "static/chunks/fallback/webpack.js", + "static/chunks/fallback/main.js", + "static/chunks/fallback/pages/_app.js" + ], + "/_error": [ + "static/chunks/fallback/webpack.js", + "static/chunks/fallback/main.js", + "static/chunks/fallback/pages/_error.js" + ] + }, + "ampFirstPages": [] +} \ No newline at end of file diff --git a/.next/server/app-paths-manifest.json b/.next/server/app-paths-manifest.json index 98d61fca..523c2ecd 100644 --- a/.next/server/app-paths-manifest.json +++ b/.next/server/app-paths-manifest.json @@ -1,4 +1,3 @@ { - "/api/monitor/route": "app/api/monitor/route.js", - "/page": "app/page.js" + "/_not-found/page": "app/_not-found/page.js" } \ No newline at end of file diff --git a/.next/server/app/_not-found/page.js b/.next/server/app/_not-found/page.js new file mode 100644 index 00000000..49a7816a --- /dev/null +++ b/.next/server/app/_not-found/page.js @@ -0,0 +1,164 @@ +/* + * ATTENTION: An "eval-source-map" devtool has been used. + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +(() => { +var exports = {}; +exports.id = "app/_not-found/page"; +exports.ids = ["app/_not-found/page"]; +exports.modules = { + +/***/ "next/dist/compiled/next-server/app-page.runtime.dev.js": +/*!*************************************************************************!*\ + !*** external "next/dist/compiled/next-server/app-page.runtime.dev.js" ***! + \*************************************************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("next/dist/compiled/next-server/app-page.runtime.dev.js"); + +/***/ }), + +/***/ "../app-render/action-async-storage.external": +/*!*******************************************************************************!*\ + !*** external "next/dist/server/app-render/action-async-storage.external.js" ***! + \*******************************************************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); + +/***/ }), + +/***/ "../app-render/after-task-async-storage.external": +/*!***********************************************************************************!*\ + !*** external "next/dist/server/app-render/after-task-async-storage.external.js" ***! + \***********************************************************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); + +/***/ }), + +/***/ "../app-render/work-async-storage.external": +/*!*****************************************************************************!*\ + !*** external "next/dist/server/app-render/work-async-storage.external.js" ***! + \*****************************************************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); + +/***/ }), + +/***/ "./work-unit-async-storage.external": +/*!**********************************************************************************!*\ + !*** external "next/dist/server/app-render/work-unit-async-storage.external.js" ***! + \**********************************************************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); + +/***/ }), + +/***/ "path": +/*!***********************!*\ + !*** external "path" ***! + \***********************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("path"); + +/***/ }), + +/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2F_not-found%2Fpage&page=%2F_not-found%2Fpage&appPaths=&pagePath=..%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!": +/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2F_not-found%2Fpage&page=%2F_not-found%2Fpage&appPaths=&pagePath=..%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D! ***! + \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2___default.a),\n/* harmony export */ __next_app__: () => (/* binding */ __next_app__),\n/* harmony export */ pages: () => (/* binding */ pages),\n/* harmony export */ routeModule: () => (/* binding */ routeModule),\n/* harmony export */ tree: () => (/* binding */ tree)\n/* harmony export */ });\n/* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! next/dist/server/route-modules/app-page/module.compiled */ \"(ssr)/./node_modules/next/dist/server/route-modules/app-page/module.compiled.js?91d2\");\n/* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! next/dist/server/route-kind */ \"(rsc)/./node_modules/next/dist/server/route-kind.js\");\n/* harmony import */ var next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! next/dist/client/components/error-boundary */ \"(rsc)/./node_modules/next/dist/client/components/error-boundary.js\");\n/* harmony import */ var next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! next/dist/server/app-render/entry-base */ \"(rsc)/./node_modules/next/dist/server/app-render/entry-base.js\");\n/* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__) if([\"default\",\"tree\",\"pages\",\"GlobalError\",\"__next_app__\",\"routeModule\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\nconst notFound0 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! next/dist/client/components/not-found-error */ \"(rsc)/./node_modules/next/dist/client/components/not-found-error.js\", 23));\nconst module1 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.bind(__webpack_require__, /*! ./src/app/layout.tsx */ \"(rsc)/./src/app/layout.tsx\"));\nconst module2 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! next/dist/client/components/not-found-error */ \"(rsc)/./node_modules/next/dist/client/components/not-found-error.js\", 23));\nconst module3 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! next/dist/client/components/forbidden-error */ \"(rsc)/./node_modules/next/dist/client/components/forbidden-error.js\", 23));\nconst module4 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! next/dist/client/components/unauthorized-error */ \"(rsc)/./node_modules/next/dist/client/components/unauthorized-error.js\", 23));\n\n\n// We inject the tree and pages here so that we can use them in the route\n// module.\nconst tree = {\n children: [\n '',\n {\n children: [\"/_not-found\", {\n children: ['__PAGE__', {}, {\n page: [\n notFound0,\n \"next/dist/client/components/not-found-error\"\n ]\n }]\n }, {}]\n },\n {\n 'layout': [module1, \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout.tsx\"],\n'not-found': [module2, \"next/dist/client/components/not-found-error\"],\n'forbidden': [module3, \"next/dist/client/components/forbidden-error\"],\n'unauthorized': [module4, \"next/dist/client/components/unauthorized-error\"],\n \n }\n ]\n }.children;\nconst pages = [];\n\n\nconst __next_app_require__ = __webpack_require__\nconst __next_app_load_chunk__ = () => Promise.resolve()\nconst __next_app__ = {\n require: __next_app_require__,\n loadChunk: __next_app_load_chunk__\n};\n\n// Create and export the route module that will be consumed.\nconst routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({\n definition: {\n kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,\n page: \"/_not-found/page\",\n pathname: \"/_not-found\",\n // The following aren't used in production.\n bundlePath: '',\n filename: '',\n appPaths: []\n },\n userland: {\n loaderTree: tree\n }\n});\n\n//# sourceMappingURL=app-page.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWFwcC1sb2FkZXIvaW5kZXguanM/bmFtZT1hcHAlMkZfbm90LWZvdW5kJTJGcGFnZSZwYWdlPSUyRl9ub3QtZm91bmQlMkZwYWdlJmFwcFBhdGhzPSZwYWdlUGF0aD0uLiUyRm5vZGVfbW9kdWxlcyUyRm5leHQlMkZkaXN0JTJGY2xpZW50JTJGY29tcG9uZW50cyUyRm5vdC1mb3VuZC1lcnJvci5qcyZhcHBEaXI9JTJGVXNlcnMlMkZtYXR0YnJ1Y2UlMkZEb2N1bWVudHMlMkZQcm9qZWN0cyUyRk9wZW5DbGF3JTJGV2ViJTJGaGVhcnRiZWF0LW1vbml0b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OiB7XG4gICAgICAgIGxvYWRlclRyZWU6IHRyZWVcbiAgICB9XG59KTtcblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9YXBwLXBhZ2UuanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2F_not-found%2Fpage&page=%2F_not-found%2Fpage&appPaths=&pagePath=..%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!\n"); + +/***/ }), + +/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!": +/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! + \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +eval("Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-page.js */ \"(rsc)/./node_modules/next/dist/client/components/client-page.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-segment.js */ \"(rsc)/./node_modules/next/dist/client/components/client-segment.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/error-boundary.js */ \"(rsc)/./node_modules/next/dist/client/components/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js */ \"(rsc)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/layout-router.js */ \"(rsc)/./node_modules/next/dist/client/components/layout-router.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/render-from-template-context.js */ \"(rsc)/./node_modules/next/dist/client/components/render-from-template-context.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/lib/metadata/metadata-boundary.js */ \"(rsc)/./node_modules/next/dist/lib/metadata/metadata-boundary.js\", 23));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWZsaWdodC1jbGllbnQtZW50cnktbG9hZGVyLmpzP21vZHVsZXM9JTdCJTIycmVxdWVzdCUyMiUzQSUyMiUyRlVzZXJzJTJGbWF0dGJydWNlJTJGRG9jdW1lbnRzJTJGUHJvamVjdHMlMkZPcGVuQ2xhdyUyRldlYiUyRmhlYXJ0YmV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RiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9sYXlvdXQtcm91dGVyLmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9yZW5kZXItZnJvbS10ZW1wbGF0ZS1jb250ZXh0LmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9saWIvbWV0YWRhdGEvbWV0YWRhdGEtYm91bmRhcnkuanNcIik7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!\n"); + +/***/ }), + +/***/ "(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!": +/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! + \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +eval("Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-page.js */ \"(ssr)/./node_modules/next/dist/client/components/client-page.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-segment.js */ \"(ssr)/./node_modules/next/dist/client/components/client-segment.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/error-boundary.js */ \"(ssr)/./node_modules/next/dist/client/components/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js */ \"(ssr)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/layout-router.js */ \"(ssr)/./node_modules/next/dist/client/components/layout-router.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/render-from-template-context.js */ \"(ssr)/./node_modules/next/dist/client/components/render-from-template-context.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/lib/metadata/metadata-boundary.js */ \"(ssr)/./node_modules/next/dist/lib/metadata/metadata-boundary.js\", 23));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWZsaWdodC1jbGllbnQtZW50cnktbG9hZGVyLmpzP21vZHVsZXM9JTdCJTIyc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C8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9sYXlvdXQtcm91dGVyLmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9yZW5kZXItZnJvbS10ZW1wbGF0ZS1jb250ZXh0LmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9saWIvbWV0YWRhdGEvbWV0YWRhdGEtYm91bmRhcnkuanNcIik7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!\n"); + +/***/ }), + +/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true!": +/*!**************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! + \**************************************************************************************************************************************************************************************************************************************************************************/ +/***/ (() => { + + + +/***/ }), + +/***/ "(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true!": +/*!**************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! + \**************************************************************************************************************************************************************************************************************************************************************************/ +/***/ (() => { + + + +/***/ }), + +/***/ "(rsc)/./src/app/globals.css": +/*!*****************************!*\ + !*** ./src/app/globals.css ***! + \*****************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"43019ed0b75a\");\nif (false) {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9zcmMvYXBwL2dsb2JhbHMuY3NzIiwibWFwcGluZ3MiOiI7Ozs7QUFBQSxpRUFBZSxjQUFjO0FBQzdCLElBQUksS0FBVSxFQUFFLEVBQXVCIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivc3JjL2FwcC9nbG9iYWxzLmNzcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBcIjQzMDE5ZWQwYjc1YVwiXG5pZiAobW9kdWxlLmhvdCkgeyBtb2R1bGUuaG90LmFjY2VwdCgpIH1cbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./src/app/globals.css\n"); + +/***/ }), + +/***/ "(rsc)/./src/app/layout.tsx": +/*!****************************!*\ + !*** ./src/app/layout.tsx ***! + \****************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ RootLayout),\n/* harmony export */ metadata: () => (/* binding */ metadata)\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(rsc)/./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js\");\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./globals.css */ \"(rsc)/./src/app/globals.css\");\n\n\nconst metadata = {\n title: \"Heartbeat Monitor\",\n description: \"Real-time monitoring dashboard for your web applications\"\n};\nfunction RootLayout({ children }) {\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"html\", {\n lang: \"en\",\n className: \"dark\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"body\", {\n className: \"antialiased\",\n children: children\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout.tsx\",\n lineNumber: 16,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout.tsx\",\n lineNumber: 15,\n columnNumber: 5\n }, this);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9zcmMvYXBwL2xheW91dC50c3giLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQ3VCO0FBRWhCLE1BQU1BLFdBQXFCO0lBQ2hDQyxPQUFPO0lBQ1BDLGFBQWE7QUFDZixFQUFFO0FBRWEsU0FBU0MsV0FBVyxFQUNqQ0MsUUFBUSxFQUdSO0lBQ0EscUJBQ0UsOERBQUNDO1FBQUtDLE1BQUs7UUFBS0MsV0FBVTtrQkFDeEIsNEVBQUNDO1lBQUtELFdBQVU7c0JBQWVIOzs7Ozs7Ozs7OztBQUdyQyIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvV2ViL2hlYXJ0YmVhdC1tb25pdG9yL3NyYy9hcHAvbGF5b3V0LnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IE1ldGFkYXRhIH0gZnJvbSBcIm5leHRcIjtcbmltcG9ydCBcIi4vZ2xvYmFscy5jc3NcIjtcblxuZXhwb3J0IGNvbnN0IG1ldGFkYXRhOiBNZXRhZGF0YSA9IHtcbiAgdGl0bGU6IFwiSGVhcnRiZWF0IE1vbml0b3JcIixcbiAgZGVzY3JpcHRpb246IFwiUmVhbC10aW1lIG1vbml0b3JpbmcgZGFzaGJvYXJkIGZvciB5b3VyIHdlYiBhcHBsaWNhdGlvbnNcIixcbn07XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIFJvb3RMYXlvdXQoe1xuICBjaGlsZHJlbixcbn06IFJlYWRvbmx5PHtcbiAgY2hpbGRyZW46IFJlYWN0LlJlYWN0Tm9kZTtcbn0+KSB7XG4gIHJldHVybiAoXG4gICAgPGh0bWwgbGFuZz1cImVuXCIgY2xhc3NOYW1lPVwiZGFya1wiPlxuICAgICAgPGJvZHkgY2xhc3NOYW1lPVwiYW50aWFsaWFzZWRcIj57Y2hpbGRyZW59PC9ib2R5PlxuICAgIDwvaHRtbD5cbiAgKTtcbn1cbiJdLCJuYW1lcyI6WyJtZXRhZGF0YSIsInRpdGxlIiwiZGVzY3JpcHRpb24iLCJSb290TGF5b3V0IiwiY2hpbGRyZW4iLCJodG1sIiwibGFuZyIsImNsYXNzTmFtZSIsImJvZHkiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./src/app/layout.tsx\n"); + +/***/ }) + +}; +; + +// load runtime +var __webpack_require__ = require("../../webpack-runtime.js"); +__webpack_require__.C(exports); +var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +var __webpack_exports__ = __webpack_require__.X(0, ["vendor-chunks/next","vendor-chunks/@swc"], () => (__webpack_exec__("(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2F_not-found%2Fpage&page=%2F_not-found%2Fpage&appPaths=&pagePath=..%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!"))); +module.exports = __webpack_exports__; + +})(); \ No newline at end of file diff --git a/.next/server/app/_not-found/page_client-reference-manifest.js b/.next/server/app/_not-found/page_client-reference-manifest.js new file mode 100644 index 00000000..a5e6c2c5 --- /dev/null +++ b/.next/server/app/_not-found/page_client-reference-manifest.js @@ -0,0 +1 @@ +globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/_not-found/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/globals.css":{"id":"(app-pages-browser)/./src/app/globals.css","name":"*","chunks":["app/layout","static/chunks/app/layout.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/client-page.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/client-page.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/client-segment.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/client-segment.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/layout-router.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/layout-router.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/render-from-template-context.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false}},"entryCSSFiles":{"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/":[],"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout":[{"inlined":false,"path":"static/css/app/layout.css"}],"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/_not-found/page":[]},"rscModuleMapping":{"(app-pages-browser)/./src/app/globals.css":{"*":{"id":"(rsc)/./src/app/globals.css","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}} \ No newline at end of file diff --git a/.next/server/app/api/monitor/route.js b/.next/server/app/api/monitor/route.js deleted file mode 100644 index ce3aef28..00000000 --- a/.next/server/app/api/monitor/route.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * ATTENTION: An "eval-source-map" devtool has been used. - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -(() => { -var exports = {}; -exports.id = "app/api/monitor/route"; -exports.ids = ["app/api/monitor/route"]; -exports.modules = { - -/***/ "next/dist/compiled/next-server/app-page.runtime.dev.js": -/*!*************************************************************************!*\ - !*** external "next/dist/compiled/next-server/app-page.runtime.dev.js" ***! - \*************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/compiled/next-server/app-page.runtime.dev.js"); - -/***/ }), - -/***/ "next/dist/compiled/next-server/app-route.runtime.dev.js": -/*!**************************************************************************!*\ - !*** external "next/dist/compiled/next-server/app-route.runtime.dev.js" ***! - \**************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/compiled/next-server/app-route.runtime.dev.js"); - -/***/ }), - -/***/ "../app-render/after-task-async-storage.external": -/*!***********************************************************************************!*\ - !*** external "next/dist/server/app-render/after-task-async-storage.external.js" ***! - \***********************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); - -/***/ }), - -/***/ "../app-render/work-async-storage.external": -/*!*****************************************************************************!*\ - !*** external "next/dist/server/app-render/work-async-storage.external.js" ***! - \*****************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); - -/***/ }), - -/***/ "./work-unit-async-storage.external": -/*!**********************************************************************************!*\ - !*** external "next/dist/server/app-render/work-unit-async-storage.external.js" ***! - \**********************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); - -/***/ }), - -/***/ "fs": -/*!*********************!*\ - !*** external "fs" ***! - \*********************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("fs"); - -/***/ }), - -/***/ "path": -/*!***********************!*\ - !*** external "path" ***! - \***********************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("path"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapi%2Fmonitor%2Froute&page=%2Fapi%2Fmonitor%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Fmonitor%2Froute.ts&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!": -/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapi%2Fmonitor%2Froute&page=%2Fapi%2Fmonitor%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Fmonitor%2Froute.ts&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D! ***! - \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ patchFetch: () => (/* binding */ patchFetch),\n/* harmony export */ routeModule: () => (/* binding */ routeModule),\n/* harmony export */ serverHooks: () => (/* binding */ serverHooks),\n/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),\n/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)\n/* harmony export */ });\n/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! next/dist/server/route-modules/app-route/module.compiled */ \"(rsc)/./node_modules/next/dist/server/route-modules/app-route/module.compiled.js\");\n/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! next/dist/server/route-kind */ \"(rsc)/./node_modules/next/dist/server/route-kind.js\");\n/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! next/dist/server/lib/patch-fetch */ \"(rsc)/./node_modules/next/dist/server/lib/patch-fetch.js\");\n/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _Users_mattbruce_Documents_Projects_OpenClaw_Web_heartbeat_monitor_src_app_api_monitor_route_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./src/app/api/monitor/route.ts */ \"(rsc)/./src/app/api/monitor/route.ts\");\n\n\n\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\nconst nextConfigOutput = \"\"\nconst routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({\n definition: {\n kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,\n page: \"/api/monitor/route\",\n pathname: \"/api/monitor\",\n filename: \"route\",\n bundlePath: \"app/api/monitor/route\"\n },\n resolvedPagePath: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/api/monitor/route.ts\",\n nextConfigOutput,\n userland: _Users_mattbruce_Documents_Projects_OpenClaw_Web_heartbeat_monitor_src_app_api_monitor_route_ts__WEBPACK_IMPORTED_MODULE_3__\n});\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;\nfunction patchFetch() {\n return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({\n workAsyncStorage,\n workUnitAsyncStorage\n });\n}\n\n\n//# sourceMappingURL=app-route.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWFwcC1sb2FkZXIvaW5kZXguanM/bmFtZT1hcHAlMkZhcGklMkZtb25pdG9yJTJGcm91dGUmcGFnZT0lMkZhcGklMkZtb25pdG9yJTJGcm91dGUmYXBwUGF0aHM9JnBhZ2VQYXRoPXByaXZhdGUtbmV4dC1hcHAtZGlyJTJGYXBpJTJGbW9uaXRvciUyRnJvdXRlLnRzJmFwcERpcj0l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gdXNlcmxhbmRcbn0pO1xuLy8gUHVsbCBvdXQgdGhlIGV4cG9ydHMgdGhhdCB3ZSBuZWVkIHRvIGV4cG9zZSBmcm9tIHRoZSBtb2R1bGUuIFRoaXMgc2hvdWxkXG4vLyBiZSBlbGltaW5hdGVkIHdoZW4gd2UndmUgbW92ZWQgdGhlIG90aGVyIHJvdXRlcyB0byB0aGUgbmV3IGZvcm1hdC4gVGhlc2Vcbi8vIGFyZSB1c2VkIHRvIGhvb2sgaW50byB0aGUgcm91dGUuXG5jb25zdCB7IHdvcmtBc3luY1N0b3JhZ2UsIHdvcmtVbml0QXN5bmNTdG9yYWdlLCBzZXJ2ZXJIb29rcyB9ID0gcm91dGVNb2R1bGU7XG5mdW5jdGlvbiBwYXRjaEZldGNoKCkge1xuICAgIHJldHVybiBfcGF0Y2hGZXRjaCh7XG4gICAgICAgIHdvcmtBc3luY1N0b3JhZ2UsXG4gICAgICAgIHdvcmtVbml0QXN5bmNTdG9yYWdlXG4gICAgfSk7XG59XG5leHBvcnQgeyByb3V0ZU1vZHVsZSwgd29ya0FzeW5jU3RvcmFnZSwgd29ya1VuaXRBc3luY1N0b3JhZ2UsIHNlcnZlckhvb2tzLCBwYXRjaEZldGNoLCAgfTtcblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9YXBwLXJvdXRlLmpzLm1hcCJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapi%2Fmonitor%2Froute&page=%2Fapi%2Fmonitor%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Fmonitor%2Froute.ts&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!\n"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=true!": -/*!******************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=true! ***! - \******************************************************************************************************/ -/***/ (() => { - - - -/***/ }), - -/***/ "(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=true!": -/*!******************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=true! ***! - \******************************************************************************************************/ -/***/ (() => { - - - -/***/ }), - -/***/ "(rsc)/./src/app/api/monitor/route.ts": -/*!**************************************!*\ - !*** ./src/app/api/monitor/route.ts ***! - \**************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GET: () => (/* binding */ GET),\n/* harmony export */ POST: () => (/* binding */ POST)\n/* harmony export */ });\n/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! next/server */ \"(rsc)/./node_modules/next/dist/api/server.js\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! path */ \"path\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nconst APPS_FILE = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(process.cwd(), \"data\", \"apps.json\");\nconst STATUS_FILE = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(process.cwd(), \"data\", \"status.json\");\nfunction getApps() {\n if (!(0,fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(APPS_FILE)) return [];\n try {\n const data = JSON.parse((0,fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync)(APPS_FILE, \"utf-8\"));\n return data.apps || [];\n } catch {\n return [];\n }\n}\nfunction saveApps(apps) {\n const dir = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(process.cwd(), \"data\");\n if (!(0,fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(dir)) (__webpack_require__(/*! fs */ \"fs\").mkdirSync)(dir, {\n recursive: true\n });\n (0,fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync)(APPS_FILE, JSON.stringify({\n apps\n }, null, 2));\n}\nfunction getStatus() {\n if (!(0,fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(STATUS_FILE)) return [];\n try {\n const data = JSON.parse((0,fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync)(STATUS_FILE, \"utf-8\"));\n return data.entries || [];\n } catch {\n return [];\n }\n}\nfunction saveStatus(entries) {\n const dir = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(process.cwd(), \"data\");\n if (!(0,fs__WEBPACK_IMPORTED_MODULE_1__.existsSync)(dir)) (__webpack_require__(/*! fs */ \"fs\").mkdirSync)(dir, {\n recursive: true\n });\n (0,fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync)(STATUS_FILE, JSON.stringify({\n entries\n }, null, 2));\n}\nasync function GET(request) {\n const { searchParams } = new URL(request.url);\n const type = searchParams.get(\"type\");\n if (type === \"apps\") {\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n apps: getApps()\n });\n }\n if (type === \"status\") {\n const appId = searchParams.get(\"appId\");\n const entries = getStatus();\n if (appId) {\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n entries: entries.filter((e)=>e.appId === appId).slice(-100)\n });\n }\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n entries: entries.slice(-500)\n });\n }\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n apps: getApps(),\n status: getStatus().slice(-100)\n });\n}\nasync function POST(request) {\n const body = await request.json();\n if (body.action === \"addApp\") {\n const apps = getApps();\n const newApp = {\n ...body.app,\n id: body.app.id || Date.now().toString()\n };\n apps.push(newApp);\n saveApps(apps);\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(newApp);\n }\n if (body.action === \"updateApp\") {\n const apps = getApps();\n const index = apps.findIndex((a)=>a.id === body.id);\n if (index >= 0) {\n apps[index] = {\n ...apps[index],\n ...body.updates\n };\n saveApps(apps);\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(apps[index]);\n }\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n error: \"App not found\"\n }, {\n status: 404\n });\n }\n if (body.action === \"deleteApp\") {\n const apps = getApps().filter((a)=>a.id !== body.id);\n saveApps(apps);\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n success: true\n });\n }\n if (body.action === \"recordStatus\") {\n const entries = getStatus();\n entries.push(body.entry);\n // Keep last 1000 entries\n if (entries.length > 1000) entries.shift();\n saveStatus(entries);\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n success: true\n });\n }\n return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({\n error: \"Unknown action\"\n }, {\n status: 400\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9zcmMvYXBwL2FwaS9tb25pdG9yL3JvdXRlLnRzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBMk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bGVTeW5jIiwiZXhpc3RzU3luYyIsImpvaW4iLCJBUFBTX0ZJTEUiLCJwcm9jZXNzIiwiY3dkIiwiU1RBVFVTX0ZJTEUiLCJnZXRBcHBzIiwiZGF0YSIsIkpTT04iLCJwYXJzZSIsImFwcHMiLCJzYXZlQXBwcyIsImRpciIsInJlcXVpcmUiLCJta2RpclN5bmMiLCJyZWN1cnNpdmUiLCJzdHJpbmdpZnkiLCJnZXRTdGF0dXMiLCJlbnRyaWVzIiwic2F2ZVN0YXR1cyIsIkdFVCIsInJlcXVlc3QiLCJzZWFyY2hQYXJhbXMiLCJVUkwiLCJ1cmwiLCJ0eXBlIiwiZ2V0IiwianNvbiIsImFwcElkIiwiZmlsdGVyIiwiZSIsInNsaWNlIiwic3RhdHVzIiwiUE9TVCIsImJvZHkiLCJhY3Rpb24iLCJuZXdBcHAiLCJhcHAiLCJpZCIsIkRhdGUiLCJub3ciLCJ0b1N0cmluZyIsInB1c2giLCJpbmRleCIsImZpbmRJbmRleCIsImEiLCJ1cGRhdGVzIiwiZXJyb3IiLCJzdWNjZXNzIiwiZW50cnkiLCJsZW5ndGgiLCJzaGlmdCJdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(rsc)/./src/app/api/monitor/route.ts\n"); - -/***/ }) - -}; -; - -// load runtime -var __webpack_require__ = require("../../../webpack-runtime.js"); -__webpack_require__.C(exports); -var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) -var __webpack_exports__ = __webpack_require__.X(0, ["vendor-chunks/next"], () => (__webpack_exec__("(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fapi%2Fmonitor%2Froute&page=%2Fapi%2Fmonitor%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Fmonitor%2Froute.ts&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!"))); -module.exports = __webpack_exports__; - -})(); \ No newline at end of file diff --git a/.next/server/app/api/monitor/route_client-reference-manifest.js b/.next/server/app/api/monitor/route_client-reference-manifest.js deleted file mode 100644 index d234bf06..00000000 --- a/.next/server/app/api/monitor/route_client-reference-manifest.js +++ /dev/null @@ -1 +0,0 @@ -globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/api/monitor/route"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"(app-pages-browser)/./src/app/page.tsx":{"*":{"id":"(ssr)/./src/app/page.tsx","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/globals.css":{"id":"(app-pages-browser)/./src/app/globals.css","name":"*","chunks":["app/layout","static/chunks/app/layout.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx":{"id":"(app-pages-browser)/./src/app/page.tsx","name":"*","chunks":["app/page","static/chunks/app/page.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/client-page.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/client-page.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/client-segment.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/client-segment.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/layout-router.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/layout-router.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/render-from-template-context.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false}},"entryCSSFiles":{"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/":[],"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout":[{"inlined":false,"path":"static/css/app/layout.css"}],"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page":[],"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/api/monitor/route":[]},"rscModuleMapping":{"(app-pages-browser)/./src/app/globals.css":{"*":{"id":"(rsc)/./src/app/globals.css","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./src/app/page.tsx":{"*":{"id":"(rsc)/./src/app/page.tsx","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}} \ No newline at end of file diff --git a/.next/server/app/page.js b/.next/server/app/page.js deleted file mode 100644 index df0ea6ac..00000000 --- a/.next/server/app/page.js +++ /dev/null @@ -1,218 +0,0 @@ -/* - * ATTENTION: An "eval-source-map" devtool has been used. - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -(() => { -var exports = {}; -exports.id = "app/page"; -exports.ids = ["app/page"]; -exports.modules = { - -/***/ "next/dist/compiled/next-server/app-page.runtime.dev.js": -/*!*************************************************************************!*\ - !*** external "next/dist/compiled/next-server/app-page.runtime.dev.js" ***! - \*************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/compiled/next-server/app-page.runtime.dev.js"); - -/***/ }), - -/***/ "../app-render/action-async-storage.external": -/*!*******************************************************************************!*\ - !*** external "next/dist/server/app-render/action-async-storage.external.js" ***! - \*******************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); - -/***/ }), - -/***/ "../app-render/after-task-async-storage.external": -/*!***********************************************************************************!*\ - !*** external "next/dist/server/app-render/after-task-async-storage.external.js" ***! - \***********************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); - -/***/ }), - -/***/ "../app-render/work-async-storage.external": -/*!*****************************************************************************!*\ - !*** external "next/dist/server/app-render/work-async-storage.external.js" ***! - \*****************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); - -/***/ }), - -/***/ "./work-unit-async-storage.external": -/*!**********************************************************************************!*\ - !*** external "next/dist/server/app-render/work-unit-async-storage.external.js" ***! - \**********************************************************************************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); - -/***/ }), - -/***/ "path": -/*!***********************!*\ - !*** external "path" ***! - \***********************/ -/***/ ((module) => { - -"use strict"; -module.exports = require("path"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fpage&page=%2Fpage&appPaths=%2Fpage&pagePath=private-next-app-dir%2Fpage.tsx&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!": -/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fpage&page=%2Fpage&appPaths=%2Fpage&pagePath=private-next-app-dir%2Fpage.tsx&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D! ***! - \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2___default.a),\n/* harmony export */ __next_app__: () => (/* binding */ __next_app__),\n/* harmony export */ pages: () => (/* binding */ pages),\n/* harmony export */ routeModule: () => (/* binding */ routeModule),\n/* harmony export */ tree: () => (/* binding */ tree)\n/* harmony export */ });\n/* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! next/dist/server/route-modules/app-page/module.compiled */ \"(ssr)/./node_modules/next/dist/server/route-modules/app-page/module.compiled.js?91d2\");\n/* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! next/dist/server/route-kind */ \"(rsc)/./node_modules/next/dist/server/route-kind.js\");\n/* harmony import */ var next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! next/dist/client/components/error-boundary */ \"(rsc)/./node_modules/next/dist/client/components/error-boundary.js\");\n/* harmony import */ var next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_error_boundary__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! next/dist/server/app-render/entry-base */ \"(rsc)/./node_modules/next/dist/server/app-render/entry-base.js\");\n/* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__) if([\"default\",\"tree\",\"pages\",\"GlobalError\",\"__next_app__\",\"routeModule\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_3__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\nconst module0 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.bind(__webpack_require__, /*! ./src/app/layout.tsx */ \"(rsc)/./src/app/layout.tsx\"));\nconst module1 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! next/dist/client/components/not-found-error */ \"(rsc)/./node_modules/next/dist/client/components/not-found-error.js\", 23));\nconst module2 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! next/dist/client/components/forbidden-error */ \"(rsc)/./node_modules/next/dist/client/components/forbidden-error.js\", 23));\nconst module3 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! next/dist/client/components/unauthorized-error */ \"(rsc)/./node_modules/next/dist/client/components/unauthorized-error.js\", 23));\nconst page4 = () => Promise.resolve(/*! import() eager */).then(__webpack_require__.bind(__webpack_require__, /*! ./src/app/page.tsx */ \"(rsc)/./src/app/page.tsx\"));\n\n\n// We inject the tree and pages here so that we can use them in the route\n// module.\nconst tree = {\n children: [\n '',\n {\n children: ['__PAGE__', {}, {\n page: [page4, \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\"],\n \n }]\n },\n {\n 'layout': [module0, \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout.tsx\"],\n'not-found': [module1, \"next/dist/client/components/not-found-error\"],\n'forbidden': [module2, \"next/dist/client/components/forbidden-error\"],\n'unauthorized': [module3, \"next/dist/client/components/unauthorized-error\"],\n \n }\n ]\n }.children;\nconst pages = [\"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\"];\n\n\nconst __next_app_require__ = __webpack_require__\nconst __next_app_load_chunk__ = () => Promise.resolve()\nconst __next_app__ = {\n require: __next_app_require__,\n loadChunk: __next_app_load_chunk__\n};\n\n// Create and export the route module that will be consumed.\nconst routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({\n definition: {\n kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,\n page: \"/page\",\n pathname: \"/\",\n // The following aren't used in production.\n bundlePath: '',\n filename: '',\n appPaths: []\n },\n userland: {\n loaderTree: tree\n }\n});\n\n//# sourceMappingURL=app-page.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWFwcC1sb2FkZXIvaW5kZXguanM/bmFtZT1hcHAlMkZwYWdlJnBhZ2U9JTJGcGFnZSZhcHBQYXRocz0lMkZwYW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ICAgICBwYXRobmFtZTogXCIvXCIsXG4gICAgICAgIC8vIFRoZSBmb2xsb3dpbmcgYXJlbid0IHVzZWQgaW4gcHJvZHVjdGlvbi5cbiAgICAgICAgYnVuZGxlUGF0aDogJycsXG4gICAgICAgIGZpbGVuYW1lOiAnJyxcbiAgICAgICAgYXBwUGF0aHM6IFtdXG4gICAgfSxcbiAgICB1c2VybGFuZDoge1xuICAgICAgICBsb2FkZXJUcmVlOiB0cmVlXG4gICAgfVxufSk7XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFwcC1wYWdlLmpzLm1hcCJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fpage&page=%2Fpage&appPaths=%2Fpage&pagePath=private-next-app-dir%2Fpage.tsx&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!\n"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!": -/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! - \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -eval("Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-page.js */ \"(rsc)/./node_modules/next/dist/client/components/client-page.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-segment.js */ \"(rsc)/./node_modules/next/dist/client/components/client-segment.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/error-boundary.js */ \"(rsc)/./node_modules/next/dist/client/components/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js */ \"(rsc)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/layout-router.js */ \"(rsc)/./node_modules/next/dist/client/components/layout-router.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/render-from-template-context.js */ \"(rsc)/./node_modules/next/dist/client/components/render-from-template-context.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/lib/metadata/metadata-boundary.js */ \"(rsc)/./node_modules/next/dist/lib/metadata/metadata-boundary.js\", 23));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWZs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iYWNrL2Vycm9yLWJvdW5kYXJ5LmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9sYXlvdXQtcm91dGVyLmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9yZW5kZXItZnJvbS10ZW1wbGF0ZS1jb250ZXh0LmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9saWIvbWV0YWRhdGEvbWV0YWRhdGEtYm91bmRhcnkuanNcIik7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!": -/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! - \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -eval("Promise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-page.js */ \"(ssr)/./node_modules/next/dist/client/components/client-page.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/client-segment.js */ \"(ssr)/./node_modules/next/dist/client/components/client-segment.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/error-boundary.js */ \"(ssr)/./node_modules/next/dist/client/components/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js */ \"(ssr)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/layout-router.js */ \"(ssr)/./node_modules/next/dist/client/components/layout-router.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/client/components/render-from-template-context.js */ \"(ssr)/./node_modules/next/dist/client/components/render-from-template-context.js\", 23));\n;\nPromise.resolve(/*! import() eager */).then(__webpack_require__.t.bind(__webpack_require__, /*! ./node_modules/next/dist/lib/metadata/metadata-boundary.js */ \"(ssr)/./node_modules/next/dist/lib/metadata/metadata-boundary.js\", 23));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=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zL09wZW5DbGF3L1dlYi9oZWFydGJlYXQtbW9uaXRvci9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9jb21wb25lbnRzL2h0dHAtYWNjZXNzLWZhbGxiYWNrL2Vycm9yLWJvdW5kYXJ5LmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9sYXlvdXQtcm91dGVyLmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9yZW5kZXItZnJvbS10ZW1wbGF0ZS1jb250ZXh0LmpzXCIpO1xuO1xuaW1wb3J0KC8qIHdlYnBhY2tNb2RlOiBcImVhZ2VyXCIgKi8gXCIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9saWIvbWV0YWRhdGEvbWV0YWRhdGEtYm91bmRhcnkuanNcIik7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-page.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fclient-segment.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fhttp-access-fallback%2Ferror-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Flayout-router.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Frender-from-template-context.js%22%2C%22ids%22%3A%5B%5D%7D&modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Flib%2Fmetadata%2Fmetadata-boundary.js%22%2C%22ids%22%3A%5B%5D%7D&server=true!\n"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true!": -/*!**************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! - \**************************************************************************************************************************************************************************************************************************************************************************/ -/***/ (() => { - - - -/***/ }), - -/***/ "(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true!": -/*!**************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fglobals.css%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! - \**************************************************************************************************************************************************************************************************************************************************************************/ -/***/ (() => { - - - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=true!": -/*!***********************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! - \***********************************************************************************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -eval("Promise.resolve(/*! import() eager */).then(__webpack_require__.bind(__webpack_require__, /*! ./src/app/page.tsx */ \"(rsc)/./src/app/page.tsx\"));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWZsaWdodC1jbGllbnQtZW50cnktbG9hZGVyLmpzP21vZHVsZXM9JTdCJTIycmVxdWVzdCUyMiUzQSUyMiUyRlVzZXJzJTJGbWF0dGJydWNlJTJGRG9jdW1lbnRzJTJGUHJvamVjdHMlMkZPcGVuQ2xhdyUyRldlYiUyRmhlYXJ0YmVhdC1tb25pdG9yJTJGc3JjJTJGYXBwJTJGcGFnZS50c3glMjIlMkMlMjJpZHMlMjIlM0ElNUIlNUQlN0Qmc2VydmVyPXRydWUhIiwibWFwcGluZ3MiOiJBQUFBLGdKQUF3SCIsInNvdXJjZXMiOlsiIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCgvKiB3ZWJwYWNrTW9kZTogXCJlYWdlclwiICovIFwiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvV2ViL2hlYXJ0YmVhdC1tb25pdG9yL3NyYy9hcHAvcGFnZS50c3hcIik7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=true!\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=true!": -/*!***********************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=true! ***! - \***********************************************************************************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -eval("Promise.resolve(/*! import() eager */).then(__webpack_require__.bind(__webpack_require__, /*! ./src/app/page.tsx */ \"(ssr)/./src/app/page.tsx\"));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3dlYnBhY2svbG9hZGVycy9uZXh0LWZsaWdodC1jbGllbnQtZW50cnktbG9hZGVyLmpzP21vZHVsZXM9JTdCJTIycmVxdWVzdCUyMiUzQSUyMiUyRlVzZXJzJTJGbWF0dGJydWNlJTJGRG9jdW1lbnRzJTJGUHJvamVjdHMlMkZPcGVuQ2xhdyUyRldlYiUyRmhlYXJ0YmVhdC1tb25pdG9yJTJGc3JjJTJGYXBwJTJGcGFnZS50c3glMjIlMkMlMjJpZHMlMjIlM0ElNUIlNUQlN0Qmc2VydmVyPXRydWUhIiwibWFwcGluZ3MiOiJBQUFBLGdKQUF3SCIsInNvdXJjZXMiOlsiIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCgvKiB3ZWJwYWNrTW9kZTogXCJlYWdlclwiICovIFwiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvV2ViL2hlYXJ0YmVhdC1tb25pdG9yL3NyYy9hcHAvcGFnZS50c3hcIik7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=true!\n"); - -/***/ }), - -/***/ "(ssr)/./src/app/page.tsx": -/*!**************************!*\ - !*** ./src/app/page.tsx ***! - \**************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ HeartbeatMonitor)\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(ssr)/./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js\");\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(ssr)/./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/refresh-cw.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/activity.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/plus.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-check.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-x.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/trending-up.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/clock.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-alert.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/globe.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/external-link.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/ellipsis.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(ssr)/./node_modules/lucide-react/dist/esm/icons/trash-2.js\");\n/* __next_internal_client_entry_do_not_use__ default auto */ \n\n\nfunction HeartbeatMonitor() {\n const [apps, setApps] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);\n const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);\n const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);\n const [checking, setChecking] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);\n const [showAddApp, setShowAddApp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n const [selectedApp, setSelectedApp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);\n const [newApp, setNewApp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({\n name: \"\",\n description: \"\",\n url: \"http://localhost:\",\n port: 3000,\n path: \"\",\n command: \"npm run dev\",\n category: \"Other\",\n color: \"#22C55E\",\n enabled: true\n });\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)({\n \"HeartbeatMonitor.useEffect\": ()=>{\n fetchData();\n const interval = setInterval(fetchData, 30000);\n return ({\n \"HeartbeatMonitor.useEffect\": ()=>clearInterval(interval)\n })[\"HeartbeatMonitor.useEffect\"];\n }\n }[\"HeartbeatMonitor.useEffect\"], []);\n async function fetchData() {\n try {\n const res = await fetch(\"/api/monitor\");\n const data = await res.json();\n setApps(data.apps || []);\n setStatus(data.status || []);\n } catch (err) {\n console.error(\"Failed to fetch data:\", err);\n } finally{\n setLoading(false);\n }\n }\n async function checkApp(app) {\n setChecking(app.id);\n try {\n const start = Date.now();\n await fetch(app.url, {\n method: \"HEAD\",\n mode: \"no-cors\"\n });\n const responseTime = Date.now() - start;\n const entry = {\n appId: app.id,\n timestamp: new Date().toISOString(),\n status: \"up\",\n responseTime\n };\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"recordStatus\",\n entry\n })\n });\n fetchData();\n } catch {\n const entry = {\n appId: app.id,\n timestamp: new Date().toISOString(),\n status: \"down\"\n };\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"recordStatus\",\n entry\n })\n });\n fetchData();\n } finally{\n setChecking(null);\n }\n }\n async function addApp(e) {\n e.preventDefault();\n if (!newApp.name || !newApp.url) return;\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"addApp\",\n app: newApp\n })\n });\n setNewApp({\n name: \"\",\n description: \"\",\n url: \"http://localhost:\",\n port: 3000,\n path: \"\",\n command: \"npm run dev\",\n category: \"Other\",\n color: \"#22C55E\",\n enabled: true\n });\n setShowAddApp(false);\n fetchData();\n }\n async function deleteApp(id) {\n if (!confirm(\"Delete this app from monitoring?\")) return;\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"deleteApp\",\n id\n })\n });\n fetchData();\n }\n function getAppStatus(appId) {\n const appStatus = status.filter((s)=>s.appId === appId);\n const latest = appStatus[appStatus.length - 1];\n const isUp = latest?.status === \"up\";\n const uptime = appStatus.length > 0 ? Math.round(appStatus.filter((s)=>s.status === \"up\").length / appStatus.length * 100) : 100;\n const avgResponseTime = appStatus.length > 0 ? Math.round(appStatus.filter((s)=>s.responseTime).reduce((acc, s)=>acc + (s.responseTime || 0), 0) / appStatus.filter((s)=>s.responseTime).length) : 0;\n return {\n latest,\n isUp,\n uptime,\n avgResponseTime,\n history: appStatus.slice(-24)\n };\n }\n const totalApps = apps.length;\n const onlineApps = apps.filter((app)=>getAppStatus(app.id).isUp).length;\n const offlineApps = totalApps - onlineApps;\n const allUp = onlineApps === totalApps && totalApps > 0;\n // Generate sparkline data\n function Sparkline({ data, isUp }) {\n if (data.length === 0) return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"h-8 w-24 bg-gray-100 rounded\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 173,\n columnNumber: 35\n }, this);\n const bars = data.slice(-12).map((entry, i)=>/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: `w-1.5 rounded-sm ${entry.status === \"up\" ? \"bg-emerald-500\" : \"bg-red-500\"}`,\n style: {\n height: `${Math.max(20, Math.min(100, (entry.responseTime || 100) / 5))}%`\n }\n }, i, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 176,\n columnNumber: 7\n }, this));\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"h-8 w-24 flex items-end gap-0.5\",\n children: bars\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 184,\n columnNumber: 7\n }, this);\n }\n if (loading) {\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"min-h-screen bg-gray-50 flex items-center justify-center\",\n role: \"status\",\n \"aria-live\": \"polite\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3 text-gray-500\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: \"w-5 h-5 animate-spin\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 194,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n children: \"Loading dashboard...\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 195,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 193,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 192,\n columnNumber: 7\n }, this);\n }\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"min-h-screen bg-gray-50\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"nav\", {\n className: \"bg-white border-b border-gray-200 sticky top-0 z-40\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between h-16\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-600/20\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n className: \"w-6 h-6 text-white\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 209,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 208,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h1\", {\n className: \"text-xl font-bold text-gray-900\",\n children: \"Heartbeat Monitor\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 212,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm text-gray-500\",\n children: \"Local Infrastructure Monitoring\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 213,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 211,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 207,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: fetchData,\n className: \"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-900 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2\",\n \"aria-label\": \"Refresh data\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 223,\n columnNumber: 17\n }, this),\n \"Refresh\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 218,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>setShowAddApp(true),\n className: \"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 230,\n columnNumber: 17\n }, this),\n \"Add Monitor\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 226,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 217,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 206,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 205,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 204,\n columnNumber: 7\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"main\", {\n className: \"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: `w-12 h-12 rounded-xl flex items-center justify-center ${allUp ? 'bg-emerald-100' : 'bg-red-100'}`,\n children: allUp ? /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n className: \"w-6 h-6 text-emerald-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 246,\n columnNumber: 19\n }, this) : /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n className: \"w-6 h-6 text-red-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 248,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 244,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n onlineApps,\n \"/\",\n totalApps\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 251,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 243,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Services Online\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 253,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: allUp ? 'All systems operational' : `${offlineApps} service${offlineApps > 1 ? 's' : ''} down`\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 254,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 242,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-12 h-12 bg-blue-100 rounded-xl flex items-center justify-center\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n className: \"w-6 h-6 text-blue-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 262,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 261,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n totalApps > 0 ? Math.round(apps.reduce((acc, app)=>acc + getAppStatus(app.id).uptime, 0) / totalApps) : 0,\n \"%\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 264,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 260,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Average Uptime\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 268,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: \"Last 24 hours\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 269,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 259,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-12 h-12 bg-purple-100 rounded-xl flex items-center justify-center\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n className: \"w-6 h-6 text-purple-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 275,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 274,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n totalApps > 0 ? Math.round(apps.reduce((acc, app)=>acc + (getAppStatus(app.id).avgResponseTime || 0), 0) / totalApps) : 0,\n \"ms\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 277,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 273,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Avg Response\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 281,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: \"Across all monitors\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 282,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 272,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-12 h-12 bg-amber-100 rounded-xl flex items-center justify-center\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n className: \"w-6 h-6 text-amber-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 288,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 287,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: status.filter((s)=>s.status === \"down\").length\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 290,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 286,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Incidents\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 294,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: \"Total recorded\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 295,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 285,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 241,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"px-6 py-4 border-b border-gray-200 flex items-center justify-between\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n className: \"w-5 h-5 text-gray-400\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 303,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n className: \"text-lg font-semibold text-gray-900\",\n children: \"Monitored Services\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 304,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 302,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-sm text-gray-500\",\n children: [\n totalApps,\n \" active monitor\",\n totalApps !== 1 ? 's' : ''\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 306,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 301,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"divide-y divide-gray-100\",\n children: apps.map((app)=>{\n const { isUp, uptime, avgResponseTime, history, latest } = getAppStatus(app.id);\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"px-6 py-5 hover:bg-gray-50 transition-colors group\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: `w-3 h-3 rounded-full ${isUp ? 'bg-emerald-500 shadow-lg shadow-emerald-500/30' : 'bg-red-500 shadow-lg shadow-red-500/30'}`\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 321,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h3\", {\n className: \"text-base font-semibold text-gray-900\",\n children: app.name\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 325,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3 mt-1\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: app.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"text-sm text-blue-600 hover:text-blue-700 hover:underline\",\n children: app.url\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 327,\n columnNumber: 27\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-gray-300\",\n children: \"|\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 335,\n columnNumber: 27\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-sm text-gray-500\",\n children: [\n \"Port \",\n app.port\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 336,\n columnNumber: 27\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 326,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 324,\n columnNumber: 23\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 319,\n columnNumber: 21\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-8\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"text-right\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n uptime,\n \"%\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 345,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-500\",\n children: \"Uptime\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 346,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 344,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"text-right\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: avgResponseTime > 0 ? `${avgResponseTime}ms` : '—'\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 351,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-500\",\n children: \"Response\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 354,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 350,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"hidden sm:block\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(Sparkline, {\n data: history,\n isUp: isUp\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 359,\n columnNumber: 25\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 358,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>checkApp(app),\n disabled: checking === app.id,\n className: \"p-2 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors\",\n \"aria-label\": `Check ${app.name}`,\n title: \"Check now\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: `w-4 h-4 ${checking === app.id ? 'animate-spin' : ''}`\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 371,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 364,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: app.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"p-2 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors\",\n \"aria-label\": `Open ${app.name}`,\n title: \"Open app\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 381,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 373,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>setSelectedApp(app),\n className: \"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors\",\n \"aria-label\": `Details for ${app.name}`,\n title: \"View details\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 389,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 383,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>deleteApp(app.id),\n className: \"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors\",\n \"aria-label\": `Delete ${app.name}`,\n title: \"Delete monitor\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_13__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 397,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 391,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 363,\n columnNumber: 23\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 342,\n columnNumber: 21\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 318,\n columnNumber: 19\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"mt-3 flex items-center gap-4 text-xs text-gray-400\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n children: [\n \"Last checked: \",\n latest ? new Date(latest.timestamp).toLocaleTimeString() : 'Never'\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 405,\n columnNumber: 21\n }, this),\n latest?.responseTime && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n children: [\n \"Response: \",\n latest.responseTime,\n \"ms\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 407,\n columnNumber: 23\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 404,\n columnNumber: 19\n }, this)\n ]\n }, app.id, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 314,\n columnNumber: 17\n }, this);\n })\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 309,\n columnNumber: 11\n }, this),\n apps.length === 0 && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"px-6 py-12 text-center\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-16 h-16 bg-gray-100 rounded-2xl flex items-center justify-center mx-auto mb-4\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n className: \"w-8 h-8 text-gray-400\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 418,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 417,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h3\", {\n className: \"text-lg font-medium text-gray-900 mb-2\",\n children: \"No monitors yet\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 420,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-gray-500 mb-4\",\n children: \"Add your first service to start monitoring\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 421,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>setShowAddApp(true),\n className: \"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-blue-600 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 426,\n columnNumber: 17\n }, this),\n \"Add Monitor\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 422,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 416,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 300,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 239,\n columnNumber: 7\n }, this),\n showAddApp && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 w-full max-w-md shadow-2xl\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n className: \"text-xl font-bold text-gray-900 mb-6\",\n children: \"Add New Monitor\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 438,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"form\", {\n onSubmit: addApp,\n className: \"space-y-5\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-name\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: [\n \"Monitor Name \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-red-500\",\n children: \"*\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 442,\n columnNumber: 32\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 441,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-name\",\n type: \"text\",\n value: newApp.name,\n onChange: (e)=>setNewApp({\n ...newApp,\n name: e.target.value\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n placeholder: \"My Application\",\n required: true\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 444,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 440,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-desc\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: \"Description\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 455,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-desc\",\n type: \"text\",\n value: newApp.description,\n onChange: (e)=>setNewApp({\n ...newApp,\n description: e.target.value\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n placeholder: \"Brief description...\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 458,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 454,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"grid grid-cols-2 gap-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-url\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: [\n \"URL \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-red-500\",\n children: \"*\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 470,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 469,\n columnNumber: 19\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-url\",\n type: \"url\",\n value: newApp.url,\n onChange: (e)=>setNewApp({\n ...newApp,\n url: e.target.value\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n placeholder: \"http://localhost:3000\",\n required: true\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 472,\n columnNumber: 19\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 468,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-port\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: [\n \"Port \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-red-500\",\n children: \"*\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 484,\n columnNumber: 26\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 483,\n columnNumber: 19\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-port\",\n type: \"number\",\n value: newApp.port,\n onChange: (e)=>setNewApp({\n ...newApp,\n port: parseInt(e.target.value)\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n required: true,\n min: \"1\",\n max: \"65535\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 486,\n columnNumber: 19\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 482,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 467,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex gap-3 pt-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n type: \"button\",\n onClick: ()=>setShowAddApp(false),\n className: \"flex-1 px-4 py-2.5 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors\",\n children: \"Cancel\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 499,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n type: \"submit\",\n className: \"flex-1 px-4 py-2.5 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors shadow-sm\",\n children: \"Add Monitor\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 506,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 498,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 439,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 437,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 436,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 202,\n columnNumber: 5\n }, this);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9zcmMvYXBwL3BhZ2UudHN4IiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUU0QztBQWN0QjtBQXNCUCxTQUFTYztJQUN0QixNQUFNLENBQUNDLE1BQU1DLFFBQVEsR0FBR2hCLCtDQUFRQSxDQUFRLEVBQUU7SUFDMUMsTUFBTSxDQUFDaUIsUUFBUUMsVUFBVSxHQUFHbEIsK0NBQVFBLENBQWdCLEVBQUU7SUFDdEQsTUFBTSxDQUFDbUIsU0FBU0MsV0FBVyxHQUFHcEIsK0NBQVFBLENBQUM7SUFDdkMsTUFBTSxDQUFDcUIsVUFBVUMsWUFBWSxHQUFHdEIsK0NBQVFBLENBQWdCO0lBQ3hELE1BQU0sQ0FBQ3VCLFlBQVlDLGNBQWMsR0FBR3hCLCtDQUFRQSxDQUFDO0lBQzdDLE1BQU0sQ0FBQ3lCLGFBQW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gPlxuICAgICAgICAgICAgICAgIDxSZWZyZXNoQ3cgY2xhc3NOYW1lPVwidy00IGgtNFwiIC8+XG4gICAgICAgICAgICAgICAgUmVmcmVzaFxuICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IHNldFNob3dBZGRBcHAodHJ1ZSl9XG4gICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwiaW5saW5lLWZsZXggaXRlbXMtY2VudGVyIGdhcC0yIHB4LTQgcHktMiB0ZXh0LXNtIGZvbnQtbWVkaXVtIHRleHQtd2hpdGUgYmctYmx1ZS02MDAgcm91bmRlZC1sZyBob3ZlcjpiZy1ibHVlLTcwMCB0cmFuc2l0aW9uLWNvbG9ycyBzaGFkb3ctc20gZm9jdXM6b3V0bGluZS1ub25lIGZvY3VzOnJpbmctMiBmb2N1czpyaW5nLWJsdWUtNTAwIGZvY3VzOnJpbmctb2Zmc2V0LTJcIlxuICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgPFBsdXMgY2xhc3NOYW1lPVwidy00IGgtNFwiIC8+XG4gICAgICAgICAgICAgICAgQWRkIE1vbml0b3JcbiAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L25hdj5cblxuICAgICAgey8qIE1haW4gQ29udGVudCAqL31cbiAgICAgIDxtYWluIGNsYXNzTmFtZT1cIm1heC13LTd4bCBteC1hdXRvIHB4LTQgc206cHgtNiBsZzpweC04IHB5LThcIj5cbiAgICAgICAgey8qIFN0YXR1cyBPdmVydmlldyBDYXJkcyAqL31cbiAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJncmlkIGdyaWQtY29scy0xIG1kOmdyaWQtY29scy00IGdhcC02IG1iLThcIj5cbiAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cIm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cIj5cbiAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInB4LTYgcHktNCBib3JkZXItYiBib3JkZXItZ3JheS0yMDAgZmxleCBpdGVtcy1jZW50ZXIganVzdGlmeS1iZXR3ZWVuXCI+XG4gICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImZsZXggaXRlbXMtY2VudGVyIGdhcC0zXCI+XG4gICAgICAgICAgICAgIDxHbG9iZSBjbGFzc05hbWU9XCJ3LTUgaC01IHRleHQtZ3JheS00MDBcIiAvPlxuICAgICAgICAgICAgICA8aDIgY2xhc3NOYW1lPVwidGV4dC1sZyBmb250LXNlbWlib2xkIHRleHQtZ3JheS05MDBcIj5Nb25pdG9yZWQgU2VydmljZXM8L2gyPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8c3BhbiBjbGFzc05hbWU9XCJ0ZXh0LXNtIHRleHQtZ3JheS01MDBcIj57dG90YWxBcHBzfSBhY3RpdmUgbW9uaXRvcnt0b3RhbEFwcHMgIT09IDEgPyAncycgOiAnJ308L3NwYW4+XG4gICAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImRpdmlkZS15IGRpdmlkZS1ncmF5LTEwMFwiPlxuICAgICAgICAgICAge2FwcHMubWFwKChhcHApID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgeyBpc1VwLCB1cHRpbWUsIGF2Z1Jlc3BvbnNlVGltZSwgaGlzdG9yeSwgbGF0ZXN0IH0gPSBnZXRBcHBTdGF0dXMoYXBwLmlkKTtcbiAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPGRpdiBcbiAgICAgICAgICAgICAgICAgIGtleT17YXBwLmlkfSBcbiAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInB4LTYgcHktNSBob3ZlcjpiZy1ncmF5LTUwIHRyYW5zaXRpb24tY29sb3JzIGdyb3VwXCJcbiAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImZsZXggaXRlbXMtY2VudGVyIGp1c3RpZnktYmV0d2VlblwiPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImZsZXggaXRlbXMtY2VudGVyIGdhcC00XCI+XG4gICAgICAgICAgICAgICAgICAgICAgey8qIFN0YXR1cyBJbmRpY2F0b3IgKi99XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9e2B3LTMgaC0zIHJvdW5kZWQtZnVsbCAke2lzVXAgPyAnYmctZW1lcmFsZC01MDAgc2hhZG93LWxnIHNoYWRvdy1lbWVyYWxkLTUwMC8zMCcgOiAnYmctcmVkLTUwMCBzaGFkb3ctbGcgc2hhZG93LXJlZC01MDAvMzAnfWB9IC8+XG4gICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgey8qIEFwcCBJbmZvICovfVxuICAgICAgICAgICAgICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICAgICAgICAgICAgICA8aDMgY2xhc3NOYW1lPVwidGV4dC1iYXNlIGZvbnQtc2VtaWJvbGQgdGV4dC1ncmF5LTkwMFwiPnthcHAubmFtZX08L2gzPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbGV4IGl0ZW1zLWNlbnRlciBnYXAtMyBtdC0xXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxhIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhyZWY9e2FwcC51cmx9IFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldD1cIl9ibGFua1wiIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbD1cIm5vb3BlbmVyIG5vcmVmZXJyZXJcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInRleHQtc20gdGV4dC1ibHVlLTYwMCBob3Zlcjp0ZXh0LWJsdWUtNzAwIGhvdmVyOnVuZGVybGluZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7YXBwLnVybH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPC9hPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzc05hbWU9XCJ0ZXh0LWdyYXktMzAwXCI+fDwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3NOYW1lPVwidGV4dC1zbSB0ZXh0LWdyYXktNTAwXCI+UG9ydCB7YXBwLnBvcnR9PC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgICAgICAgIHsvKiBTdGF0cyAqL31cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbGV4IGl0ZW1zLWNlbnRlciBnYXAtOFwiPlxuICAgICAgICAgICAgICAgICAgICAgIHsvKiBVcHRpbWUgKi99XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJ0ZXh0LXJpZ2h0XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8cCBjbGFzc05hbWU9XCJ0ZXh0LTJ4bCBmb250LWJvbGQgdGV4dC1ncmF5LTkwMFwiPnt1cHRpbWV9JTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxwIGNsYXNzTmFtZT1cInRleHQteHMgdGV4dC1ncmF5LTUwMFwiPlVwdGltZTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cblxuICAgICAgICAgICAgICAgICAgICAgIHsvKiBSZXNwb25zZSBUaW1lICovfVxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwidGV4dC1yaWdodFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHAgY2xhc3NOYW1lPVwidGV4dC0yeGwgZm9udC1ib2xkIHRleHQtZ3JheS05MDBcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge2F2Z1Jlc3BvbnNlVGltZSA+IDAgPyBgJHthdmdSZXNwb25zZVRpbWV9bXNgIDogJ+KAlCd9XG4gICAgICAgICAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICA8cCBjbGFzc05hbWU9XCJ0ZXh0LXhzIHRleHQtZ3JheS01MDBcIj5SZXNwb25zZTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cblxuICAgICAgICAgICAgICAgICAgICAgIHsvKiBTcGFya2xpbmUgKi99XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJoaWRkZW4gc206YmxvY2tcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxTcGFya2xpbmUgZGF0YT17aGlzdG9yeX0gaXNVcD17aXNVcH0gLz5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cblxuICAgICAgICAgICAgICAgICAgICAgIHsvKiBBY3Rpb25zICovfVxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiZmxleCBpdGVtcy1jZW50ZXIgZ2FwLTEgb3BhY2l0eS0wIGdyb3VwLWhvdmVyOm9wYWNpdHktMTAwIHRyYW5zaXRpb24tb3BhY2l0eVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiBjaGVja0FwcChhcHApfVxuICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZD17Y2hlY2tpbmcgPT09IGFwcC5pZH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwicC0yIHRleHQtZ3JheS00MDAgaG92ZXI6dGV4dC1ibHVlLTYwMCBob3ZlcjpiZy1ibHVlLTUwIHJvdW5kZWQtbGcgdHJhbnNpdGlvbi1jb2xvcnNcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICBhcmlhLWxhYmVsPXtgQ2hlY2sgJHthcHAubmFtZX1gfVxuICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZT1cIkNoZWNrIG5vd1wiXG4gICAgICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxSZWZyZXNoQ3cgY2xhc3NOYW1lPXtgdy00IGgtNCAke2NoZWNraW5nID09PSBhcHAuaWQgPyAnYW5pbWF0ZS1zcGluJyA6ICcnfWB9IC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxhXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGhyZWY9e2FwcC51cmx9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldD1cIl9ibGFua1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIHJlbD1cIm5vb3BlbmVyIG5vcmVmZXJyZXJcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJwLTIgdGV4dC1ncmF5LTQwMCBob3Zlcjp0ZXh0LWJsdWUtNjAwIGhvdmVyOmJnLWJsdWUtNTAgcm91bmRlZC1sZyB0cmFuc2l0aW9uLWNvbG9yc1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGFyaWEtbGFiZWw9e2BPcGVuICR7YXBwLm5hbWV9YH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU9XCJPcGVuIGFwcFwiXG4gICAgICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxFeHRlcm5hbExpbmsgY2xhc3NOYW1lPVwidy00IGgtNFwiIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2E+XG4gICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IHNldFNlbGVjdGVkQXBwKGFwcCl9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInAtMiB0ZXh0LWdyYXktNDAwIGhvdmVyOnRleHQtZ3JheS02MDAgaG92ZXI6YmctZ3JheS0xMDAgcm91bmRlZC1sZyB0cmFuc2l0aW9uLWNvbG9yc1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGFyaWEtbGFiZWw9e2BEZXRhaWxzIGZvciAke2FwcC5uYW1lfWB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlPVwiVmlldyBkZXRhaWxzXCJcbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPE1vcmVIb3Jpem9udGFsIGNsYXNzTmFtZT1cInctNCBoLTRcIiAvPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IGRlbGV0ZUFwcChhcHAuaWQpfVxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJwLTIgdGV4dC1ncmF5LTQwMCBob3Zlcjp0ZXh0LXJlZC02MDAgaG92ZXI6YmctcmVkLTUwIHJvdW5kZWQtbGcgdHJhbnNpdGlvbi1jb2xvcnNcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICBhcmlhLWxhYmVsPXtgRGVsZXRlICR7YXBwLm5hbWV9YH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU9XCJEZWxldGUgbW9uaXRvclwiXG4gICAgICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxUcmFzaDIgY2xhc3NOYW1lPVwidy00IGgtNFwiIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICA8L2Rpdj5cblxuICAgICAgICAgICAgICAgICAgey8qIExhc3QgQ2hlY2tlZCAqL31cbiAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwibXQtMyBmbGV4IGl0ZW1zLWNlbnRlciBnYXAtNCB0ZXh0LXhzIHRleHQtZ3JheS00MDBcIj5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+TGFzdCBjaGVja2VkOiB7bGF0ZXN0ID8gbmV3IERhdGUobGF0ZXN0LnRpbWVzdGFtcCkudG9Mb2NhbGVUaW1lU3RyaW5nKCkgOiAnTmV2ZXInfTwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgICAge2xhdGVzdD8ucmVzcG9uc2VUaW1lICYmIChcbiAgICAgICAgICAgICAgICAgICAgICA8c3Bhbj5SZXNwb25zZToge2xhdGVzdC5yZXNwb25zZVRpbWV9bXM8L3NwYW4+XG4gICAgICAgICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pfVxuICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAge2FwcHMubGVuZ3RoID09PSAwICYmIChcbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwicHgtNiBweS0xMiB0ZXh0LWNlbnRlclwiPlxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInctMTYgaC0xNiBiZy1ncmF5LTEwMCByb3VuZGVkLTJ4bCBmbGV4IGl0ZW1zLWNlbnRlciBqdXN0aWZ5LWNlbnRlciBteC1hdXRvIG1iLTRcIj5cbiAgICAgICAgICAgICAgICA8QWN0aXZpdHkgY2xhc3NOYW1lP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C8yMCB0cmFuc2l0aW9uLWFsbFwiXG4gICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cIk15IEFwcGxpY2F0aW9uXCJcbiAgICAgICAgICAgICAgICAgIHJlcXVpcmVkXG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICAgICAgPGxhYmVsIGh0bWxGb3I9XCJhcHAtZGVzY1wiIGNsYXNzTmFtZT1cImJsb2NrIHRleHQtc20gZm9udC1tZWRpdW0gdGV4dC1ncmF5LTcwMCBtYi0yXCI+XG4gICAgICAgICAgICAgICAgICBEZXNjcmlwdGlvblxuICAgICAgICAgICAgICAgIDwvbGFiZWw+XG4gICAgICAgICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICAgICAgICBpZD1cImFwcC1kZXNjXCJcbiAgICAgICAgICAgICAgICAgIHR5cGU9XCJ0ZXh0XCJcbiAgICAgICAgICAgICAgICAgIHZhbHVlPXtuZXdBcHAuZGVzY3JpcHRpb259XG4gICAgICAgICAgICAgICAgICBvbkNoYW5nZT17KGUpID0+IHNldE5ld0FwcCh7IC4uLm5ld0FwcCwgZGVzY3JpcHRpb246IGUudGFyZ2V0LnZhbHVlIH0pfVxuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwidy1mdWxsIGJvcmRlciBib3JkZXItZ3JheS0zMDAgcm91bmRlZC1sZyBweC00IHB5LTIuNSB0ZXh0LWdyYXktOTAwIHBsYWNlaG9sZGVyLWdyYXktNDAwIGZvY3VzOmJvcmRlci1ibHVlLTUwMCBmb2N1czpyaW5nLTIgZm9jdXM6cmluZy1ibHVlLTUwMC8yMCB0cmFuc2l0aW9uLWFsbFwiXG4gICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cIkJyaWVmIGRlc2NyaXB0aW9uLi4uXCJcbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJncmlkIGdyaWQtY29scy0yIGdhcC00XCI+XG4gICAgICAgICAgICAgICAgPGRpdj5cbiAgICAgICAgICAgICAgICAgIDxsYWJlbCBodG1sRm9yPVwiYXBwLXVybFwiIGNsYXNzTmFtZT1cImJsb2NrIHRleHQtc20gZm9udC1tZWRpdW0gdGV4dC1ncmF5LTcwMCBtYi0yXCI+XG4gICAgICAgICAgICAgICAgICAgIFVSTCA8c3BhbiBjbGFzc05hbWU9XCJ0ZXh0LXJlZC01MDBcIj4qPC9zcGFuPlxuICAgICAgICAgICAgICAgICAgPC9sYWJlbD5cbiAgICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICBpZD1cImFwcC11cmxcIlxuICAgICAgICAgICAgICAgICAgICB0eXBlPVwidXJsXCJcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU9e25ld0FwcC51cmx9XG4gICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlPXsoZSkgPT4gc2V0TmV3QXBwKHsgLi4ubmV3QXBwLCB1cmw6IGUudGFyZ2V0LnZhbHVlIH0pfVxuICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJ3LWZ1bGwgYm9yZGVyIGJvcmRlci1ncmF5LTMwMCByb3VuZGVkLWxnIHB4LTQgcHktMi41IHRleHQtZ3JheS05MDAgcGxhY2Vob2xkZXItZ3JheS00MDAgZm9jdXM6Ym9yZGVyLWJsdWUtNTAwIGZvY3VzOnJpbmctMiBmb2N1czpyaW5nLWJsdWUtNTAwLzIwIHRyYW5zaXRpb24tYWxsXCJcbiAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI9XCJodHRwOi8vbG9jYWxob3N0OjMwMDBcIlxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlZFxuICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8ZGl2PlxuICAgICAgICAgICAgICAgICAgPGxhYmVsIGh0bWxGb3I9XCJhcHAtcG9ydFwiIGNsYXNzTmFtZT1cImJsb2NrIHRleHQtc20gZm9udC1tZWRpdW0gdGV4dC1ncmF5LTcwMCBtYi0yXCI+XG4gICAgICAgICAgICAgICAgICAgIFBvcnQgPHNwYW4gY2xhc3NOYW1lPVwidGV4dC1yZWQtNTAwXCI+Kjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgIDwvbGFiZWw+XG4gICAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgICAgaWQ9XCJhcHAtcG9ydFwiXG4gICAgICAgICAgICAgICAgICAgIHR5cGU9XCJudW1iZXJcIlxuICAgICAgICAgICAgICAgICAgICB2YWx1ZT17bmV3QXBwLnBvcnR9XG4gICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlPXsoZSkgPT4gc2V0TmV3QXBwKHsgLi4ubmV3QXBwLCBwb3J0OiBwYXJzZUludChlLnRhcmdldC52YWx1ZSkgfSl9XG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInctZnVsbCBib3JkZXIgYm9yZGVyLWdyYXktMzAwIHJvdW5kZWQtbGcgcHgtNCBweS0yLjUgdGV4dC1ncmF5LTkwMCBwbGFjZWhvbGRlci1ncmF5LTQwMCBmb2N1czpib3JkZXItYmx1ZS01MDAgZm9jdXM6cmluZy0yIGZvY3VzOnJpbmctYmx1ZS01MDAvMjAgdHJhbnNpdGlvbi1hbGxcIlxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlZFxuICAgICAgICAgICAgICAgICAgICBtaW49XCIxXCJcbiAgICAgICAgICAgICAgICAgICAgbWF4PVwiNjU1MzVcIlxuICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiZmxleCBnYXAtMyBwdC00XCI+XG4gICAgICAgICA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ZmbGluZUFwcHMiLCJhbGxVcCIsIlNwYXJrbGluZSIsImRpdiIsImNsYXNzTmFtZSIsImJhcnMiLCJtYXAiLCJpIiwic3R5bGUiLCJoZWlnaHQiLCJtYXgiLCJtaW4iLCJyb2xlIiwiYXJpYS1saXZlIiwic3BhbiIsIm5hdiIsImgxIiwicCIsImJ1dHRvbiIsIm9uQ2xpY2siLCJhcmlhLWxhYmVsIiwibWFpbiIsImgyIiwiaDMiLCJhIiwiaHJlZiIsInRhcmdldCIsInJlbCIsImRpc2FibGVkIiwidGl0bGUiLCJ0b0xvY2FsZVRpbWVTdHJpbmciLCJmb3JtIiwib25TdWJtaXQiLCJsYWJlbCIsImh0bWxGb3IiLCJpbnB1dCIsInR5cGUiLCJ2YWx1ZSIsIm9uQ2hhbmdlIiwicGxhY2Vob2xkZXIiLCJyZXF1aXJlZCIsInBhcnNlSW50Il0sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(ssr)/./src/app/page.tsx\n"); - -/***/ }), - -/***/ "(rsc)/./src/app/globals.css": -/*!*****************************!*\ - !*** ./src/app/globals.css ***! - \*****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (\"43019ed0b75a\");\nif (false) {}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9zcmMvYXBwL2dsb2JhbHMuY3NzIiwibWFwcGluZ3MiOiI7Ozs7QUFBQSxpRUFBZSxjQUFjO0FBQzdCLElBQUksS0FBVSxFQUFFLEVBQXVCIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivc3JjL2FwcC9nbG9iYWxzLmNzcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBcIjQzMDE5ZWQwYjc1YVwiXG5pZiAobW9kdWxlLmhvdCkgeyBtb2R1bGUuaG90LmFjY2VwdCgpIH1cbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./src/app/globals.css\n"); - -/***/ }), - -/***/ "(rsc)/./src/app/layout.tsx": -/*!****************************!*\ - !*** ./src/app/layout.tsx ***! - \****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ RootLayout),\n/* harmony export */ metadata: () => (/* binding */ metadata)\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(rsc)/./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js\");\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./globals.css */ \"(rsc)/./src/app/globals.css\");\n\n\nconst metadata = {\n title: \"Heartbeat Monitor\",\n description: \"Real-time monitoring dashboard for your web applications\"\n};\nfunction RootLayout({ children }) {\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"html\", {\n lang: \"en\",\n className: \"dark\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"body\", {\n className: \"antialiased\",\n children: children\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout.tsx\",\n lineNumber: 16,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout.tsx\",\n lineNumber: 15,\n columnNumber: 5\n }, this);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9zcmMvYXBwL2xheW91dC50c3giLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQ3VCO0FBRWhCLE1BQU1BLFdBQXFCO0lBQ2hDQyxPQUFPO0lBQ1BDLGFBQWE7QUFDZixFQUFFO0FBRWEsU0FBU0MsV0FBVyxFQUNqQ0MsUUFBUSxFQUdSO0lBQ0EscUJBQ0UsOERBQUNDO1FBQUtDLE1BQUs7UUFBS0MsV0FBVTtrQkFDeEIsNEVBQUNDO1lBQUtELFdBQVU7c0JBQWVIOzs7Ozs7Ozs7OztBQUdyQyIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvV2ViL2hlYXJ0YmVhdC1tb25pdG9yL3NyYy9hcHAvbGF5b3V0LnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IE1ldGFkYXRhIH0gZnJvbSBcIm5leHRcIjtcbmltcG9ydCBcIi4vZ2xvYmFscy5jc3NcIjtcblxuZXhwb3J0IGNvbnN0IG1ldGFkYXRhOiBNZXRhZGF0YSA9IHtcbiAgdGl0bGU6IFwiSGVhcnRiZWF0IE1vbml0b3JcIixcbiAgZGVzY3JpcHRpb246IFwiUmVhbC10aW1lIG1vbml0b3JpbmcgZGFzaGJvYXJkIGZvciB5b3VyIHdlYiBhcHBsaWNhdGlvbnNcIixcbn07XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIFJvb3RMYXlvdXQoe1xuICBjaGlsZHJlbixcbn06IFJlYWRvbmx5PHtcbiAgY2hpbGRyZW46IFJlYWN0LlJlYWN0Tm9kZTtcbn0+KSB7XG4gIHJldHVybiAoXG4gICAgPGh0bWwgbGFuZz1cImVuXCIgY2xhc3NOYW1lPVwiZGFya1wiPlxuICAgICAgPGJvZHkgY2xhc3NOYW1lPVwiYW50aWFsaWFzZWRcIj57Y2hpbGRyZW59PC9ib2R5PlxuICAgIDwvaHRtbD5cbiAgKTtcbn1cbiJdLCJuYW1lcyI6WyJtZXRhZGF0YSIsInRpdGxlIiwiZGVzY3JpcHRpb24iLCJSb290TGF5b3V0IiwiY2hpbGRyZW4iLCJodG1sIiwibGFuZyIsImNsYXNzTmFtZSIsImJvZHkiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./src/app/layout.tsx\n"); - -/***/ }), - -/***/ "(rsc)/./src/app/page.tsx": -/*!**************************!*\ - !*** ./src/app/page.tsx ***! - \**************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react_server_dom_webpack_server_edge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-server-dom-webpack/server.edge */ "(rsc)/./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server-edge.js"); -/* harmony import */ var react_server_dom_webpack_server_edge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server_edge__WEBPACK_IMPORTED_MODULE_0__); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server_edge__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( -function() { throw new Error("Attempted to call the default export of \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, -"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx", -"default", -)); - - -/***/ }) - -}; -; - -// load runtime -var __webpack_require__ = require("../webpack-runtime.js"); -__webpack_require__.C(exports); -var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) -var __webpack_exports__ = __webpack_require__.X(0, ["vendor-chunks/next","vendor-chunks/lucide-react","vendor-chunks/@swc"], () => (__webpack_exec__("(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?name=app%2Fpage&page=%2Fpage&appPaths=%2Fpage&pagePath=private-next-app-dir%2Fpage.tsx&appDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!"))); -module.exports = __webpack_exports__; - -})(); \ No newline at end of file diff --git a/.next/server/app/page_client-reference-manifest.js b/.next/server/app/page_client-reference-manifest.js deleted file mode 100644 index 9f93d907..00000000 --- a/.next/server/app/page_client-reference-manifest.js +++ /dev/null @@ -1 +0,0 @@ -globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"(app-pages-browser)/./src/app/page.tsx":{"*":{"id":"(ssr)/./src/app/page.tsx","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js":{"*":{"id":"(ssr)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js":{"*":{"id":"(ssr)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/globals.css":{"id":"(app-pages-browser)/./src/app/globals.css","name":"*","chunks":["app/layout","static/chunks/app/layout.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx":{"id":"(app-pages-browser)/./src/app/page.tsx","name":"*","chunks":["app/page","static/chunks/app/page.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/client-page.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/client-page.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/client-segment.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/client-segment.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/layout-router.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/layout-router.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/client/components/render-from-template-context.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/lib/metadata/metadata-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false},"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/node_modules/next/dist/esm/lib/metadata/metadata-boundary.js":{"id":"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":["app-pages-internals","static/chunks/app-pages-internals.js"],"async":false}},"entryCSSFiles":{"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/":[],"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/layout":[{"inlined":false,"path":"static/css/app/layout.css"}],"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page":[]},"rscModuleMapping":{"(app-pages-browser)/./src/app/globals.css":{"*":{"id":"(rsc)/./src/app/globals.css","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./src/app/page.tsx":{"*":{"id":"(rsc)/./src/app/page.tsx","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-page.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/client-page.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/client-segment.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/client-segment.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/error-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/http-access-fallback/error-boundary.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/layout-router.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/client/components/render-from-template-context.js":{"*":{"id":"(rsc)/./node_modules/next/dist/client/components/render-from-template-context.js","name":"*","chunks":[],"async":false}},"(app-pages-browser)/./node_modules/next/dist/lib/metadata/metadata-boundary.js":{"*":{"id":"(rsc)/./node_modules/next/dist/lib/metadata/metadata-boundary.js","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}} \ No newline at end of file diff --git a/.next/server/middleware-build-manifest.js b/.next/server/middleware-build-manifest.js index 6dce15d7..e9b5ec65 100644 --- a/.next/server/middleware-build-manifest.js +++ b/.next/server/middleware-build-manifest.js @@ -2,16 +2,27 @@ self.__BUILD_MANIFEST = { "polyfillFiles": [ "static/chunks/polyfills.js" ], - "devFiles": [], - "ampDevFiles": [], - "lowPriorityFiles": [], - "rootMainFiles": [ - "static/chunks/webpack.js", - "static/chunks/main-app.js" + "devFiles": [ + "static/chunks/fallback/react-refresh.js" ], + "ampDevFiles": [ + "static/chunks/fallback/webpack.js", + "static/chunks/fallback/amp.js" + ], + "lowPriorityFiles": [], + "rootMainFiles": [], "rootMainFilesTree": {}, "pages": { - "/_app": [] + "/_app": [ + "static/chunks/fallback/webpack.js", + "static/chunks/fallback/main.js", + "static/chunks/fallback/pages/_app.js" + ], + "/_error": [ + "static/chunks/fallback/webpack.js", + "static/chunks/fallback/main.js", + "static/chunks/fallback/pages/_error.js" + ] }, "ampFirstPages": [] }; diff --git a/.next/server/vendor-chunks/lucide-react.js b/.next/server/vendor-chunks/lucide-react.js deleted file mode 100644 index 9f913108..00000000 --- a/.next/server/vendor-chunks/lucide-react.js +++ /dev/null @@ -1,175 +0,0 @@ -"use strict"; -/* - * ATTENTION: An "eval-source-map" devtool has been used. - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -exports.id = "vendor-chunks/lucide-react"; -exports.ids = ["vendor-chunks/lucide-react"]; -exports.modules = { - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/Icon.js": -/*!****************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/Icon.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Icon)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"(ssr)/./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js\");\n/* harmony import */ var _defaultAttributes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./defaultAttributes.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/defaultAttributes.js\");\n/* harmony import */ var _shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/src/utils.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/shared/src/utils.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \n\n\nconst Icon = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ color = \"currentColor\", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = \"\", children, iconNode, ...rest }, ref)=>{\n return /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(\"svg\", {\n ref,\n ..._defaultAttributes_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: (0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeClasses)(\"lucide\", className),\n ...rest\n }, [\n ...iconNode.map(([tag, attrs])=>/*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(tag, attrs)),\n ...Array.isArray(children) ? children : [\n children\n ]\n ]);\n});\n //# sourceMappingURL=Icon.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL0ljb24uanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBd0JBLENBQU0sU0FBTyxvRUFFVCxFQUNFLEtBQVEsbUJBQ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0dXJuIGNyZWF0ZUVsZW1lbnQoXG4gICAgICAnc3ZnJyxcbiAgICAgIHtcbiAgICAgICAgcmVmLFxuICAgICAgICAuLi5kZWZhdWx0QXR0cmlidXRlcyxcbiAgICAgICAgd2lkdGg6IHNpemUsXG4gICAgICAgIGhlaWdodDogc2l6ZSxcbiAgICAgICAgc3Ryb2tlOiBjb2xvcixcbiAgICAgICAgc3Ryb2tlV2lkdGg6IGFic29sdXRlU3Ryb2tlV2lkdGggPyAoTnVtYmVyKHN0cm9rZVdpZHRoKSAqIDI0KSAvIE51bWJlcihzaXplKSA6IHN0cm9rZVdpZHRoLFxuICAgICAgICBjbGFzc05hbWU6IG1lcmdlQ2xhc3NlcygnbHVjaWRlJywgY2xhc3NOYW1lKSxcbiAgICAgICAgLi4ucmVzdCxcbiAgICAgIH0sXG4gICAgICBbXG4gICAgICAgIC4uLmljb25Ob2RlLm1hcCgoW3RhZywgYXR0cnNdKSA9PiBjcmVhdGVFbGVtZW50KHRhZywgYXR0cnMpKSxcbiAgICAgICAgLi4uKEFycmF5LmlzQXJyYXkoY2hpbGRyZW4pID8gY2hpbGRyZW4gOiBbY2hpbGRyZW5dKSxcbiAgICAgIF0sXG4gICAgKTtcbiAgfSxcbik7XG5cbmV4cG9ydCBkZWZhdWx0IEljb247XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/Icon.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js": -/*!****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/createLucideIcon.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ createLucideIcon)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"(ssr)/./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js\");\n/* harmony import */ var _shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/src/utils.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/shared/src/utils.js\");\n/* harmony import */ var _Icon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Icon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/Icon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \n\n\nconst createLucideIcon = (iconName, iconNode)=>{\n const Component = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ className, ...props }, ref)=>/*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Icon_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n ref,\n iconNode,\n className: (0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeClasses)(`lucide-${(0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.toKebabCase)(iconName)}`, className),\n ...props\n }));\n Component.displayName = `${iconName}`;\n return Component;\n};\n //# sourceMappingURL=createLucideIcon.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2NyZWF0ZUx1Y2lkZUljb24uanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBV00sdUJBQW1CLEdBQUMsVUFBa0IsUUFBdUI7SUFDakUsTUFBTSxDQUFZLDRFQUF3QyxFQUFFLENBQVcsV0FBRyxRQUFTLHVCQUNqRixvREFBYSxDQUFD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XNzTmFtZTogbWVyZ2VDbGFzc2VzKGBsdWNpZGUtJHt0b0tlYmFiQ2FzZShpY29uTmFtZSl9YCwgY2xhc3NOYW1lKSxcbiAgICAgIC4uLnByb3BzLFxuICAgIH0pLFxuICApO1xuXG4gIENvbXBvbmVudC5kaXNwbGF5TmFtZSA9IGAke2ljb25OYW1lfWA7XG5cbiAgcmV0dXJuIENvbXBvbmVudDtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IGNyZWF0ZUx1Y2lkZUljb247XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/defaultAttributes.js": -/*!*****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/defaultAttributes.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ defaultAttributes)\n/* harmony export */ });\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ var defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n //# sourceMappingURL=defaultAttributes.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2RlZmF1bHRBdHRyaWJ1dGVzLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7OztJQUFBLENBQWU7SUFDYixLQUFPO0lBQ1AsS0FBTztJQUNQLE1BQVE7SUFDUixPQUFTO0lBQ1QsSUFBTTtJQUNOLE1BQVE7SUFDUixXQUFhO0lBQ2IsYUFBZTtJQUNmLGNBQWdCO0FBQ2xCIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9zcmMvZGVmYXVsdEF0dHJpYnV0ZXMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQge1xuICB4bWxuczogJ2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyxcbiAgd2lkdGg6IDI0LFxuICBoZWlnaHQ6IDI0LFxuICB2aWV3Qm94OiAnMCAwIDI0IDI0JyxcbiAgZmlsbDogJ25vbmUnLFxuICBzdHJva2U6ICdjdXJyZW50Q29sb3InLFxuICBzdHJva2VXaWR0aDogMixcbiAgc3Ryb2tlTGluZWNhcDogJ3JvdW5kJyxcbiAgc3Ryb2tlTGluZWpvaW46ICdyb3VuZCcsXG59O1xuIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/defaultAttributes.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/activity.js": -/*!**************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/activity.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Activity)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\",\n key: \"169zse\"\n }\n ]\n];\nconst Activity = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Activity\", __iconNode);\n //# sourceMappingURL=activity.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2FjdGl2aXR5LmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFDRTtRQUNBO1lBQ0UsQ0FBRztZQUNILEdBQUs7UUFDUDtLQUNGO0NBQ0Y7QUFhTSxlQUFXLGtFQUFpQixhQUFZLENBQVUiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL3NyYy9pY29ucy9hY3Rpdml0eS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgY3JlYXRlTHVjaWRlSWNvbiBmcm9tICcuLi9jcmVhdGVMdWNpZGVJY29uJztcbmltcG9ydCB7IEljb25Ob2RlIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgX19pY29uTm9kZTogSWNvbk5vZGUgPSBbXG4gIFtcbiAgICAncGF0aCcsXG4gICAge1xuICAgICAgZDogJ00yMiAxMmgtMi40OGEyIDIg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1pQXlJREFnTUNBeElEUXVORGtnTVRKSU1pSWdMejRLUEM5emRtYytDZz09KSAtIGh0dHBzOi8vbHVjaWRlLmRldi9pY29ucy9hY3Rpdml0eVxuICogQHNlZSBodHRwczovL2x1Y2lkZS5kZXYvZ3VpZGUvcGFja2FnZXMvbHVjaWRlLXJlYWN0IC0gRG9jdW1lbnRhdGlvblxuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBwcm9wcyAtIEx1Y2lkZSBpY29ucyBwcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IEFjdGl2aXR5ID0gY3JlYXRlTHVjaWRlSWNvbignQWN0aXZpdHknLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgQWN0aXZpdHk7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/activity.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-alert.js": -/*!******************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/circle-alert.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ CircleAlert)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"line\",\n {\n x1: \"12\",\n x2: \"12\",\n y1: \"8\",\n y2: \"12\",\n key: \"1pkeuh\"\n }\n ],\n [\n \"line\",\n {\n x1: \"12\",\n x2: \"12.01\",\n y1: \"16\",\n y2: \"16\",\n key: \"4dfq90\"\n }\n ]\n];\nconst CircleAlert = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"CircleAlert\", __iconNode);\n //# sourceMappingURL=circle-alert.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2NpcmNsZS1hbGVydC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFHTyxNQUFNLFVBQXVCO0lBQ2xDO1FBQUMsUUFBVTtRQUFBO1lBQUUsRUFBSTtZQUFNLENBQUksUUFBTTtZQUFBLENBQUc7WUFBTSxHQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQ3pEO1FBQUM7UUFBUSxDQUFFO1lBQUEsSUFBSSxDQUFNO1lBQUEsSUFBSSxDQUFNO1lBQUEsR0FBSSxJQUFLO1lBQUEsR0FBSSxLQUFNO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtJQUNqRTtRQUFDO1FBQVEsQ0FBRTtZQUFBLElBQUksQ0FBTTtZQUFBLElBQUksQ0FBUztZQUFBLEdBQUksS0FBTTtZQUFBLEdBQUksS0FBTTtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7Q0FDdkU7QUFhTSxrQkFBYyxrRUFBaUIsZ0JBQWUsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVud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hKdmEyVXRkMmxrZEdnOUlqSWlDaUFnYzNSeWIydGxMV3hwYm1WallYQTlJbkp2ZFc1a0lnb2dJSE4wY205clpTMXNhVzVsYW05cGJqMGljbTkxYm1RaUNqNEtJQ0E4WTJseVkyeGxJR040UFNJeE1pSWdZM2s5SWpFeUlpQnlQU0l4TUNJZ0x6NEtJQ0E4YkdsdVpTQjRNVDBpTVRJaUlIZ3lQU0l4TWlJZ2VURTlJamdpSUhreVBTSXhNaUlnTHo0S0lDQThiR2x1WlNCNE1UMGlNVElpSUhneVBTSXhNaTR3TVNJZ2VURTlJakUySWlCNU1qMGlNVFlpSUM4K0Nqd3ZjM1puUGdvPSkgLSBodHRwczovL2x1Y2lkZS5kZXYvaWNvbnMvY2lyY2xlLWFsZXJ0XG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgQ2lyY2xlQWxlcnQgPSBjcmVhdGVMdWNpZGVJY29uKCdDaXJjbGVBbGVydCcsIF9faWNvbk5vZGUpO1xuXG5leHBvcnQgZGVmYXVsdCBDaXJjbGVBbGVydDtcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-alert.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-check.js": -/*!******************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/circle-check.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ CircleCheck)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"path\",\n {\n d: \"m9 12 2 2 4-4\",\n key: \"dzmm74\"\n }\n ]\n];\nconst CircleCheck = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"CircleCheck\", __iconNode);\n //# sourceMappingURL=circle-check.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2NpcmNsZS1jaGVjay5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFHTyxNQUFNLFVBQXVCO0lBQ2xDO1FBQUMsUUFBVTtRQUFBO1lBQUUsRUFBSTtZQUFNLENBQUksUUFBTTtZQUFBLENBQUc7WUFBTSxHQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQ3pEO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFpQjtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7Q0FDaEQ7QUFhTSxrQkFBYyxrRUFBaUIsZ0JBQWUsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicn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pQ2o0S0lDQThZMmx5WTJ4bElHTjRQU0l4TWlJZ1kzazlJakV5SWlCeVBTSXhNQ0lnTHo0S0lDQThjR0YwYUNCa1BTSnRPU0F4TWlBeUlESWdOQzAwSWlBdlBnbzhMM04yWno0SykgLSBodHRwczovL2x1Y2lkZS5kZXYvaWNvbnMvY2lyY2xlLWNoZWNrXG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgQ2lyY2xlQ2hlY2sgPSBjcmVhdGVMdWNpZGVJY29uKCdDaXJjbGVDaGVjaycsIF9faWNvbk5vZGUpO1xuXG5leHBvcnQgZGVmYXVsdCBDaXJjbGVDaGVjaztcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-check.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-x.js": -/*!**************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/circle-x.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ CircleX)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"path\",\n {\n d: \"m15 9-6 6\",\n key: \"1uzhvr\"\n }\n ],\n [\n \"path\",\n {\n d: \"m9 9 6 6\",\n key: \"z0biqf\"\n }\n ]\n];\nconst CircleX = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"CircleX\", __iconNode);\n //# sourceMappingURL=circle-x.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2NpcmNsZS14LmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQU0sQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFNLEdBQUs7UUFBQSxDQUFVO0tBQUE7SUFDekQ7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQWE7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQzFDO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFZO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtDQUMzQztBQWFNLGNBQVUsa0VBQWlCLFlBQVcsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2ljb25zL2NpcmNsZS14LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uI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UNBOGNHRjBhQ0JrUFNKdE1UVWdPUzAySURZaUlDOCtDaUFnUEhCaGRHZ2daRDBpYlRrZ09TQTJJRFlpSUM4K0Nqd3ZjM1puUGdvPSkgLSBodHRwczovL2x1Y2lkZS5kZXYvaWNvbnMvY2lyY2xlLXhcbiAqIEBzZWUgaHR0cHM6Ly9sdWNpZGUuZGV2L2d1aWRlL3BhY2thZ2VzL2x1Y2lkZS1yZWFjdCAtIERvY3VtZW50YXRpb25cbiAqXG4gKiBAcGFyYW0ge09iamVjdH0gcHJvcHMgLSBMdWNpZGUgaWNvbnMgcHJvcHMgYW5kIGFueSB2YWxpZCBTVkcgYXR0cmlidXRlXG4gKiBAcmV0dXJucyB7SlNYLkVsZW1lbnR9IEpTWCBFbGVtZW50XG4gKlxuICovXG5jb25zdCBDaXJjbGVYID0gY3JlYXRlTHVjaWRlSWNvbignQ2lyY2xlWCcsIF9faWNvbk5vZGUpO1xuXG5leHBvcnQgZGVmYXVsdCBDaXJjbGVYO1xuIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/circle-x.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/clock.js": -/*!***********************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/clock.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Clock)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"polyline\",\n {\n points: \"12 6 12 12 16 14\",\n key: \"68esgv\"\n }\n ]\n];\nconst Clock = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Clock\", __iconNode);\n //# sourceMappingURL=clock.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2Nsb2NrLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQU0sQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFNLEdBQUs7UUFBQSxDQUFVO0tBQUE7SUFDekQ7UUFBQyxVQUFZO1FBQUE7WUFBRSxRQUFRLENBQW9CO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtDQUM1RDtBQWFNLFlBQVEsa0VBQWlCLFVBQVMsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2ljb25zL2Nsb2NrLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2lkZUljb24nO1xuaW1wb3J0IHsgSWNvbk5vZGUgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBfX2ljb25Ob2RlOiBJY29uTm9kZSA9IFtcbiAgWydjaXJjbGUnLCB7IGN4OiAnMTInLCBjeTogJzEyJywg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4gKiBAcGFyYW0ge09iamVjdH0gcHJvcHMgLSBMdWNpZGUgaWNvbnMgcHJvcHMgYW5kIGFueSB2YWxpZCBTVkcgYXR0cmlidXRlXG4gKiBAcmV0dXJucyB7SlNYLkVsZW1lbnR9IEpTWCBFbGVtZW50XG4gKlxuICovXG5jb25zdCBDbG9jayA9IGNyZWF0ZUx1Y2lkZUljb24oJ0Nsb2NrJywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IENsb2NrO1xuIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/clock.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/ellipsis.js": -/*!**************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/ellipsis.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Ellipsis)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"1\",\n key: \"41hilf\"\n }\n ],\n [\n \"circle\",\n {\n cx: \"19\",\n cy: \"12\",\n r: \"1\",\n key: \"1wjl8i\"\n }\n ],\n [\n \"circle\",\n {\n cx: \"5\",\n cy: \"12\",\n r: \"1\",\n key: \"1pcz8c\"\n }\n ]\n];\nconst Ellipsis = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Ellipsis\", __iconNode);\n //# sourceMappingURL=ellipsis.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2VsbGlwc2lzLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQU0sQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFLLEdBQUs7UUFBQSxDQUFVO0tBQUE7SUFDeEQ7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQU0sQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFLLEdBQUs7UUFBQSxDQUFVO0tBQUE7SUFDeEQ7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQUssQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFLLEdBQUs7UUFBQSxDQUFVO0tBQUE7Q0FDekQ7QUFhTSxlQUFXLGtFQUFpQixhQUFZLENBQVUiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL3NyYy9pY29ucy9lbGxpcHNpcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgY3JlYXRlTHVjaWRlSWNvbiBmcm9tICcuLi9jcmVhdGVMdWNpZGVJY29uJztcbmltcG9ydCB7IEljb25Ob2RlIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgX19pY29uTm9kZTogSWNvbk5vZGUgPSBbXG4gIFsnY2lyY2xlJywgeyBjeDogJzEyJywgY3k6ICcxMicsIHI6ICcxJywga2V5OiAnND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pY29ucy9lbGxpcHNpc1xuICogQHNlZSBodHRwczovL2x1Y2lkZS5kZXYvZ3VpZGUvcGFja2FnZXMvbHVjaWRlLXJlYWN0IC0gRG9jdW1lbnRhdGlvblxuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBwcm9wcyAtIEx1Y2lkZSBpY29ucyBwcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IEVsbGlwc2lzID0gY3JlYXRlTHVjaWRlSWNvbignRWxsaXBzaXMnLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgRWxsaXBzaXM7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/ellipsis.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/external-link.js": -/*!*******************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/external-link.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ ExternalLink)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M15 3h6v6\",\n key: \"1q9fwt\"\n }\n ],\n [\n \"path\",\n {\n d: \"M10 14 21 3\",\n key: \"gplh6r\"\n }\n ],\n [\n \"path\",\n {\n d: \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\",\n key: \"a6xqqp\"\n }\n ]\n];\nconst ExternalLink = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"ExternalLink\", __iconNode);\n //# sourceMappingURL=external-link.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2V4dGVybmFsLWxpbmsuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBYTtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7SUFDMUM7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQWU7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQzVDO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUE0RDtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7Q0FDM0Y7QUFhTSxtQkFBZSxrRUFBaUIsaUJBQWdCLENBQVUiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL3NyYy9pY29ucy9leHRlcm5hbC1saW5rLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2lkZUljb24nO1xuaW1wb3J0IHsgSWNvbk5vZGUgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBfX2ljb25Ob2RlOiBJY29uTm9kZ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lJREFnTUNBeExUSWdNa2cxWVRJZ01pQXdJREFnTVMweUxUSldPR0V5SURJZ01DQXdJREVnTWkweWFEWWlJQzgrQ2p3dmMzWm5QZ289KSAtIGh0dHBzOi8vbHVjaWRlLmRldi9pY29ucy9leHRlcm5hbC1saW5rXG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgRXh0ZXJuYWxMaW5rID0gY3JlYXRlTHVjaWRlSWNvbignRXh0ZXJuYWxMaW5rJywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IEV4dGVybmFsTGluaztcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/external-link.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/globe.js": -/*!***********************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/globe.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Globe)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"path\",\n {\n d: \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\",\n key: \"13o1zl\"\n }\n ],\n [\n \"path\",\n {\n d: \"M2 12h20\",\n key: \"9i4pu4\"\n }\n ]\n];\nconst Globe = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Globe\", __iconNode);\n //# sourceMappingURL=globe.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL2dsb2JlLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQU0sQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFNLEdBQUs7UUFBQSxDQUFVO0tBQUE7SUFDekQ7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQW1EO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtJQUNoRjtRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBWTtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7Q0FDM0M7QUFhTSxZQUFRLGtFQUFpQixVQUFTLENBQVUiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL3NyYy9pY29ucy9nbG9iZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgY3JlYXRlTHVjaWRlSWNvbiBmcm9tICcuLi9j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4TWlJZ1kzazlJakV5SWlCeVBTSXhNQ0lnTHo0S0lDQThjR0YwYUNCa1BTSk5NVElnTW1FeE5DNDFJREUwTGpVZ01DQXdJREFnTUNBeU1DQXhOQzQxSURFMExqVWdNQ0F3SURBZ01DMHlNQ0lnTHo0S0lDQThjR0YwYUNCa1BTSk5NaUF4TW1neU1DSWdMejRLUEM5emRtYytDZz09KSAtIGh0dHBzOi8vbHVjaWRlLmRldi9pY29ucy9nbG9iZVxuICogQHNlZSBodHRwczovL2x1Y2lkZS5kZXYvZ3VpZGUvcGFja2FnZXMvbHVjaWRlLXJlYWN0IC0gRG9jdW1lbnRhdGlvblxuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBwcm9wcyAtIEx1Y2lkZSBpY29ucyBwcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IEdsb2JlID0gY3JlYXRlTHVjaWRlSWNvbignR2xvYmUnLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgR2xvYmU7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/globe.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/plus.js": -/*!**********************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/plus.js ***! - \**********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Plus)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M5 12h14\",\n key: \"1ays0h\"\n }\n ],\n [\n \"path\",\n {\n d: \"M12 5v14\",\n key: \"s699le\"\n }\n ]\n];\nconst Plus = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Plus\", __iconNode);\n //# sourceMappingURL=plus.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL3BsdXMuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBWTtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7SUFDekM7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQVk7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0NBQzNDO0FBYU0sV0FBTyxrRUFBaUIsU0FBUSxDQUFVIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9zcmMvaWNvbnMvcGx1cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgY3JlYXRlTHVjaWRlSWNvbiBmcm9tICcuLi9jcmVhdGVMdWNpZGVJY29uJztcbmltcG9ydCB7IEljb25Ob2RlIH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5leHBvcnQgY29uc3QgX19pY29uTm9kZTogSWNvbk5vZGUgPSBbXG4gIFsncGF0aCcsIHsg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wcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IFBsdXMgPSBjcmVhdGVMdWNpZGVJY29uKCdQbHVzJywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IFBsdXM7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/plus.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/refresh-cw.js": -/*!****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/refresh-cw.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ RefreshCw)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\",\n key: \"v9h5vc\"\n }\n ],\n [\n \"path\",\n {\n d: \"M21 3v5h-5\",\n key: \"1q7to0\"\n }\n ],\n [\n \"path\",\n {\n d: \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\",\n key: \"3uifl3\"\n }\n ],\n [\n \"path\",\n {\n d: \"M8 16H3v5\",\n key: \"1cv678\"\n }\n ]\n];\nconst RefreshCw = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"RefreshCw\", __iconNode);\n //# sourceMappingURL=refresh-cw.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL3JlZnJlc2gtY3cuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBc0Q7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQ25GO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFjO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtJQUMzQztRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBdUQ7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQ3BGO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFhO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtDQUM1QztBQWFNLGdCQUFZLGtFQUFpQixjQUFhLENBQVUiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL3NyYy9pY29ucy9yZWZyZXNoLWN3LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2lkZUljb24nO1xuaW1wb3J0IHsgSWNvbk5vZGUgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBfX2ljb25Ob2RlOiBJY29uTm9kZSA9IFtcbiAgWydwYXRoJywgeyBkOiAnTTMgMT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05TQXdJREFnTVNBMkxqYzBJREl1TnpSTU1qRWdPQ0lnTHo0S0lDQThjR0YwYUNCa1BTSk5NakVnTTNZMWFDMDFJaUF2UGdvZ0lEeHdZWFJvSUdROUlrMHlNU0F4TW1FNUlEa2dNQ0F3SURFdE9TQTVJRGt1TnpVZ09TNDNOU0F3SURBZ01TMDJMamMwTFRJdU56Uk1NeUF4TmlJZ0x6NEtJQ0E4Y0dGMGFDQmtQU0pOT0NBeE5rZ3pkalVpSUM4K0Nqd3ZjM1puUGdvPSkgLSBodHRwczovL2x1Y2lkZS5kZXYvaWNvbnMvcmVmcmVzaC1jd1xuICogQHNlZSBodHRwczovL2x1Y2lkZS5kZXYvZ3VpZGUvcGFja2FnZXMvbHVjaWRlLXJlYWN0IC0gRG9jdW1lbnRhdGlvblxuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBwcm9wcyAtIEx1Y2lkZSBpY29ucyBwcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IFJlZnJlc2hDdyA9IGNyZWF0ZUx1Y2lkZUljb24oJ1JlZnJlc2hDdycsIF9faWNvbk5vZGUpO1xuXG5leHBvcnQgZGVmYXVsdCBSZWZyZXNoQ3c7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/refresh-cw.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/trash-2.js": -/*!*************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/trash-2.js ***! - \*************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Trash2)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M3 6h18\",\n key: \"d0wm0j\"\n }\n ],\n [\n \"path\",\n {\n d: \"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\",\n key: \"4alrt4\"\n }\n ],\n [\n \"path\",\n {\n d: \"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\",\n key: \"v07s0e\"\n }\n ],\n [\n \"line\",\n {\n x1: \"10\",\n x2: \"10\",\n y1: \"11\",\n y2: \"17\",\n key: \"1uufr5\"\n }\n ],\n [\n \"line\",\n {\n x1: \"14\",\n x2: \"14\",\n y1: \"11\",\n y2: \"17\",\n key: \"xtxkd\"\n }\n ]\n];\nconst Trash2 = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Trash2\", __iconNode);\n //# sourceMappingURL=trash-2.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL3RyYXNoLTIuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBVztZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7SUFDeEM7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQXlDO1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UNJZ2VURTlJakV4SWlCNU1qMGlNVGNpSUM4K0NpQWdQR3hwYm1VZ2VERTlJakUwSWlCNE1qMGlNVFFpSUhreFBTSXhNU0lnZVRJOUlqRTNJaUF2UGdvOEwzTjJaejRLKSAtIGh0dHBzOi8vbHVjaWRlLmRldi9pY29ucy90cmFzaC0yXG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgVHJhc2gyID0gY3JlYXRlTHVjaWRlSWNvbignVHJhc2gyJywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IFRyYXNoMjtcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/trash-2.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/icons/trending-up.js": -/*!*****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/trending-up.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ TrendingUp)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(ssr)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"polyline\",\n {\n points: \"22 7 13.5 15.5 8.5 10.5 2 17\",\n key: \"126l90\"\n }\n ],\n [\n \"polyline\",\n {\n points: \"16 7 22 7 22 13\",\n key: \"kwv8wd\"\n }\n ]\n];\nconst TrendingUp = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"TrendingUp\", __iconNode);\n //# sourceMappingURL=trending-up.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbHVjaWRlLXJlYWN0L2Rpc3QvZXNtL2ljb25zL3RyZW5kaW5nLXVwLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFBQyxVQUFZO1FBQUE7WUFBRSxRQUFRLENBQWdDO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtJQUN0RTtRQUFDLFVBQVk7UUFBQTtZQUFFLFFBQVEsQ0FBbUI7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0NBQzNEO0FBYU0saUJBQWEsa0VBQWlCLGVBQWMsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2ljb25zL3RyZW5kaW5nLXVwLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2lkZUljb24nO1xuaW1wb3J0IHsgSWNvbk5vZGUgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBfX2ljb25Ob2RlOiBJY29uTm9kZSA9IFtcbiAgWydwb2x5bGluZScsIHsgcG9pbn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ovL2x1Y2lkZS5kZXYvZ3VpZGUvcGFja2FnZXMvbHVjaWRlLXJlYWN0IC0gRG9jdW1lbnRhdGlvblxuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBwcm9wcyAtIEx1Y2lkZSBpY29ucyBwcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IFRyZW5kaW5nVXAgPSBjcmVhdGVMdWNpZGVJY29uKCdUcmVuZGluZ1VwJywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IFRyZW5kaW5nVXA7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/icons/trending-up.js\n"); - -/***/ }), - -/***/ "(ssr)/./node_modules/lucide-react/dist/esm/shared/src/utils.js": -/*!****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/shared/src/utils.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ mergeClasses: () => (/* binding */ mergeClasses),\n/* harmony export */ toKebabCase: () => (/* binding */ toKebabCase)\n/* harmony export */ });\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ const toKebabCase = (string)=>string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst mergeClasses = (...classes)=>classes.filter((className, index, array)=>{\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n }).join(\" \").trim();\n //# sourceMappingURL=utils.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ey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Y2xhc3NOYW1lKSAmJlxuICAgICAgICAoY2xhc3NOYW1lIGFzIHN0cmluZykudHJpbSgpICE9PSAnJyAmJlxuICAgICAgICBhcnJheS5pbmRleE9mKGNsYXNzTmFtZSkgPT09IGluZGV4XG4gICAgICApO1xuICAgIH0pXG4gICAgLmpvaW4oJyAnKVxuICAgIC50cmltKCk7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/lucide-react/dist/esm/shared/src/utils.js\n"); - -/***/ }) - -}; -; \ No newline at end of file diff --git a/.next/server/vendor-chunks/next.js b/.next/server/vendor-chunks/next.js index 971ff3b4..04193bd2 100644 --- a/.next/server/vendor-chunks/next.js +++ b/.next/server/vendor-chunks/next.js @@ -1436,17 +1436,6 @@ eval("\nmodule.exports = __webpack_require__(/*! ../../module.compiled */ \"(ssr /***/ }), -/***/ "(ssr)/./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js": -/*!****************************************************************************************************!*\ - !*** ./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js ***! - \****************************************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -eval("\nmodule.exports = __webpack_require__(/*! ../../module.compiled */ \"(ssr)/./node_modules/next/dist/server/route-modules/app-page/module.compiled.js?9abb\").vendored[\"react-ssr\"].ReactJsxDevRuntime;\n\n//# sourceMappingURL=react-jsx-dev-runtime.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHNzcikvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci9yb3V0ZS1tb2R1bGVzL2FwcC1wYWdlL3ZlbmRvcmVkL3Nzci9yZWFjdC1qc3gtZGV2LXJ1bnRpbWUuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYixrTUFBMEY7O0FBRTFGIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9zZXJ2ZXIvcm91dGUtbW9kdWxlcy9hcHAtcGFnZS92ZW5kb3JlZC9zc3IvcmVhY3QtanN4LWRldi1ydW50aW1lLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGUuY29tcGlsZWQnKS52ZW5kb3JlZFsncmVhY3Qtc3NyJ10uUmVhY3RKc3hEZXZSdW50aW1lO1xuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1yZWFjdC1qc3gtZGV2LXJ1bnRpbWUuanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(ssr)/./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js\n"); - -/***/ }), - /***/ "(ssr)/./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js": /*!************************************************************************************************!*\ !*** ./node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js ***! @@ -1634,17 +1623,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sha /***/ }), -/***/ "(rsc)/./node_modules/next/dist/api/server.js": -/*!**********************************************!*\ - !*** ./node_modules/next/dist/api/server.js ***! - \**********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _server_web_exports_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../server/web/exports/index */ \"(rsc)/./node_modules/next/dist/server/web/exports/index.js\");\n/* harmony import */ var _server_web_exports_index__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_server_web_exports_index__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _server_web_exports_index__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _server_web_exports_index__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\n\n//# sourceMappingURL=server.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2FwaS9zZXJ2ZXIuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQTRDOztBQUU1QyIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvV2ViL2hlYXJ0YmVhdC1tb25pdG9yL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvYXBpL3NlcnZlci5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuLi9zZXJ2ZXIvd2ViL2V4cG9ydHMvaW5kZXgnO1xuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1zZXJ2ZXIuanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/api/server.js\n"); - -/***/ }), - /***/ "(rsc)/./node_modules/next/dist/build/output/log.js": /*!****************************************************!*\ !*** ./node_modules/next/dist/build/output/log.js ***! @@ -1884,16 +1862,6 @@ eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/compiled/ua-parser-js/ua-parser.js": -/*!*******************************************************************!*\ - !*** ./node_modules/next/dist/compiled/ua-parser-js/ua-parser.js ***! - \*******************************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -eval("var __WEBPACK_AMD_DEFINE_RESULT__;(()=>{var i={226:function(i,e){(function(o,a){\"use strict\";var r=\"1.0.35\",t=\"\",n=\"?\",s=\"function\",b=\"undefined\",w=\"object\",l=\"string\",d=\"major\",c=\"model\",u=\"name\",p=\"type\",m=\"vendor\",f=\"version\",h=\"architecture\",v=\"console\",g=\"mobile\",k=\"tablet\",x=\"smarttv\",_=\"wearable\",y=\"embedded\",q=350;var T=\"Amazon\",S=\"Apple\",z=\"ASUS\",N=\"BlackBerry\",A=\"Browser\",C=\"Chrome\",E=\"Edge\",O=\"Firefox\",U=\"Google\",j=\"Huawei\",P=\"LG\",R=\"Microsoft\",M=\"Motorola\",B=\"Opera\",V=\"Samsung\",D=\"Sharp\",I=\"Sony\",W=\"Viera\",F=\"Xiaomi\",G=\"Zebra\",H=\"Facebook\",L=\"Chromium OS\",Z=\"Mac OS\";var extend=function(i,e){var o={};for(var a in i){if(e[a]&&e[a].length%2===0){o[a]=e[a].concat(i[a])}else{o[a]=i[a]}}return o},enumerize=function(i){var e={};for(var o=0;o0){if(b.length===2){if(typeof b[1]==s){this[b[0]]=b[1].call(this,d)}else{this[b[0]]=b[1]}}else if(b.length===3){if(typeof b[1]===s&&!(b[1].exec&&b[1].test)){this[b[0]]=d?b[1].call(this,d,b[2]):a}else{this[b[0]]=d?d.replace(b[1],b[2]):a}}else if(b.length===4){this[b[0]]=d?b[3].call(this,d.replace(b[1],b[2])):a}}else{this[b]=d?d:a}}}}o+=2}},strMapper=function(i,e){for(var o in e){if(typeof e[o]===w&&e[o].length>0){for(var r=0;r2){i[c]=\"iPad\";i[p]=k}return i};this.getEngine=function(){var i={};i[u]=a;i[f]=a;rgxMapper.call(i,n,x.engine);return i};this.getOS=function(){var i={};i[u]=a;i[f]=a;rgxMapper.call(i,n,x.os);if(_&&!i[u]&&v&&v.platform!=\"Unknown\"){i[u]=v.platform.replace(/chrome os/i,L).replace(/macos/i,Z)}return i};this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}};this.getUA=function(){return n};this.setUA=function(i){n=typeof i===l&&i.length>q?trim(i,q):i;return this};this.setUA(n);return this};UAParser.VERSION=r;UAParser.BROWSER=enumerize([u,f,d]);UAParser.CPU=enumerize([h]);UAParser.DEVICE=enumerize([c,m,p,v,g,x,k,_,y]);UAParser.ENGINE=UAParser.OS=enumerize([u,f]);if(typeof e!==b){if(\"object\"!==b&&i.exports){e=i.exports=UAParser}e.UAParser=UAParser}else{if(\"function\"===s&&__webpack_require__.amdO){!(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){return UAParser}).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))}else if(typeof o!==b){o.UAParser=UAParser}}var Q=typeof o!==b&&(o.jQuery||o.Zepto);if(Q&&!Q.ua){var Y=new UAParser;Q.ua=Y.getResult();Q.ua.get=function(){return Y.getUA()};Q.ua.set=function(i){Y.setUA(i);var e=Y.getResult();for(var o in e){Q.ua[o]=e[o]}}}})(typeof window===\"object\"?window:this)}};var e={};function __nccwpck_require__(o){var a=e[o];if(a!==undefined){return a.exports}var r=e[o]={exports:{}};var t=true;try{i[o].call(r.exports,r,r.exports,__nccwpck_require__);t=false}finally{if(t)delete e[o]}return r.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var o=__nccwpck_require__(226);module.exports=o})();//# sourceURL=[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SBlW29dfXJldHVybiByLmV4cG9ydHN9aWYodHlwZW9mIF9fbmNjd3Bja19yZXF1aXJlX18hPT1cInVuZGVmaW5lZFwiKV9fbmNjd3Bja19yZXF1aXJlX18uYWI9X19kaXJuYW1lK1wiL1wiO3ZhciBvPV9fbmNjd3Bja19yZXF1aXJlX18oMjI2KTttb2R1bGUuZXhwb3J0cz1vfSkoKTsiXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/compiled/ua-parser-js/ua-parser.js\n"); - /***/ }), /***/ "(rsc)/./node_modules/next/dist/lib/batcher.js": @@ -2184,28 +2152,6 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), -/***/ "(rsc)/./node_modules/next/dist/server/after/after.js": -/*!******************************************************!*\ - !*** ./node_modules/next/dist/server/after/after.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"after\", ({\n enumerable: true,\n get: function() {\n return after;\n }\n}));\nconst _workasyncstorageexternal = __webpack_require__(/*! ../app-render/work-async-storage.external */ \"../app-render/work-async-storage.external\");\nfunction after(task) {\n const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();\n if (!workStore) {\n // TODO(after): the linked docs page talks about *dynamic* APIs, which after soon won't be anymore\n throw new Error('`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context');\n }\n const { afterContext } = workStore;\n return afterContext.after(task);\n}\n\n//# sourceMappingURL=after.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci9hZnRlci9hZnRlci5qcyIsIm1hcHBpbmd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Z2UgdGFsa3MgYWJvdXQgKmR5bmFtaWMqIEFQSXMsIHdoaWNoIGFmdGVyIHNvb24gd29uJ3QgYmUgYW55bW9yZVxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2BhZnRlcmAgd2FzIGNhbGxlZCBvdXRzaWRlIGEgcmVxdWVzdCBzY29wZS4gUmVhZCBtb3JlOiBodHRwczovL25leHRqcy5vcmcvZG9jcy9tZXNzYWdlcy9uZXh0LWR5bmFtaWMtYXBpLXdyb25nLWNvbnRleHQnKTtcbiAgICB9XG4gICAgY29uc3QgeyBhZnRlckNvbnRleHQgfSA9IHdvcmtTdG9yZTtcbiAgICByZXR1cm4gYWZ0ZXJDb250ZXh0LmFmdGVyKHRhc2spO1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1hZnRlci5qcy5tYXAiXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/after/after.js\n"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/server/after/index.js": -/*!******************************************************!*\ - !*** ./node_modules/next/dist/server/after/index.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && 0;\n_export_star(__webpack_require__(/*! ./after */ \"(rsc)/./node_modules/next/dist/server/after/after.js\"), exports);\nfunction _export_star(from, to) {\n Object.keys(from).forEach(function(k) {\n if (k !== \"default\" && !Object.prototype.hasOwnProperty.call(to, k)) {\n Object.defineProperty(to, k, {\n enumerable: true,\n get: function() {\n return from[k];\n }\n });\n }\n });\n return from;\n}\n\n//# sourceMappingURL=index.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3N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ICAgICByZXR1cm4gZnJvbVtrXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH0pO1xuICAgIHJldHVybiBmcm9tO1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1pbmRleC5qcy5tYXAiXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/after/index.js\n"); - -/***/ }), - /***/ "(rsc)/./node_modules/next/dist/server/app-render/collect-segment-data.js": /*!**************************************************************************!*\ !*** ./node_modules/next/dist/server/app-render/collect-segment-data.js ***! @@ -2426,17 +2372,6 @@ eval("/* eslint-disable no-redeclare */ \nObject.defineProperty(exports, \"__esM /***/ }), -/***/ "(rsc)/./node_modules/next/dist/server/request/connection.js": -/*!*************************************************************!*\ - !*** ./node_modules/next/dist/server/request/connection.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"connection\", ({\n enumerable: true,\n get: function() {\n return connection;\n }\n}));\nconst _workasyncstorageexternal = __webpack_require__(/*! ../app-render/work-async-storage.external */ \"../app-render/work-async-storage.external\");\nconst _workunitasyncstorageexternal = __webpack_require__(/*! ../app-render/work-unit-async-storage.external */ \"./work-unit-async-storage.external\");\nconst _dynamicrendering = __webpack_require__(/*! ../app-render/dynamic-rendering */ \"(rsc)/./node_modules/next/dist/server/app-render/dynamic-rendering.js\");\nconst _staticgenerationbailout = __webpack_require__(/*! ../../client/components/static-generation-bailout */ \"(rsc)/./node_modules/next/dist/client/components/static-generation-bailout.js\");\nconst _dynamicrenderingutils = __webpack_require__(/*! ../dynamic-rendering-utils */ \"(rsc)/./node_modules/next/dist/server/dynamic-rendering-utils.js\");\nconst _utils = __webpack_require__(/*! ./utils */ \"(rsc)/./node_modules/next/dist/server/request/utils.js\");\nfunction connection() {\n const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();\n const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();\n if (workStore) {\n if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) {\n throw new Error(`Route ${workStore.route} used \"connection\" inside \"after(...)\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`);\n }\n if (workStore.forceStatic) {\n // When using forceStatic we override all other logic and always just return an empty\n // headers object without tracking\n return Promise.resolve(undefined);\n }\n if (workUnitStore) {\n if (workUnitStore.type === 'cache') {\n throw new Error(`Route ${workStore.route} used \"connection\" inside \"use cache\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`);\n } else if (workUnitStore.type === 'unstable-cache') {\n throw new Error(`Route ${workStore.route} used \"connection\" inside a function cached with \"unstable_cache(...)\". The \\`connection()\\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);\n }\n }\n if (workStore.dynamicShouldError) {\n throw new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`connection\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);\n }\n if (workUnitStore) {\n if (workUnitStore.type === 'prerender') {\n // dynamicIO Prerender\n // We return a promise that never resolves to allow the prender to stall at this point\n return (0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, '`connection()`');\n } else if (workUnitStore.type === 'prerender-ppr') {\n // PPR Prerender (no dynamicIO)\n // We use React's postpone API to interrupt rendering here to create a dynamic hole\n (0, _dynamicrendering.postponeWithTracking)(workStore.route, 'connection', workUnitStore.dynamicTracking);\n } else if (workUnitStore.type === 'prerender-legacy') {\n // Legacy Prerender\n // We throw an error here to interrupt prerendering to mark the route as dynamic\n (0, _dynamicrendering.throwToInterruptStaticGeneration)('connection', workStore, workUnitStore);\n }\n }\n // We fall through to the dynamic context below but we still track dynamic access\n // because in dev we can still error for things like using headers inside a cache context\n (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workStore, workUnitStore);\n }\n return Promise.resolve(undefined);\n}\n\n//# sourceMappingURL=connection.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci9yZXF1ZXN0L2Nvbm5lY3Rpb24uanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRiw4Q0FBNkM7QUFDN0M7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDLEVBQUM7QUFDRixrQ0FBa0MsbUJBQU8sQ0FBQyw0RkFBMkM7QUFDckYsc0NBQXNDLG1CQUFPLENBQUMsMEZBQWdEO0FBQzlGLDBCQUEwQixtQkFBTyxDQUFDLDhHQUFpQztBQUNuRSxpQ0FBaUMsbUJBQU8sQ0FBQyx3SUFBbUQ7QUFDNUYsK0JBQStCLG1CQUFPLENBQUMsb0dBQTRCO0FBQ25FLGVBQWUsbUJBQU8sQ0FBQyx1RUFBUztBQUNoQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUNBQXFDLGlCQUFpQjtBQUN0RDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EseUNBQXlDLGlCQUFpQjtBQUMxRCxjQUFjO0FBQ2QseUNBQXlDLGlCQUFpQjtBQUMxRDtBQUNBO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YWNraW5nKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAod29ya1VuaXRTdG9yZS50eXBlID09PSAncHJlcmVuZGVyLWxlZ2FjeScpIHtcbiAgICAgICAgICAgICAgICAvLyBMZWdhY3kgUHJlcmVuZGVyXG4gICAgICAgICAgICAgICAgLy8gV2UgdGhyb3cgYW4gZXJyb3IgaGVyZSB0byBpbnRlcnJ1cHQgcHJlcmVuZGVyaW5nIHRvIG1hcmsgdGhlIHJvdXRlIGFzIGR5bmFtaWNcbiAgICAgICAgICAgICAgICAoMCwgX2R5bmFtaWNyZW5kZXJpbmcudGhyb3dUb0ludGVycnVwdFN0YXRpY0dlbmVyYXRpb24pKCdjb25uZWN0aW9uJywgd29ya1N0b3JlLCB3b3JrVW5pdFN0b3JlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBXZSBmYWxsIHRocm91Z2ggdG8gdGhlIGR5bmFtaWMgY29udGV4dCBiZWxvdyBidXQgd2Ugc3RpbGwgdHJhY2sgZHluYW1pYyBhY2Nlc3NcbiAgICAgICAgLy8gYmVjYXVzZSBpbiBkZXYgd2UgY2FuIHN0aWxsIGVycm9yIGZvciB0aGluZ3MgbGlrZSB1c2luZyBoZWFkZXJzIGluc2lkZSBhIGNhY2hlIGNvbnRleHRcbiAgICAgICAgKDAsIF9keW5hbWljcmVuZGVyaW5nLnRyYWNrRHluYW1pY0RhdGFJbkR5bmFtaWNSZW5kZXIpKHdvcmtTdG9yZSwgd29ya1VuaXRTdG9yZSk7XG4gICAgfVxuICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodW5kZWZpbmVkKTtcbn1cblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y29ubmVjdGlvbi5qcy5tYXAiXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/request/connection.js\n"); - -/***/ }), - /***/ "(rsc)/./node_modules/next/dist/server/request/params.js": /*!*********************************************************!*\ !*** ./node_modules/next/dist/server/request/params.js ***! @@ -2591,17 +2526,6 @@ eval("\nmodule.exports = __webpack_require__(/*! ../../module.compiled */ \"(ssr /***/ }), -/***/ "(rsc)/./node_modules/next/dist/server/route-modules/app-route/module.compiled.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js ***! - \**********************************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -eval("\nif (false) {} else {\n if (false) {} else {\n if (true) {\n module.exports = __webpack_require__(/*! next/dist/compiled/next-server/app-route.runtime.dev.js */ \"next/dist/compiled/next-server/app-route.runtime.dev.js\");\n } else {}\n }\n}\n\n//# sourceMappingURL=module.compiled.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci9yb3V0ZS1tb2R1bGVzL2FwcC1yb3V0ZS9tb2R1bGUuY29tcGlsZWQuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYixJQUFJLEtBQW1DLEVBQUUsRUFFeEMsQ0FBQztBQUNGLFFBQVEsS0FBcUMsRUFBRSxFQVExQyxDQUFDO0FBQ04sWUFBWSxJQUFzQztBQUNsRCxZQUFZLDhKQUFtRjtBQUMvRixVQUFVLEtBQUssRUFJTjtBQUNUO0FBQ0E7O0FBRUEiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL09wZW5DbGF3L1dlYi9oZWFydGJlYXQtbW9uaXRvci9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci9yb3V0ZS1tb2R1bGVzL2FwcC1yb3V0ZS9tb2R1bGUuY29tcGlsZWQuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ug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ydW50aW1lLmRldi5qcycpO1xuICAgICAgICB9IGVsc2UgaWYgKHByb2Nlc3MuZW52LlRVUkJPUEFDSykge1xuICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCduZXh0L2Rpc3QvY29tcGlsZWQvbmV4dC1zZXJ2ZXIvYXBwLXJvdXRlLXR1cmJvLnJ1bnRpbWUucHJvZC5qcycpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCduZXh0L2Rpc3QvY29tcGlsZWQvbmV4dC1zZXJ2ZXIvYXBwLXJvdXRlLnJ1bnRpbWUucHJvZC5qcycpO1xuICAgICAgICB9XG4gICAgfVxufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1tb2R1bGUuY29tcGlsZWQuanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/route-modules/app-route/module.compiled.js\n"); - -/***/ }), - /***/ "(rsc)/./node_modules/next/dist/server/stream-utils/encodedTags.js": /*!*******************************************************************!*\ !*** ./node_modules/next/dist/server/stream-utils/encodedTags.js ***! @@ -2646,17 +2570,6 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), -/***/ "(rsc)/./node_modules/next/dist/server/web/exports/index.js": -/*!************************************************************!*\ - !*** ./node_modules/next/dist/server/web/exports/index.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("// Alias index file of next/server for edge runtime for tree-shaking purpose\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && (0);\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n ImageResponse: function() {\n return _imageresponse.ImageResponse;\n },\n NextRequest: function() {\n return _request.NextRequest;\n },\n NextResponse: function() {\n return _response.NextResponse;\n },\n URLPattern: function() {\n return _urlpattern.URLPattern;\n },\n after: function() {\n return _after.after;\n },\n connection: function() {\n return _connection.connection;\n },\n userAgent: function() {\n return _useragent.userAgent;\n },\n userAgentFromString: function() {\n return _useragent.userAgentFromString;\n }\n});\nconst _imageresponse = __webpack_require__(/*! ../spec-extension/image-response */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/image-response.js\");\nconst _request = __webpack_require__(/*! ../spec-extension/request */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/request.js\");\nconst _response = __webpack_require__(/*! ../spec-extension/response */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/response.js\");\nconst _useragent = __webpack_require__(/*! ../spec-extension/user-agent */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/user-agent.js\");\nconst _urlpattern = __webpack_require__(/*! ../spec-extension/url-pattern */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/url-pattern.js\");\nconst _after = __webpack_require__(/*! ../../after */ \"(rsc)/./node_modules/next/dist/server/after/index.js\");\nconst _connection = __webpack_require__(/*! ../../request/connection */ \"(rsc)/./node_modules/next/dist/server/request/connection.js\");\n\n//# sourceMappingURL=index.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci93ZWIvZXhwb3J0cy9pbmRleC5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNhO0FBQ2IsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0YsTUFBTSxDQVNMO0FBQ0Q7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0EsS0FBSztBQUNMO0F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HJldHVybiBfdXNlcmFnZW50LnVzZXJBZ2VudEZyb21TdHJpbmc7XG4gICAgfVxufSk7XG5jb25zdCBfaW1hZ2VyZXNwb25zZSA9IHJlcXVpcmUoXCIuLi9zcGVjLWV4dGVuc2lvbi9pbWFnZS1yZXNwb25zZVwiKTtcbmNvbnN0IF9yZXF1ZXN0ID0gcmVxdWlyZShcIi4uL3NwZWMtZXh0ZW5zaW9uL3JlcXVlc3RcIik7XG5jb25zdCBfcmVzcG9uc2UgPSByZXF1aXJlKFwiLi4vc3BlYy1leHRlbnNpb24vcmVzcG9uc2VcIik7XG5jb25zdCBfdXNlcmFnZW50ID0gcmVxdWlyZShcIi4uL3NwZWMtZXh0ZW5zaW9uL3VzZXItYWdlbnRcIik7XG5jb25zdCBfdXJscGF0dGVybiA9IHJlcXVpcmUoXCIuLi9zcGVjLWV4dGVuc2lvbi91cmwtcGF0dGVyblwiKTtcbmNvbnN0IF9hZnRlciA9IHJlcXVpcmUoXCIuLi8uLi9hZnRlclwiKTtcbmNvbnN0IF9jb25uZWN0aW9uID0gcmVxdWlyZShcIi4uLy4uL3JlcXVlc3QvY29ubmVjdGlvblwiKTtcblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW5kZXguanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/web/exports/index.js\n"); - -/***/ }), - /***/ "(rsc)/./node_modules/next/dist/server/web/next-url.js": /*!*******************************************************!*\ !*** ./node_modules/next/dist/server/web/next-url.js ***! @@ -2701,17 +2614,6 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), -/***/ "(rsc)/./node_modules/next/dist/server/web/spec-extension/image-response.js": -/*!****************************************************************************!*\ - !*** ./node_modules/next/dist/server/web/spec-extension/image-response.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -eval("/**\n * @deprecated ImageResponse moved from \"next/server\" to \"next/og\" since Next.js 14, please import from \"next/og\" instead.\n * Migration with codemods: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#next-og-import\n */ \nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"ImageResponse\", ({\n enumerable: true,\n get: function() {\n return ImageResponse;\n }\n}));\nfunction ImageResponse() {\n throw new Error('ImageResponse moved from \"next/server\" to \"next/og\" since Next.js 14, please import from \"next/og\" instead');\n}\n\n//# sourceMappingURL=image-response.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci93ZWIvc3BlYy1leHRlbnNpb24vaW1hZ2UtcmVzcG9uc2UuanMiLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0EsSUFBaUI7QUFDakIsOENBQTZDO0FBQzdDO0FBQ0EsQ0FBQyxFQUFDO0FBQ0YsaURBQWdEO0FBQ2hEO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQyxFQUFDO0FBQ0Y7QUFDQTtBQUNBOztBQUVBIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9zZXJ2ZXIvd2ViL3NwZWMtZXh0ZW5zaW9uL2ltYWdlLXJlc3BvbnNlLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGRlcHJlY2F0ZWQgSW1hZ2VSZXNwb25zZSBtb3ZlZCBmcm9tIFwibmV4dC9zZXJ2ZXJcIiB0byBcIm5leHQvb2dcIiBzaW5jZSBOZXh0LmpzIDE0LCBwbGVhc2UgaW1wb3J0IGZyb20gXCJuZXh0L29nXCIgaW5zdGVhZC5cbiAqIE1pZ3JhdGlvbiB3aXRoIGNvZGVtb2RzOiBodHRwczovL25leHRqcy5vcmcvZG9jcy9hcHAvYnVpbGRpbmcteW91ci1hcHBsaWNhdGlvbi91cGdyYWRpbmcvY29kZW1vZHMjbmV4dC1vZy1pbXBvcnRcbiAqLyBcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwge1xuICAgIHZhbHVlOiB0cnVlXG59KTtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIkltYWdlUmVzcG9uc2VcIiwge1xuICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIEltYWdlUmVzcG9uc2U7XG4gICAgfVxufSk7XG5mdW5jdGlvbiBJbWFnZVJlc3BvbnNlKCkge1xuICAgIHRocm93IG5ldyBFcnJvcignSW1hZ2VSZXNwb25zZSBtb3ZlZCBmcm9tIFwibmV4dC9zZXJ2ZXJcIiB0byBcIm5leHQvb2dcIiBzaW5jZSBOZXh0LmpzIDE0LCBwbGVhc2UgaW1wb3J0IGZyb20gXCJuZXh0L29nXCIgaW5zdGVhZCcpO1xufVxuXG4vLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1yZXNwb25zZS5qcy5tYXAiXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/web/spec-extension/image-response.js\n"); - -/***/ }), - /***/ "(rsc)/./node_modules/next/dist/server/web/spec-extension/request.js": /*!*********************************************************************!*\ !*** ./node_modules/next/dist/server/web/spec-extension/request.js ***! @@ -2723,39 +2625,6 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), -/***/ "(rsc)/./node_modules/next/dist/server/web/spec-extension/response.js": -/*!**********************************************************************!*\ - !*** ./node_modules/next/dist/server/web/spec-extension/response.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"NextResponse\", ({\n enumerable: true,\n get: function() {\n return NextResponse;\n }\n}));\nconst _cookies = __webpack_require__(/*! ../../web/spec-extension/cookies */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/cookies.js\");\nconst _nexturl = __webpack_require__(/*! ../next-url */ \"(rsc)/./node_modules/next/dist/server/web/next-url.js\");\nconst _utils = __webpack_require__(/*! ../utils */ \"(rsc)/./node_modules/next/dist/server/web/utils.js\");\nconst _reflect = __webpack_require__(/*! ./adapters/reflect */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/adapters/reflect.js\");\nconst _cookies1 = __webpack_require__(/*! ./cookies */ \"(rsc)/./node_modules/next/dist/server/web/spec-extension/cookies.js\");\nconst INTERNALS = Symbol('internal response');\nconst REDIRECTS = new Set([\n 301,\n 302,\n 303,\n 307,\n 308\n]);\nfunction handleMiddlewareField(init, headers) {\n var _init_request;\n if (init == null ? void 0 : (_init_request = init.request) == null ? void 0 : _init_request.headers) {\n if (!(init.request.headers instanceof Headers)) {\n throw new Error('request.headers must be an instance of Headers');\n }\n const keys = [];\n for (const [key, value] of init.request.headers){\n headers.set('x-middleware-request-' + key, value);\n keys.push(key);\n }\n headers.set('x-middleware-override-headers', keys.join(','));\n }\n}\nclass NextResponse extends Response {\n constructor(body, init = {}){\n super(body, init);\n const headers = this.headers;\n const cookies = new _cookies1.ResponseCookies(headers);\n const cookiesProxy = new Proxy(cookies, {\n get (target, prop, receiver) {\n switch(prop){\n case 'delete':\n case 'set':\n {\n return (...args)=>{\n const result = Reflect.apply(target[prop], target, args);\n const newHeaders = new Headers(headers);\n if (result instanceof _cookies1.ResponseCookies) {\n headers.set('x-middleware-set-cookie', result.getAll().map((cookie)=>(0, _cookies.stringifyCookie)(cookie)).join(','));\n }\n handleMiddlewareField(init, newHeaders);\n return result;\n };\n }\n default:\n return _reflect.ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n this[INTERNALS] = {\n cookies: cookiesProxy,\n url: init.url ? new _nexturl.NextURL(init.url, {\n headers: (0, _utils.toNodeOutgoingHttpHeaders)(headers),\n nextConfig: init.nextConfig\n }) : undefined\n };\n }\n [Symbol.for('edge-runtime.inspect.custom')]() {\n return {\n cookies: this.cookies,\n url: this.url,\n // rest of props come from Response\n body: this.body,\n bodyUsed: this.bodyUsed,\n headers: Object.fromEntries(this.headers),\n ok: this.ok,\n redirected: this.redirected,\n status: this.status,\n statusText: this.statusText,\n type: this.type\n };\n }\n get cookies() {\n return this[INTERNALS].cookies;\n }\n static json(body, init) {\n const response = Response.json(body, init);\n return new NextResponse(response.body, response);\n }\n static redirect(url, init) {\n const status = typeof init === 'number' ? init : (init == null ? void 0 : init.status) ?? 307;\n if (!REDIRECTS.has(status)) {\n throw new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n }\n const initObj = typeof init === 'object' ? init : {};\n const headers = new Headers(initObj == null ? void 0 : initObj.headers);\n headers.set('Location', (0, _utils.validateURL)(url));\n return new NextResponse(null, {\n ...initObj,\n headers,\n status\n });\n }\n static rewrite(destination, init) {\n const headers = new Headers(init == null ? void 0 : init.headers);\n headers.set('x-middleware-rewrite', (0, _utils.validateURL)(destination));\n handleMiddlewareField(init, headers);\n return new NextResponse(null, {\n ...init,\n headers\n });\n }\n static next(init) {\n const headers = new Headers(init == null ? void 0 : init.headers);\n headers.set('x-middleware-next', '1');\n handleMiddlewareField(init, headers);\n return new NextResponse(null, {\n ...init,\n headers\n });\n }\n}\n\n//# sourceMappingURL=response.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9k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JzO1xuICAgICAgICBjb25zdCBjb29raWVzID0gbmV3IF9jb29raWVzMS5SZXNwb25zZUNvb2tpZXMoaGVhZGVycyk7XG4gICAgICAgIGNvbnN0IGNvb2tpZXNQcm94eSA9IG5ldyBQcm94eShjb29raWVzLCB7XG4gICAgICAgICAgICBnZXQgKHRhcmdldCwgcHJvcCwgcmVjZWl2ZXIpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2gocHJvcCl7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2RlbGV0ZSc6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3NldCc6XG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICguLi5hcmdzKT0+e1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByZXN1bHQgPSBSZWZsZWN0LmFwcGx5KHRhcmdldFtwcm9wXSwgdGFyZ2V0LCBhcmdzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbmV3SGVhZGVycyA9IG5ldyBIZWFkZXJzKGhlYWRlcnMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0IGluc3RhbmNlb2YgX2Nvb2tpZXMxLlJlc3BvbnNlQ29va2llcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVycy5zZXQoJ3gtbWlkZGxld2FyZS1zZXQtY29va2llJywgcmVzdWx0LmdldEFsbCgpLm1hcCgoY29va2llKT0+KDAsIF9jb29raWVzLnN0cmluZ2lmeUNvb2tpZSkoY29va2llKSkuam9pbignLCcpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVNaWRkbGV3YXJlRmllbGQoaW5pdCwgbmV3SGVhZGVycyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfcmVmbGVjdC5SZWZsZWN0QWRhcHRlci5nZXQodGFyZ2V0LCBwcm9wLCByZWNlaXZlcik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgdGhpc1tJTlRFUk5BTFNdID0ge1xuICAgICAgICAgICAgY29va2llczogY29va2llc1Byb3h5LFxuICAgICAgICAgICAgdXJsOiBpbml0LnVybCA/IG5ldyBfbmV4dHVybC5OZXh0VVJMKGluaXQudXJsLCB7XG4gICAgICAgICAgICAgICAgaGVhZGVyczogKDAsIF91dGlscy50b05vZGVPdXRnb2luZ0h0dHBIZWFkZXJzKShoZWFkZXJzKSxcbiAgICAgICAgICAgICAgICBuZXh0Q29uZmlnOiBpbml0Lm5leHRDb25maWdcbiAgICAgICAgICAgIH0pIDogdW5kZWZpbmVkXG4gICAgICAgIH07XG4gICAgfVxuICAgIFtTeW1ib2wuZm9yKCdlZGdlLXJ1bnRpbWUuaW5zcGVjdC5jdXN0b20nKV0oKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBjb29raWVzOiB0aGlzLmNvb2tpZXMsXG4gICAgICAgICAgICB1cmw6IHRoaXMudXJsLFxuICAgICAgICAgICAgLy8gcmVzdCBvZiBwcm9wcyBjb21lIGZyb20gUmVzcG9uc2VcbiAgICAgICAgICAgIGJvZHk6IHRoaXMuYm9keSxcbiAgICAgICAgICAgIGJvZHlVc2VkOiB0aGlzLmJvZHlVc2VkLFxuICAgICAgICAgICAgaGVhZGVyczogT2JqZWN0LmZyb21FbnRyaWVzKHRoaXMuaGVhZGVycyksXG4gICAgICAgICAgICBvazogdGhpcy5vayxcbiAgICAgICAgICAgIHJlZ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G9uc2UuanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/web/spec-extension/response.js\n"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/server/web/spec-extension/url-pattern.js": -/*!*************************************************************************!*\ - !*** ./node_modules/next/dist/server/web/spec-extension/url-pattern.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"URLPattern\", ({\n enumerable: true,\n get: function() {\n return GlobalURLPattern;\n }\n}));\nconst GlobalURLPattern = // @ts-expect-error: URLPattern is not available in Node.js\ntypeof URLPattern === 'undefined' ? undefined : URLPattern;\n\n//# sourceMappingURL=url-pattern.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci93ZWIvc3BlYy1leHRlbnNpb24vdXJsLXBhdHRlcm4uanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRiw4Q0FBNkM7QUFDN0M7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDLEVBQUM7QUFDRjtBQUNBOztBQUVBIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9XZWIvaGVhcnRiZWF0LW1vbml0b3Ivbm9kZV9tb2R1bGVzL25leHQvZGlzdC9zZXJ2ZXIvd2ViL3NwZWMtZXh0ZW5zaW9uL3VybC1wYXR0ZXJuLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7XG4gICAgdmFsdWU6IHRydWVcbn0pO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiVVJMUGF0dGVyblwiLCB7XG4gICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICBnZXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gR2xvYmFsVVJMUGF0dGVybjtcbiAgICB9XG59KTtcbmNvbnN0IEdsb2JhbFVSTFBhdHRlcm4gPSAvLyBAdHMtZXhwZWN0LWVycm9yOiBVUkxQYXR0ZXJuIGlzIG5vdCBhdmFpbGFibGUgaW4gTm9kZS5qc1xudHlwZW9mIFVSTFBhdHRlcm4gPT09ICd1bmRlZmluZWQnID8gdW5kZWZpbmVkIDogVVJMUGF0dGVybjtcblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9dXJsLXBhdHRlcm4uanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/web/spec-extension/url-pattern.js\n"); - -/***/ }), - -/***/ "(rsc)/./node_modules/next/dist/server/web/spec-extension/user-agent.js": -/*!************************************************************************!*\ - !*** ./node_modules/next/dist/server/web/spec-extension/user-agent.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && (0);\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n isBot: function() {\n return isBot;\n },\n userAgent: function() {\n return userAgent;\n },\n userAgentFromString: function() {\n return userAgentFromString;\n }\n});\nconst _uaparserjs = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! next/dist/compiled/ua-parser-js */ \"(rsc)/./node_modules/next/dist/compiled/ua-parser-js/ua-parser.js\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nfunction isBot(input) {\n return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(input);\n}\nfunction userAgentFromString(input) {\n return {\n ...(0, _uaparserjs.default)(input),\n isBot: input === undefined ? false : isBot(input)\n };\n}\nfunction userAgent({ headers }) {\n return userAgentFromString(headers.get('user-agent') || undefined);\n}\n\n//# sourceMappingURL=user-agent.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L3NlcnZlci93ZWIvc3BlYy1leHRlbnNpb24vdXNlci1hZ2VudC5qcyIsIm1hcHBpbmdzIjoiQUFBYTtBQUNiLDhDQUE2QztBQUM3QztBQUNBLENBQUMsRUFBQztBQUNGLE1BQU0sQ0FJTDtBQUNEO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0EsQ0FBQztBQUNELDJEQUEyRCxtQkFBTyxDQUFDLDBHQUFpQztBQUNwRztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUJBQXFCLFNBQVM7QUFDOUI7QUFDQTs7QUFFQSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicn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aW5lZCk7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXVzZXItYWdlbnQuanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/next/dist/server/web/spec-extension/user-agent.js\n"); - -/***/ }), - /***/ "(rsc)/./node_modules/next/dist/server/web/utils.js": /*!****************************************************!*\ !*** ./node_modules/next/dist/server/web/utils.js ***! diff --git a/.next/server/webpack-runtime.js b/.next/server/webpack-runtime.js index 123a5760..cd5881e3 100644 --- a/.next/server/webpack-runtime.js +++ b/.next/server/webpack-runtime.js @@ -47,11 +47,6 @@ /******/ __webpack_require__.m = __webpack_modules__; /******/ /************************************************************************/ -/******/ /* webpack/runtime/amd options */ -/******/ (() => { -/******/ __webpack_require__.amdO = {}; -/******/ })(); -/******/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules @@ -130,7 +125,7 @@ /******/ /******/ /* webpack/runtime/getFullHash */ /******/ (() => { -/******/ __webpack_require__.h = () => ("8f8ba47fd7242a1b") +/******/ __webpack_require__.h = () => ("0e336cb3c86c715c") /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ diff --git a/.next/static/chunks/app/_not-found/page.js b/.next/static/chunks/app/_not-found/page.js new file mode 100644 index 00000000..5768c908 --- /dev/null +++ b/.next/static/chunks/app/_not-found/page.js @@ -0,0 +1,50 @@ +/* + * ATTENTION: An "eval-source-map" devtool has been used. + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["app/_not-found/page"],{ + +/***/ "(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&page=%2F_not-found%2Fpage!": +/*!***************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&page=%2F_not-found%2Fpage! ***! + \***************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +eval(__webpack_require__.ts("\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/_not-found/page\",\n function () {\n return __webpack_require__(/*! ./node_modules/next/dist/client/components/not-found-error.js */ \"(app-pages-browser)/./node_modules/next/dist/client/components/not-found-error.js\");\n }\n ]);\n if(true) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/_not-found/page\"])\n });\n }\n //# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvYnVpbGQvd2VicGFjay9sb2FkZXJzL25leHQtY2xpZW50LXBhZ2VzLWxvYWRlci5qcz9hYnNvbHV0ZVBhZ2VQYXRoPSUyRlVzZXJzJTJGbWF0dGJydWNlJTJGRG9jdW1lbnRzJTJGUHJvamVjdHMlMkZPcGVuQ2xhdyUyRldlYiUyRmhlYXJ0YmVhdC1tb25pdG9yJTJGbm9kZV9tb2R1bGVzJTJGbmV4dCUyRmRpc3QlMkZjbGllbnQlMkZjb21wb25lbnRzJTJGbm90LWZvdW5kLWVycm9yLmpzJnBhZ2U9JTJGX25vdC1mb3VuZCUyRnBhZ2UhIiwibWFwcGluZ3MiOiI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxlQUFlLG1CQUFPLENBQUMsd0pBQStEO0FBQ3RGO0FBQ0E7QUFDQSxPQUFPLElBQVU7QUFDakIsTUFBTSxVQUFVO0FBQ2hCO0FBQ0EsT0FBTztBQUNQO0FBQ0EiLCJzb3VyY2VzIjpbIiJdLCJzb3VyY2VzQ29udGVudCI6WyJcbiAgICAod2luZG93Ll9fTkVYVF9QID0gd2luZG93Ll9fTkVYVF9QIHx8IFtdKS5wdXNoKFtcbiAgICAgIFwiL19ub3QtZm91bmQvcGFnZVwiLFxuICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gcmVxdWlyZShcIi4vbm9kZV9tb2R1bGVzL25leHQvZGlzdC9jbGllbnQvY29tcG9uZW50cy9ub3QtZm91bmQtZXJyb3IuanNcIik7XG4gICAgICB9XG4gICAgXSk7XG4gICAgaWYobW9kdWxlLmhvdCkge1xuICAgICAgbW9kdWxlLmhvdC5kaXNwb3NlKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgd2luZG93Ll9fTkVYVF9QLnB1c2goW1wiL19ub3QtZm91bmQvcGFnZVwiXSlcbiAgICAgIH0pO1xuICAgIH1cbiAgIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&page=%2F_not-found%2Fpage!\n")); + +/***/ }), + +/***/ "(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-fallback.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/next/dist/client/components/http-access-fallback/error-fallback.js ***! + \*****************************************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"HTTPAccessErrorFallback\", ({\n enumerable: true,\n get: function() {\n return HTTPAccessErrorFallback;\n }\n}));\nconst _interop_require_default = __webpack_require__(/*! @swc/helpers/_/_interop_require_default */ \"(app-pages-browser)/./node_modules/@swc/helpers/esm/_interop_require_default.js\");\nconst _jsxruntime = __webpack_require__(/*! react/jsx-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-runtime.js\");\nconst _react = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\"));\nconst styles = {\n error: {\n // https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52\n fontFamily: 'system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"',\n height: '100vh',\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center'\n },\n desc: {\n display: 'inline-block'\n },\n h1: {\n display: 'inline-block',\n margin: '0 20px 0 0',\n padding: '0 23px 0 0',\n fontSize: 24,\n fontWeight: 500,\n verticalAlign: 'top',\n lineHeight: '49px'\n },\n h2: {\n fontSize: 14,\n fontWeight: 400,\n lineHeight: '49px',\n margin: 0\n }\n};\nfunction HTTPAccessErrorFallback(param) {\n let { status, message } = param;\n return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {\n children: [\n /*#__PURE__*/ (0, _jsxruntime.jsx)(\"title\", {\n children: status + \": \" + message\n }),\n /*#__PURE__*/ (0, _jsxruntime.jsx)(\"div\", {\n style: styles.error,\n children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(\"div\", {\n children: [\n /*#__PURE__*/ (0, _jsxruntime.jsx)(\"style\", {\n dangerouslySetInnerHTML: {\n /* Minified CSS from\n body { margin: 0; color: #000; background: #fff; }\n .next-error-h1 {\n border-right: 1px solid rgba(0, 0, 0, .3);\n }\n\n @media (prefers-color-scheme: dark) {\n body { color: #fff; background: #000; }\n .next-error-h1 {\n border-right: 1px solid rgba(255, 255, 255, .3);\n }\n }\n */ __html: \"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"\n }\n }),\n /*#__PURE__*/ (0, _jsxruntime.jsx)(\"h1\", {\n className: \"next-error-h1\",\n style: styles.h1,\n children: status\n }),\n /*#__PURE__*/ (0, _jsxruntime.jsx)(\"div\", {\n style: styles.desc,\n children: /*#__PURE__*/ (0, _jsxruntime.jsx)(\"h2\", {\n style: styles.h2,\n children: message\n })\n })\n ]\n })\n })\n ]\n });\n}\n_c = HTTPAccessErrorFallback;\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=error-fallback.js.map\nvar _c;\n$RefreshReg$(_c, \"HTTPAccessErrorFallback\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvY2xpZW50L2NvbXBvbmVudHMvaHR0cC1hY2Nlc3MtZmFsbGJhY2svZXJyb3ItZmFsbGJhY2suanMiLCJtYXBwaW5ncyI6Ijs7OzsyREFxQ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cmdpbiIsInBhZGRpbmciLCJmb250U2l6ZSIsImZvbnRXZWlnaHQiLCJ2ZXJ0aWNhbEFsaWduIiwibGluZUhlaWdodCIsImgyIiwic3RhdHVzIiwibWVzc2FnZSIsInRpdGxlIiwiZGl2Iiwic3R5bGUiLCJkYW5nZXJvdXNseVNldElubmVySFRNTCIsIl9faHRtbCIsImNsYXNzTmFtZSJdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-fallback.js\n")); + +/***/ }), + +/***/ "(app-pages-browser)/./node_modules/next/dist/client/components/not-found-error.js": +/*!*********************************************************************!*\ + !*** ./node_modules/next/dist/client/components/not-found-error.js ***! + \*********************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"default\", ({\n enumerable: true,\n get: function() {\n return NotFound;\n }\n}));\nconst _jsxruntime = __webpack_require__(/*! react/jsx-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-runtime.js\");\nconst _errorfallback = __webpack_require__(/*! ./http-access-fallback/error-fallback */ \"(app-pages-browser)/./node_modules/next/dist/client/components/http-access-fallback/error-fallback.js\");\nfunction NotFound() {\n return /*#__PURE__*/ (0, _jsxruntime.jsx)(_errorfallback.HTTPAccessErrorFallback, {\n status: 404,\n message: \"This page could not be found.\"\n });\n}\n_c = NotFound;\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=not-found-error.js.map\nvar _c;\n$RefreshReg$(_c, \"NotFound\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvY2xpZW50L2NvbXBvbmVudHMvbm90LWZvdW5kLWVycm9yLmpzIiwibWFwcGluZ3MiOiI7Ozs7MkNBRUE7OztlQUF3QkE7Ozs7MkNBRmdCO0FBRXpCO0lBQ2IscUJBQ0UscUJBQUNDLGVBQUFBLHVCQUF1QjtRQUN0QkMsUUFBUTtRQUNSQyxTQUFROztBQUdkO0tBUHdCSCIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2NsaWVudC9jb21wb25lbnRzL25vdC1mb3VuZC1lcnJvci50c3giXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSFRUUEFjY2Vzc0Vycm9yRmFsbGJhY2sgfSBmcm9tICcuL2h0dHAtYWNjZXNzLWZhbGxiYWNrL2Vycm9yLWZhbGxiYWNrJ1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBOb3RGb3VuZCgpIHtcbiAgcmV0dXJuIChcbiAgICA8SFRUUEFjY2Vzc0Vycm9yRmFsbGJhY2tcbiAgICAgIHN0YXR1cz17NDA0fVxuICAgICAgbWVzc2FnZT1cIlRoaXMgcGFnZSBjb3VsZCBub3QgYmUgZm91bmQuXCJcbiAgICAvPlxuICApXG59XG4iXSwibmFtZXMiOlsiTm90Rm91bmQiLCJIVFRQQWNjZXNzRXJyb3JGYWxsYmFjayIsInN0YXR1cyIsIm1lc3NhZ2UiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/not-found-error.js\n")); + +/***/ }) + +}, +/******/ __webpack_require__ => { // webpackRuntimeModules +/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +/******/ __webpack_require__.O(0, ["main-app"], () => (__webpack_exec__("(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-client-pages-loader.js?absolutePagePath=%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fnode_modules%2Fnext%2Fdist%2Fclient%2Fcomponents%2Fnot-found-error.js&page=%2F_not-found%2Fpage!"))); +/******/ var __webpack_exports__ = __webpack_require__.O(); +/******/ _N_E = __webpack_exports__; +/******/ } +]); \ No newline at end of file diff --git a/.next/static/chunks/app/api/monitor/route.js b/.next/static/chunks/app/api/monitor/route.js deleted file mode 100644 index f40a45e3..00000000 --- a/.next/static/chunks/app/api/monitor/route.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * ATTENTION: An "eval-source-map" devtool has been used. - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["app/api/monitor/route"],{ - -/***/ "(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=false!": -/*!*******************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=false! ***! - \*******************************************************************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - - - -/***/ }) - -}, -/******/ __webpack_require__ => { // webpackRuntimeModules -/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) -/******/ __webpack_require__.O(0, ["main-app"], () => (__webpack_exec__("(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=false!"))); -/******/ var __webpack_exports__ = __webpack_require__.O(); -/******/ _N_E = __webpack_exports__; -/******/ } -]); \ No newline at end of file diff --git a/.next/static/chunks/app/page.js b/.next/static/chunks/app/page.js deleted file mode 100644 index 8e028388..00000000 --- a/.next/static/chunks/app/page.js +++ /dev/null @@ -1,237 +0,0 @@ -/* - * ATTENTION: An "eval-source-map" devtool has been used. - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["app/page"],{ - -/***/ "(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false!": -/*!************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false! ***! - \************************************************************************************************************************************************************************************************************************************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -eval(__webpack_require__.ts("Promise.resolve(/*! import() eager */).then(__webpack_require__.bind(__webpack_require__, /*! ./src/app/page.tsx */ \"(app-pages-browser)/./src/app/page.tsx\"));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvYnVpbGQvd2VicGFjay9sb2FkZXJzL25leHQtZmxpZ2h0LWNsaWVudC1lbnRyeS1sb2FkZXIuanM/bW9kdWxlcz0lN0IlMjJyZXF1ZXN0JTIyJTNBJTIyJTJGVXNlcnMlMkZtYXR0YnJ1Y2UlMkZEb2N1bWVudHMlMkZQcm9qZWN0cyUyRk9wZW5DbGF3JTJGV2ViJTJGaGVhcnRiZWF0LW1vbml0b3IlMkZzcmMlMkZhcHAlMkZwYWdlLnRzeCUyMiUyQyUyMmlkcyUyMiUzQSU1QiU1RCU3RCZzZXJ2ZXI9ZmFsc2UhIiwibWFwcGluZ3MiOiJBQUFBLDhKQUF3SCIsInNvdXJjZXMiOlsiIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCgvKiB3ZWJwYWNrTW9kZTogXCJlYWdlclwiICovIFwiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvV2ViL2hlYXJ0YmVhdC1tb25pdG9yL3NyYy9hcHAvcGFnZS50c3hcIik7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false!\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./src/app/page.tsx": -/*!**************************!*\ - !*** ./src/app/page.tsx ***! - \**************************/ -/***/ ((module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ HeartbeatMonitor)\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/refresh-cw.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/activity.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/plus.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-check.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-x.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/trending-up.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/clock.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-alert.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/globe.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/external-link.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/ellipsis.js\");\n/* harmony import */ var _barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! __barrel_optimize__?names=Activity,AlertCircle,CheckCircle2,Clock,ExternalLink,Globe,MoreHorizontal,Plus,RefreshCw,Trash2,TrendingUp,XCircle!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/trash-2.js\");\n/* __next_internal_client_entry_do_not_use__ default auto */ \nvar _s = $RefreshSig$();\n\n\nfunction HeartbeatMonitor() {\n _s();\n const [apps, setApps] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);\n const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);\n const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);\n const [checking, setChecking] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);\n const [showAddApp, setShowAddApp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n const [selectedApp, setSelectedApp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);\n const [newApp, setNewApp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({\n name: \"\",\n description: \"\",\n url: \"http://localhost:\",\n port: 3000,\n path: \"\",\n command: \"npm run dev\",\n category: \"Other\",\n color: \"#22C55E\",\n enabled: true\n });\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)({\n \"HeartbeatMonitor.useEffect\": ()=>{\n fetchData();\n const interval = setInterval(fetchData, 30000);\n return ({\n \"HeartbeatMonitor.useEffect\": ()=>clearInterval(interval)\n })[\"HeartbeatMonitor.useEffect\"];\n }\n }[\"HeartbeatMonitor.useEffect\"], []);\n async function fetchData() {\n try {\n const res = await fetch(\"/api/monitor\");\n const data = await res.json();\n setApps(data.apps || []);\n setStatus(data.status || []);\n } catch (err) {\n console.error(\"Failed to fetch data:\", err);\n } finally{\n setLoading(false);\n }\n }\n async function checkApp(app) {\n setChecking(app.id);\n try {\n const start = Date.now();\n await fetch(app.url, {\n method: \"HEAD\",\n mode: \"no-cors\"\n });\n const responseTime = Date.now() - start;\n const entry = {\n appId: app.id,\n timestamp: new Date().toISOString(),\n status: \"up\",\n responseTime\n };\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"recordStatus\",\n entry\n })\n });\n fetchData();\n } catch (e) {\n const entry = {\n appId: app.id,\n timestamp: new Date().toISOString(),\n status: \"down\"\n };\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"recordStatus\",\n entry\n })\n });\n fetchData();\n } finally{\n setChecking(null);\n }\n }\n async function addApp(e) {\n e.preventDefault();\n if (!newApp.name || !newApp.url) return;\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"addApp\",\n app: newApp\n })\n });\n setNewApp({\n name: \"\",\n description: \"\",\n url: \"http://localhost:\",\n port: 3000,\n path: \"\",\n command: \"npm run dev\",\n category: \"Other\",\n color: \"#22C55E\",\n enabled: true\n });\n setShowAddApp(false);\n fetchData();\n }\n async function deleteApp(id) {\n if (!confirm(\"Delete this app from monitoring?\")) return;\n await fetch(\"/api/monitor\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n action: \"deleteApp\",\n id\n })\n });\n fetchData();\n }\n function getAppStatus(appId) {\n const appStatus = status.filter((s)=>s.appId === appId);\n const latest = appStatus[appStatus.length - 1];\n const isUp = (latest === null || latest === void 0 ? void 0 : latest.status) === \"up\";\n const uptime = appStatus.length > 0 ? Math.round(appStatus.filter((s)=>s.status === \"up\").length / appStatus.length * 100) : 100;\n const avgResponseTime = appStatus.length > 0 ? Math.round(appStatus.filter((s)=>s.responseTime).reduce((acc, s)=>acc + (s.responseTime || 0), 0) / appStatus.filter((s)=>s.responseTime).length) : 0;\n return {\n latest,\n isUp,\n uptime,\n avgResponseTime,\n history: appStatus.slice(-24)\n };\n }\n const totalApps = apps.length;\n const onlineApps = apps.filter((app)=>getAppStatus(app.id).isUp).length;\n const offlineApps = totalApps - onlineApps;\n const allUp = onlineApps === totalApps && totalApps > 0;\n // Generate sparkline data\n function Sparkline(param) {\n let { data, isUp } = param;\n if (data.length === 0) return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"h-8 w-24 bg-gray-100 rounded\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 173,\n columnNumber: 35\n }, this);\n const bars = data.slice(-12).map((entry, i)=>/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-1.5 rounded-sm \".concat(entry.status === \"up\" ? \"bg-emerald-500\" : \"bg-red-500\"),\n style: {\n height: \"\".concat(Math.max(20, Math.min(100, (entry.responseTime || 100) / 5)), \"%\")\n }\n }, i, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 176,\n columnNumber: 7\n }, this));\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"h-8 w-24 flex items-end gap-0.5\",\n children: bars\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 184,\n columnNumber: 7\n }, this);\n }\n if (loading) {\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"min-h-screen bg-gray-50 flex items-center justify-center\",\n role: \"status\",\n \"aria-live\": \"polite\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3 text-gray-500\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: \"w-5 h-5 animate-spin\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 194,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n children: \"Loading dashboard...\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 195,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 193,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 192,\n columnNumber: 7\n }, this);\n }\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"min-h-screen bg-gray-50\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"nav\", {\n className: \"bg-white border-b border-gray-200 sticky top-0 z-40\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between h-16\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-600/20\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n className: \"w-6 h-6 text-white\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 209,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 208,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h1\", {\n className: \"text-xl font-bold text-gray-900\",\n children: \"Heartbeat Monitor\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 212,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm text-gray-500\",\n children: \"Local Infrastructure Monitoring\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 213,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 211,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 207,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: fetchData,\n className: \"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 hover:text-gray-900 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2\",\n \"aria-label\": \"Refresh data\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 223,\n columnNumber: 17\n }, this),\n \"Refresh\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 218,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>setShowAddApp(true),\n className: \"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 230,\n columnNumber: 17\n }, this),\n \"Add Monitor\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 226,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 217,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 206,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 205,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 204,\n columnNumber: 7\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"main\", {\n className: \"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-12 h-12 rounded-xl flex items-center justify-center \".concat(allUp ? 'bg-emerald-100' : 'bg-red-100'),\n children: allUp ? /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n className: \"w-6 h-6 text-emerald-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 246,\n columnNumber: 19\n }, this) : /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n className: \"w-6 h-6 text-red-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 248,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 244,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n onlineApps,\n \"/\",\n totalApps\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 251,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 243,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Services Online\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 253,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: allUp ? 'All systems operational' : \"\".concat(offlineApps, \" service\").concat(offlineApps > 1 ? 's' : '', \" down\")\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 254,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 242,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-12 h-12 bg-blue-100 rounded-xl flex items-center justify-center\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n className: \"w-6 h-6 text-blue-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 262,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 261,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n totalApps > 0 ? Math.round(apps.reduce((acc, app)=>acc + getAppStatus(app.id).uptime, 0) / totalApps) : 0,\n \"%\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 264,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 260,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Average Uptime\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 268,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: \"Last 24 hours\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 269,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 259,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-12 h-12 bg-purple-100 rounded-xl flex items-center justify-center\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n className: \"w-6 h-6 text-purple-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 275,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 274,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n totalApps > 0 ? Math.round(apps.reduce((acc, app)=>acc + (getAppStatus(app.id).avgResponseTime || 0), 0) / totalApps) : 0,\n \"ms\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 277,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 273,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Avg Response\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 281,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: \"Across all monitors\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 282,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 272,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 shadow-sm border border-gray-200\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between mb-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-12 h-12 bg-amber-100 rounded-xl flex items-center justify-center\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n className: \"w-6 h-6 text-amber-600\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 288,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 287,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: status.filter((s)=>s.status === \"down\").length\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 290,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 286,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-sm font-medium text-gray-600\",\n children: \"Incidents\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 294,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-400 mt-1\",\n children: \"Total recorded\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 295,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 285,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 241,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"px-6 py-4 border-b border-gray-200 flex items-center justify-between\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n className: \"w-5 h-5 text-gray-400\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 303,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n className: \"text-lg font-semibold text-gray-900\",\n children: \"Monitored Services\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 304,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 302,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-sm text-gray-500\",\n children: [\n totalApps,\n \" active monitor\",\n totalApps !== 1 ? 's' : ''\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 306,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 301,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"divide-y divide-gray-100\",\n children: apps.map((app)=>{\n const { isUp, uptime, avgResponseTime, history, latest } = getAppStatus(app.id);\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"px-6 py-5 hover:bg-gray-50 transition-colors group\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center justify-between\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-3 h-3 rounded-full \".concat(isUp ? 'bg-emerald-500 shadow-lg shadow-emerald-500/30' : 'bg-red-500 shadow-lg shadow-red-500/30')\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 321,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h3\", {\n className: \"text-base font-semibold text-gray-900\",\n children: app.name\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 325,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-3 mt-1\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: app.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"text-sm text-blue-600 hover:text-blue-700 hover:underline\",\n children: app.url\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 327,\n columnNumber: 27\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-gray-300\",\n children: \"|\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 335,\n columnNumber: 27\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-sm text-gray-500\",\n children: [\n \"Port \",\n app.port\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 336,\n columnNumber: 27\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 326,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 324,\n columnNumber: 23\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 319,\n columnNumber: 21\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-8\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"text-right\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: [\n uptime,\n \"%\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 345,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-500\",\n children: \"Uptime\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 346,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 344,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"text-right\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-2xl font-bold text-gray-900\",\n children: avgResponseTime > 0 ? \"\".concat(avgResponseTime, \"ms\") : '—'\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 351,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-xs text-gray-500\",\n children: \"Response\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 354,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 350,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"hidden sm:block\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(Sparkline, {\n data: history,\n isUp: isUp\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 359,\n columnNumber: 25\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 358,\n columnNumber: 23\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>checkApp(app),\n disabled: checking === app.id,\n className: \"p-2 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors\",\n \"aria-label\": \"Check \".concat(app.name),\n title: \"Check now\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n className: \"w-4 h-4 \".concat(checking === app.id ? 'animate-spin' : '')\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 371,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 364,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: app.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: \"p-2 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors\",\n \"aria-label\": \"Open \".concat(app.name),\n title: \"Open app\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 381,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 373,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>setSelectedApp(app),\n className: \"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors\",\n \"aria-label\": \"Details for \".concat(app.name),\n title: \"View details\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_12__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 389,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 383,\n columnNumber: 25\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>deleteApp(app.id),\n className: \"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors\",\n \"aria-label\": \"Delete \".concat(app.name),\n title: \"Delete monitor\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_13__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 397,\n columnNumber: 27\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 391,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 363,\n columnNumber: 23\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 342,\n columnNumber: 21\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 318,\n columnNumber: 19\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"mt-3 flex items-center gap-4 text-xs text-gray-400\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n children: [\n \"Last checked: \",\n latest ? new Date(latest.timestamp).toLocaleTimeString() : 'Never'\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 405,\n columnNumber: 21\n }, this),\n (latest === null || latest === void 0 ? void 0 : latest.responseTime) && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n children: [\n \"Response: \",\n latest.responseTime,\n \"ms\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 407,\n columnNumber: 23\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 404,\n columnNumber: 19\n }, this)\n ]\n }, app.id, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 314,\n columnNumber: 17\n }, this);\n })\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 309,\n columnNumber: 11\n }, this),\n apps.length === 0 && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"px-6 py-12 text-center\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"w-16 h-16 bg-gray-100 rounded-2xl flex items-center justify-center mx-auto mb-4\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n className: \"w-8 h-8 text-gray-400\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 418,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 417,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h3\", {\n className: \"text-lg font-medium text-gray-900 mb-2\",\n children: \"No monitors yet\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 420,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: \"text-gray-500 mb-4\",\n children: \"Add your first service to start monitoring\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 421,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n onClick: ()=>setShowAddApp(true),\n className: \"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-blue-600 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Activity_AlertCircle_CheckCircle2_Clock_ExternalLink_Globe_MoreHorizontal_Plus_RefreshCw_Trash2_TrendingUp_XCircle_lucide_react__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n className: \"w-4 h-4\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 426,\n columnNumber: 17\n }, this),\n \"Add Monitor\"\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 422,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 416,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 300,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 239,\n columnNumber: 7\n }, this),\n showAddApp && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4\",\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"bg-white rounded-2xl p-6 w-full max-w-md shadow-2xl\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n className: \"text-xl font-bold text-gray-900 mb-6\",\n children: \"Add New Monitor\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 438,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"form\", {\n onSubmit: addApp,\n className: \"space-y-5\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-name\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: [\n \"Monitor Name \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-red-500\",\n children: \"*\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 442,\n columnNumber: 32\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 441,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-name\",\n type: \"text\",\n value: newApp.name,\n onChange: (e)=>setNewApp({\n ...newApp,\n name: e.target.value\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n placeholder: \"My Application\",\n required: true\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 444,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 440,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-desc\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: \"Description\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 455,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-desc\",\n type: \"text\",\n value: newApp.description,\n onChange: (e)=>setNewApp({\n ...newApp,\n description: e.target.value\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n placeholder: \"Brief description...\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 458,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 454,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"grid grid-cols-2 gap-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-url\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: [\n \"URL \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-red-500\",\n children: \"*\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 470,\n columnNumber: 25\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 469,\n columnNumber: 19\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-url\",\n type: \"url\",\n value: newApp.url,\n onChange: (e)=>setNewApp({\n ...newApp,\n url: e.target.value\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n placeholder: \"http://localhost:3000\",\n required: true\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 472,\n columnNumber: 19\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 468,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n htmlFor: \"app-port\",\n className: \"block text-sm font-medium text-gray-700 mb-2\",\n children: [\n \"Port \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: \"text-red-500\",\n children: \"*\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 484,\n columnNumber: 26\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 483,\n columnNumber: 19\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n id: \"app-port\",\n type: \"number\",\n value: newApp.port,\n onChange: (e)=>setNewApp({\n ...newApp,\n port: parseInt(e.target.value)\n }),\n className: \"w-full border border-gray-300 rounded-lg px-4 py-2.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all\",\n required: true,\n min: \"1\",\n max: \"65535\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 486,\n columnNumber: 19\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 482,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 467,\n columnNumber: 15\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: \"flex gap-3 pt-4\",\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n type: \"button\",\n onClick: ()=>setShowAddApp(false),\n className: \"flex-1 px-4 py-2.5 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors\",\n children: \"Cancel\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 499,\n columnNumber: 17\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n type: \"submit\",\n className: \"flex-1 px-4 py-2.5 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors shadow-sm\",\n children: \"Add Monitor\"\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 506,\n columnNumber: 17\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 498,\n columnNumber: 15\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 439,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 437,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 436,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/Users/mattbruce/Documents/Projects/OpenClaw/Web/heartbeat-monitor/src/app/page.tsx\",\n lineNumber: 202,\n columnNumber: 5\n }, this);\n}\n_s(HeartbeatMonitor, \"h18H86Jzi/8nkb52qlCLYFzOOxQ=\");\n_c = HeartbeatMonitor;\nvar _c;\n$RefreshReg$(_c, \"HeartbeatMonitor\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n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biAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICB7LyogQXBwIEluZm8gKi99XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxoMyBjbGFzc05hbWU9XCJ0ZXh0LWJhc2UgZm9udC1zZW1pYm9sZCB0ZXh0LWdyYXktOTAwXCI+e2FwcC5uYW1lfTwvaDM+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImZsZXggaXRlbXMtY2VudGVyIGdhcC0zIG10LTFcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaHJlZj17YXBwLnVybH0gXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0PVwiX2JsYW5rXCIgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVsPVwibm9vcGVuZXIgbm9yZWZlcnJlclwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwidGV4dC1zbSB0ZXh0LWJsdWUtNjAwIGhvdmVyOnRleHQtYmx1ZS03MDAgaG92ZXI6dW5kZXJsaW5lXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHthcHAudXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgICA8L2E+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzTmFtZT1cInRleHQtZ3JheS0zMDBcIj58PC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzc05hbWU9XCJ0ZXh0LXNtIHRleHQtZ3JheS01MDBcIj5Qb3J0IHthcHAucG9ydH08L3NwYW4+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgICAgICAgICAgICAgey8qIFN0YXRzICovfVxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImZsZXggaXRlbXMtY2VudGVyIGdhcC04XCI+XG4gICAgICAgICAgICAgICAgICAgICAgey8qIFVwdGltZSAqL31cbiAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInRleHQtcmlnaHRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxwIGNsYXNzTmFtZT1cInRleHQtMnhsIGZvbnQtYm9sZCB0ZXh0LWdyYXktOTAwXCI+e3VwdGltZX0lPC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHAgY2xhc3NOYW1lPVwidGV4dC14cyB0ZXh0LWdyYXktNTAwXCI+VXB0aW1lPC9wPlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgICAgICAgICAgey8qIFJlc3BvbnNlIFRpbWUgKi99XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJ0ZXh0LXJpZ2h0XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8cCBjbGFzc05hbWU9XCJ0ZXh0LTJ4bCBmb250LWJvbGQgdGV4dC1ncmF5LTkwMFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7YXZnUmVzcG9uc2VUaW1lID4gMCA/IGAke2F2Z1Jlc3BvbnNlVGltZX1tc2AgOiAn4oCUJ31cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxwIGNsYXNzTmFtZT1cInRleHQteHMgdGV4dC1ncmF5LTUwMFwiPlJlc3BvbnNlPC9wPlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgICAgICAgICAgey8qIFNwYXJrbGluZSAqL31cbiAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImhpZGRlbiBzbTpibG9ja1wiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPFNwYXJrbGluZSBkYXRhPXtoaXN0b3J5fSBpc1VwPXtpc1VwfSAvPlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgICAgICAgICAgey8qIEFjdGlvbnMgKi99XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbGV4IGl0ZW1zLWNlbnRlciBnYXAtMSBvcGFjaXR5LTAgZ3JvdXAtaG92ZXI6b3BhY2l0eS0xMDAgdHJhbnNpdGlvbi1vcGFjaXR5XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IGNoZWNrQXBwKGFwcCl9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkPXtjaGVja2luZyA9PT0gYXBwLmlkfVxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJwLTIgdGV4dC1ncmF5LTQwMCBob3Zlcjp0ZXh0LWJsdWUtNjAwIGhvdmVyOmJnLWJsdWUtNTAgcm91bmRlZC1sZyB0cmFuc2l0aW9uLWNvbG9yc1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGFyaWEtbGFiZWw9e2BDaGVjayAke2FwcC5uYW1lfWB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlPVwiQ2hlY2sgbm93XCJcbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPFJlZnJlc2hDdyBjbGFzc05hbWU9e2B3LTQgaC00ICR7Y2hlY2tpbmcgPT09IGFwcC5pZCA/ICdhbmltYXRlLXNwaW4nIDogJyd9YH0gLz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgaHJlZj17YXBwLnVybH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0PVwiX2JsYW5rXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgcmVsPVwibm9vcGVuZXIgbm9yZWZlcnJlclwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInAtMiB0ZXh0LWdyYXktNDAwIGhvdmVyOnRleHQtYmx1ZS02MDAgaG92ZXI6YmctYmx1ZS01MCByb3VuZGVkLWxnIHRyYW5zaXRpb24tY29sb3JzXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYXJpYS1sYWJlbD17YE9wZW4gJHthcHAubmFtZX1gfVxuICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZT1cIk9wZW4gYXBwXCJcbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPEV4dGVybmFsTGluayBjbGFzc05hbWU9XCJ3LTQgaC00XCIgLz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvYT5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4gc2V0U2VsZWN0ZWRBcHAoYXBwKX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwicC0yIHRleHQtZ3JheS00MDAgaG92ZXI6dGV4dC1ncmF5LTYwMCBob3ZlcjpiZy1ncmF5LTEwMCByb3VuZGVkLWxnIHRyYW5zaXRpb24tY29sb3JzXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYXJpYS1sYWJlbD17YERldGFpbHMgZm9yICR7YXBwLm5hbWV9YH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU9XCJWaWV3IGRldGFpbHNcIlxuICAgICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8TW9yZUhvcml6b250YWwgY2xhc3NOYW1lPVwidy00IGgtNFwiIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4gZGVsZXRlQXBwKGFwcC5pZCl9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInAtMiB0ZXh0LWdyYXktNDAwIGhvdmVyOnRleHQtcmVkLTYwMCBob3ZlcjpiZy1yZWQtNTAgcm91bmRlZC1sZyB0cmFuc2l0aW9uLWNvbG9yc1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGFyaWEtbGFiZWw9e2BEZWxldGUgJHthcHAubmFtZX1gfVxuICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZT1cIkRlbGV0ZSBtb25pdG9yXCJcbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPFRyYXNoMiBjbGFzc05hbWU9XCJ3LTQgaC00XCIgLz5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgICAgICB7LyogTGFzdCBDaGVja2VkICovfVxuICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJtdC0zIGZsZXggaXRlbXMtY2VudGVyIGdhcC00IHRleHQteHMgdGV4dC1ncmF5LTQwMFwiPlxuICAgICAgICAgICAgICAgICAgICA8c3Bhbj5MYXN0IGNoZWNrZWQ6IHtsYXRlc3QgPyBuZXcgRGF0ZShsYXRlc3QudGltZXN0YW1wKS50b0xvY2FsZVRpbWVTdHJpbmcoKSA6ICdOZXZlcid9PC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICB7bGF0ZXN0Py5yZXNwb25zZVRpbWUgJiYgKFxuICAgICAgICAgICAgICAgICAgICAgIDxzcGFuPlJlc3BvbnNlOiB7bGF0ZXN0LnJlc3BvbnNlVGltZX1tczwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSl9XG4gICAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgICB7YXBwcy5sZW5ndGggPT09IDAgJiYgKFxuICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJweC02IHB5LTEyIHRleHQtY2VudGVyXCI+XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwidy0xNiBoLTE2IGJnLWdyYXktMTAwIHJvdW5kZWQtMnhsIGZsZXggaXRlbXMtY2VudGVyIGp1c3RpZnktY2VudGVyIG14LWF1dG8gbWItNFwiPlxuICAgICAgICAgICAgICAgIDxBY3Rpdml0eSBjbGFzc05hbWU9XCJ3LTggaC04IHRleHQtZ3JheS00MDBcIiAvPlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPGgzIGNsYXNzTmFtZT1cInRleHQtbGcgZm9udC1tZWRpdW0gdGV4dC1ncmF5LTkwMCBtYi0yXCI+Tm8gbW9uaXRvcnMgeWV0PC9oMz5cbiAgICAgICAgICAgICAgPHAgY2xhc3NOYW1lPVwidGV4dC1ncmF5LTUwMCBtYi00XCI+QWRkIHlvdXIgZmlyc3Qgc2VydmljZSB0byBzdGFydCBtb25pdG9yaW5nPC9wPlxuICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4gc2V0U2hvd0FkZEFwcCh0cnVlKX1cbiAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJpbmxpbmUtZmxleCBpdGVtcy1jZW50ZXIgZ2FwLT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gICBNb25pdG9yIE5hbWUgPHNwYW4gY2xhc3NOYW1lPVwidGV4dC1yZWQtNTAwXCI+Kjwvc3Bhbj5cbiAgICAgICAgICAgICAgICA8L2xhYmVsPlxuICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgaWQ9XCJhcHAtbmFtZVwiXG4gICAgICAgICAgICAgICAgICB0eXBlPVwidGV4dFwiXG4gICAgICAgICAgICAgICAgICB2YWx1ZT17bmV3QXBwLm5hbWV9XG4gICAgICAgICAgICAgICAgICBvbkNoYW5nZT17KGUpID0+IHNldE5ld0FwcCh7IC4uLm5ld0FwcCwgbmFtZTogZS50YXJnZXQudmFsdWUgfSl9XG4gICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJ3LWZ1bGwgYm9yZGVyIGJvcmRlci1ncmF5LTMwMCByb3VuZGVkLWxnIHB4LTQgcHktMi41IHRleHQtZ3JheS05MDAgcGxhY2Vob2xkZXItZ3JheS00MDAgZm9jdXM6Ym9yZGVyLWJsdWUtNTAwIGZvY3VzOnJpbmctMiBmb2N1czpyaW5nLWJsdWUtNTAwLzIwIHRyYW5zaXRpb24tYWxsXCJcbiAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiTXkgQXBwbGljYXRpb25cIlxuICAgICAgICAgICAgICAgICAgcmVxdWlyZWRcbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPGRpdj5cbiAgICAgICAgICAgICAgICA8bGFiZWwgaHRtbEZvcj1cImFwcC1kZXNjXCIgY2xhc3NOYW1lPVwiYmxvY2sgdGV4dC1zbSBmb250LW1lZGl1bSB0ZXh0LWdyYXktNzAwIG1iLTJcIj5cbiAgICAgICAgICAgICAgICAgIERlc2NyaXB0aW9uXG4gICAgICAgICAgICAgICAgPC9sYWJlbD5cbiAgICAgICAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgICAgICAgIGlkPVwiYXBwLWRlc2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uICAgICAgICAgICAgICAgICAgICB2YWx1ZT17bmV3QXBwLnVybH1cbiAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9eyhlKSA9PiBzZXROZXdBcHAoeyAuLi5uZXdBcHAsIHVybDogZS50YXJnZXQudmFsdWUgfSl9XG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cInctZnVsbCBib3JkZXIgYm9yZGVyLWdyYXktMzAwIHJvdW5kZWQtbGcgcHgtNCBweS0yLjUgdGV4dC1ncmF5LTkwMCBwbGFjZWhvbGRlci1ncmF5LTQwMCBmb2N1czpib3JkZXItYmx1ZS01MDAgZm9jdXM6cmluZy0yIGZvY3VzOnJpbmctYmx1ZS01MDAvMjAgdHJhbnNpdGlvbi1hbGxcIlxuICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMFwiXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmVkXG4gICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICAgICAgICA8bGFiZWwgaHRtbEZvcj1cImFwcC1wb3J0XCIgY2xhc3NOYW1lPVwiYmxvY2sgdGV4dC1zbSBmb250LW1lZGl1bSB0ZXh0LWdyYXktNzAwIG1iLTJcIj5cbiAgICAgICAgICAgICAgICAgICAgUG9ydCA8c3BhbiBjbGFzc05hbWU9XCJ0ZXh0LXJlZC01MDBcIj4qPC9zcGFuPlxuICAgICAgICAgICAgICAgICAgPC9sYWJlbD5cbiAgICAgICAgICAgICAgICAgIDxpbnB1dFxuICAgICAgICAgICAgICAgICAgICBpZD1cImFwcC1wb3J0XCJcbiAgICAgICAgICAgICAgICAgICAgdHlwZT1cIm51bWJlclwiXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlPXtuZXdBcHAucG9ydH1cbiAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9eyhlKSA9PiBzZXROZXdBcHAoeyAuLi5uZXdBcHAsIHBvcnQ6IHBhcnNlSW50KGUudGFyZ2V0LnZhbHVlKSB9KX1cbiAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwidy1mdWxsIGJvcmRlciBib3JkZXItZ3JheS0zMDAgcm91bmRlZC1sZyBweC00IHB5LTIuNSB0ZXh0LWdyYXktOTAwIHBsYWNlaG9sZGVyLWdyYXktNDAwIGZvY3VzOmJvcmRlci1ibHVlLTUwMCBmb2N1czpyaW5nLTIgZm9jdXM6cmluZy1ibHVlLTUwMC8yMCB0cmFuc2l0aW9uLWFsbFwiXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmVkXG4gICAgICAgICAgICAgICAgICAgIG1pbj1cIjFcIlxuICAgICAgICAgICAgICAgICAgICBtYXg9XCI2NTUzNVwiXG4gICAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbGV4IGdhcC0zIHB0LTRcIj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IHNldFNob3dBZGRBcHAoZmFsc2UpfVxuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwiZmxleC0xIHB4LTQgcHktMi41IHRleHQtc20gZm9udC1tZWRpdW0gdGV4dC1ncmF5LTcwMCBiZy1ncmF5LTEwMCByb3VuZGVkLWxnIGhvdmVyOmJnLWdyYXktMjAwIHRyYW5zaXRpb24tY29sb3JzXCJcbiAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICBDYW5jZWxcbiAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8YnV0dG9uXG4gICAgICAgICAgICAgICAgICB0eXBlPVwic3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jZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/app/page.tsx\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js ***! - \****************************************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("/**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n true &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE$2\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_CONTEXT_TYPE:\n return (type.displayName || \"Context\") + \".Provider\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function disabledLog() {}\n function disableLogs() {\n if (0 === disabledDepth) {\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd;\n var props = {\n configurable: !0,\n enumerable: !0,\n value: disabledLog,\n writable: !0\n };\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n }\n disabledDepth++;\n }\n function reenableLogs() {\n disabledDepth--;\n if (0 === disabledDepth) {\n var props = { configurable: !0, enumerable: !0, writable: !0 };\n Object.defineProperties(console, {\n log: assign({}, props, { value: prevLog }),\n info: assign({}, props, { value: prevInfo }),\n warn: assign({}, props, { value: prevWarn }),\n error: assign({}, props, { value: prevError }),\n group: assign({}, props, { value: prevGroup }),\n groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),\n groupEnd: assign({}, props, { value: prevGroupEnd })\n });\n }\n 0 > disabledDepth &&\n console.error(\n \"disabledDepth fell below zero. This is a bug in React. Please file an issue.\"\n );\n }\n function describeBuiltInComponentFrame(name) {\n if (void 0 === prefix)\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = (match && match[1]) || \"\";\n suffix =\n -1 < x.stack.indexOf(\"\\n at\")\n ? \" ()\"\n : -1 < x.stack.indexOf(\"@\")\n ? \"@unknown:0:0\"\n : \"\";\n }\n return \"\\n\" + prefix + name + suffix;\n }\n function describeNativeComponentFrame(fn, construct) {\n if (!fn || reentry) return \"\";\n var frame = componentFrameCache.get(fn);\n if (void 0 !== frame) return frame;\n reentry = !0;\n frame = Error.prepareStackTrace;\n Error.prepareStackTrace = void 0;\n var previousDispatcher = null;\n previousDispatcher = ReactSharedInternals.H;\n ReactSharedInternals.H = null;\n disableLogs();\n try {\n var RunInRootFrame = {\n DetermineComponentFrameRoot: function () {\n try {\n if (construct) {\n var Fake = function () {\n throw Error();\n };\n Object.defineProperty(Fake.prototype, \"props\", {\n set: function () {\n throw Error();\n }\n });\n if (\"object\" === typeof Reflect && Reflect.construct) {\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n var control = x;\n }\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x$0) {\n control = x$0;\n }\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x$1) {\n control = x$1;\n }\n (Fake = fn()) &&\n \"function\" === typeof Fake.catch &&\n Fake.catch(function () {});\n }\n } catch (sample) {\n if (sample && control && \"string\" === typeof sample.stack)\n return [sample.stack, control.stack];\n }\n return [null, null];\n }\n };\n RunInRootFrame.DetermineComponentFrameRoot.displayName =\n \"DetermineComponentFrameRoot\";\n var namePropDescriptor = Object.getOwnPropertyDescriptor(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\"\n );\n namePropDescriptor &&\n namePropDescriptor.configurable &&\n Object.defineProperty(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\",\n { value: \"DetermineComponentFrameRoot\" }\n );\n var _RunInRootFrame$Deter =\n RunInRootFrame.DetermineComponentFrameRoot(),\n sampleStack = _RunInRootFrame$Deter[0],\n controlStack = _RunInRootFrame$Deter[1];\n if (sampleStack && controlStack) {\n var sampleLines = sampleStack.split(\"\\n\"),\n controlLines = controlStack.split(\"\\n\");\n for (\n _RunInRootFrame$Deter = namePropDescriptor = 0;\n namePropDescriptor < sampleLines.length &&\n !sampleLines[namePropDescriptor].includes(\n \"DetermineComponentFrameRoot\"\n );\n\n )\n namePropDescriptor++;\n for (\n ;\n _RunInRootFrame$Deter < controlLines.length &&\n !controlLines[_RunInRootFrame$Deter].includes(\n \"DetermineComponentFrameRoot\"\n );\n\n )\n _RunInRootFrame$Deter++;\n if (\n namePropDescriptor === sampleLines.length ||\n _RunInRootFrame$Deter === controlLines.length\n )\n for (\n namePropDescriptor = sampleLines.length - 1,\n _RunInRootFrame$Deter = controlLines.length - 1;\n 1 <= namePropDescriptor &&\n 0 <= _RunInRootFrame$Deter &&\n sampleLines[namePropDescriptor] !==\n controlLines[_RunInRootFrame$Deter];\n\n )\n _RunInRootFrame$Deter--;\n for (\n ;\n 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;\n namePropDescriptor--, _RunInRootFrame$Deter--\n )\n if (\n sampleLines[namePropDescriptor] !==\n controlLines[_RunInRootFrame$Deter]\n ) {\n if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {\n do\n if (\n (namePropDescriptor--,\n _RunInRootFrame$Deter--,\n 0 > _RunInRootFrame$Deter ||\n sampleLines[namePropDescriptor] !==\n controlLines[_RunInRootFrame$Deter])\n ) {\n var _frame =\n \"\\n\" +\n sampleLines[namePropDescriptor].replace(\n \" at new \",\n \" at \"\n );\n fn.displayName &&\n _frame.includes(\"\") &&\n (_frame = _frame.replace(\"\", fn.displayName));\n \"function\" === typeof fn &&\n componentFrameCache.set(fn, _frame);\n return _frame;\n }\n while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);\n }\n break;\n }\n }\n } finally {\n (reentry = !1),\n (ReactSharedInternals.H = previousDispatcher),\n reenableLogs(),\n (Error.prepareStackTrace = frame);\n }\n sampleLines = (sampleLines = fn ? fn.displayName || fn.name : \"\")\n ? describeBuiltInComponentFrame(sampleLines)\n : \"\";\n \"function\" === typeof fn && componentFrameCache.set(fn, sampleLines);\n return sampleLines;\n }\n function describeUnknownElementTypeFrameInDEV(type) {\n if (null == type) return \"\";\n if (\"function\" === typeof type) {\n var prototype = type.prototype;\n return describeNativeComponentFrame(\n type,\n !(!prototype || !prototype.isReactComponent)\n );\n }\n if (\"string\" === typeof type) return describeBuiltInComponentFrame(type);\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame(\"Suspense\");\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame(\"SuspenseList\");\n }\n if (\"object\" === typeof type)\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return (type = describeNativeComponentFrame(type.render, !1)), type;\n case REACT_MEMO_TYPE:\n return describeUnknownElementTypeFrameInDEV(type.type);\n case REACT_LAZY_TYPE:\n prototype = type._payload;\n type = type._init;\n try {\n return describeUnknownElementTypeFrameInDEV(type(prototype));\n } catch (x) {}\n }\n return \"\";\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, self, source, owner, props) {\n self = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== self ? self : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n source,\n self\n ) {\n if (\n \"string\" === typeof type ||\n \"function\" === typeof type ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_OFFSCREEN_TYPE ||\n (\"object\" === typeof type &&\n null !== type &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE$1 ||\n void 0 !== type.getModuleId))\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren], type);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children, type);\n } else {\n children = \"\";\n if (\n void 0 === type ||\n (\"object\" === typeof type &&\n null !== type &&\n 0 === Object.keys(type).length)\n )\n children +=\n \" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.\";\n null === type\n ? (isStaticChildren = \"null\")\n : isArrayImpl(type)\n ? (isStaticChildren = \"array\")\n : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE\n ? ((isStaticChildren =\n \"<\" +\n (getComponentNameFromType(type.type) || \"Unknown\") +\n \" />\"),\n (children =\n \" Did you accidentally export a JSX literal instead of a component?\"))\n : (isStaticChildren = typeof type);\n console.error(\n \"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",\n isStaticChildren,\n children\n );\n }\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(type, children, self, source, getOwner(), maybeKey);\n }\n function validateChildKeys(node, parentType) {\n if (\n \"object\" === typeof node &&\n node &&\n node.$$typeof !== REACT_CLIENT_REFERENCE\n )\n if (isArrayImpl(node))\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n isValidElement(child) && validateExplicitKey(child, parentType);\n }\n else if (isValidElement(node))\n node._store && (node._store.validated = 1);\n else if (\n (null === node || \"object\" !== typeof node\n ? (i = null)\n : ((i =\n (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||\n node[\"@@iterator\"]),\n (i = \"function\" === typeof i ? i : null)),\n \"function\" === typeof i &&\n i !== node.entries &&\n ((i = i.call(node)), i !== node))\n )\n for (; !(node = i.next()).done; )\n isValidElement(node.value) &&\n validateExplicitKey(node.value, parentType);\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n function validateExplicitKey(element, parentType) {\n if (\n element._store &&\n !element._store.validated &&\n null == element.key &&\n ((element._store.validated = 1),\n (parentType = getCurrentComponentErrorInfo(parentType)),\n !ownerHasKeyUseWarning[parentType])\n ) {\n ownerHasKeyUseWarning[parentType] = !0;\n var childOwner = \"\";\n element &&\n null != element._owner &&\n element._owner !== getOwner() &&\n ((childOwner = null),\n \"number\" === typeof element._owner.tag\n ? (childOwner = getComponentNameFromType(element._owner.type))\n : \"string\" === typeof element._owner.name &&\n (childOwner = element._owner.name),\n (childOwner = \" It was passed a child from \" + childOwner + \".\"));\n var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;\n ReactSharedInternals.getCurrentStack = function () {\n var stack = describeUnknownElementTypeFrameInDEV(element.type);\n prevGetCurrentStack && (stack += prevGetCurrentStack() || \"\");\n return stack;\n };\n console.error(\n 'Each child in a list should have a unique \"key\" prop.%s%s See https://react.dev/link/warning-keys for more information.',\n parentType,\n childOwner\n );\n ReactSharedInternals.getCurrentStack = prevGetCurrentStack;\n }\n }\n function getCurrentComponentErrorInfo(parentType) {\n var info = \"\",\n owner = getOwner();\n owner &&\n (owner = getComponentNameFromType(owner.type)) &&\n (info = \"\\n\\nCheck the render method of `\" + owner + \"`.\");\n info ||\n ((parentType = getComponentNameFromType(parentType)) &&\n (info =\n \"\\n\\nCheck the top-level render call using <\" + parentType + \">.\"));\n return info;\n }\n var React = __webpack_require__(/*! next/dist/compiled/react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\");\n Symbol.for(\"react.provider\");\n var REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_OFFSCREEN_TYPE = Symbol.for(\"react.offscreen\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator,\n REACT_CLIENT_REFERENCE$2 = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n assign = Object.assign,\n REACT_CLIENT_REFERENCE$1 = Symbol.for(\"react.client.reference\"),\n isArrayImpl = Array.isArray,\n disabledDepth = 0,\n prevLog,\n prevInfo,\n prevWarn,\n prevError,\n prevGroup,\n prevGroupCollapsed,\n prevGroupEnd;\n disabledLog.__reactDisabledLog = !0;\n var prefix,\n suffix,\n reentry = !1;\n var componentFrameCache = new (\n \"function\" === typeof WeakMap ? WeakMap : Map\n )();\n var REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var didWarnAboutKeySpread = {},\n ownerHasKeyUseWarning = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsxDEV = function (\n type,\n config,\n maybeKey,\n isStaticChildren,\n source,\n self\n ) {\n return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self);\n };\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvY29tcGlsZWQvcmVhY3QvY2pzL3JlYWN0LWpzeC1kZXYtcnVudGltZS5kZXZlbG9wbWVudC5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRWE7QUFDYixLQUFxQztBQUNyQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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bGF5TmFtZSB8fCBcIkNvbnRleHRcIikgKyBcIi5Db25zdW1lclwiO1xuICAgICAgICAgIGNhc2UgUkVBQ1RfRk9SV0FSRF9SRUZfVFlQRTpcbiAgICAgICAgICAgIHZhciBpbm5lclR5cGUgPSB0eXBlLnJlbmRlcjtcbiAgICAgICAgICAgIHR5cGUgPSB0eXBlLmRpc3BsYXlOYW1lO1xuICAgICAgICAgICAgdHlwZSB8fFxuICAgICAgICAgICAgICAoKHR5cGUgPSBpbm5lclR5cGUuZGlzcGxheU5hbWUgfHwgaW5uZXJUeXBlLm5hbWUgfHwgXCJcIiksXG4gICAgICAgICAgICAgICh0eXBlID0gXCJcIiAhPT0gdHlwZSA/IFwiRm9yd2FyZFJlZihcIiArIHR5cGUgKyBcIilcIiA6IFwiRm9yd2FyZFJlZlwiKSk7XG4gICAgICAgICAgICByZXR1cm4gdHlwZTtcbiAgICAgICAgICBjYXNlIFJFQUNUX01FTU9fVFlQRTpcbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgIChpbm5lclR5cGUgPSB0eXBlLmRpc3BsYXlOYW1lIHx8IG51bGwpLFxuICAgICAgICAgICAgICBudWxsICE9PSBpbm5lclR5cGVcbiAgICAgICAgICAgICAgICA/IGlubmVyVHlwZVxuICAgICAgICAgICAgICAgIDogZ2V0Q29tcG9uZW50TmFtZUZyb21UeXBlKHR5cGUudHlwZSkgfHwgXCJNZW1vXCJcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgY2FzZSBSRUFDVF9MQVpZX1RZUEU6XG4gICAgICAgICAgICBpbm5lclR5cGUgPSB0eXBlLl9wYXlsb2FkO1xuICAgICAgICAgICAgdHlwZSA9IHR5cGUuX2luaXQ7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICByZXR1cm4gZ2V0Q29tcG9uZW50TmFtZUZyb21UeXBlKHR5cGUoaW5uZXJUeXBlKSk7XG4gICAgICAgICAgICB9IGNhdGNoICh4KSB7fVxuICAgICAgIC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yB2YWx1ZSBtdXN0IGJlIGNvZXJjZWQgdG8gYSBzdHJpbmcgYmVmb3JlIHVzaW5nIGl0IGhlcmUuXCIsXG4gICAgICAgICAgSlNDb21waWxlcl9pbmxpbmVfcmVzdWx0JGpzY29tcCQwXG4gICAgICAgICk7XG4gICAgICAgIHJldHVybiB0ZXN0U3RyaW5nQ29lcmNpb24odmFsdWUpO1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiBkaXNhYmxlZExvZygpIHt9XG4gICAgZnVuY3Rpb24gZGlzYWJsZUxvZ3MoKSB7XG4gICAgICBpZiAoMCA9PT0gZGlzYWJsZWREZXB0aCkge1xuICAgICAgICBwcmV2TG9nID0gY29uc29sZS5sb2c7XG4gICAgICAgIHByZXZJbmZvID0gY29uc29sZS5pbmZvO1xuICAgICAgICBwcmV2V2FybiA9IGNvbnNvbGUud2FybjtcbiAgICAgICAgcHJldkVycm9yID0gY29uc29sZS5lcnJvcjtcbiAgICAgICAgcHJldkdyb3VwID0gY29uc29sZS5ncm91cDtcbiAgICAgICAgcHJldkdyb3VwQ29sbGFwc2VkID0gY29uc29sZS5ncm91cENvbGxhcHNlZDtcbiAgICAgICAgcHJldkdyb3VwRW5kID0gY29uc29sZS5ncm91cEVuZDtcbiAgICAgICAgdmFyIHByb3BzID0ge1xuICAgICAgICAgIGNvbmZpZ3VyYWJsZTogITAsXG4gICAgICAgICAgZW51bWVyYWJsZTogITAsXG4gICAgICAgICAgdmFsdWU6IGRpc2FibGVkTG9nLFxuICAgICAgICAgIHdyaXRhYmxlOiAhMFxuICAgICAgICB9O1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydGllcyhjb25zb2xlLCB7XG4gICAgICAgICAgaW5mbzogcHJvcHMsXG4gICAgICAgICAgbG9nOiBwcm9wcyxcbiAgICAgICAgICB3YXJuOiBwcm9wcyxcbiAgICAgICAgICBlcnJvcjogcHJvcHMsXG4gICAgICAgICAgZ3JvdXA6IHByb3BzLFxuICAgICAgIC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IEVycm9yLnByZXBhcmVTdGFja1RyYWNlO1xuICAgICAgRXJyb3IucHJlcGFyZVN0YWNrVHJhY2UgPSB2b2lkIDA7XG4gICAgICB2YXIgcHJldmlvdXNEaXNwYXRjaGVyID0gbnVsbDtcbiAgICAgIHByZXZpb3VzRGlzcGF0Y2hlciA9IFJlYWN0U2hhcmVkSW50ZXJuYWxzLkg7XG4gICAgICBSZWFjdFNoYXJlZEludGVybmFscy5IID0gbnVsbDtcbiAgICAgIGRpc2FibGVMb2dzKCk7XG4gICAgICB0cnkge1xuICAgICAgICB2YXIgUnVuSW5Sb290RnJhbWUgPSB7XG4gICAgICAgICAgRGV0ZXJtaW5lQ29tcG9uZW50RnJhbWVSb290OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBpZiAoY29uc3RydWN0KSB7XG4gICAgICAgICAgICAgICAgdmFyIEZha2UgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICB0aHJvdyBFcnJvcigpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEZha2UucHJvdG90eXBlLCBcInByb3BzXCIsIHtcbiAgICAgICAgICAgICAgICAgIHNldDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBFcnJvcigpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGlmIChcIm9iamVjdFwiID09PSB0eXBlb2YgUmVmbGVjdCAmJiBSZWZsZWN0LmNvbnN0cnVjdCkge1xuICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgUmVmbGVjdC5jb25zdHJ1Y3QoRmFrZSwgW10pO1xuICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoeCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY29udHJvbCA9IHg7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBSZWZsZWN0LmNvbnN0cnVjdChmbiwgW10sIEZha2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBGYWtlLmNhbGwoKTtcbiAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKHgkMCkge1xuICAgICAgICAgICAgICAgICAgICBjb250cm9sID0geCQwO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgZm4uY2FsbChGYWtlLnByb3RvdHlwZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICB0aHJvdyBFcnJvcigpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKHgkMSkge1xuICAgICAgICAgICAgICAgICAgY29udHJvbCA9IHgkMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKEZha2UgPSBmbigpKSAmJlxuICAgICAgICAgICAgICAgICAgXCJmdW5jdGlvblwiID09PSB0eXBlb2YgRmFrZS5jYXRjaCAmJlxuICAgICAgICAgICAgICAgICAgRmFrZS5jYXRjaChmdW5jdGlvbiAoKSB7fSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gY2F0Y2ggKHNhbXBsZSkge1xuICAgICAgICAgICAgICBpZiAoc2FtcGxlICYmIGNvbnRyb2wgJiYgXCJzdHJpbmdcIiA9PT0gdHlwZW9mIHNhbXBsZS5zdGFjaylcbiAgICAgICAgICAgICAgICByZXR1cm4gW3NhbXBsZS5zdGFjaywgY29udHJvbC5zdGFja107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gW251bGwsIG51bGxdO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgUnVuSW5Sb290RnJhbWUuRGV0ZXJtaW5lQ29tcG9uZW50RnJhbWVSb290LmRpc3BsYXlOYW1lID1cbiAgICAgICAgICBcIkRldGVybWluZUNvbXBvbmVudEZyYW1lUm9vdFwiO1xuICAgICAgICB2YXIgbmFtZVByb3BEZXNjcmlwdG9yID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihcbiAgICAgICAgICBSdW5JblJvb3RGcmFtZS5EZXRlcm1pbmVDb21wb25lbnRGcmFtZVJvb3QsXG4gICAgICAgICAgXCJuYW1lXCJcbiAgICAgICAgKTtcbiAgICAgICAgbmFtZVByb3BEZXNjcmlwdG9yICYmXG4gICAgICAgICAgbmFtZVByb3BEZXNjcmlwdG9yLmNvbmZpZ3VyYWJsZSAmJlxuICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShcbiAgICAgICAgICAgIFJ1bkluUm9vdEZyYW1lLkRldGVybWluZUNvbXBvbmVudEZyYW1lUm9vdCxcbiAgICAgICAgICAgIFwibmFtZVwiLFxuICAgICAgICAgICAgeyB2YWx1ZTogXCJEZXRlcm1pbmVDb21wb25lbnRGcmFtZVJvb3RcIiB9XG4gICAgICAgICAgKTtcbiAgICAgICAgdmFyIF9SdW5JblJvb3RGcmFtZSREZXRlciA9XG4gICAgICAgICAgICBSdW5JblJvb3RGcmFtZS5EZXRlcm1pbmVDb21wb25lbnRGcmFtZVJvb3QoKSxcbiAgICAgICAgICBzYW1wbGVTdGFjayA9IF9SdW5JblJvb3RGcmFtZSREZXRlclswXSxcbiAgICAgICAgICBjb250cm9sU3RhY2sgPSBfUnVuSW5Sb290RnJhbWUkRGV0ZXJbMV07XG4gICAgICAgIGlmIChzYW1wbGVTdGFjayAmJiBjb250cm9sU3RhY2spIHtcbiAgICAgICAgICB2YXIgc2FtcGxlTGluZXMgPSBzYW1wbGVTdGFjay5zcGxpdChcIlxcblwiKSxcbiAgICAgICAgICAgIGNvbnRyb2xMaW5lcyA9IGNvbnRyb2xTdGFjay5zcGxpdChcIlxcblwiKTtcbiAgICAgICAgICBmb3IgKFxuICAgICAgICAgICAgX1J1bkluUm9vdEZyYW1lJERldGVyID0gbmFtZVByb3BEZXNjcmlwdG9yID0gMDtcbiAgICAgICAgICAgIG5hbWVQcm9wRGVzY3JpcHRvciA8IHNhbXBsZUxpbmVzLmxlbmd0aCAmJlxuICAgICAgICAgICAgIXNhbXBsZUxpbmVzW25hbWVQcm9wRGVzY3JpcHRvcl0uaW5jbHVkZXMoXG4gICAgICAgICAgICAgIFwiRGV0ZXJtaW5lQ29tcG9uZW50RnJhbWVSb290XCJcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICApXG4gICAgICAgICAgICBuYW1lUHJvcERlc2NyaXB0b3IrKztcbiAgICAgICAgICBmb3IgKFxuICAgICAgICAgICAgO1xuICAgICAgICAgICAgX1J1bkluUm9vdEZyYW1lJERldGVyIDwgY29udHJvbExpbmVzLmxlbmd0aCAmJlxuICAgICAgICAgICAgIWNvbnRyb2xMaW5lc1tfUnVuSW5Sb290RnJhbWUkRGV0ZXJdLmluY2x1ZGVzKFxuICAgICAgICAgICAgICBcIkRldGVybWluZUNvbXBvbmVudEZyYW1lUm9vdFwiXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgKVxuICAgICAgICAgICAgX1J1bkluUm9vdEZyYW1lJERldGVyKys7XG4gICAgICAgICAgaWYgKFxuICAgICAgICAgICAgbmFtZVByb3BEZXNjcmlwdG9yID09PSBzYW1wbGVMaW5lcy5sZW5ndGggfHxcbiAgICAgICAgICAgIF9SdW5JblJvb3RGcmFtZSREZXRlciA9PT0gY29udHJvbExpbmVzLmxlbmd0aFxuICAgICAgICAgIClcbiAgICAgICAgICAgIGZvciAoXG4gICAgICAgICAgICAgIG5hbWVQcm9wRGVzY3JpcHRvciA9IHNhbXBsZUxpbmVzLmxlbmd0aCAtIDEsXG4gICAgICAgICAgICAgICAgX1J1bkluUm9vdEZyYW1lJERldGVyID0gY29udHJvbExpbmVzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgIDEgPD0gbmFtZVByb3BEZXNjcmlwdG9yICYmXG4gICAgICAgICAgICAgIDAgPD0gX1J1bkluUm9vdEZyYW1lJERldGVyICYmXG4gICAgICAgICAgICAgIHNhbXBsZUxpbmVzW25hbWVQcm9wRGVzY3JpcHRvcl0gIT09XG4gICAgICAgICAgICAgICAgY29udHJvbExpbmVzW19SdW5JblJvb3RGcmFtZSREZXRlcl07XG5cbiAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgX1J1bkluUm9vdEZyYW1lJERldGVyLS07XG4gICAgICAgICAgZm9yIChcbiAgICAgICAgICAgIDtcbiAgICAgICAgICAgIDEgPD0gbmFtZVByb3BEZXNjcmlwdG9yICYmIDAgPD0gX1J1bkluUm9vdEZyYW1lJERldGVyO1xuICAgICAgICAgICAgbmFtZVByb3BEZXNjcmlwdG9yLS0sIF9SdW5JblJvb3RGcmFtZSREZXRlci0tXG4gICAgICAgICAgKVxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICBzYW1wbGVMaW5lc1tuYW1lUHJvcERlc2NyaXB0b3JdICE9PVxuICAgICAgICAgICAgICBjb250cm9sTGluZXNbX1J1bkluUm9vdEZyYW1lJERldGVyXVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgIGlmICgxICE9PSBuYW1lUHJvcERlc2NyaXB0b3IgfHwgMSAhPT0gX1J1bkluUm9vdEZyYW1lJERldGVyKSB7XG4gICAgICAgICAgICAgICAgZG9cbiAgICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgKG5hbWVQcm9wRGVzY3JpcHRvci0tLFxuICAgICAgICAgICAgICAgICAgICBfUnVuSW5Sb290RnJhbWUkRGV0ZXItLSxcbiAgICAgICAgICAgICAgICAgICAgMCA+IF9SdW5JblJvb3RGcmFtZSREZXRlciB8fFxuICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZUxpbmVzW25hbWVQcm9wRGVzY3JpcHRvcl0gIT09XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sTGluZXNbX1J1bkluUm9vdEZyYW1lJERldGVyXSlcbiAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgX2ZyYW1lID1cbiAgICAgICAgICAgICAgICAgICAgICBcIlxcblwiICtcbiAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVMaW5lc1tuYW1lUHJvcERlc2NyaXB0b3JdLnJlcGxhY2UoXG4gICAgICAgICAgICAgICAgICAgICAgICBcIiBhdCBuZXcgXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBcIiBhdCBcIlxuICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIGZuLmRpc3BsYXlOYW1lICYmXG4gICAgICAgICAgICAgICAgICAgICAgX2ZyYW1lLmluY2x1ZGVzKFwiPGFub255bW91cz5cIikgJiZcbiAgICAgICAgICAgICAgICAgICAgICAoX2ZyYW1lID0gX2ZyYW1lLnJlcGxhY2UoXCI8YW5vbnltb3VzPlwiLCBmbi5kaXNwbGF5TmFtZSkpO1xuICAgICAgICAgICAgICAgICAgICBcImZ1bmN0aW9uXCIgPT09IHR5cGVvZiBmbiAmJlxuICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudEZyYW1lQ2FjaGUuc2V0KGZuLCBfZnJhbWUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX2ZyYW1lO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdoaWxlICgxIDw9IG5hbWVQcm9wRGVzY3JpcHRvciAmJiAwIDw9IF9SdW5JblJvb3RGcmFtZSREZXRlcik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZmluYWxseSB7XG4gICAgICAgIChyZWVudHJ5ID0gITEpLFxuICAgICAgICAgIChSZWFjdFNoYXJlZEludGVybmFscy5IID0gcHJldml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TUVOVF9UWVBFLFxuICAgICAgICB0eXBlOiB0eXBlLFxuICAgICAgICBrZXk6IGtleSxcbiAgICAgICAgcHJvcHM6IHByb3BzLFxuICAgICAgICBfb3duZXI6IG93bmVyXG4gICAgICB9O1xuICAgICAgbnVsbCAhPT0gKHZvaWQgMCAhPT0gc2VsZiA/IHNlbGYgOiBudWxsKVxuICAgICAgICA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0eXBlLCBcInJlZlwiLCB7XG4gICAgICAgICAgICBlbnVtZXJhYmxlOiAhMSxcbiAgICAgICAgICAgIGdldDogZWxlbWVudFJlZkdldHRlcldpdGhEZXByZWNhdGlvbldhcm5pbmdcbiAgICAgICAgICB9KVxuICAgICAgICA6IE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0eXBlLCBcInJlZlwiLCB7IGVudW1lcmFibGU6ICExLCB2YWx1ZTogbnVsbCB9KTtcbiAgICAgIHR5cGUuX3N0b3JlID0ge307XG4gICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodHlwZS5fc3RvcmUsIFwidmFsaWRhdGVkXCIsIHtcbiAgICAgICAgY29uZmlndXJhYmxlOiAhMSxcbiAgICAgICAgZW51bWVyYWJsZTogITEsXG4gICAgICAgIHdyaXRhYmxlOiAhMCxcbiAgICAgICAgdmFsdWU6IDBcbiAgICAgIH0pO1xuICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHR5cGUsIFwiX2RlYnVnSW5mb1wiLCB7XG4gICAgICAgIGNvbmZpZ3VyYWJsZTogITEsXG4gICAgICAgIGVudW1lcmFibGU6ICExLFxuICAgICAgICB3cml0YWJsZTogITAsXG4gICAgICAgIHZhbHVlOiBudWxsXG4gICAgICB9KTtcbiAgICAgIE9iamVjdC5mcmVlemUgJiYgKE9iamVjdC5mcmVlemUodHlwZS5wcm9wcyksIE9iamVjdC5mcmVlemUodHlwZSkpO1xuICAgICAgcmV0dXJuIHR5cGU7XG4gICAgfVxuICAgIGZ1bmN0aW9u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gICAgICBjaGlsZHJlbiA9IFwiXCI7XG4gICAgICAgIGlmIChcbiAgICAgICAgICB2b2lkIDAgPT09IHR5cGUgfHxcbiAgICAgICAgICAoXCJvYmplY3RcIiA9PT0gdHlwZW9mIHR5cGUgJiZcbiAgICAgICAgICAgIG51bGwgIT09IHR5cGUgJiZcbiAgICAgICAgICAgIDAgPT09IE9iamVjdC5rZXlzKHR5cGUpLmxlbmd0aClcbiAgICAgICAgKVxuICAgICAgICAgIGNoaWxkcmVuICs9XG4gICAgICAgICAgICBcIiBZb3UgbGlrZWx5IGZvcmdvdCB0byBleHBvcnQgeW91ciBjb21wb25lbnQgZnJvbSB0aGUgZmlsZSBpdCdzIGRlZmluZWQgaW4sIG9yIHlvdSBtaWdodCBoYXZlIG1peGVkIHVwIGRlZmF1bHQgYW5kIG5hbWVkIGltcG9ydHMuXCI7XG4gICAgICAgIG51bGwgPT09IHR5cGVcbiAgICAgICAgICA/IChpc1N0YXRpY0NoaWxkcmVuID0gXCJudWxsXCIpXG4gICAgICAgICAgOiBpc0FycmF5SW1wbCh0eXBlKVxuICAgICAgICAgICAgPyAoaXNTdGF0aWNDaGlsZHJlbiA9IFwiYXJyYXlcIilcbiAgICAgICAgICAgIDogdm9pZCAwICE9PSB0eXBlICYmIHR5cGUuJCR0eXBlb2YgPT09IFJFQUNUX0VMRU1FTlRfVFlQRVxuICAgICAgICAgICAgICA/ICgoaXNTdGF0aWNDaGlsZHJlbiA9XG4gICAgICAgICAgICAgICAgICBcIjxcIiArXG4gICAgICAgICAgICAgICAgICAoZ2V0Q29tcG9uZW50TmFtZUZyb21UeXBlKHR5cGUudHlwZSkgfHwgXCJVbmtub3duXCIpICtcbiAgICAgICAgICAgICAgICAgIFwiIC8+XCIpLFxuICAgICAgICAgICAgICAgIChjaGlsZHJlbiA9XG4gICAgICAgICAgICAgICAgICBcIiBEaWQgeW91IGFjY2lkZW50YWxseSBleHBvcnQgYSBKU1ggbGl0ZXJhbCBpbnN0ZWFkIG9mIG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3BOYW1lICYmIChtYXliZUtleVtwcm9wTmFtZV0gPSBjb25maWdbcHJvcE5hbWVdKTtcbiAgICAgIH0gZWxzZSBtYXliZUtleSA9IGNvbmZpZztcbiAgICAgIGNoaWxkcmVuICYmXG4gICAgICAgIGRlZmluZUtleVByb3BXYXJuaW5nR2V0dGVyKFxuICAgICAgICAgIG1heWJlS2V5LFxuICAgICAgICAgIFwiZnVuY3Rpb25cIiA9PT0gdHlwZW9mIHR5cGVcbiAgICAgICAgICAgID8gdHlwZS5kaXNwbGF5TmFtZSB8fCB0eXBlLm5hbWUgfHwgXCJVbmtub3duXCJcbiAgICAgICAgICAgIDogdHlwZVxuICAgICAgICApO1xuICAgICAgcmV0dXJuIFJlYWN0RWxlbWVudCh0eXBlLCBjaGlsZHJlbiwgc2VsZiwgc291cmNlLCBnZXRPd25lcigpLCBtYXliZUtleSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHZhbGlkYXRlQ2hpbGRLZXlzKG5vZGUsIHBhcmVudFR5cGUpIHtcbiAgICAgIGlmIChcbiAgICAgICAgXCJvYmplY3RcIiA9PT0gdHlwZW9mIG5vZGUgJiZcbiAgICAgICAgbm9kZSAmJlxuICAgICAgICBub2RlLiQkdHlwZW9mICE9PSBSRUFDVF9DTElFTlRfUkVGRVJFTkNFXG4gICAgICApXG4gICAgICAgIGlmIChpc0FycmF5SW1wbChub2RlKSlcbiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG5vZGUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciBjaGlsZCA9IG5vZGVbaV07XG4gICAgICAgICAgICBpc1ZhbGlkRWxlbWVudChjaGlsZCkgJiYgdmFsaWRhdGVFeHBsaWNpdEtleShjaGlsZCwgcGFyZW50VHlwZSk7XG4gICAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpc1ZhbGlkRWxlbWVudChub2RlKSlcbiAgICAgICAgICBub2RlLl9zdG9yZSAmJiAobm9kZS5fc3RvcmUudmFsaWRhdGVkID0gMSk7XG4gICAgICAgIGVsc2UgaWYgKFxuICAgICAgICAgIChudWxsID09PSBub2RlIHx8IFwib2JqZWN0XCIgIT09IHR5cGVvZiBub2RlXG4gICAgICAgICAgICA/IChpID0gbnVsbClcbiAgICAgICAgICAgIDogKChpID1cbiAgICAgICAgICAgICAgICAoTUFZQkVfSVRFUkFUT1JfU1lNQk9MICYmIG5vZGVbTUFZQkVfSVRFUkFUT1JfU1lNQk9MXSkgfHxcbiAgICAgICAgICAgICAgICBub2RlW1wiQEBpdGVyYXRvclwiXSksXG4gICAgICAgICAgICAgIChpID0gXCJmdW5jdGlvblwiID09PSB0eXBlb2YgaSA/IGkgOiBudWxsKSksXG4gICAgICAgICAgXCJmdW5jdGlvblwiID09PSB0eXBlb2YgaSAmJlxuICAgICAgICAgICAgaSAhPT0gbm9kZS5lbnRyaWVzICYmXG4gICAgICAgICAgICAoKGkgPSBpLmNhbGwobm9kZSkpLCBpICE9PSBub2RlKSlcbiAgICAgICAgKVxuICAgICAgICAgIGZvciAoOyAhKG5vZGUgPSBpLm5leHQoKSkuZG9uZTsgKVxuICAgICAgICAgICAgaXNWYWxpZEVsZW1lbnQobm9kZS52YWx1ZSkgJiZcbiAgICAgICAgICAgICAgdmFsaWRhdGVFeHBsaWNpdEtleShub2RlLnZhbHVlLCBwYXJlbnRUeXBlKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gaXNWYWxpZEVsZW1lbnQob2JqZWN0KSB7XG4gICAgICByZXR1cm4gKFxuICAgICAgICBcIm9iamVjdFwiID09PSB0eXBlb2Ygb2JqZWN0ICYmXG4gICAgICAgIG51bGwgIT09IG9iamVjdCAmJlxuICAgICAgICBvYmplY3QuJCR0eXBlb2YgPT09IFJFQUNUX0VMRU1FTlRfVFlQRVxuICAgICAgKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gdmFsaWRhdGVFeHBsaWNpdEtleShlbGVtZW50LCBwYXJlbnRUeXBlKSB7XG4gICAgICBpZiAoXG4gICAgICAgIGVsZW1lbnQuX3N0b3JlICYmXG4gICAgICAgICFlbGVtZW50Ll9zdG9yZS52YWxpZGF0ZWQgJiZcbiAgICAgICAgbnVsbCA9PSBlbGVtZW50LmtleSAmJlxuICAgICAgICAoKGVsZW1lbnQuX3N0b3JlLnZhbGlkYXRlZCA9IDEpLFxuICAgICAgICAocGFyZW50VHlwZSA9IGdldEN1cnJlbnRDb21wb25lbnRFcnJvckluZm8ocGFyZW50VHlwZSkpLFxuICAgICAgICAhb3duZXJIYXNLZXlVc2VXYXJuaW5nW3BhcmVudFR5cGVdKVxuICAgICAgKSB7XG4gICAgICAgIG93bmVySGFzS2V5VXNlV2FybmluZ1twYXJlbnRUeXBlXSA9ICEwO1xuICAgICAgICB2YXIgY2hpbGRPd25lciA9IFwiXCI7XG4gICAgICAgIGVsZW1lbnQgJiZcbiAgICAgICAgICBudWxsICE9IGVsZW1lbnQuX293bmVyICYmXG4gICAgICAgICAgZWxlbWVudC5fb3duZXIgIT09IGdldE93bmVyKCkgJiZcbiAgICAgICAgICAoKGNoaWxkT3duZXIgPSBudWxsKSxcbiAgICAgICAgICBcIm51bWJlclwiID09PSB0eXBlb2YgZWxlbWVudC5fb3duZXIudGFnXG4gICAgICAgICAgICA/IChjaGlsZE93bmVyID0gZ2V0Q29tcG9uZW50TmFtZUZyb21UeXBlKGVsZW1lbnQuX293bmVyLnR5cGUpKVxuICAgICAgICAgICAgOiBcInN0cmluZ1wiID09PSB0eXBlb2YgZWxlbWVudC5fb3duZXIubmFtZSAmJlxuICAgICAgICAgICAgICAoY2hpbGRPd25lciA9IGVsZW1lbnQuX293bmVyLm5hbWUpLFxuICAgICAgICAgIChjaGlsZE93bmVyID0gXCIgSXQgd2FzIHBhc3NlZCBhIGNoaWxkIGZyb20gXCIgKyBjaGlsZE93bmVyICsgXCIuXCIpKTtcbiAgICAgICAgdmFyIHByZXZHZXRDdXJyZW50U3RhY2sgPSBSZWFjdFNoYXJlZEludGVybmFscy5nZXRDd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R3JvdXAsXG4gICAgICBwcmV2R3JvdXBDb2xsYXBzZWQsXG4gICAgICBwcmV2R3JvdXBFbmQ7XG4gICAgZGlzYWJsZWRMb2cuX19yZWFjdERpc2FibGVkTG9nID0gITA7XG4gICAgdmFyIHByZWZpeCxcbiAgICAgIHN1ZmZpeCxcbiAgICAgIHJlZW50cnkgPSAhMTtcbiAgICB2YXIgY29tcG9uZW50RnJhbWVDYWNoZSA9IG5ldyAoXG4gICAgICBcImZ1bmN0aW9uXCIgPT09IHR5cGVvZiBXZWFrTWFwID8gV2Vha01hcCA6IE1hcFxuICAgICkoKTtcbiAgICB2YXIgUkVBQ1RfQ0xJRU5UX1JFRkVSRU5DRSA9IFN5bWJvbC5mb3IoXCJyZWFjdC5jbGllbnQucmVmZXJlbmNlXCIpLFxuICAgICAgc3BlY2lhbFByb3BLZXlXYXJuaW5nU2hvd247XG4gICAgdmFyIGRpZFdhcm5BYm91dEVsZW1lbnRSZWYgPSB7fTtcbiAgICB2YXIgZGlkV2FybkFib3V0S2V5U3ByZWFkID0ge30sXG4gICAgICBvd25lckhhc0tleVVzZVdhcm5pbmcgPSB7fTtcbiAgICBleHBvcnRzLkZyYWdtZW50ID0gUkVBQ1RfRlJBR01FTlRfVFlQRTtcbiAgICBleHBvcnRzLmpzeERFViA9IGZ1bmN0aW9uIChcbiAgICAgIHR5cGUsXG4gICAgICBjb25maWcsXG4gICAgICBtYXliZUtleSxcbiAgICAgIGlzU3RhdGljQ2hpbGRyZW4sXG4gICAgICBzb3VyY2UsXG4gICAgICBzZWxmXG4gICAgKSB7XG4gICAgICByZXR1cm4ganN4REVWSW1wbCh0eXBlLCBjb25maWcsIG1heWJlS2V5LCBpc1N0YXRpY0NoaWxkcmVuLCBzb3VyY2UsIHNlbGYpO1xuICAgIH07XG4gIH0pKCk7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js": -/*!******************************************************************!*\ - !*** ./node_modules/next/dist/compiled/react/jsx-dev-runtime.js ***! - \******************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-jsx-dev-runtime.development.js */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/cjs/react-jsx-dev-runtime.development.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvY29tcGlsZWQvcmVhY3QvanN4LWRldi1ydW50aW1lLmpzIiwibWFwcGluZ3MiOiJBQUFhOztBQUViLElBQUksS0FBcUMsRUFBRSxFQUUxQyxDQUFDO0FBQ0YsRUFBRSw4TEFBc0U7QUFDeEUiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL09wZW5DbGF3L1dlYi9oZWFydGJlYXQtbW9uaXRvci9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NvbXBpbGVkL3JlYWN0L2pzeC1kZXYtcnVudGltZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG5cbmlmIChwcm9jZXNzLmVudi5OT0RFX0VOViA9PT0gJ3Byb2R1Y3Rpb24nKSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QtanN4LWRldi1ydW50aW1lLnByb2R1Y3Rpb24uanMnKTtcbn0gZWxzZSB7XG4gIG1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9janMvcmVhY3QtanN4LWRldi1ydW50aW1lLmRldmVsb3BtZW50LmpzJyk7XG59XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/Icon.js": -/*!****************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/Icon.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Icon)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var _defaultAttributes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./defaultAttributes.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/defaultAttributes.js\");\n/* harmony import */ var _shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/src/utils.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/shared/src/utils.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \n\n\nconst Icon = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(_c = (param, ref)=>{\n let { color = \"currentColor\", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = \"\", children, iconNode, ...rest } = param;\n return /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(\"svg\", {\n ref,\n ..._defaultAttributes_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: (0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeClasses)(\"lucide\", className),\n ...rest\n }, [\n ...iconNode.map((param)=>{\n let [tag, attrs] = param;\n return /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(tag, attrs);\n }),\n ...Array.isArray(children) ? children : [\n children\n ]\n ]);\n});\n_c1 = Icon;\n //# sourceMappingURL=Icon.js.map\nvar _c, _c1;\n$RefreshReg$(_c, \"Icon$forwardRef\");\n$RefreshReg$(_c1, \"Icon\");\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vSWNvbi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7QUF3QkEsQ0FBTSxTQUFPLHdFQUNYLFFBV0UsR0FDRztRQVhILEVBQ0UsS0FBUSxtQkFDUixJQUFPLE9BQ1AsV0FBYyxNQUNkLHFCQUNBLFNBQVksT0FDWixVQUNBLFVBQ0EsR0FBRztJQUlFLDJFQUNMLE1BQ0E7UUFDRTtRQUNBLEdBQUc7UUFDSCxLQUFPO1FBQ1AsTUFBUTtRQUNSLE1BQVE7UUFDUixZQUFhLHFCQUF1QixRQUFPLEVBQVcsWUFBSSxJQUFNLFVBQU8sQ0FBSSxJQUFJO1FBQy9FLFVBQVcsbUVBQWEsV0FBVSxTQUFTO1FBQzNDLEdBQUc7SUFDTCxHQUNBO1dBQ0ssQ0FBUyxZQUFJO2dCQUFDLENBQUMsQ0FBSyxLQUFLLEtBQU07aUNBQUEscURBQWMsR0FBSyxPQUFLLENBQUM7O1dBQ3ZELEtBQU0sU0FBUSxRQUFRLENBQUksY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CxcbiAgICAgIH0sXG4gICAgICBbXG4gICAgICAgIC4uLmljb25Ob2RlLm1hcCgoW3RhZywgYXR0cnNdKSA9PiBjcmVhdGVFbGVtZW50KHRhZywgYXR0cnMpKSxcbiAgICAgICAgLi4uKEFycmF5LmlzQXJyYXkoY2hpbGRyZW4pID8gY2hpbGRyZW4gOiBbY2hpbGRyZW5dKSxcbiAgICAgIF0sXG4gICAgKTtcbiAgfSxcbik7XG5cbmV4cG9ydCBkZWZhdWx0IEljb247XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/Icon.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js": -/*!****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/createLucideIcon.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ createLucideIcon)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var _shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/src/utils.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/shared/src/utils.js\");\n/* harmony import */ var _Icon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Icon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/Icon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \n\n\nconst createLucideIcon = (iconName, iconNode)=>{\n const Component = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((param, ref)=>{\n let { className, ...props } = param;\n return /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Icon_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n ref,\n iconNode,\n className: (0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeClasses)(\"lucide-\".concat((0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.toKebabCase)(iconName)), className),\n ...props\n });\n });\n Component.displayName = \"\".concat(iconName);\n return Component;\n};\n //# sourceMappingURL=createLucideIcon.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vY3JlYXRlTHVjaWRlSWNvbi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7QUFXTSx1QkFBbUIsR0FBQyxVQUFrQixRQUF1QjtJQUNqRSxNQUFNLENBQVksbUZBQWlFO1lBQXpCLEVBQUUsQ0FBVyxXQUFHLFFBQVM7NkJBQ2pGLG9EQUFhLENBQUMsZ0RBQU07WUFDbEI7WUFDQTtZQUNBLFdBQVcsa0VBQWEsV0FBK0IsT0FBckIsaUVBQVcsQ0FBQyxRQUFRLENBQUMsR0FBSSxTQUFTO1lBQ3BFLEdBQUc7UUFBQSxDQUNKOztJQUdPLHdCQUFjLENBQUcsRUFBUSxPQUFSLFFBQVE7SUFFNUI7QUFDVCIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvc3JjL2NyZWF0ZUx1Y2lkZUljb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3JlYXRlRWxlbW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=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/defaultAttributes.js": -/*!*****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/defaultAttributes.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ defaultAttributes)\n/* harmony export */ });\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ var defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n //# sourceMappingURL=defaultAttributes.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vZGVmYXVsdEF0dHJpYnV0ZXMuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0lBQUEsQ0FBZTtJQUNiLEtBQU87SUFDUCxLQUFPO0lBQ1AsTUFBUTtJQUNSLE9BQVM7SUFDVCxJQUFNO0lBQ04sTUFBUTtJQUNSLFdBQWE7SUFDYixhQUFlO0lBQ2YsY0FBZ0I7QUFDbEIiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL09wZW5DbGF3L3NyYy9kZWZhdWx0QXR0cmlidXRlcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCB7XG4gIHhtbG5zOiAnaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnLFxuICB3aWR0aDogMjQsXG4gIGhlaWdodDogMjQsXG4gIHZpZXdCb3g6ICcwIDAgMjQgMjQnLFxuICBmaWxsOiAnbm9uZScsXG4gIHN0cm9rZTogJ2N1cnJlbnRDb2xvcicsXG4gIHN0cm9rZVdpZHRoOiAyLFxuICBzdHJva2VMaW5lY2FwOiAncm91bmQnLFxuICBzdHJva2VMaW5lam9pbjogJ3JvdW5kJyxcbn07XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/defaultAttributes.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/activity.js": -/*!**************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/activity.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Activity)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\",\n key: \"169zse\"\n }\n ]\n];\nconst Activity = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Activity\", __iconNode);\n //# sourceMappingURL=activity.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvYWN0aXZpdHkuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUNFO1FBQ0E7WUFDRSxDQUFHO1lBQ0gsR0FBSztRQUNQO0tBQ0Y7Q0FDRjtBQWFNLGVBQVcsa0VBQWlCLGFBQVksQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2ljb25zL2FjdGl2aXR5LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2lkZUljb24nO1xuaW1wb3J0IHsgSWNvbk5vZGUgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBfX2ljb25Ob2RlOiBJY29uTm9kZSA9IFtcbiAgW1xuICAgICdwYXRoJyxcbiAgICB7XG4gICAgICBkOiAnTTIyIDEyaC0yLjQ4YTIgMiAwIDAgMC0xLjkzIDEuNDZsLTIuMzUgOC4zNmEuMjUuMjUgMCAwIDEtLjQ4IDBMOS4yNCAyLjE4YS4yNS4yNSAwIDAgMC0uNDggMGwtMi4zNSA4LjM2QTIgMiAwIDAgMSA0LjQ5IDEySDInLFxuICAgICAga2V5OiAnMTY5enNlJyxcbiAgICB9LFxuICBdLFxuXTtcblxuLyoqXG4gKiBAY29tcG9uZW50IEBuYW1lIEFjdGl2aXR5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0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgQWN0aXZpdHkgPSBjcmVhdGVMdWNpZGVJY29uKCdBY3Rpdml0eScsIF9faWNvbk5vZGUpO1xuXG5leHBvcnQgZGVmYXVsdCBBY3Rpdml0eTtcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/activity.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-alert.js": -/*!******************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/circle-alert.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ CircleAlert)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"line\",\n {\n x1: \"12\",\n x2: \"12\",\n y1: \"8\",\n y2: \"12\",\n key: \"1pkeuh\"\n }\n ],\n [\n \"line\",\n {\n x1: \"12\",\n x2: \"12.01\",\n y1: \"16\",\n y2: \"16\",\n key: \"4dfq90\"\n }\n ]\n];\nconst CircleAlert = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"CircleAlert\", __iconNode);\n //# sourceMappingURL=circle-alert.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvY2lyY2xlLWFsZXJ0LmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQU0sQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFNLEdBQUs7UUFBQSxDQUFVO0tBQUE7SUFDekQ7UUFBQztRQUFRLENBQUU7WUFBQSxJQUFJLENBQU07WUFBQSxJQUFJLENBQU07WUFBQSxHQUFJLElBQUs7WUFBQSxHQUFJLEtBQU07WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQ2pFO1FBQUM7UUFBUSxDQUFFO1lBQUEsSUFBSSxDQUFNO1lBQUEsSUFBSSxDQUFTO1lBQUEsR0FBSSxLQUFNO1lBQUEsR0FBSSxLQUFNO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtDQUN2RTtBQWFNLGtCQUFjLGtFQUFpQixnQkFBZSxDQUFVIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9zcmMvaWNvbnMvY2lyY2xlLWFsZXJ0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2lkZUljb24nO1xuaW1wb3J0IHsgSWNvbk5vZGUgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4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E1UMGlNVElpSUhneVBTSXhNaUlnZVRFOUlqZ2lJSGt5UFNJeE1pSWdMejRLSUNBOGJHbHVaU0I0TVQwaU1USWlJSGd5UFNJeE1pNHdNU0lnZVRFOUlqRTJJaUI1TWowaU1UWWlJQzgrQ2p3dmMzWm5QZ289KSAtIGh0dHBzOi8vbHVjaWRlLmRldi9pY29ucy9jaXJjbGUtYWxlcnRcbiAqIEBzZWUgaHR0cHM6Ly9sdWNpZGUuZGV2L2d1aWRlL3BhY2thZ2VzL2x1Y2lkZS1yZWFjdCAtIERvY3VtZW50YXRpb25cbiAqXG4gKiBAcGFyYW0ge09iamVjdH0gcHJvcHMgLSBMdWNpZGUgaWNvbnMgcHJvcHMgYW5kIGFueSB2YWxpZCBTVkcgYXR0cmlidXRlXG4gKiBAcmV0dXJucyB7SlNYLkVsZW1lbnR9IEpTWCBFbGVtZW50XG4gKlxuICovXG5jb25zdCBDaXJjbGVBbGVydCA9IGNyZWF0ZUx1Y2lkZUljb24oJ0NpcmNsZUFsZXJ0JywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IENpcmNsZUFsZXJ0O1xuIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-alert.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-check.js": -/*!******************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/circle-check.js ***! - \******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ CircleCheck)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"path\",\n {\n d: \"m9 12 2 2 4-4\",\n key: \"dzmm74\"\n }\n ]\n];\nconst CircleCheck = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"CircleCheck\", __iconNode);\n //# sourceMappingURL=circle-check.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvY2lyY2xlLWNoZWNrLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUdPLE1BQU0sVUFBdUI7SUFDbEM7UUFBQyxRQUFVO1FBQUE7WUFBRSxFQUFJO1lBQU0sQ0FBSSxRQUFNO1lBQUEsQ0FBRztZQUFNLEdBQUs7UUFBQSxDQUFVO0tBQUE7SUFDekQ7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQWlCO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtDQUNoRDtBQWFNLGtCQUFjLGtFQUFpQixnQkFBZSxDQUFVIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9zcmMvaWNvbnMvY2lyY2xlLWNoZWNrLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2l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Oi8vbHVjaWRlLmRldi9pY29ucy9jaXJjbGUtY2hlY2tcbiAqIEBzZWUgaHR0cHM6Ly9sdWNpZGUuZGV2L2d1aWRlL3BhY2thZ2VzL2x1Y2lkZS1yZWFjdCAtIERvY3VtZW50YXRpb25cbiAqXG4gKiBAcGFyYW0ge09iamVjdH0gcHJvcHMgLSBMdWNpZGUgaWNvbnMgcHJvcHMgYW5kIGFueSB2YWxpZCBTVkcgYXR0cmlidXRlXG4gKiBAcmV0dXJucyB7SlNYLkVsZW1lbnR9IEpTWCBFbGVtZW50XG4gKlxuICovXG5jb25zdCBDaXJjbGVDaGVjayA9IGNyZWF0ZUx1Y2lkZUljb24oJ0NpcmNsZUNoZWNrJywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IENpcmNsZUNoZWNrO1xuIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-check.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-x.js": -/*!**************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/circle-x.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ CircleX)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"path\",\n {\n d: \"m15 9-6 6\",\n key: \"1uzhvr\"\n }\n ],\n [\n \"path\",\n {\n d: \"m9 9 6 6\",\n key: \"z0biqf\"\n }\n ]\n];\nconst CircleX = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"CircleX\", __iconNode);\n //# sourceMappingURL=circle-x.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvY2lyY2xlLXguanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLFFBQVU7UUFBQTtZQUFFLEVBQUk7WUFBTSxDQUFJLFFBQU07WUFBQSxDQUFHO1lBQU0sR0FBSztRQUFBLENBQVU7S0FBQTtJQUN6RDtRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBYTtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7SUFDMUM7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQVk7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0NBQzNDO0FBYU0sY0FBVSxrRUFBaUIsWUFBVyxDQUFVIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9zcmMvaWNvbnMvY2lyY2xlLXgudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNyZWF0ZUx1Y2lkZUljb24gZnJvbSAnLi4vY3JlYXRlTHVjaWRlSWNvbic7XG5pbXBvcnQgeyBJY29uTm9kZSB9IGZyb20gJy4uL3R5cGVzJztc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VGtnT1NBMklEWWlJQzgrQ2p3dmMzWm5QZ289KSAtIGh0dHBzOi8vbHVjaWRlLmRldi9pY29ucy9jaXJjbGUteFxuICogQHNlZSBodHRwczovL2x1Y2lkZS5kZXYvZ3VpZGUvcGFja2FnZXMvbHVjaWRlLXJlYWN0IC0gRG9jdW1lbnRhdGlvblxuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBwcm9wcyAtIEx1Y2lkZSBpY29ucyBwcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IENpcmNsZVggPSBjcmVhdGVMdWNpZGVJY29uKCdDaXJjbGVYJywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IENpcmNsZVg7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/circle-x.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/clock.js": -/*!***********************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/clock.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Clock)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"polyline\",\n {\n points: \"12 6 12 12 16 14\",\n key: \"68esgv\"\n }\n ]\n];\nconst Clock = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Clock\", __iconNode);\n //# sourceMappingURL=clock.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvY2xvY2suanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLFFBQVU7UUFBQTtZQUFFLEVBQUk7WUFBTSxDQUFJLFFBQU07WUFBQSxDQUFHO1lBQU0sR0FBSztRQUFBLENBQVU7S0FBQTtJQUN6RDtRQUFDLFVBQVk7UUFBQTtZQUFFLFFBQVEsQ0FBb0I7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0NBQzVEO0FBYU0sWUFBUSxrRUFBaUIsVUFBUyxDQUFVIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9zcmMvaWNvbnMvY2xvY2sudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNyZWF0ZUx1Y2lkZUljb24gZnJvbSAnLi4vY3JlYXRlTHVjaWRlSWNvbic7XG5pbXBvcnQgeyBJY29uTm9kZSB9IGZyb20gJy4uL3R5cGVzJztcblxuZXhwb3J0IGNvbnN0IF9faWNvbk5vZGU6IEljb25Ob2RlID0gW1xuICBbJ2NpcmNsZScsIHsgY3g6ICcxMicsIGN5OiAnMTInLCByOiAnMTAnLCBrZXk6ICcxbWdsYX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B7T2JqZWN0fSBwcm9wcyAtIEx1Y2lkZSBpY29ucyBwcm9wcyBhbmQgYW55IHZhbGlkIFNWRyBhdHRyaWJ1dGVcbiAqIEByZXR1cm5zIHtKU1guRWxlbWVudH0gSlNYIEVsZW1lbnRcbiAqXG4gKi9cbmNvbnN0IENsb2NrID0gY3JlYXRlTHVjaWRlSWNvbignQ2xvY2snLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgQ2xvY2s7XG4iXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/clock.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/ellipsis.js": -/*!**************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/ellipsis.js ***! - \**************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Ellipsis)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"1\",\n key: \"41hilf\"\n }\n ],\n [\n \"circle\",\n {\n cx: \"19\",\n cy: \"12\",\n r: \"1\",\n key: \"1wjl8i\"\n }\n ],\n [\n \"circle\",\n {\n cx: \"5\",\n cy: \"12\",\n r: \"1\",\n key: \"1pcz8c\"\n }\n ]\n];\nconst Ellipsis = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Ellipsis\", __iconNode);\n //# sourceMappingURL=ellipsis.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvZWxsaXBzaXMuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLFFBQVU7UUFBQTtZQUFFLEVBQUk7WUFBTSxDQUFJLFFBQU07WUFBQSxDQUFHO1lBQUssR0FBSztRQUFBLENBQVU7S0FBQTtJQUN4RDtRQUFDLFFBQVU7UUFBQTtZQUFFLEVBQUk7WUFBTSxDQUFJLFFBQU07WUFBQSxDQUFHO1lBQUssR0FBSztRQUFBLENBQVU7S0FBQTtJQUN4RDtRQUFDLFFBQVU7UUFBQTtZQUFFLEVBQUk7WUFBSyxDQUFJLFFBQU07WUFBQSxDQUFHO1lBQUssR0FBSztRQUFBLENBQVU7S0FBQTtDQUN6RDtBQWFNLGVBQVcsa0VBQWlCLGFBQVksQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2ljb25zL2VsbGlwc2lzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJy4uL2NyZWF0ZUx1Y2lkZUljb24nO1xuaW1wb3J0IHsgSWNvbk5vZGUgfSBmcm9tICcuLi90eXBlcyc7XG5cbmV4cG9ydCBjb25zdCBfX2ljb25Ob2RlOiBJY29uTm9kZSA9IFtcbiAgWydjaXJjbGUnLCB7IGN4OiAnMTInLCBjeTogJzEyJywgcj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ly9sdWNpZGUuZGV2L2ljb25zL2VsbGlwc2lzXG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgRWxsaXBzaXMgPSBjcmVhdGVMdWNpZGVJY29uKCdFbGxpcHNpcycsIF9faWNvbk5vZGUpO1xuXG5leHBvcnQgZGVmYXVsdCBFbGxpcHNpcztcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/ellipsis.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/external-link.js": -/*!*******************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/external-link.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ ExternalLink)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M15 3h6v6\",\n key: \"1q9fwt\"\n }\n ],\n [\n \"path\",\n {\n d: \"M10 14 21 3\",\n key: \"gplh6r\"\n }\n ],\n [\n \"path\",\n {\n d: \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\",\n key: \"a6xqqp\"\n }\n ]\n];\nconst ExternalLink = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"ExternalLink\", __iconNode);\n //# sourceMappingURL=external-link.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvZXh0ZXJuYWwtbGluay5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFHTyxNQUFNLFVBQXVCO0lBQ2xDO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFhO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtJQUMxQztRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBZTtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7SUFDNUM7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQTREO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtDQUMzRjtBQWFNLG1CQUFlLGtFQUFpQixpQkFBZ0IsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2ljb25zL2V4dGVybmFsLWxpbmsudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNyZWF0ZUx1Y2lkZUljb24gZnJvbSAnLi4vY3JlYXRlTHVjaWRlSWNvbic7XG5pbXBvcnQgeyBJY29uTm9kZSB9IGZyb20gJy4uL3R5cGVzJ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tDaUFnUEhCaGRHZ2daRDBpVFRFNElERXpkalpoTWlBeUlEQWdNQ0F4TFRJZ01rZzFZVElnTWlBd0lEQWdNUzB5TFRKV09HRXlJRElnTUNBd0lERWdNaTB5YURZaUlDOCtDand2YzNablBnbz0pIC0gaHR0cHM6Ly9sdWNpZGUuZGV2L2ljb25zL2V4dGVybmFsLWxpbmtcbiAqIEBzZWUgaHR0cHM6Ly9sdWNpZGUuZGV2L2d1aWRlL3BhY2thZ2VzL2x1Y2lkZS1yZWFjdCAtIERvY3VtZW50YXRpb25cbiAqXG4gKiBAcGFyYW0ge09iamVjdH0gcHJvcHMgLSBMdWNpZGUgaWNvbnMgcHJvcHMgYW5kIGFueSB2YWxpZCBTVkcgYXR0cmlidXRlXG4gKiBAcmV0dXJucyB7SlNYLkVsZW1lbnR9IEpTWCBFbGVtZW50XG4gKlxuICovXG5jb25zdCBFeHRlcm5hbExpbmsgPSBjcmVhdGVMdWNpZGVJY29uKCdFeHRlcm5hbExpbmsnLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgRXh0ZXJuYWxMaW5rO1xuIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/external-link.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/globe.js": -/*!***********************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/globe.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Globe)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"circle\",\n {\n cx: \"12\",\n cy: \"12\",\n r: \"10\",\n key: \"1mglay\"\n }\n ],\n [\n \"path\",\n {\n d: \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\",\n key: \"13o1zl\"\n }\n ],\n [\n \"path\",\n {\n d: \"M2 12h20\",\n key: \"9i4pu4\"\n }\n ]\n];\nconst Globe = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Globe\", __iconNode);\n //# sourceMappingURL=globe.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvZ2xvYmUuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLFFBQVU7UUFBQTtZQUFFLEVBQUk7WUFBTSxDQUFJLFFBQU07WUFBQSxDQUFHO1lBQU0sR0FBSztRQUFBLENBQVU7S0FBQTtJQUN6RDtRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBbUQ7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQ2hGO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFZO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtDQUMzQztBQWFNLFlBQVEsa0VBQWlCLFVBQVMsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVj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mpZWEE5SW5KdmRXNWtJZ29nSUhOMGNtOXJaUzFzYVc1bGFtOXBiajBpY205MWJtUWlDajRLSUNBOFkybHlZMnhsSUdONFBTSXhNaUlnWTNrOUlqRXlJaUJ5UFNJeE1DSWdMejRLSUNBOGNHRjBhQ0JrUFNKTk1USWdNbUV4TkM0MUlERTBMalVnTUNBd0lEQWdNQ0F5TUNBeE5DNDFJREUwTGpVZ01DQXdJREFnTUMweU1DSWdMejRLSUNBOGNHRjBhQ0JrUFNKTk1pQXhNbWd5TUNJZ0x6NEtQQzl6ZG1jK0NnPT0pIC0gaHR0cHM6Ly9sdWNpZGUuZGV2L2ljb25zL2dsb2JlXG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgR2xvYmUgPSBjcmVhdGVMdWNpZGVJY29uKCdHbG9iZScsIF9faWNvbk5vZGUpO1xuXG5leHBvcnQgZGVmYXVsdCBHbG9iZTtcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/globe.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/plus.js": -/*!**********************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/plus.js ***! - \**********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Plus)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M5 12h14\",\n key: \"1ays0h\"\n }\n ],\n [\n \"path\",\n {\n d: \"M12 5v14\",\n key: \"s699le\"\n }\n ]\n];\nconst Plus = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Plus\", __iconNode);\n //# sourceMappingURL=plus.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvcGx1cy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFHTyxNQUFNLFVBQXVCO0lBQ2xDO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFZO1lBQUEsS0FBSztRQUFBLENBQVU7S0FBQTtJQUN6QztRQUFDLE1BQVE7UUFBQTtZQUFFLEdBQUcsQ0FBWTtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7Q0FDM0M7QUFhTSxXQUFPLGtFQUFpQixTQUFRLENBQVUiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL3NyYy9pY29ucy9wbHVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjcmVhdGVMdWNpZGVJY29uIGZyb20gJ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ucy9wbHVzXG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgUGx1cyA9IGNyZWF0ZUx1Y2lkZUljb24oJ1BsdXMnLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgUGx1cztcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/plus.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/refresh-cw.js": -/*!****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/refresh-cw.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ RefreshCw)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\",\n key: \"v9h5vc\"\n }\n ],\n [\n \"path\",\n {\n d: \"M21 3v5h-5\",\n key: \"1q7to0\"\n }\n ],\n [\n \"path\",\n {\n d: \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\",\n key: \"3uifl3\"\n }\n ],\n [\n \"path\",\n {\n d: \"M8 16H3v5\",\n key: \"1cv678\"\n }\n ]\n];\nconst RefreshCw = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"RefreshCw\", __iconNode);\n //# sourceMappingURL=refresh-cw.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvcmVmcmVzaC1jdy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFHTyxNQUFNLFVBQXVCO0lBQ2xDO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUFzRDtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7SUFDbkY7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQWM7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQzNDO1FBQUMsTUFBUTtRQUFBO1lBQUUsR0FBRyxDQUF1RDtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7SUFDcEY7UUFBQyxNQUFRO1FBQUE7WUFBRSxHQUFHLENBQWE7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0NBQzVDO0FBYU0sZ0JBQVksa0VBQWlCLGNBQWEsQ0FBVSIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvc3JjL2ljb25zL3JlZnJlc2gtY3cudHMiXSwic291cmNlc0NvbnRlbn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N0lHSnZjbVJsY2kxeVlXUnBkWE02SURKd2VDSUtJQ0J6ZEhKdmEyVXRkMmxrZEdnOUlqSWlDaUFnYzNSeWIydGxMV3hwYm1WallYQTlJbkp2ZFc1a0lnb2dJSE4wY205clpTMXNhVzVsYW05cGJqMGljbTkxYm1RaUNqNEtJQ0E4Y0dGMGFDQmtQU0pOTXlBeE1tRTVJRGtnTUNBd0lERWdPUzA1SURrdU56VWdPUzQzTlNBd0lEQWdNU0EyTGpjMElESXVOelJNTWpFZ09DSWdMejRLSUNBOGNHRjBhQ0JrUFNKTk1qRWdNM1kxYUMwMUlpQXZQZ29nSUR4d1lYUm9JR1E5SWsweU1TQXhNbUU1SURrZ01DQXdJREV0T1NBNUlEa3VOelVnT1M0M05TQXdJREFnTVMwMkxqYzBMVEl1TnpSTU15QXhOaUlnTHo0S0lDQThjR0YwYUNCa1BTSk5PQ0F4TmtnemRqVWlJQzgrQ2p3dmMzWm5QZ289KSAtIGh0dHBzOi8vbHVjaWRlLmRldi9pY29ucy9yZWZyZXNoLWN3XG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgUmVmcmVzaEN3ID0gY3JlYXRlTHVjaWRlSWNvbignUmVmcmVzaEN3JywgX19pY29uTm9kZSk7XG5cbmV4cG9ydCBkZWZhdWx0IFJlZnJlc2hDdztcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/refresh-cw.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/trash-2.js": -/*!*************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/trash-2.js ***! - \*************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ Trash2)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M3 6h18\",\n key: \"d0wm0j\"\n }\n ],\n [\n \"path\",\n {\n d: \"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\",\n key: \"4alrt4\"\n }\n ],\n [\n \"path\",\n {\n d: \"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\",\n key: \"v07s0e\"\n }\n ],\n [\n \"line\",\n {\n x1: \"10\",\n x2: \"10\",\n y1: \"11\",\n y2: \"17\",\n key: \"1uufr5\"\n }\n ],\n [\n \"line\",\n {\n x1: \"14\",\n x2: \"14\",\n y1: \"11\",\n y2: \"17\",\n key: \"xtxkd\"\n }\n ]\n];\nconst Trash2 = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"Trash2\", __iconNode);\n //# sourceMappingURL=trash-2.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL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UNCa1BTSk5NeUEyYURFNElpQXZQZ29nSUR4d1lYUm9JR1E5SWsweE9TQTJkakUwWXpBZ01TMHhJREl0TWlBeVNEZGpMVEVnTUMweUxURXRNaTB5VmpZaUlDOCtDaUFnUEhCaGRHZ2daRDBpVFRnZ05sWTBZekF0TVNBeExUSWdNaTB5YURSak1TQXdJRElnTVNBeUlESjJNaUlnTHo0S0lDQThiR2x1WlNCNE1UMGlNVEFpSUhneVBTSXhNQ0lnZVRFOUlqRXhJaUI1TWowaU1UY2lJQzgrQ2lBZ1BHeHBibVVnZURFOUlqRTBJaUI0TWowaU1UUWlJSGt4UFNJeE1TSWdlVEk5SWpFM0lpQXZQZ284TDNOMlp6NEspIC0gaHR0cHM6Ly9sdWNpZGUuZGV2L2ljb25zL3RyYXNoLTJcbiAqIEBzZWUgaHR0cHM6Ly9sdWNpZGUuZGV2L2d1aWRlL3BhY2thZ2VzL2x1Y2lkZS1yZWFjdCAtIERvY3VtZW50YXRpb25cbiAqXG4gKiBAcGFyYW0ge09iamVjdH0gcHJvcHMgLSBMdWNpZGUgaWNvbnMgcHJvcHMgYW5kIGFueSB2YWxpZCBTVkcgYXR0cmlidXRlXG4gKiBAcmV0dXJucyB7SlNYLkVsZW1lbnR9IEpTWCBFbGVtZW50XG4gKlxuICovXG5jb25zdCBUcmFzaDIgPSBjcmVhdGVMdWNpZGVJY29uKCdUcmFzaDInLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgVHJhc2gyO1xuIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/trash-2.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/trending-up.js": -/*!*****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/icons/trending-up.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ __iconNode: () => (/* binding */ __iconNode),\n/* harmony export */ \"default\": () => (/* binding */ TrendingUp)\n/* harmony export */ });\n/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/createLucideIcon.js\");\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ \nconst __iconNode = [\n [\n \"polyline\",\n {\n points: \"22 7 13.5 15.5 8.5 10.5 2 17\",\n key: \"126l90\"\n }\n ],\n [\n \"polyline\",\n {\n points: \"16 7 22 7 22 13\",\n key: \"kwv8wd\"\n }\n ]\n];\nconst TrendingUp = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"TrendingUp\", __iconNode);\n //# sourceMappingURL=trending-up.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vaWNvbnMvdHJlbmRpbmctdXAuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBR08sTUFBTSxVQUF1QjtJQUNsQztRQUFDLFVBQVk7UUFBQTtZQUFFLFFBQVEsQ0FBZ0M7WUFBQSxLQUFLO1FBQUEsQ0FBVTtLQUFBO0lBQ3RFO1FBQUMsVUFBWTtRQUFBO1lBQUUsUUFBUSxDQUFtQjtZQUFBLEtBQUs7UUFBQSxDQUFVO0tBQUE7Q0FDM0Q7QUFhTSxpQkFBYSxrRUFBaUIsZUFBYyxDQUFVIiwic291cmNlc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BOUluSnZkVzVrSWdvZ0lITjBjbTlyWlMxc2FXNWxhbTlwYmowaWNtOTFibVFpQ2o0S0lDQThjRzlzZVd4cGJtVWdjRzlwYm5SelBTSXlNaUEzSURFekxqVWdNVFV1TlNBNExqVWdNVEF1TlNBeUlERTNJaUF2UGdvZ0lEeHdiMng1YkdsdVpTQndiMmx1ZEhNOUlqRTJJRGNnTWpJZ055QXlNaUF4TXlJZ0x6NEtQQzl6ZG1jK0NnPT0pIC0gaHR0cHM6Ly9sdWNpZGUuZGV2L2ljb25zL3RyZW5kaW5nLXVwXG4gKiBAc2VlIGh0dHBzOi8vbHVjaWRlLmRldi9ndWlkZS9wYWNrYWdlcy9sdWNpZGUtcmVhY3QgLSBEb2N1bWVudGF0aW9uXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IHByb3BzIC0gTHVjaWRlIGljb25zIHByb3BzIGFuZCBhbnkgdmFsaWQgU1ZHIGF0dHJpYnV0ZVxuICogQHJldHVybnMge0pTWC5FbGVtZW50fSBKU1ggRWxlbWVudFxuICpcbiAqL1xuY29uc3QgVHJlbmRpbmdVcCA9IGNyZWF0ZUx1Y2lkZUljb24oJ1RyZW5kaW5nVXAnLCBfX2ljb25Ob2RlKTtcblxuZXhwb3J0IGRlZmF1bHQgVHJlbmRpbmdVcDtcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/trending-up.js\n")); - -/***/ }), - -/***/ "(app-pages-browser)/./node_modules/lucide-react/dist/esm/shared/src/utils.js": -/*!****************************************************************!*\ - !*** ./node_modules/lucide-react/dist/esm/shared/src/utils.js ***! - \****************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -"use strict"; -eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ mergeClasses: () => (/* binding */ mergeClasses),\n/* harmony export */ toKebabCase: () => (/* binding */ toKebabCase)\n/* harmony export */ });\n/**\n * @license lucide-react v0.474.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */ const toKebabCase = (string)=>string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst mergeClasses = function() {\n for(var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++){\n classes[_key] = arguments[_key];\n }\n return classes.filter((className, index, array)=>{\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n }).join(\" \").trim();\n};\n //# sourceMappingURL=utils.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL25vZGVfbW9kdWxlcy9sdWNpZGUtcmVhY3QvZGlzdC9lc20vc2hhcmVkL3NyYy91dGlscy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0lBUWEsb0JBQWMsQ0FBQyxNQUMxQixVQUFPLFFBQVEsb0JBQXNCLFNBQU8sRUFBRSxXQUFZO0FBK0IvQyxtQkFBZSxJQUEyQzs7UUFBQSxPQUNyRTs7V0FBQSxRQUNHLE9BQU8sQ0FBQyxXQUFXLE9BQU8sS0FBVTtRQUVqQyxlQUFRLFNBQVMsRUFDaEIsWUFBcUIsWUFBVyxDQUNqQyxXQUFNLE9BQVEsRUFBUyxTQUFNO0lBRWpDLENBQUMsQ0FDQSxNQUFLLENBQUcsSUFDUixDQUFLIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL3NoYXJlZC9zcmMvdXRpbHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ2FtZWxUb1Bhc2NhbCB9IGZyb20gJy4vdXRpbGl0eS10eXBlcyc7XG5cbi8qKlxuICogQ29udmVydHMgc3RyaW5nIHR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GljZSgxKSkgYXMgQ2FtZWxUb1Bhc2NhbDxUPjtcbn07XG5cbi8qKlxuICogTWVyZ2VzIGNsYXNzZXMgaW50byBhIHNpbmdsZSBzdHJpbmdcbiAqXG4gKiBAcGFyYW0ge2FycmF5fSBjbGFzc2VzXG4gKiBAcmV0dXJucyB7c3RyaW5nfSBBIHN0cmluZyBvZiBjbGFzc2VzXG4gKi9cbmV4cG9ydCBjb25zdCBtZXJnZUNsYXNzZXMgPSA8Q2xhc3NUeXBlID0gc3RyaW5nIHwgdW5kZWZpbmVkIHwgbnVsbD4oLi4uY2xhc3NlczogQ2xhc3NUeXBlW10pID0+XG4gIGNsYXNzZXNcbiAgICAuZmlsdGVyKChjbGFzc05hbWUsIGluZGV4LCBhcnJheSkgPT4ge1xuICAgICAgcmV0dXJuIChcbiAgICAgICAgQm9vbGVhbihjbGFzc05hbWUpICYmXG4gICAgICAgIChjbGFzc05hbWUgYXMgc3RyaW5nKS50cmltKCkgIT09ICcnICYmXG4gICAgICAgIGFycmF5LmluZGV4T2YoY2xhc3NOYW1lKSA9PT0gaW5kZXhcbiAgICAgICk7XG4gICAgfSlcbiAgICAuam9pbignICcpXG4gICAgLnRyaW0oKTtcbiJdLCJuYW1lcyI6W10sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./node_modules/lucide-react/dist/esm/shared/src/utils.js\n")); - -/***/ }) - -}, -/******/ __webpack_require__ => { // webpackRuntimeModules -/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) -/******/ __webpack_require__.O(0, ["main-app"], () => (__webpack_exec__("(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?modules=%7B%22request%22%3A%22%2FUsers%2Fmattbruce%2FDocuments%2FProjects%2FOpenClaw%2FWeb%2Fheartbeat-monitor%2Fsrc%2Fapp%2Fpage.tsx%22%2C%22ids%22%3A%5B%5D%7D&server=false!"))); -/******/ var __webpack_exports__ = __webpack_require__.O(); -/******/ _N_E = __webpack_exports__; -/******/ } -]); \ No newline at end of file diff --git a/.next/static/chunks/fallback/amp.js b/.next/static/chunks/fallback/amp.js new file mode 100644 index 00000000..3236a130 --- /dev/null +++ b/.next/static/chunks/fallback/amp.js @@ -0,0 +1,884 @@ +/* + * ATTENTION: An "eval-source-map" devtool has been used. + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). + */ +(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["amp"],{ + +/***/ "./node_modules/next/dist/build/deployment-id.js": +/*!*******************************************************!*\ + !*** ./node_modules/next/dist/build/deployment-id.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"getDeploymentIdQueryOrEmptyString\", ({\n enumerable: true,\n get: function() {\n return getDeploymentIdQueryOrEmptyString;\n }\n}));\nfunction getDeploymentIdQueryOrEmptyString() {\n if (false) {}\n return '';\n}\n\n//# sourceMappingURL=deployment-id.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL2RlcGxveW1lbnQtaWQuanMiLCJtYXBwaW5ncyI6IkFBQWE7QUFDYiw4Q0FBNkM7QUFDN0M7QUFDQSxDQUFDLEVBQUM7QUFDRixxRUFBb0U7QUFDcEU7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDLEVBQUM7QUFDRjtBQUNBLFFBQVEsS0FBOEIsRUFBRSxFQUVuQztBQUNMO0FBQ0E7O0FBRUEiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL09wZW5DbGF3L1dlYi9oZWFydGJlYXQtbW9uaXRvci9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL2RlcGxveW1lbnQtaWQuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHtcbiAgICB2YWx1ZTogdHJ1ZVxufSk7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJnZXREZXBsb3ltZW50SWRRdWVyeU9yRW1wdHlTdHJpbmdcIiwge1xuICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIGdldERlcGxveW1lbnRJZFF1ZXJ5T3JFbXB0eVN0cmluZztcbiAgICB9XG59KTtcbmZ1bmN0aW9uIGdldERlcGxveW1lbnRJZFF1ZXJ5T3JFbXB0eVN0cmluZygpIHtcbiAgICBpZiAocHJvY2Vzcy5lbnYuTkVYVF9ERVBMT1lNRU5UX0lEKSB7XG4gICAgICAgIHJldHVybiBgP2RwbD0ke3Byb2Nlc3MuZW52Lk5FWFRfREVQTE9ZTUVOVF9JRH1gO1xuICAgIH1cbiAgICByZXR1cm4gJyc7XG59XG5cbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWRlcGxveW1lbnQtaWQuanMubWFwIl0sIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6WzBdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/build/deployment-id.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/build/polyfills/process.js": +/*!***********************************************************!*\ + !*** ./node_modules/next/dist/build/polyfills/process.js ***! + \***********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nvar _global_process, _global_process1;\nmodule.exports = ((_global_process = __webpack_require__.g.process) == null ? void 0 : _global_process.env) && typeof ((_global_process1 = __webpack_require__.g.process) == null ? void 0 : _global_process1.env) === 'object' ? __webpack_require__.g.process : __webpack_require__(/*! next/dist/compiled/process */ \"./node_modules/next/dist/compiled/process/browser.js\");\n\n//# sourceMappingURL=process.js.map//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2J1aWxkL3BvbHlmaWxscy9wcm9jZXNzLmpzIiwibWFwcGluZ3MiOiJBQUFhO0FBQ2I7QUFDQSxxQ0FBcUMscUJBQU0saUZBQWlGLHFCQUFNLGtFQUFrRSxxQkFBTSxXQUFXLG1CQUFPLENBQUMsd0ZBQTRCOztBQUV6UCIsInNvdXJjZXMiOlsiL1VzZXJzL21hdHRicnVjZS9Eb2N1bWVudHMvUHJvamVjdHMvT3BlbkNsYXcvV2ViL2hlYXJ0YmVhdC1tb25pdG9yL25vZGVfbW9kdWxlcy9uZXh0L2Rpc3QvYnVpbGQvcG9seWZpbGxzL3Byb2Nlc3MuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG52YXIgX2dsb2JhbF9wcm9jZXNzLCBfZ2xvYmFsX3Byb2Nlc3MxO1xubW9kdWxlLmV4cG9ydHMgPSAoKF9nbG9iYWxfcHJvY2VzcyA9IGdsb2JhbC5wcm9jZXNzKSA9PSBudWxsID8gdm9pZCAwIDogX2dsb2JhbF9wcm9jZXNzLmVudikgJiYgdHlwZW9mICgoX2dsb2JhbF9wcm9jZXNzMSA9IGdsb2JhbC5wcm9jZXNzKSA9PSBudWxsID8gdm9pZCAwIDogX2dsb2JhbF9wcm9jZXNzMS5lbnYpID09PSAnb2JqZWN0JyA/IGdsb2JhbC5wcm9jZXNzIDogcmVxdWlyZSgnbmV4dC9kaXN0L2NvbXBpbGVkL3Byb2Nlc3MnKTtcblxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9cHJvY2Vzcy5qcy5tYXAiXSwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbMF0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/build/polyfills/process.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/add-base-path.js": +/*!********************************************************!*\ + !*** ./node_modules/next/dist/client/add-base-path.js ***! + \********************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"addBasePath\", ({\n enumerable: true,\n get: function() {\n return addBasePath;\n }\n}));\nconst _addpathprefix = __webpack_require__(/*! ../shared/lib/router/utils/add-path-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js\");\nconst _normalizetrailingslash = __webpack_require__(/*! ./normalize-trailing-slash */ \"./node_modules/next/dist/client/normalize-trailing-slash.js\");\nconst basePath = false || '';\nfunction addBasePath(path, required) {\n return (0, _normalizetrailingslash.normalizePathTrailingSlash)( false ? 0 : (0, _addpathprefix.addPathPrefix)(path, basePath));\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=add-base-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L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YXRoKVxuICApXG59XG4iXSwibmFtZXMiOlsiYWRkQmFzZVBhdGgiLCJiYXNlUGF0aCIsInByb2Nlc3MiLCJlbnYiLCJfX05FWFRfUk9VVEVSX0JBU0VQQVRIIiwicGF0aCIsInJlcXVpcmVkIiwibm9ybWFsaXplUGF0aFRyYWlsaW5nU2xhc2giLCJfX05FWFRfTUFOVUFMX0NMSUVOVF9CQVNFX1BBVEgiLCJhZGRQYXRoUHJlZml4Il0sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/add-base-path.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/add-locale.js": +/*!*****************************************************!*\ + !*** ./node_modules/next/dist/client/add-locale.js ***! + \*****************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"addLocale\", ({\n enumerable: true,\n get: function() {\n return addLocale;\n }\n}));\nconst _normalizetrailingslash = __webpack_require__(/*! ./normalize-trailing-slash */ \"./node_modules/next/dist/client/normalize-trailing-slash.js\");\nconst addLocale = function(path) {\n for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n args[_key - 1] = arguments[_key];\n }\n if (false) {}\n return path;\n};\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=add-locale.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXM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ufVxuIl0sIm5hbWVzIjpbImFkZExvY2FsZSIsInBhdGgiLCJhcmdzIiwicHJvY2VzcyIsImVudiIsIl9fTkVYVF9JMThOX1NVUFBPUlQiLCJub3JtYWxpemVQYXRoVHJhaWxpbmdTbGFzaCIsInJlcXVpcmUiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/add-locale.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/components/react-dev-overlay/internal/helpers/get-socket-url.js": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/next/dist/client/components/react-dev-overlay/internal/helpers/get-socket-url.js ***! + \*******************************************************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"getSocketUrl\", ({\n enumerable: true,\n get: function() {\n return getSocketUrl;\n }\n}));\nconst _normalizedassetprefix = __webpack_require__(/*! ../../../../../shared/lib/normalized-asset-prefix */ \"./node_modules/next/dist/shared/lib/normalized-asset-prefix.js\");\nfunction getSocketProtocol(assetPrefix) {\n let protocol = window.location.protocol;\n try {\n // assetPrefix is a url\n protocol = new URL(assetPrefix).protocol;\n } catch (e) {}\n return protocol === 'http:' ? 'ws:' : 'wss:';\n}\nfunction getSocketUrl(assetPrefix) {\n const prefix = (0, _normalizedassetprefix.normalizedAssetPrefix)(assetPrefix);\n const protocol = getSocketProtocol(assetPrefix || '');\n if (URL.canParse(prefix)) {\n // since normalized asset prefix is ensured to be a URL format,\n // we can safely replace the protocol\n return prefix.replace(/^http/, 'ws');\n }\n const { hostname, port } = window.location;\n return protocol + \"//\" + hostname + (port ? \":\" + port : '') + prefix;\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=get-socket-url.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9jb21wb25lbnRzL3JlYWN0LWRldi1vdmVybGF5L2ludGVybmFsL2hlbHBlcnMvZ2V0LXNvY2tldC11cmwuanMiLCJtYXBwaW5ncyI6Ijs7OztnREFhZ0JBOzs7ZUFBQUE7OzttREFic0I7QUFFdEMsU0FBU0Msa0JBQWtCQyxXQUFtQjtJQUM1QyxJQUFJQyxXQUFXQyxPQUFPQyxRQUFRLENBQUNGLFFBQVE7SUFFdkMsSUFBSTtRQUNGLHVCQUF1QjtRQUN2QkEsV0FBVyxJQUFJRyxJQUFJSixhQUFhQyxRQUFRO0lBQzFDLEVBQUUsVUFBTSxDQUFDO0lBRVQsT0FBT0EsYUFBYSxVQUFVLFFBQVE7QUFDeEM7QUFFTyxTQUFTSCxhQUFhRSxXQUErQjtJQUMxRCxNQUFNSyxTQUFTQyxDQUFBQSxHQUFBQSx1QkFBQUEscUJBQUFBLEVBQXNCTjtJQUNyQyxNQUFNQyxXQUFXRixrQkFBa0JDLGVBQWU7SUFFbEQsSUFBSUksSUFBSUcsUUFBUSxDQUFDRixTQUFTO1FBQ3hCLCtEQUErRDtRQUMvRCxxQ0FBcUM7UUFDckMsT0FBT0EsT0FBT0csT0FBTyxDQUFDLFNBQVM7SUFDakM7SUFFQSxNQUFNLEVBQUVDLFFBQVEsRUFBRUMsSUFBSSxFQUFFLEdBQUdSLE9BQU9DLFFBQVE7SUFDMUMsT0FBVUYsV0FBUyxPQUFJUSxXQUFXQyxDQUFBQSxPQUFRLE1BQUdBLE9BQVMsR0FBQyxHQUFJTDtBQUM3RCIsInN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HRwLywgJ3dzJylcbiAgfVxuXG4gIGNvbnN0IHsgaG9zdG5hbWUsIHBvcnQgfSA9IHdpbmRvdy5sb2NhdGlvblxuICByZXR1cm4gYCR7cHJvdG9jb2x9Ly8ke2hvc3RuYW1lfSR7cG9ydCA/IGA6JHtwb3J0fWAgOiAnJ30ke3ByZWZpeH1gXG59XG4iXSwibmFtZXMiOlsiZ2V0U29ja2V0VXJsIiwiZ2V0U29ja2V0UHJvdG9jb2wiLCJhc3NldFByZWZpeCIsInByb3RvY29sIiwid2luZG93IiwibG9jYXRpb24iLCJVUkwiLCJwcmVmaXgiLCJub3JtYWxpemVkQXNzZXRQcmVmaXgiLCJjYW5QYXJzZSIsInJlcGxhY2UiLCJob3N0bmFtZSIsInBvcnQiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/components/react-dev-overlay/internal/helpers/get-socket-url.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/components/react-dev-overlay/pages/websocket.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/next/dist/client/components/react-dev-overlay/pages/websocket.js ***! + \***************************************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && (0);\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n addMessageListener: function() {\n return addMessageListener;\n },\n connectHMR: function() {\n return connectHMR;\n },\n sendMessage: function() {\n return sendMessage;\n }\n});\nconst _hotreloadertypes = __webpack_require__(/*! ../../../../server/dev/hot-reloader-types */ \"./node_modules/next/dist/server/dev/hot-reloader-types.js\");\nconst _getsocketurl = __webpack_require__(/*! ../internal/helpers/get-socket-url */ \"./node_modules/next/dist/client/components/react-dev-overlay/internal/helpers/get-socket-url.js\");\nlet source;\nconst eventCallbacks = [];\nfunction addMessageListener(callback) {\n eventCallbacks.push(callback);\n}\nfunction sendMessage(data) {\n if (!source || source.readyState !== source.OPEN) return;\n return source.send(data);\n}\nlet reconnections = 0;\nlet reloading = false;\nlet serverSessionId = null;\nfunction connectHMR(options) {\n function init() {\n if (source) source.close();\n function handleOnline() {\n reconnections = 0;\n window.console.log('[HMR] connected');\n }\n function handleMessage(event) {\n // While the page is reloading, don't respond to any more messages.\n // On reconnect, the server may send an empty list of changes if it was restarted.\n if (reloading) {\n return;\n }\n // Coerce into HMR_ACTION_TYPES as that is the format.\n const msg = JSON.parse(event.data);\n if ('action' in msg && msg.action === _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.TURBOPACK_CONNECTED) {\n if (serverSessionId !== null && serverSessionId !== msg.data.sessionId) {\n // Either the server's session id has changed and it's a new server, or\n // it's been too long since we disconnected and we should reload the page.\n // There could be 1) unhandled server errors and/or 2) stale content.\n // Perform a hard reload of the page.\n window.location.reload();\n reloading = true;\n return;\n }\n serverSessionId = msg.data.sessionId;\n }\n for (const eventCallback of eventCallbacks){\n eventCallback(msg);\n }\n }\n let timer;\n function handleDisconnect() {\n source.onerror = null;\n source.onclose = null;\n source.close();\n reconnections++;\n // After 25 reconnects we'll want to reload the page as it indicates the dev server is no longer running.\n if (reconnections > 25) {\n reloading = true;\n window.location.reload();\n return;\n }\n clearTimeout(timer);\n // Try again after 5 seconds\n timer = setTimeout(init, reconnections > 5 ? 5000 : 1000);\n }\n const url = (0, _getsocketurl.getSocketUrl)(options.assetPrefix);\n source = new window.WebSocket(\"\" + url + options.path);\n source.onopen = handleOnline;\n source.onerror = handleDisconnect;\n source.onclose = handleDisconnect;\n source.onmessage = handleMessage;\n }\n init();\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=websocket.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9jb21wb25lbnRzL3JlYWN0LWRldi1vdmVybGF5L3BhZ2VzL3dlYnNvY2tldC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7SUFZZ0JBLGtCQUFrQjtlQUFsQkE7O0lBYUFDLFVBQVU7ZUFBVkE7O0lBVEFDLFdBQVc7ZUFBWEE7Ozs4Q0FiVDswQ0FDc0I7QUFFN0IsSUFBSUM7QUFJSixNQUFNQyxpQkFBd0MsRUFBRTtBQUV6QyxTQUFTSixtQkFBbUJLLFFBQXdCO0lBQ3pERCxlQUFlRSxJQUFJLENBQUNEO0FBQ3RCO0FBRU8sU0FBU0gsWUFBWUssSUFBWTtJQUN0QyxJQUFJLENBQUNKLFVBQVVBLE9BQU9LLFVBQVUsS0FBS0wsT0FBT00sSUFBSSxFQUFFO0lBQ2xELE9BQU9OLE9BQU9PLElBQUksQ0FBQ0g7QUFDckI7QUFFQSxJQUFJSSxnQkFBZ0I7QUFDcEIsSUFBSUMsWUFBWTtBQUNoQixJQUFJQyxrQkFBaUM7QUFFOUIsU0FBU1osV0FBV2EsT0FBOEM7SUFDdkUsU0FBU0M7UUFDUCxJQUFJWixRQUFRQSxPQUFPYSxLQUFLO1FBRXhCLFNBQVNDO1lBQ1BOLGdCQUFnQjtZQUNoQk8sT0FBT0MsT0FBTyxDQUFDQyxHQUFHLENBQUM7UUFDckI7UUFFQSxTQUFTQyxjQUFjQyxLQUEyQjtZQUNoRCxtRUFBbUU7WUFDbkUsa0ZBQWtGO1lBQ2xGLElBQUlWLFdBQVc7Z0JBQ2I7WUFDRjtZQUVBLHNEQUFzRDtZQUN0RCxNQU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iIsInNlbmQiLCJyZWNvbm5lY3Rpb25zIiwicmVsb2FkaW5nIiwic2VydmVyU2Vzc2lvbklkIiwib3B0aW9ucyIsImluaXQiLCJjbG9zZSIsImhhbmRsZU9ubGluZSIsIndpbmRvdyIsImNvbnNvbGUiLCJsb2ciLCJoYW5kbGVNZXNzYWdlIiwiZXZlbnQiLCJtc2ciLCJKU09OIiwicGFyc2UiLCJhY3Rpb24iLCJITVJfQUNUSU9OU19TRU5UX1RPX0JST1dTRVIiLCJUVVJCT1BBQ0tfQ09OTkVDVEVEIiwic2Vzc2lvbklkIiwibG9jYXRpb24iLCJyZWxvYWQiLCJldmVudENhbGxiYWNrIiwidGltZXIiLCJoYW5kbGVEaXNjb25uZWN0Iiwib25lcnJvciIsIm9uY2xvc2UiLCJjbGVhclRpbWVvdXQiLCJzZXRUaW1lb3V0IiwidXJsIiwiZ2V0U29ja2V0VXJsIiwiYXNzZXRQcmVmaXgiLCJXZWJTb2NrZXQiLCJwYXRoIiwib25vcGVuIiwib25tZXNzYWdlIl0sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/components/react-dev-overlay/pages/websocket.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/detect-domain-locale.js": +/*!***************************************************************!*\ + !*** ./node_modules/next/dist/client/detect-domain-locale.js ***! + \***************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"detectDomainLocale\", ({\n enumerable: true,\n get: function() {\n return detectDomainLocale;\n }\n}));\nconst detectDomainLocale = function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n if (false) {}\n};\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=detect-domain-locale.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXRlY3QtZG9tYWluLWxvY2FsZS5qcyIsIm1hcHBpbmdzIjoiOzs7O3NEQUVhQTs7O2VBQUFBOzs7QUFBTixNQUFNQSxxQkFBZ0M7cUNBQUlDLE9BQUFBLElBQUFBLE1BQUFBLE9BQUFBLE9BQUFBLEdBQUFBLE9BQUFBLE1BQUFBLE9BQUFBO1FBQUFBLElBQUFBLENBQUFBLEtBQUFBLEdBQUFBLFNBQUFBLENBQUFBLEtBQUFBOztJQUMvQyxJQUFJQyxLQUErQixFQUFFLEVBSXBDO0FBQ0giLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL09wZW5DbGF3L3NyYy9jbGllbnQvZGV0ZWN0LWRvbWFpbi1sb2NhbGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBkZXRlY3REb21haW5Mb2NhbGUgYXMgRm4gfSBmcm9tICcuLi9zaGFyZWQvbGliL2kxOG4vZGV0ZWN0LWRvbWFpbi1sb2NhbGUnXG5cbmV4cG9ydCBjb25zdCBkZXRlY3REb21haW5Mb2NhbGU6IHR5cGVvZiBGbiA9ICguLi5hcmdzKSA9PiB7XG4gIGlmIChwcm9jZXNzLmVudi5fX05FWFRfSTE4Tl9TVVBQT1JUKSB7XG4gICAgcmV0dXJuIHJlcXVpcmUoJy4uL3NoYXJlZC9saWIvaTE4bi9kZXRlY3QtZG9tYWluLWxvY2FsZScpLmRldGVjdERvbWFpbkxvY2FsZShcbiAgICAgIC4uLmFyZ3NcbiAgICApXG4gIH1cbn1cbiJdLCJuYW1lcyI6WyJkZXRlY3REb21haW5Mb2NhbGUiLCJhcmdzIiwicHJvY2VzcyIsImVudiIsIl9fTkVYVF9JMThOX1NVUFBPUlQiLCJyZXF1aXJlIl0sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/detect-domain-locale.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/dev/amp-dev.js": +/*!******************************************************!*\ + !*** ./node_modules/next/dist/client/dev/amp-dev.js ***! + \******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("/* globals __webpack_hash__ */ \nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nconst _interop_require_default = __webpack_require__(/*! @swc/helpers/_/_interop_require_default */ \"./node_modules/@swc/helpers/esm/_interop_require_default.js\");\nconst _fouc = __webpack_require__(/*! ./fouc */ \"./node_modules/next/dist/client/dev/fouc.js\");\nconst _ondemandentriesclient = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! ./on-demand-entries-client */ \"./node_modules/next/dist/client/dev/on-demand-entries-client.js\"));\nconst _websocket = __webpack_require__(/*! ../components/react-dev-overlay/pages/websocket */ \"./node_modules/next/dist/client/components/react-dev-overlay/pages/websocket.js\");\nconst _hotreloadertypes = __webpack_require__(/*! ../../server/dev/hot-reloader-types */ \"./node_modules/next/dist/server/dev/hot-reloader-types.js\");\nconst data = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);\nwindow.__NEXT_DATA__ = data;\nlet { assetPrefix, page } = data;\nassetPrefix = assetPrefix || '';\nlet mostRecentHash = null;\n/* eslint-disable-next-line */ let curHash = __webpack_require__.h();\nconst hotUpdatePath = assetPrefix + (assetPrefix.endsWith('/') ? '' : '/') + '_next/static/webpack/';\n// Is there a newer version of this code available?\nfunction isUpdateAvailable() {\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n /* eslint-disable-next-line */ return mostRecentHash !== __webpack_require__.h();\n}\n// Webpack disallows updates in other states.\nfunction canApplyUpdates() {\n // @ts-expect-error TODO: module.hot exists but type needs to be added. Can't use `as any` here as webpack parses for `module.hot` calls.\n return module.hot.status() === 'idle';\n}\n// This function reads code updates on the fly and hard\n// reloads the page when it has changed.\nasync function tryApplyUpdates() {\n if (!isUpdateAvailable() || !canApplyUpdates()) {\n return;\n }\n try {\n const res = await fetch(typeof __webpack_require__.j !== 'undefined' ? \"\" + hotUpdatePath + curHash + \".\" + __webpack_require__.j + \".hot-update.json\" : \"\" + hotUpdatePath + curHash + \".hot-update.json\");\n const jsonData = await res.json();\n const curPage = page === '/' ? 'index' : page;\n // webpack 5 uses an array instead\n const pageUpdated = (Array.isArray(jsonData.c) ? jsonData.c : Object.keys(jsonData.c)).some((mod)=>{\n return mod.indexOf(\"pages\" + (curPage.startsWith('/') ? curPage : \"/\" + curPage)) !== -1 || mod.indexOf((\"pages\" + (curPage.startsWith('/') ? curPage : \"/\" + curPage)).replace(/\\//g, '\\\\')) !== -1;\n });\n if (pageUpdated) {\n window.location.reload();\n } else {\n curHash = mostRecentHash;\n }\n } catch (err) {\n console.error('Error occurred checking for update', err);\n window.location.reload();\n }\n}\n(0, _websocket.addMessageListener)((message)=>{\n if (!('action' in message)) {\n return;\n }\n try {\n // actions which are not related to amp-dev\n if (message.action === _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ERROR || message.action === _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.DEV_PAGES_MANIFEST_UPDATE) {\n return;\n }\n if (message.action === _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.SYNC || message.action === _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.BUILT) {\n if (!message.hash) {\n return;\n }\n mostRecentHash = message.hash;\n tryApplyUpdates();\n } else if (message.action === _hotreloadertypes.HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE) {\n window.location.reload();\n }\n } catch (err) {\n var _err_stack;\n console.warn('[HMR] Invalid message: ' + JSON.stringify(message) + '\\n' + ((_err_stack = err == null ? void 0 : err.stack) != null ? _err_stack : ''));\n }\n});\n(0, _websocket.connectHMR)({\n assetPrefix,\n path: '/_next/webpack-hmr'\n});\n(0, _fouc.displayContent)();\n(0, _ondemandentriesclient.default)(data.page);\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=amp-dev.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvYW1wLWRldi5qcyIsIm1hcHBpbmdzIjoiQUFBQSw0QkFBNEI7Ozs7O2tDQUNHOzRGQUNDO3VDQUl6Qjs4Q0FDcUM7QUFNNUMsTUFBTUEsT0FBT0MsS0FBS0MsS0FBSyxDQUNwQkMsU0FBU0MsY0FBYyxDQUFDLGlCQUF5QkMsV0FBVztBQUUvREMsT0FBT0MsYUFBYSxHQUFHUDtBQUV2QixJQUFJLEVBQUVRLFdBQVcsRUFBRUMsSUFBSSxFQUFFLEdBQUdUO0FBQzVCUSxjQUFjQSxlQUFlO0FBQzdCLElBQUlFLGlCQUFnQztBQUNwQyw0QkFBNEIsR0FDNUIsSUFBSUMsVUFBVUMsdUJBQWdCQTtBQUM5QixNQUFNQyxnQkFDSkwsY0FBZUEsQ0FBQUEsWUFBWU0sUUFBUSxDQUFDLE9BQU8sS0FBSyxJQUFFLEdB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ZCIsInRleHRDb250ZW50Iiwid2luZG93IiwiX19ORVhUX0RBVEFfXyIsImFzc2V0UHJlZml4IiwicGFnZSIsIm1vc3RSZWNlbnRIYXNoIiwiY3VySGFzaCIsIl9fd2VicGFja19oYXNoX18iLCJob3RVcGRhdGVQYXRoIiwiZW5kc1dpdGgiLCJpc1VwZGF0ZUF2YWlsYWJsZSIsImNhbkFwcGx5VXBkYXRlcyIsIm1vZHVsZSIsImhvdCIsInN0YXR1cyIsInRyeUFwcGx5VXBkYXRlcyIsInJlcyIsImZldGNoIiwiX193ZWJwYWNrX3J1bnRpbWVfaWRfXyIsImpzb25EYXRhIiwianNvbiIsImN1clBhZ2UiLCJwYWdlVXBkYXRlZCIsIkFycmF5IiwiaXNBcnJheSIsImMiLCJPYmplY3QiLCJrZXlzIiwic29tZSIsIm1vZCIsImluZGV4T2YiLCJzdGFydHNXaXRoIiwicmVwbGFjZSIsImxvY2F0aW9uIiwicmVsb2FkIiwiZXJyIiwiY29uc29sZSIsImVycm9yIiwiYWRkTWVzc2FnZUxpc3RlbmVyIiwibWVzc2FnZSIsImFjdGlvbiIsIkhNUl9BQ1RJT05TX1NFTlRfVE9fQlJPV1NFUiIsIlNFUlZFUl9FUlJPUiIsIkRFVl9QQUdFU19NQU5JRkVTVF9VUERBVEUiLCJTWU5DIiwiQlVJTFQiLCJoYXNoIiwiUkVMT0FEX1BBR0UiLCJ3YXJuIiwic3RyaW5naWZ5Iiwic3RhY2siLCJjb25uZWN0SE1SIiwicGF0aCIsImRpc3BsYXlDb250ZW50IiwiaW5pdE9uRGVtYW5kRW50cmllcyJdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/amp-dev.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/dev/fouc.js": +/*!***************************************************!*\ + !*** ./node_modules/next/dist/client/dev/fouc.js ***! + \***************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("// This wrapper function is used to safely select the best available function\n// to schedule removal of the no-FOUC styles workaround. requestAnimationFrame\n// is the ideal choice, but when used in iframes, there are no guarantees that\n// the callback will actually be called, which could stall the promise returned\n// from displayContent.\n//\n// See: https://www.vector-logic.com/blog/posts/on-request-animation-frame-and-embedded-iframes\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"displayContent\", ({\n enumerable: true,\n get: function() {\n return displayContent;\n }\n}));\nconst safeCallbackQueue = (callback)=>{\n if (window.requestAnimationFrame && window.self === window.top) {\n window.requestAnimationFrame(callback);\n } else {\n window.setTimeout(callback);\n }\n};\nfunction displayContent() {\n return new Promise((resolve)=>{\n safeCallbackQueue(function() {\n for(var x = document.querySelectorAll('[data-next-hide-fouc]'), i = x.length; i--;){\n x[i].parentNode.removeChild(x[i]);\n }\n resolve();\n });\n });\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=fouc.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvZm91Yy5qcyIsIm1hcHBpbmdzIjoiQUFBQSw2RUFBNkU7QUFDN0UsOEVBQThFO0FBQzlFLDhFQUE4RTtBQUM5RSwrRUFBK0U7QUFDL0UsdUJBQXVCO0FBQ3ZCLEVBQUU7QUFDRiwrRkFBK0Y7Ozs7O2tEQVkvRUE7OztlQUFBQTs7O0FBWGhCLE1BQU1DLG9CQUFvQixDQUFDQztJQUN6QixJQUF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xuXG4gICAgICApIHtcbiAgICAgICAgeFtpXS5wYXJlbnROb2RlIS5yZW1vdmVDaGlsZCh4W2ldKVxuICAgICAgfVxuICAgICAgcmVzb2x2ZSgpXG4gICAgfSlcbiAgfSlcbn1cbiJdLCJuYW1lcyI6WyJkaXNwbGF5Q29udGVudCIsInNhZmVDYWxsYmFja1F1ZXVlIiwiY2FsbGJhY2siLCJ3aW5kb3ciLCJyZXF1ZXN0QW5pbWF0aW9uRnJhbWUiLCJzZWxmIiwidG9wIiwic2V0VGltZW91dCIsIlByb21pc2UiLCJyZXNvbHZlIiwieCIsImRvY3VtZW50IiwicXVlcnlTZWxlY3RvckFsbCIsImkiLCJsZW5ndGgiLCJwYXJlbnROb2RlIiwicmVtb3ZlQ2hpbGQiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/fouc.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/dev/on-demand-entries-client.js": +/*!***********************************************************************!*\ + !*** ./node_modules/next/dist/client/dev/on-demand-entries-client.js ***! + \***********************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"default\", ({\n enumerable: true,\n get: function() {\n return _default;\n }\n}));\nconst _interop_require_default = __webpack_require__(/*! @swc/helpers/_/_interop_require_default */ \"./node_modules/@swc/helpers/esm/_interop_require_default.js\");\nconst _router = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! ../router */ \"./node_modules/next/dist/client/router.js\"));\nconst _websocket = __webpack_require__(/*! ../components/react-dev-overlay/pages/websocket */ \"./node_modules/next/dist/client/components/react-dev-overlay/pages/websocket.js\");\nconst _default = async (page)=>{\n if (page) {\n // in AMP the router isn't initialized on the client and\n // client-transitions don't occur so ping initial page\n setInterval(()=>{\n (0, _websocket.sendMessage)(JSON.stringify({\n event: 'ping',\n page\n }));\n }, 2500);\n } else {\n _router.default.ready(()=>{\n setInterval(()=>{\n // when notFound: true is returned we should use the notFoundPage\n // as the Router.pathname will point to the 404 page but we want\n // to ping the source page that returned notFound: true instead\n const notFoundSrcPage = self.__NEXT_DATA__.notFoundSrcPage;\n const pathname = (_router.default.pathname === '/404' || _router.default.pathname === '/_error') && notFoundSrcPage ? notFoundSrcPage : _router.default.pathname;\n (0, _websocket.sendMessage)(JSON.stringify({\n event: 'ping',\n page: pathname\n }));\n }, 2500);\n });\n }\n};\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=on-demand-entries-client.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9kZXYvb24tZGVtYW5kLWVudHJpZXMtY2xpZW50LmpzIiwibWFwcGluZ3MiOiI7Ozs7MkNBR0E7OztlQUFBOzs7OzZFQUhtQjt1Q0FDUztNQUU1QixXQUFlLE9BQU9BO0lBQ3BCLElBQUlBLE1BQU07UUFDUix3REFBd0Q7UUFDeEQsc0RBQXNEO1FBQ3REQyxZQUFZO1lBQ1ZDLENBQUFBLEdBQUFBLFdBQUFBLFdBQUFBLEVBQVlDLEtBQUtDLFNBQVMsQ0FBQztnQkFBRUMsT0FBTztnQkFBUUw7WUFBSztRQUNuRCxHQUFHO0lBQ0wsT0FBTztRQUNMTSxRQUFBQSxPQUFNLENBQUNDLEtBQUssQ0FBQztZQUNYTixZQUFZO2dCQUNWLGlFQUFpRTtnQkFDakUsZ0VBQW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vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/dev/on-demand-entries-client.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/has-base-path.js": +/*!********************************************************!*\ + !*** ./node_modules/next/dist/client/has-base-path.js ***! + \********************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"hasBasePath\", ({\n enumerable: true,\n get: function() {\n return hasBasePath;\n }\n}));\nconst _pathhasprefix = __webpack_require__(/*! ../shared/lib/router/utils/path-has-prefix */ \"./node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js\");\nconst basePath = false || '';\nfunction hasBasePath(path) {\n return (0, _pathhasprefix.pathHasPrefix)(path, basePath);\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=has-base-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9oYXMtYmFzZS1wYXRoLmpzIiwibWFwcGluZ3MiOiI7Ozs7K0NBSWdCQTs7O2VBQUFBOzs7MkNBSmM7QUFFOUIsTUFBTUMsV0FBWUMsTUFBa0MsSUFBZTtBQUU1RCxTQUFTRixZQUFZSyxJQUFZO0lBQ3RDLE9BQU9DLENBQUFBLEdBQUFBLGVBQUFBLGFBQUFBLEVBQWNELE1BQU1KO0FBQzdCIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9zcmMvY2xpZW50L2hhcy1iYXNlLXBhdGgudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcGF0aEhhc1ByZWZpeCB9IGZyb20gJy4uL3NoYXJlZC9saWIvcm91dGVyL3V0aWxzL3BhdGgtaGFzLXByZWZpeCdcblxuY29uc3QgYmFzZVBhdGggPSAocHJvY2Vzcy5lbnYuX19ORVhUX1JPVVRFUl9CQVNFUEFUSCBhcyBzdHJpbmcpIHx8ICcnXG5cbmV4cG9ydCBmdW5jdGlvbiBoYXNCYXNlUGF0aChwYXRoOiBzdHJpbmcpOiBib29sZWFuIHtcbiAgcmV0dXJuIHBhdGhIYXNQcmVmaXgocGF0aCwgYmFzZVBhdGgpXG59XG4iXSwibmFtZXMiOlsiaGFzQmFzZVBhdGgiLCJiYXNlUGF0aCIsInByb2Nlc3MiLCJlbnYiLCJfX05FWFRfUk9VVEVSX0JBU0VQQVRIIiwicGF0aCIsInBhdGhIYXNQcmVmaXgiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/has-base-path.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/normalize-trailing-slash.js": +/*!*******************************************************************!*\ + !*** ./node_modules/next/dist/client/normalize-trailing-slash.js ***! + \*******************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"normalizePathTrailingSlash\", ({\n enumerable: true,\n get: function() {\n return normalizePathTrailingSlash;\n }\n}));\nconst _removetrailingslash = __webpack_require__(/*! ../shared/lib/router/utils/remove-trailing-slash */ \"./node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js\");\nconst _parsepath = __webpack_require__(/*! ../shared/lib/router/utils/parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nconst normalizePathTrailingSlash = (path)=>{\n if (!path.startsWith('/') || undefined) {\n return path;\n }\n const { pathname, query, hash } = (0, _parsepath.parsePath)(path);\n if (false) {}\n return \"\" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;\n};\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=normalize-trailing-slash.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9ub3JtYWxpemUtdHJhaWxpbmctc2xhc2guanMiLCJtYXBwaW5ncyI6Ijs7Ozs4REFPYUE7OztlQUFBQTs7O2lEQVB1Qjt1Q0FDVjtBQU1uQixNQUFNQSw2QkFBNkIsQ0FBQ0M7SUFDekMsSUFBSSxDQUFDQSxLQUFLQyxVQUFVLENBQUMsUUFBUUMsU0FBd0MsRUFBRTtRQUNyRSxPQUFPRjtJQUNUO0lBRUEsTUFBTSxFQUFFSyxRQUFRLEVBQUVDLEtBQUssRUFBRUMsSUFBSSxFQUFFLEdBQUdDLENBQUFBLEdBQUFBLFdBQUFBLFNBQUFBLEVBQVVSO0lBQzVDLElBQUlFLEtBQWlDLEVBQUUsRUFRdEM7SUFFRCxPQUFRLEtBQUVTLENBQUFBLEdBQUFBLHFCQUFBQSxtQkFBQUEsRUFBb0JOLFlBQVlDLFFBQVFDO0FBQ3BEIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2x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ICAgICAgcmV0dXJuIGAke3BhdGhuYW1lfS8ke3F1ZXJ5fSR7aGFzaH1gXG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIGAke3JlbW92ZVRyYWlsaW5nU2xhc2gocGF0aG5hbWUpfSR7cXVlcnl9JHtoYXNofWBcbn1cbiJdLCJuYW1lcyI6WyJub3JtYWxpemVQYXRoVHJhaWxpbmdTbGFzaCIsInBhdGgiLCJzdGFydHNXaXRoIiwicHJvY2VzcyIsImVudiIsIl9fTkVYVF9NQU5VQUxfVFJBSUxJTkdfU0xBU0giLCJwYXRobmFtZSIsInF1ZXJ5IiwiaGFzaCIsInBhcnNlUGF0aCIsIl9fTkVYVF9UUkFJTElOR19TTEFTSCIsInRlc3QiLCJyZW1vdmVUcmFpbGluZ1NsYXNoIiwiZW5kc1dpdGgiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/normalize-trailing-slash.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/remove-base-path.js": +/*!***********************************************************!*\ + !*** ./node_modules/next/dist/client/remove-base-path.js ***! + \***********************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"removeBasePath\", ({\n enumerable: true,\n get: function() {\n return removeBasePath;\n }\n}));\nconst _hasbasepath = __webpack_require__(/*! ./has-base-path */ \"./node_modules/next/dist/client/has-base-path.js\");\nconst basePath = false || '';\nfunction removeBasePath(path) {\n if (false) {}\n // Can't trim the basePath if it has zero length!\n if (basePath.length === 0) return path;\n path = path.slice(basePath.length);\n if (!path.startsWith('/')) path = \"/\" + path;\n return path;\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=remove-base-path.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yZW1vdmUtYmFzZS1wYXRoLmpzIiwibWFwcGluZ3MiOiI7Ozs7a0RBSWdCQTs7O2VBQUFBOzs7eUNBSlk7QUFFNUIsTUFBTUMsV0FBWUMsTUFBa0MsSUFBZTtBQUU1RCxTQUFTRixlQUFlSyxJQUFZO0lBQ3pDLElBQUlILEtBQTBDLEVBQUUsRUFJL0M7SUFFRCxpREFBaUQ7SUFDakQsSUFBSUQsU0FBU08sTUFBTSxLQUFLLEdBQUcsT0FBT0g7SUFFbENBLE9BQU9BLEtBQUtJLEtBQUssQ0FBQ1IsU0FBU08sTUFBTTtJQUNqQyxJQUFJLENBQUNILEtBQUtLLFVBQVUsQ0FBQyxNQUFNTCxPQUFRLE1BQUdBO0lBQ3RDLE9BQU9BO0FBQ1QiLCJzb3VyY2VzIjpbIi9Vc2Vycy9tYXR0YnJ1Y2UvRG9jdW1lbnRzL1Byb2plY3RzL09wZW5DbGF3L3NyYy9jbGllbnQvcmVtb3ZlLWJhc2UtcGF0aC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBoYXNCYXNlUGF0aCB9IGZyb20gJy4vaGFzLWJhc2UtcGF0aCdcblxuY29uc3QgYmFzZVBhdGggPSAocHJvY2Vzcy5lbnYuX19ORVhUX1JPVVRFUl9CQVNFUEFUSCBhcyBzdHJpbmcpIHx8ICcnXG5cbmV4cG9ydCBmdW5jdGlvbiByZW1vdmVCYXNlUGF0aChwYXRoOiBzdHJpbmcpOiBzdHJpbmcge1xuICBpZiAocHJvY2Vzcy5lbnYuX19ORVhUX01BTlVBTF9DTElFTlRfQkFTRV9QQVRIKSB7XG4gICAgaWYgKCFoYXNCYXNlUGF0aChwYXRoKSkge1xuICAgICAgcmV0dXJuIHBhdGhcbiAgICB9XG4gIH1cblxuICAvLyBDYW4ndCB0cmltIHRoZSBiYXNlUGF0aCBpZiBpdCBoYXMgemVybyBsZW5ndGghXG4gIGlmIChiYXNlUGF0aC5sZW5ndGggPT09IDApIHJldHVybiBwYXRoXG5cbiAgcGF0aCA9IHBhdGguc2xpY2UoYmFzZVBhdGgubGVuZ3RoKVxuICBpZiAoIXBhdGguc3RhcnRzV2l0aCgnLycpKSBwYXRoID0gYC8ke3BhdGh9YFxuICByZXR1cm4gcGF0aFxufVxuIl0sIm5hbWVzIjpbInJlbW92ZUJhc2VQYXRoIiwiYmFzZVBhdGgiLCJwcm9jZXNzIiwiZW52IiwiX19ORVhUX1JPVVRFUl9CQVNFUEFUSCIsInBhdGgiLCJfX05FWFRfTUFOVUFMX0NMSUVOVF9CQVNFX1BBVEgiLCJoYXNCYXNlUGF0aCIsImxlbmd0aCIsInNsaWNlIiwic3RhcnRzV2l0aCJdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/remove-base-path.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/remove-locale.js": +/*!********************************************************!*\ + !*** ./node_modules/next/dist/client/remove-locale.js ***! + \********************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"removeLocale\", ({\n enumerable: true,\n get: function() {\n return removeLocale;\n }\n}));\nconst _parsepath = __webpack_require__(/*! ../shared/lib/router/utils/parse-path */ \"./node_modules/next/dist/shared/lib/router/utils/parse-path.js\");\nfunction removeLocale(path, locale) {\n if (false) {}\n return path;\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=remove-locale.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yZW1vdmUtbG9jYWxlLmpzIiwibWFwcGluZ3MiOiI7Ozs7Z0RBRWdCQTs7O2VBQUFBOzs7dUNBRlU7QUFFbkIsU0FBU0EsYUFBYUMsSUFBWSxFQUFFQyxNQUFlO0lBQ3hELElBQUlDLEtBQStCLEVBQUUsRUFZcEM7SUFDRCxPQUFPRjtBQUNUIiwic291cmNlcyI6WyIvVXNlcnMvbWF0dGJydWNlL0RvY3VtZW50cy9Qcm9qZWN0cy9PcGVuQ2xhdy9zcmMvY2xpZW50L3JlbW92ZS1sb2NhbGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcGFyc2VQYXRoIH0gZnJvbSAnLi4vc2hhcmVkL2xpYi9yb3V0ZXIvdXRpbHMvcGFyc2UtcGF0aCdcblxuZXhwb3J0IGZ1bmN0aW9uIHJlbW92ZUxvY2FsZShwYXRoOiBzdHJpbmcsIGxvY2FsZT86IHN0cmluZykge1xuICBpZiAocHJvY2Vzcy5lbnYuX19ORVhUX0kxOE5fU1VQUE9SVCkge1xuICAgIGNvbnN0IHsgcGF0aG5hbWUgfSA9IHBhcnNlUGF0aChwYXRoKVxuICAgIGNvbnN0IHBhdGhMb3dlciA9IHBhdGhuYW1lLnRvTG93ZXJDYXNlKClcbiAgICBjb25zdCBsb2NhbGVMb3dlciA9IGxvY2FsZT8udG9Mb3dlckNhc2UoKVxuXG4gICAgcmV0dXJuIGxvY2FsZSAmJlxuICAgICAgKHBhdGhMb3dlci5zdGFydHNXaXRoKGAvJHtsb2NhbGVMb3dlcn0vYCkgfHxcbiAgICAgICAgcGF0aExvd2VyID09PSBgLyR7bG9jYWxlTG93ZXJ9YClcbiAgICAgID8gYCR7cGF0aG5hbWUubGVuZ3RoID09PSBsb2NhbGUubGVuZ3RoICsgMSA/IGAvYCA6IGBgfSR7cGF0aC5zbGljZShcbiAgICAgICAgICBsb2NhbGUubGVuZ3RoICsgMVxuICAgICAgICApfWBcbiAgICAgIDogcGF0aFxuICB9XG4gIHJldHVybiBwYXRoXG59XG4iXSwibmFtZXMiOlsicmVtb3ZlTG9jYWxlIiwicGF0aCIsImxvY2FsZSIsInByb2Nlc3MiLCJlbnYiLCJfX05FWFRfSTE4Tl9TVVBQT1JUIiwicGF0aG5hbWUiLCJwYXJzZVBhdGgiLCJwYXRoTG93ZXIiLCJ0b0xvd2VyQ2FzZSIsImxvY2FsZUxvd2VyIiwic3RhcnRzV2l0aCIsImxlbmd0aCIsInNsaWNlIl0sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/remove-locale.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/request-idle-callback.js": +/*!****************************************************************!*\ + !*** ./node_modules/next/dist/client/request-idle-callback.js ***! + \****************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && (0);\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n cancelIdleCallback: function() {\n return cancelIdleCallback;\n },\n requestIdleCallback: function() {\n return requestIdleCallback;\n }\n});\nconst requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {\n let start = Date.now();\n return self.setTimeout(function() {\n cb({\n didTimeout: false,\n timeRemaining: function() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n });\n }, 1);\n};\nconst cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {\n return clearTimeout(id);\n};\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=request-idle-callback.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yZXF1ZXN0LWlkbGUtY2FsbGJhY2suanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0lBZ0JhQSxrQkFBa0I7ZUFBbEJBOztJQWhCQUMsbUJBQW1CO2VBQW5CQTs7O0FBQU4sTUFBTUEsc0JBQ1YsT0FBT0MsU0FBUyxlQUNmQSxLQUFLRCxtQkFBbUIsSUFDeEJDLEtBQUtELG1CQUFtQixDQUFDRSxJQUFJLENBQUNDLFdBQ2hDLFNBQVVDLEVBQXVCO0lBQy9CLElBQUlDLFFBQVFDLEtBQUtDLEdBQUc7SUFDcEIsT0FBT04sS0FBS08sVUFBVSxDQUFDO1FBQ3JCSixHQUFHO1lBQ0RLLFlBQVk7WUFDWkMsZUFBZTtnQkFDYixPQUFPQyxLQUFLQyxHQUFHLENBQUMsR0FBRyxLQUFNTixDQUFBQSxLQUFLQyxHQUFHLEtBQUtGLEtBQUFBLENBQUk7WUFDNUM7UUFDRjtJQUNGLEdBQUc7QUFDTDtBQUVLLE1BQU1OLHFCQUNWLE9BQU9FLFNBQVM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xuICBmdW5jdGlvbiAoaWQ6IG51bWJlcikge1xuICAgIHJldHVybiBjbGVhclRpbWVvdXQoaWQpXG4gIH1cbiJdLCJuYW1lcyI6WyJjYW5jZWxJZGxlQ2FsbGJhY2siLCJyZXF1ZXN0SWRsZUNhbGxiYWNrIiwic2VsZiIsImJpbmQiLCJ3aW5kb3ciLCJjYiIsInN0YXJ0IiwiRGF0ZSIsIm5vdyIsInNldFRpbWVvdXQiLCJkaWRUaW1lb3V0IiwidGltZVJlbWFpbmluZyIsIk1hdGgiLCJtYXgiLCJpZCIsImNsZWFyVGltZW91dCJdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/request-idle-callback.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/resolve-href.js": +/*!*******************************************************!*\ + !*** ./node_modules/next/dist/client/resolve-href.js ***! + \*******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nObject.defineProperty(exports, \"resolveHref\", ({\n enumerable: true,\n get: function() {\n return resolveHref;\n }\n}));\nconst _querystring = __webpack_require__(/*! ../shared/lib/router/utils/querystring */ \"./node_modules/next/dist/shared/lib/router/utils/querystring.js\");\nconst _formaturl = __webpack_require__(/*! ../shared/lib/router/utils/format-url */ \"./node_modules/next/dist/shared/lib/router/utils/format-url.js\");\nconst _omit = __webpack_require__(/*! ../shared/lib/router/utils/omit */ \"./node_modules/next/dist/shared/lib/router/utils/omit.js\");\nconst _utils = __webpack_require__(/*! ../shared/lib/utils */ \"./node_modules/next/dist/shared/lib/utils.js\");\nconst _normalizetrailingslash = __webpack_require__(/*! ./normalize-trailing-slash */ \"./node_modules/next/dist/client/normalize-trailing-slash.js\");\nconst _islocalurl = __webpack_require__(/*! ../shared/lib/router/utils/is-local-url */ \"./node_modules/next/dist/shared/lib/router/utils/is-local-url.js\");\nconst _utils1 = __webpack_require__(/*! ../shared/lib/router/utils */ \"./node_modules/next/dist/shared/lib/router/utils/index.js\");\nconst _interpolateas = __webpack_require__(/*! ../shared/lib/router/utils/interpolate-as */ \"./node_modules/next/dist/shared/lib/router/utils/interpolate-as.js\");\nfunction resolveHref(router, href, resolveAs) {\n // we use a dummy base url for relative urls\n let base;\n let urlAsString = typeof href === 'string' ? href : (0, _formaturl.formatWithValidation)(href);\n // repeated slashes and backslashes in the URL are considered\n // invalid and will never match a Next.js page/file\n const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\\/\\//);\n const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;\n const urlParts = urlAsStringNoProto.split('?', 1);\n if ((urlParts[0] || '').match(/(\\/\\/|\\\\)/)) {\n console.error(\"Invalid href '\" + urlAsString + \"' passed to next/router in page: '\" + router.pathname + \"'. Repeated forward-slashes (//) or backslashes \\\\ are not valid in the href.\");\n const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);\n urlAsString = (urlProtoMatch ? urlProtoMatch[0] : '') + normalizedUrl;\n }\n // Return because it cannot be routed by the Next.js router\n if (!(0, _islocalurl.isLocalURL)(urlAsString)) {\n return resolveAs ? [\n urlAsString\n ] : urlAsString;\n }\n try {\n base = new URL(urlAsString.startsWith('#') ? router.asPath : router.pathname, 'http://n');\n } catch (_) {\n // fallback to / for invalid asPath values e.g. //\n base = new URL('/', 'http://n');\n }\n try {\n const finalUrl = new URL(urlAsString, base);\n finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);\n let interpolatedAs = '';\n if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {\n const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);\n const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);\n if (result) {\n interpolatedAs = (0, _formaturl.formatWithValidation)({\n pathname: result,\n hash: finalUrl.hash,\n query: (0, _omit.omit)(query, params)\n });\n }\n }\n // if the origin didn't change, it means we received a relative href\n const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;\n return resolveAs ? [\n resolvedHref,\n interpolatedAs || resolvedHref\n ] : resolvedHref;\n } catch (_) {\n return resolveAs ? [\n urlAsString\n ] : urlAsString;\n }\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=resolve-href.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yZXNvbHZlLWhyZWYuanMiLCJtYXBwaW5ncyI6Ijs7OzsrQ0F5QmdCQTs7O2VBQUFBOzs7eUNBdkJ1Qjt1Q0FDRjtrQ0FDaEI7bUNBQ29CO29EQUNFO3dDQUNoQjtvQ0FDSTsyQ0FDRDtBQWdCdkIsU0FBU0EsWUFDZEMsTUFBa0IsRUFDbEJDLElBQVMsRUFDVEMsU0FBbUI7SUFFbkIsNENBQTRDO0lBQzVDLElBQUlDO0lBQ0osSUFBSUMsY0FBYyxPQUFPSCxTQUFTLFdBQVdBLE9BQU9JLENBQUFBLEdBQUFBLFdBQUFBLG9CQUFBQSxFQUFxQko7SUFFekUsNkRBQTZEO0lBQzdELG1EQUFtRDtJQUNuRCxNQUFNSyxnQkFBZ0JGLFlBQVlHLEtBQUssQ0FBQztJQUN4QyxNQUFNQyxxQkFBcUJGLGdCQUN2QkYsWUFBWUssS0FBSyxD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JsLm9yaWdpbi5sZW5ndGgpXG4gICAgICAgIDogZmluYWxVcmwuaHJlZlxuXG4gICAgcmV0dXJuIHJlc29sdmVBc1xuICAgICAgPyBbcmVzb2x2ZWRIcmVmLCBpbnRlcnBvbGF0ZWRBcyB8fCByZXNvbHZlZEhyZWZdXG4gICAgICA6IHJlc29sdmVkSHJlZlxuICB9IGNhdGNoIChfKSB7XG4gICAgcmV0dXJuIHJlc29sdmVBcyA/IFt1cmxBc1N0cmluZ10gOiB1cmxBc1N0cmluZ1xuICB9XG59XG4iXSwibmFtZXMiOlsicmVzb2x2ZUhyZWYiLCJyb3V0ZXIiLCJocmVmIiwicmVzb2x2ZUFzIiwiYmFzZSIsInVybEFzU3RyaW5nIiwiZm9ybWF0V2l0aFZhbGlkYXRpb24iLCJ1cmxQcm90b01hdGNoIiwibWF0Y2giLCJ1cmxBc1N0cmluZ05vUHJvdG8iLCJzbGljZSIsImxlbmd0aCIsInVybFBhcnRzIiwic3BsaXQiLCJjb25zb2xlIiwiZXJyb3IiLCJwYXRobmFtZSIsIm5vcm1hbGl6ZWRVcmwiLCJub3JtYWxpemVSZXBlYXRlZFNsYXNoZXMiLCJpc0xvY2FsVVJMIiwiVVJMIiwic3RhcnRzV2l0aCIsImFzUGF0aCIsIl8iLCJmaW5hbFVybCIsIm5vcm1hbGl6ZVBhdGhUcmFpbGluZ1NsYXNoIiwiaW50ZXJwb2xhdGVkQXMiLCJpc0R5bmFtaWNSb3V0ZSIsInNlYXJjaFBhcmFtcyIsInF1ZXJ5Iiwic2VhcmNoUGFyYW1zVG9VcmxRdWVyeSIsInJlc3VsdCIsInBhcmFtcyIsImludGVycG9sYXRlQXMiLCJoYXNoIiwib21pdCIsInJlc29sdmVkSHJlZiIsIm9yaWdpbiJdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/resolve-href.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/route-loader.js": +/*!*******************************************************!*\ + !*** ./node_modules/next/dist/client/route-loader.js ***! + \*******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && (0);\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n createRouteLoader: function() {\n return createRouteLoader;\n },\n getClientBuildManifest: function() {\n return getClientBuildManifest;\n },\n isAssetError: function() {\n return isAssetError;\n },\n markAssetError: function() {\n return markAssetError;\n }\n});\nconst _interop_require_default = __webpack_require__(/*! @swc/helpers/_/_interop_require_default */ \"./node_modules/@swc/helpers/esm/_interop_require_default.js\");\nconst _getassetpathfromroute = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! ../shared/lib/router/utils/get-asset-path-from-route */ \"./node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js\"));\nconst _trustedtypes = __webpack_require__(/*! ./trusted-types */ \"./node_modules/next/dist/client/trusted-types.js\");\nconst _requestidlecallback = __webpack_require__(/*! ./request-idle-callback */ \"./node_modules/next/dist/client/request-idle-callback.js\");\nconst _deploymentid = __webpack_require__(/*! ../build/deployment-id */ \"./node_modules/next/dist/build/deployment-id.js\");\nconst _encodeuripath = __webpack_require__(/*! ../shared/lib/encode-uri-path */ \"./node_modules/next/dist/shared/lib/encode-uri-path.js\");\n// 3.8s was arbitrarily chosen as it's what https://web.dev/interactive\n// considers as \"Good\" time-to-interactive. We must assume something went\n// wrong beyond this point, and then fall-back to a full page transition to\n// show the user something of value.\nconst MS_MAX_IDLE_DELAY = 3800;\nfunction withFuture(key, map, generator) {\n let entry = map.get(key);\n if (entry) {\n if ('future' in entry) {\n return entry.future;\n }\n return Promise.resolve(entry);\n }\n let resolver;\n const prom = new Promise((resolve)=>{\n resolver = resolve;\n });\n map.set(key, {\n resolve: resolver,\n future: prom\n });\n return generator ? generator().then((value)=>{\n resolver(value);\n return value;\n }).catch((err)=>{\n map.delete(key);\n throw err;\n }) : prom;\n}\nconst ASSET_LOAD_ERROR = Symbol('ASSET_LOAD_ERROR');\nfunction markAssetError(err) {\n return Object.defineProperty(err, ASSET_LOAD_ERROR, {});\n}\nfunction isAssetError(err) {\n return err && ASSET_LOAD_ERROR in err;\n}\nfunction hasPrefetch(link) {\n try {\n link = document.createElement('link');\n return(// with relList.support\n !!window.MSInputMethodContext && !!document.documentMode || link.relList.supports('prefetch'));\n } catch (e) {\n return false;\n }\n}\nconst canPrefetch = hasPrefetch();\nconst getAssetQueryString = ()=>{\n return (0, _deploymentid.getDeploymentIdQueryOrEmptyString)();\n};\nfunction prefetchViaDom(href, as, link) {\n return new Promise((resolve, reject)=>{\n const selector = '\\n link[rel=\"prefetch\"][href^=\"' + href + '\"],\\n link[rel=\"preload\"][href^=\"' + href + '\"],\\n script[src^=\"' + href + '\"]';\n if (document.querySelector(selector)) {\n return resolve();\n }\n link = document.createElement('link');\n // The order of property assignment here is intentional:\n if (as) link.as = as;\n link.rel = \"prefetch\";\n link.crossOrigin = undefined;\n link.onload = resolve;\n link.onerror = ()=>reject(markAssetError(new Error(\"Failed to prefetch: \" + href)));\n // `href` should always be last:\n link.href = href;\n document.head.appendChild(link);\n });\n}\nfunction appendScript(src, script) {\n return new Promise((resolve, reject)=>{\n script = document.createElement('script');\n // The order of property assignment here is intentional.\n // 1. Setup success/failure hooks in case the browser synchronously\n // executes when `src` is set.\n script.onload = resolve;\n script.onerror = ()=>reject(markAssetError(new Error(\"Failed to load script: \" + src)));\n // 2. Configure the cross-origin attribute before setting `src` in case the\n // browser begins to fetch.\n script.crossOrigin = undefined;\n // 3. Finally, set the source and inject into the DOM in case the child\n // must be appended for fetching to start.\n script.src = src;\n document.body.appendChild(script);\n });\n}\n// We wait for pages to be built in dev before we start the route transition\n// timeout to prevent an un-necessary hard navigation in development.\nlet devBuildPromise;\n// Resolve a promise that times out after given amount of milliseconds.\nfunction resolvePromiseWithTimeout(p, ms, err) {\n return new Promise((resolve, reject)=>{\n let cancelled = false;\n p.then((r)=>{\n // Resolved, cancel the timeout\n cancelled = true;\n resolve(r);\n }).catch(reject);\n // We wrap these checks separately for better dead-code elimination in\n // production bundles.\n if (true) {\n ;\n (devBuildPromise || Promise.resolve()).then(()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>setTimeout(()=>{\n if (!cancelled) {\n reject(err);\n }\n }, ms));\n });\n }\n if (false) {}\n });\n}\nfunction getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n const onBuildManifest = new Promise((resolve)=>{\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB;\n self.__BUILD_MANIFEST_CB = ()=>{\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}\nfunction getFilesForRoute(assetPrefix, route) {\n if (true) {\n const scriptUrl = assetPrefix + '/_next/static/chunks/pages' + (0, _encodeuripath.encodeURIPath)((0, _getassetpathfromroute.default)(route, '.js')) + getAssetQueryString();\n return Promise.resolve({\n scripts: [\n (0, _trustedtypes.__unsafeCreateTrustedScriptURL)(scriptUrl)\n ],\n // Styles are handled by `style-loader` in development:\n css: []\n });\n }\n return getClientBuildManifest().then((manifest)=>{\n if (!(route in manifest)) {\n throw markAssetError(new Error(\"Failed to lookup route: \" + route));\n }\n const allFiles = manifest[route].map((entry)=>assetPrefix + '/_next/' + (0, _encodeuripath.encodeURIPath)(entry));\n return {\n scripts: allFiles.filter((v)=>v.endsWith('.js')).map((v)=>(0, _trustedtypes.__unsafeCreateTrustedScriptURL)(v) + getAssetQueryString()),\n css: allFiles.filter((v)=>v.endsWith('.css')).map((v)=>v + getAssetQueryString())\n };\n });\n}\nfunction createRouteLoader(assetPrefix) {\n const entrypoints = new Map();\n const loadedScripts = new Map();\n const styleSheets = new Map();\n const routes = new Map();\n function maybeExecuteScript(src) {\n // With HMR we might need to \"reload\" scripts when they are\n // disposed and readded. Executing scripts twice has no functional\n // differences\n if (false) {} else {\n return appendScript(src);\n }\n }\n function fetchStyleSheet(href) {\n let prom = styleSheets.get(href);\n if (prom) {\n return prom;\n }\n styleSheets.set(href, prom = fetch(href, {\n credentials: 'same-origin'\n }).then((res)=>{\n if (!res.ok) {\n throw new Error(\"Failed to load stylesheet: \" + href);\n }\n return res.text().then((text)=>({\n href: href,\n content: text\n }));\n }).catch((err)=>{\n throw markAssetError(err);\n }));\n return prom;\n }\n return {\n whenEntrypoint (route) {\n return withFuture(route, entrypoints);\n },\n onEntrypoint (route, execute) {\n ;\n (execute ? Promise.resolve().then(()=>execute()).then((exports1)=>({\n component: exports1 && exports1.default || exports1,\n exports: exports1\n }), (err)=>({\n error: err\n })) : Promise.resolve(undefined)).then((input)=>{\n const old = entrypoints.get(route);\n if (old && 'resolve' in old) {\n if (input) {\n entrypoints.set(route, input);\n old.resolve(input);\n }\n } else {\n if (input) {\n entrypoints.set(route, input);\n } else {\n entrypoints.delete(route);\n }\n // when this entrypoint has been resolved before\n // the route is outdated and we want to invalidate\n // this cache entry\n routes.delete(route);\n }\n });\n },\n loadRoute (route, prefetch) {\n return withFuture(route, routes, ()=>{\n let devBuildPromiseResolve;\n if (true) {\n devBuildPromise = new Promise((resolve)=>{\n devBuildPromiseResolve = resolve;\n });\n }\n return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then((param)=>{\n let { scripts, css } = param;\n return Promise.all([\n entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)),\n Promise.all(css.map(fetchStyleSheet))\n ]);\n }).then((res)=>{\n return this.whenEntrypoint(route).then((entrypoint)=>({\n entrypoint,\n styles: res[1]\n }));\n }), MS_MAX_IDLE_DELAY, markAssetError(new Error(\"Route did not complete loading: \" + route))).then((param)=>{\n let { entrypoint, styles } = param;\n const res = Object.assign({\n styles: styles\n }, entrypoint);\n return 'error' in entrypoint ? entrypoint : res;\n }).catch((err)=>{\n if (prefetch) {\n // we don't want to cache errors during prefetch\n throw err;\n }\n return {\n error: err\n };\n }).finally(()=>devBuildPromiseResolve == null ? void 0 : devBuildPromiseResolve());\n });\n },\n prefetch (route) {\n // https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118\n // License: Apache 2.0\n let cn;\n if (cn = navigator.connection) {\n // Don't prefetch if using 2G or if Save-Data is enabled.\n if (cn.saveData || /2g/.test(cn.effectiveType)) return Promise.resolve();\n }\n return getFilesForRoute(assetPrefix, route).then((output)=>Promise.all(canPrefetch ? output.scripts.map((script)=>prefetchViaDom(script.toString(), 'script')) : [])).then(()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>this.loadRoute(route, true).catch(()=>{}));\n }).catch(()=>{});\n }\n };\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=route-loader.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yb3V0ZS1sb2FkZXIuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0lBaVNnQkEsaUJBQWlCO2VBQWpCQTs7SUEzREFDLHNCQUFzQjtlQUF0QkE7O0lBbklBQyxZQUFZO2VBQVpBOztJQUpBQyxjQUFjO2VBQWRBOzs7OzRGQTdGa0I7MENBQ2E7aURBQ1g7MENBQ2M7MkNBQ3BCO0FBRTlCLHVFQ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AgICAgcmV0dXJuIHdpdGhGdXR1cmUocm91dGUsIGVudHJ5cG9pbnRzKVxuICAgIH0sXG4gICAgb25FbnRyeXBvaW50KHJvdXRlOiBzdHJpbmcsIGV4ZWN1dGU6IHVuZGVmaW5lZCB8ICgoKSA9PiB1bmtub3duKSkge1xuICAgICAgOyhleGVjdXRlXG4gICAgICAgID8gUHJvbWlzZS5yZXNvbHZlKClcbiAgICAgICAgICAgIC50aGVuKCgpID0+IGV4ZWN1dGUoKSlcbiAgICAgICAgICAgIC50aGVuKFxuICAgICAgICAgICAgICAoZXhwb3J0czogYW55KSA9PiAoe1xuICAgICAgICAgICAgICAgIGNvbXBvbmVudDogKGV4cG9ydHMgJiYgZXhwb3J0cy5kZWZhdWx0KSB8fCBleHBvcnRzLFxuICAgICAgICAgICAgICAgIGV4cG9ydHM6IGV4cG9ydHMsXG4gICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAoZXJyKSA9PiAoeyBlcnJvcjogZXJyIH0pXG4gICAgICAgICAgICApXG4gICAgICAgIDogUHJvbWlzZS5yZXNvbHZlKHVuZGVmaW5lZClcbiAgICAgICkudGhlbigoaW5wdXQ6IFJvdXRlRW50cnlwb2ludCB8IHVuZGVmaW5lZCkgPT4ge1xuICAgICAgICBjb25zdCBvbGQgPSBlbnRyeXBvaW50cy5nZXQocm91dGUpXG4gICAgICAgIGlmIChvbGQgJiYgJ3Jlc29sdmUnIGluIG9sZCkge1xuICAgICAgICAgIGlmIChpbnB1dCkge1xuICAgICAgICAgICAgZW50cnlwb2ludHMuc2V0KHJvdXRlLCBpbnB1dClcbiAgICAgICAgICAgIG9sZC5yZXNvbHZlKGlucHV0KVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoaW5wdXQpIHtcbiAgICAgICAgICAgIGVudHJ5cG9pbnRzLnNldChyb3V0ZSwgaW5wdXQpXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGVudHJ5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AgID8gW11cbiAgICAgICAgICAgICAgICAgIDogUHJvbWlzZS5hbGwoc2NyaXB0cy5tYXAobWF5YmVFeGVjdXRlU2NyaXB0KSksXG4gICAgICAgICAgICAgICAgUHJvbWlzZS5hbGwoY3NzLm1hcChmZXRjaFN0eWxlU2hlZXQpKSxcbiAgICAgICAgICAgICAgXSBhcyBjb25zdClcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAudGhlbigocmVzKSA9PiB7XG4gICAgICAgICAgICAgIHJldHVybiB0aGlzLndoZW5FbnRyeXBvaW50KHJvdXRlKS50aGVuKChlbnRyeXBvaW50KSA9PiAoe1xuICAgICAgICAgICAgICAgIGVudHJ5cG9pbnQsXG4gICAgICAgICAgICAgICAgc3R5bGVzOiByZXNbMV0sXG4gICAgICAgICAgICAgIH0pKVxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgTVNfTUFYX0lETEVfREVMQVksXG4gICAgICAgICAgbWFya0Fzc2V0RXJyb3IobmV3IEVycm9yKGBSb3V0ZSBkaWQgbm90IGNvbXBsZXRlIGxvYWRpbmc6ICR7cm91dGV9YCkpXG4gICAgICAgIClcbiAgICAgICAgICAudGhlbigoeyBlbnRyeXBvaW50LCBzdHlsZXMgfSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVzOiBSb3V0ZUxvYWRlckVudHJ5ID0gT2JqZWN0LmFzc2lnbjxcbiAgICAgICAgICAgICAgeyBzdHlsZXM6IFJvdXRlU3R5bGVTaGVldFtdIH0sXG4gICAgICAgICAgICAgIFJvdXRlRW50cnlwb2ludFxuICAgICAgICAgICAgPih7IHN0eWxlczogc3R5bGVzISB9LCBlbnRyeXBvaW50KVxuICAgICAgICAgICAgcmV0dXJuICdlcnJvcicgaW4gZW50cnlwb2ludCA/IGVudHJ5cG9pbnQgOiByZXNcbiAgICAgICAgICB9KVxuICAgICAgICAgIC5jYXRjaCgoZXJyKSA9PiB7XG4gICAgICAgICAgICBpZiAocHJlZmV0Y2gpIHtcbiAgICA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VmYXVsdCIsImVycm9yIiwidW5kZWZpbmVkIiwiaW5wdXQiLCJvbGQiLCJsb2FkUm91dGUiLCJwcmVmZXRjaCIsImRldkJ1aWxkUHJvbWlzZVJlc29sdmUiLCJhbGwiLCJoYXMiLCJlbnRyeXBvaW50Iiwic3R5bGVzIiwiYXNzaWduIiwiZmluYWxseSIsImNuIiwibmF2aWdhdG9yIiwiY29ubmVjdGlvbiIsInNhdmVEYXRhIiwidGVzdCIsImVmZmVjdGl2ZVR5cGUiLCJvdXRwdXQiXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/route-loader.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/router.js": +/*!*************************************************!*\ + !*** ./node_modules/next/dist/client/router.js ***! + \*************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("/* global window */ \nvar _s = $RefreshSig$();\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && (0);\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n Router: function() {\n return _router.default;\n },\n createRouter: function() {\n return createRouter;\n },\n // Export the singletonRouter and this is the public API.\n default: function() {\n return _default;\n },\n makePublicRouterInstance: function() {\n return makePublicRouterInstance;\n },\n useRouter: function() {\n return useRouter;\n },\n withRouter: function() {\n return _withrouter.default;\n }\n});\nconst _interop_require_default = __webpack_require__(/*! @swc/helpers/_/_interop_require_default */ \"./node_modules/@swc/helpers/esm/_interop_require_default.js\");\nconst _react = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nconst _router = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! ../shared/lib/router/router */ \"./node_modules/next/dist/shared/lib/router/router.js\"));\nconst _routercontextsharedruntime = __webpack_require__(/*! ../shared/lib/router-context.shared-runtime */ \"./node_modules/next/dist/shared/lib/router-context.shared-runtime.js\");\nconst _iserror = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! ../lib/is-error */ \"./node_modules/next/dist/lib/is-error.js\"));\nconst _withrouter = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! ./with-router */ \"./node_modules/next/dist/client/with-router.js\"));\nconst singletonRouter = {\n router: null,\n readyCallbacks: [],\n ready (callback) {\n if (this.router) return callback();\n if (true) {\n this.readyCallbacks.push(callback);\n }\n }\n};\n// Create public properties and methods of the router in the singletonRouter\nconst urlPropertyFields = [\n 'pathname',\n 'route',\n 'query',\n 'asPath',\n 'components',\n 'isFallback',\n 'basePath',\n 'locale',\n 'locales',\n 'defaultLocale',\n 'isReady',\n 'isPreview',\n 'isLocaleDomain',\n 'domainLocales'\n];\nconst routerEvents = [\n 'routeChangeStart',\n 'beforeHistoryChange',\n 'routeChangeComplete',\n 'routeChangeError',\n 'hashChangeStart',\n 'hashChangeComplete'\n];\nconst coreMethodFields = [\n 'push',\n 'replace',\n 'reload',\n 'back',\n 'prefetch',\n 'beforePopState'\n];\n// Events is a static property on the router, the router doesn't have to be initialized to use it\nObject.defineProperty(singletonRouter, 'events', {\n get () {\n return _router.default.events;\n }\n});\nfunction getRouter() {\n if (!singletonRouter.router) {\n const message = 'No router instance found.\\n' + 'You should only use \"next/router\" on the client side of your app.\\n';\n throw new Error(message);\n }\n return singletonRouter.router;\n}\nurlPropertyFields.forEach((field)=>{\n // Here we need to use Object.defineProperty because we need to return\n // the property assigned to the actual router\n // The value might get changed as we change routes and this is the\n // proper way to access it\n Object.defineProperty(singletonRouter, field, {\n get () {\n const router = getRouter();\n return router[field];\n }\n });\n});\ncoreMethodFields.forEach((field)=>{\n // We don't really know the types here, so we add them later instead\n ;\n singletonRouter[field] = function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n const router = getRouter();\n return router[field](...args);\n };\n});\nrouterEvents.forEach((event)=>{\n singletonRouter.ready(()=>{\n _router.default.events.on(event, function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n const eventField = \"on\" + event.charAt(0).toUpperCase() + event.substring(1);\n const _singletonRouter = singletonRouter;\n if (_singletonRouter[eventField]) {\n try {\n _singletonRouter[eventField](...args);\n } catch (err) {\n console.error(\"Error when running the Router event: \" + eventField);\n console.error((0, _iserror.default)(err) ? err.message + \"\\n\" + err.stack : err + '');\n }\n }\n });\n });\n});\nconst _default = singletonRouter;\nfunction useRouter() {\n _s();\n const router = _react.default.useContext(_routercontextsharedruntime.RouterContext);\n if (!router) {\n throw new Error('NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted');\n }\n return router;\n}\n_s(useRouter, \"rbAhEc3dLGnVlsHWaSDsgP4MZS0=\");\nfunction createRouter() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n singletonRouter.router = new _router.default(...args);\n singletonRouter.readyCallbacks.forEach((cb)=>cb());\n singletonRouter.readyCallbacks = [];\n return singletonRouter.router;\n}\nfunction makePublicRouterInstance(router) {\n const scopedRouter = router;\n const instance = {};\n for (const property of urlPropertyFields){\n if (typeof scopedRouter[property] === 'object') {\n instance[property] = Object.assign(Array.isArray(scopedRouter[property]) ? [] : {}, scopedRouter[property]) // makes sure query is not stateful\n ;\n continue;\n }\n instance[property] = scopedRouter[property];\n }\n // Events is a static property on the router, the router doesn't have to be initialized to use it\n instance.events = _router.default.events;\n coreMethodFields.forEach((field)=>{\n instance[field] = function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n return scopedRouter[field](...args);\n };\n });\n return instance;\n}\nif ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {\n Object.defineProperty(exports.default, '__esModule', {\n value: true\n });\n Object.assign(exports.default, exports);\n module.exports = exports.default;\n} //# sourceMappingURL=router.js.map\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports signature on update so we can compare the boundary\n // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n module.hot.dispose(function (data) {\n data.prevSignature =\n self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevSignature !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevSignature !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbmV4dC9kaXN0L2NsaWVudC9yb3V0ZXIuanMiLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCOztBQUFBOzs7Ozs7Ozs7Ozs7SUFhUkEsTUFBTTtlQUFOQSxRQUFBQSxPQUFNOztJQTZJQ0MsWUFBWTtlQUFaQTs7SUE3QmhCLHlEQUF5RDtJQUN6RCxPQUFpRDtlQUFqRDs7SUEwQ2dCQyx3QkFBd0I7ZUFBeEJBOztJQS9CQUMsU0FBUztlQUFUQTs7SUFSSUMsVUFBVTtlQUFWQSxZQUFBQSxPQUFVOzs7OzRFQWhJWjs2RUFDQzt3REFFVzs4RUFDVjtpRkE0SGtCO0FBOUd0QyxNQUFNQyxrQkFBdUM7SUFDM0NDLFFBQVE7SUFDUkMsZ0JBQWdCLEVBQUU7SUFDbEJDLE9BQU1DLFFBQW9CO1FBQ3hCLElBQUksSUFBSSxDQUFDSCxNQUFNLEVBQUUsT0FBT0c7UUFDeEIsSUFBSSxJQUE2QixFQUFFO1lBQ2pDLElBQUksQ0FBQ0YsY0FBYyxDQUFDSSxJQUFJLENBQUNGO1FBQzNCO0lBQ0Y7QUFDRjtBQUVBLDRFQUE0RTtBQUM1RSxNQUFNRyxvQkFBb0I7SUFDeEI7SUFDQTtJQUNBO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7SUFDQTtDQUNEO0FBQ0QsTUFBTUMsZUFBZTtJQUNuQjtJQUNBO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7Q0FDRDtBQUdEL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IiLCJyb3V0ZXIiLCJyZWFkeUNhbGxiYWNrcyIsInJlYWR5IiwiY2FsbGJhY2siLCJ3aW5kb3ciLCJwdXNoIiwidXJsUHJvcGVydHlGaWVsZHMiLCJyb3V0ZXJFdmVudHMiLCJjb3JlTWV0aG9kRmllbGRzIiwiT2JqZWN0IiwiZGVmaW5lUHJvcGVydHkiLCJnZXQiLCJldmVudHMiLCJnZXRSb3V0ZXIiLCJtZXNzYWdlIiwiRXJyb3IiLCJmb3JFYWNoIiwiZmllbGQiLCJhcmdzIiwiZXZlbnQiLCJvbiIsImV2ZW50RmllbGQiLCJjaGFyQXQiLCJ0b1VwcGVyQ2FzZSIsInN1YnN0cmluZyIsIl9zaW5nbGV0b25Sb3V0ZXIiLCJlcnIiLCJjb25zb2xlIiwiZXJyb3IiLCJpc0Vycm9yIiwic3RhY2siLCJSZWFjdCIsInVzZUNvbnRleHQiLCJSb3V0ZXJDb250ZXh0IiwiY2IiLCJzY29wZWRSb3V0ZXIiLCJpbnN0YW5jZSIsInByb3BlcnR5IiwiYXNzaWduIiwiQXJyYXkiLCJpc0FycmF5Il0sImlnbm9yZUxpc3QiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/next/dist/client/router.js\n")); + +/***/ }), + +/***/ "./node_modules/next/dist/client/script.js": +/*!*************************************************!*\ + !*** ./node_modules/next/dist/client/script.js ***! + \*************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +"use strict"; +eval(__webpack_require__.ts("/* __next_internal_client_entry_do_not_use__ cjs */ \nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\n0 && (0);\nfunction _export(target, all) {\n for(var name in all)Object.defineProperty(target, name, {\n enumerable: true,\n get: all[name]\n });\n}\n_export(exports, {\n default: function() {\n return _default;\n },\n handleClientScriptLoad: function() {\n return handleClientScriptLoad;\n },\n initScriptLoader: function() {\n return initScriptLoader;\n }\n});\nconst _interop_require_default = __webpack_require__(/*! @swc/helpers/_/_interop_require_default */ \"./node_modules/@swc/helpers/esm/_interop_require_default.js\");\nconst _interop_require_wildcard = __webpack_require__(/*! @swc/helpers/_/_interop_require_wildcard */ \"./node_modules/@swc/helpers/esm/_interop_require_wildcard.js\");\nconst _jsxruntime = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\nconst _reactdom = /*#__PURE__*/ _interop_require_default._(__webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\"));\nconst _react = /*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nconst _headmanagercontextsharedruntime = __webpack_require__(/*! ../shared/lib/head-manager-context.shared-runtime */ \"./node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js\");\nconst _setattributesfromprops = __webpack_require__(/*! ./set-attributes-from-props */ \"./node_modules/next/dist/client/set-attributes-from-props.js\");\nconst _requestidlecallback = __webpack_require__(/*! ./request-idle-callback */ \"./node_modules/next/dist/client/request-idle-callback.js\");\nconst ScriptCache = new Map();\nconst LoadCache = new Set();\nconst insertStylesheets = (stylesheets)=>{\n // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad\n //\n // Using ReactDOM.preinit to feature detect appDir and inject styles\n // Stylesheets might have already been loaded if initialized with Script component\n // Re-inject styles here to handle scripts loaded via handleClientScriptLoad\n // ReactDOM.preinit handles dedup and ensures the styles are loaded only once\n if (_reactdom.default.preinit) {\n stylesheets.forEach((stylesheet)=>{\n _reactdom.default.preinit(stylesheet, {\n as: 'style'\n });\n });\n return;\n }\n // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad\n //\n // We use this function to load styles when appdir is not detected\n // TODO: Use React float APIs to load styles once available for pages dir\n if (true) {\n let head = document.head;\n stylesheets.forEach((stylesheet)=>{\n let link = document.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = stylesheet;\n head.appendChild(link);\n });\n }\n};\nconst loadScript = (props)=>{\n const { src, id, onLoad = ()=>{}, onReady = null, dangerouslySetInnerHTML, children = '', strategy = 'afterInteractive', onError, stylesheets } = props;\n const cacheKey = id || src;\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return;\n }\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey);\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError);\n return;\n }\n /** Execute after the script first loaded */ const afterLoad = ()=>{\n // Run onReady for the first time after load event\n if (onReady) {\n onReady();\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey);\n };\n const el = document.createElement('script');\n const loadPromise = new Promise((resolve, reject)=>{\n el.addEventListener('load', function(e) {\n resolve();\n if (onLoad) {\n onLoad.call(this, e);\n }\n afterLoad();\n });\n el.addEventListener('error', function(e) {\n reject(e);\n });\n }).catch(function(e) {\n if (onError) {\n onError(e);\n }\n });\n if (dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n el.innerHTML = dangerouslySetInnerHTML.__html || '';\n afterLoad();\n } else if (children) {\n el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';\n afterLoad();\n } else if (src) {\n el.src = src;\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n ScriptCache.set(src, loadPromise);\n }\n (0, _setattributesfromprops.setAttributesFromProps)(el, props);\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown');\n }\n el.setAttribute('data-nscript', strategy);\n // Load styles associated with this script\n if (stylesheets) {\n insertStylesheets(stylesheets);\n }\n document.body.appendChild(el);\n};\nfunction handleClientScriptLoad(props) {\n const { strategy = 'afterInteractive' } = props;\n if (strategy === 'lazyOnload') {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n } else {\n loadScript(props);\n }\n}\nfunction loadLazyScript(props) {\n if (document.readyState === 'complete') {\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n } else {\n window.addEventListener('load', ()=>{\n (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));\n });\n }\n}\nfunction addBeforeInteractiveToCache() {\n const scripts = [\n ...document.querySelectorAll('[data-nscript=\"beforeInteractive\"]'),\n ...document.querySelectorAll('[data-nscript=\"beforePageRender\"]')\n ];\n scripts.forEach((script)=>{\n const cacheKey = script.id || script.getAttribute('src');\n LoadCache.add(cacheKey);\n });\n}\nfunction initScriptLoader(scriptLoaderItems) {\n scriptLoaderItems.forEach(handleClientScriptLoad);\n addBeforeInteractiveToCache();\n}\n/**\n * Load a third-party scripts in an optimized way.\n *\n * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script)\n */ function Script(props) {\n const { id, src = '', onLoad = ()=>{}, onReady = null, strategy = 'afterInteractive', onError, stylesheets, ...restProps } = props;\n // Context is available only during SSR\n const { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);\n /**\n * - First mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)\n * onReady is skipped, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. hasLoadScriptEffectCalled.current is false, loadScript executes\n * Once the script is loaded, the onLoad and onReady will be called by then\n * [If strict mode is enabled / is wrapped in component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n *\n * - Second mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)\n * onReady is called, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. The script is already loaded, loadScript bails out\n * [If strict mode is enabled / is wrapped in component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n */ const hasOnReadyEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n const cacheKey = id || src;\n if (!hasOnReadyEffectCalled.current) {\n // Run onReady if script has loaded before but component is re-mounted\n if (onReady && cacheKey && LoadCache.has(cacheKey)) {\n onReady();\n }\n hasOnReadyEffectCalled.current = true;\n }\n }, [\n onReady,\n id,\n src\n ]);\n const hasLoadScriptEffectCalled = (0, _react.useRef)(false);\n (0, _react.useEffect)(()=>{\n if (!hasLoadScriptEffectCalled.current) {\n if (strategy === 'afterInteractive') {\n loadScript(props);\n } else if (strategy === 'lazyOnload') {\n loadLazyScript(props);\n }\n hasLoadScriptEffectCalled.current = true;\n }\n }, [\n props,\n strategy\n ]);\n if (strategy === 'beforeInteractive' || strategy === 'worker') {\n if (updateScripts) {\n scripts[strategy] = (scripts[strategy] || []).concat([\n {\n id,\n src,\n onLoad,\n onReady,\n onError,\n ...restProps\n }\n ]);\n updateScripts(scripts);\n } else if (getIsSsr && getIsSsr()) {\n // Script has already loaded during SSR\n LoadCache.add(id || src);\n } else if (getIsSsr && !getIsSsr()) {\n loadScript(props);\n }\n }\n // For the app directory, we need React Float to preload these scripts.\n if (appDir) {\n // Injecting stylesheets here handles beforeInteractive and worker scripts correctly\n // For other strategies injecting here ensures correct stylesheet order\n // ReactDOM.preinit handles loading the styles in the correct order,\n // also ensures the stylesheet is loaded only once and in a consistent manner\n //\n // Case 1: Styles for beforeInteractive/worker with appDir - handled here\n // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet\n // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here\n // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function\n if (stylesheets) {\n stylesheets.forEach((styleSrc)=>{\n _reactdom.default.preinit(styleSrc, {\n as: 'style'\n });\n });\n }\n // Before interactive scripts need to be loaded by Next.js' runtime instead\n // of native + + +``` + +Get started with [Motion for Vue](https://motion.dev/docs/vue). + + + +## šŸŽ“ Examples + +Browse 100+ free and 180+ premium [Motion Examples](https://motion.dev/examples), with copy-paste code that'll level-up your animations whether you're a beginner or an expert. + +## āš”ļø Motion+ + +A one-time payment, lifetime-updates membership: + +- **180+ premium examples** +- **Premium APIs** like [Cursor](https://motion.dev/docs/cursor) and [Ticker](https://motion.dev/docs/react-ticker) +- **Visual editing** for VS Code (alpha) +- **Private Discord** +- **Early access content** + +[Get Motion+](https://motion.dev/plus) + +## šŸ‘©šŸ»ā€āš–ļø License + +- Motion is MIT licensed. + +## šŸ’Ž Contribute + +- Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered. + +## ✨ Sponsors + +Motion is sustainable thanks to the kind support of its sponsors. + +[Become a sponsor](https://motion.dev/sponsor) + +### Partners + +Motion powers the animations for all websites built with Framer, the web builder for creative pros. The Motion website itself is built on Framer, for its delightful canvas-based editing and powerful CMS features. + + + Framer + + +Motion drives the animations on the Cursor homepage, and is working with Cursor to bring powerful AI workflows to the Motion examples and docs. + + + Cursor + + +### Platinum + +Linear Figma Sanity Sanity Clerk + + +### Gold + +Liveblocks Luma LottieFiles + +### Silver + +Frontend.fyi Firecrawl Puzzmo Bolt.new + +### Personal + +- [OlegWock](https://sinja.io) +- [Lambert Weller](https://github.com/l-mbert) +- [Jake LeBoeuf](https://jklb.wf) +- [Han Lee](https://github.com/hahnlee) diff --git a/node_modules/framer-motion/client/README.md b/node_modules/framer-motion/client/README.md new file mode 100644 index 00000000..00af8b44 --- /dev/null +++ b/node_modules/framer-motion/client/README.md @@ -0,0 +1 @@ +This directory is a fallback for `exports["./client"]` in the root `framer-motion` `package.json`. diff --git a/node_modules/framer-motion/client/package.json b/node_modules/framer-motion/client/package.json new file mode 100644 index 00000000..ed702d3c --- /dev/null +++ b/node_modules/framer-motion/client/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/types/client.d.ts", + "main": "../dist/cjs/client.js", + "module": "../dist/es/client.mjs" +} diff --git a/node_modules/framer-motion/dist/cjs/client.js b/node_modules/framer-motion/dist/cjs/client.js new file mode 100644 index 00000000..4c484f09 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/client.js @@ -0,0 +1,369 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var featureBundle = require('./feature-bundle-Cb13qNcx.js'); +require('motion-dom'); +require('react'); +require('react/jsx-runtime'); +require('motion-utils'); + +function createMotionComponentWithFeatures(Component, options) { + return featureBundle.createMotionComponent(Component, options, featureBundle.featureBundle, featureBundle.createDomVisualElement); +} + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a"); +const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr"); +const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address"); +const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area"); +const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article"); +const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside"); +const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio"); +const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b"); +const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base"); +const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi"); +const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo"); +const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big"); +const MotionBlockquote = +/*@__PURE__*/ createMotionComponentWithFeatures("blockquote"); +const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body"); +const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button"); +const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas"); +const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption"); +const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite"); +const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code"); +const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col"); +const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup"); +const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data"); +const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist"); +const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd"); +const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del"); +const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details"); +const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn"); +const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog"); +const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div"); +const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl"); +const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt"); +const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em"); +const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed"); +const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMotionComponentWithFeatures("figcaption"); +const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure"); +const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer"); +const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form"); +const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1"); +const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2"); +const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3"); +const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4"); +const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5"); +const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6"); +const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head"); +const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header"); +const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup"); +const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr"); +const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html"); +const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i"); +const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe"); +const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img"); +const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input"); +const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins"); +const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd"); +const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen"); +const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label"); +const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend"); +const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li"); +const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link"); +const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main"); +const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map"); +const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark"); +const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu"); +const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem"); +const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter"); +const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav"); +const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object"); +const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol"); +const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup"); +const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option"); +const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output"); +const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p"); +const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param"); +const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture"); +const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre"); +const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress"); +const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q"); +const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp"); +const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt"); +const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby"); +const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s"); +const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp"); +const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script"); +const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section"); +const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select"); +const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small"); +const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source"); +const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span"); +const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong"); +const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style"); +const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub"); +const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary"); +const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup"); +const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table"); +const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody"); +const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td"); +const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea"); +const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot"); +const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th"); +const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead"); +const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time"); +const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title"); +const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr"); +const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track"); +const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u"); +const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul"); +const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video"); +const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr"); +const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview"); +/** + * SVG components + */ +const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate"); +const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle"); +const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs"); +const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc"); +const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse"); +const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g"); +const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image"); +const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line"); +const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter"); +const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker"); +const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask"); +const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata"); +const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path"); +const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern"); +const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon"); +const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline"); +const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect"); +const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop"); +const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg"); +const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol"); +const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text"); +const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan"); +const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use"); +const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view"); +const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath"); +const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix"); +const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMotionComponentWithFeatures("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow"); +const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood"); +const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA"); +const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB"); +const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG"); +const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur"); +const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage"); +const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology"); +const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient"); +const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath"); + +exports.a = MotionA; +exports.abbr = MotionAbbr; +exports.address = MotionAddress; +exports.animate = MotionAnimate; +exports.area = MotionArea; +exports.article = MotionArticle; +exports.aside = MotionAside; +exports.audio = MotionAudio; +exports.b = MotionB; +exports.base = MotionBase; +exports.bdi = MotionBdi; +exports.bdo = MotionBdo; +exports.big = MotionBig; +exports.blockquote = MotionBlockquote; +exports.body = MotionBody; +exports.button = MotionButton; +exports.canvas = MotionCanvas; +exports.caption = MotionCaption; +exports.circle = MotionCircle; +exports.cite = MotionCite; +exports.clipPath = MotionClipPath; +exports.code = MotionCode; +exports.col = MotionCol; +exports.colgroup = MotionColgroup; +exports.data = MotionData; +exports.datalist = MotionDatalist; +exports.dd = MotionDd; +exports.defs = MotionDefs; +exports.del = MotionDel; +exports.desc = MotionDesc; +exports.details = MotionDetails; +exports.dfn = MotionDfn; +exports.dialog = MotionDialog; +exports.div = MotionDiv; +exports.dl = MotionDl; +exports.dt = MotionDt; +exports.ellipse = MotionEllipse; +exports.em = MotionEm; +exports.embed = MotionEmbed; +exports.feBlend = MotionFeBlend; +exports.feColorMatrix = MotionFeColorMatrix; +exports.feComponentTransfer = MotionFeComponentTransfer; +exports.feComposite = MotionFeComposite; +exports.feConvolveMatrix = MotionFeConvolveMatrix; +exports.feDiffuseLighting = MotionFeDiffuseLighting; +exports.feDisplacementMap = MotionFeDisplacementMap; +exports.feDistantLight = MotionFeDistantLight; +exports.feDropShadow = MotionFeDropShadow; +exports.feFlood = MotionFeFlood; +exports.feFuncA = MotionFeFuncA; +exports.feFuncB = MotionFeFuncB; +exports.feFuncG = MotionFeFuncG; +exports.feFuncR = MotionFeFuncR; +exports.feGaussianBlur = MotionFeGaussianBlur; +exports.feImage = MotionFeImage; +exports.feMerge = MotionFeMerge; +exports.feMergeNode = MotionFeMergeNode; +exports.feMorphology = MotionFeMorphology; +exports.feOffset = MotionFeOffset; +exports.fePointLight = MotionFePointLight; +exports.feSpecularLighting = MotionFeSpecularLighting; +exports.feSpotLight = MotionFeSpotLight; +exports.feTile = MotionFeTile; +exports.feTurbulence = MotionFeTurbulence; +exports.fieldset = MotionFieldset; +exports.figcaption = MotionFigcaption; +exports.figure = MotionFigure; +exports.filter = MotionFilter; +exports.footer = MotionFooter; +exports.foreignObject = MotionForeignObject; +exports.form = MotionForm; +exports.g = MotionG; +exports.h1 = MotionH1; +exports.h2 = MotionH2; +exports.h3 = MotionH3; +exports.h4 = MotionH4; +exports.h5 = MotionH5; +exports.h6 = MotionH6; +exports.head = MotionHead; +exports.header = MotionHeader; +exports.hgroup = MotionHgroup; +exports.hr = MotionHr; +exports.html = MotionHtml; +exports.i = MotionI; +exports.iframe = MotionIframe; +exports.image = MotionImage; +exports.img = MotionImg; +exports.input = MotionInput; +exports.ins = MotionIns; +exports.kbd = MotionKbd; +exports.keygen = MotionKeygen; +exports.label = MotionLabel; +exports.legend = MotionLegend; +exports.li = MotionLi; +exports.line = MotionLine; +exports.linearGradient = MotionLinearGradient; +exports.link = MotionLink; +exports.main = MotionMain; +exports.map = MotionMap; +exports.mark = MotionMark; +exports.marker = MotionMarker; +exports.mask = MotionMask; +exports.menu = MotionMenu; +exports.menuitem = MotionMenuitem; +exports.metadata = MotionMetadata; +exports.meter = MotionMeter; +exports.nav = MotionNav; +exports.object = MotionObject; +exports.ol = MotionOl; +exports.optgroup = MotionOptgroup; +exports.option = MotionOption; +exports.output = MotionOutput; +exports.p = MotionP; +exports.param = MotionParam; +exports.path = MotionPath; +exports.pattern = MotionPattern; +exports.picture = MotionPicture; +exports.polygon = MotionPolygon; +exports.polyline = MotionPolyline; +exports.pre = MotionPre; +exports.progress = MotionProgress; +exports.q = MotionQ; +exports.radialGradient = MotionRadialGradient; +exports.rect = MotionRect; +exports.rp = MotionRp; +exports.rt = MotionRt; +exports.ruby = MotionRuby; +exports.s = MotionS; +exports.samp = MotionSamp; +exports.script = MotionScript; +exports.section = MotionSection; +exports.select = MotionSelect; +exports.small = MotionSmall; +exports.source = MotionSource; +exports.span = MotionSpan; +exports.stop = MotionStop; +exports.strong = MotionStrong; +exports.style = MotionStyle; +exports.sub = MotionSub; +exports.summary = MotionSummary; +exports.sup = MotionSup; +exports.svg = MotionSvg; +exports.symbol = MotionSymbol; +exports.table = MotionTable; +exports.tbody = MotionTbody; +exports.td = MotionTd; +exports.text = MotionText; +exports.textPath = MotionTextPath; +exports.textarea = MotionTextarea; +exports.tfoot = MotionTfoot; +exports.th = MotionTh; +exports.thead = MotionThead; +exports.time = MotionTime; +exports.title = MotionTitle; +exports.tr = MotionTr; +exports.track = MotionTrack; +exports.tspan = MotionTspan; +exports.u = MotionU; +exports.ul = MotionUl; +exports.use = MotionUse; +exports.video = MotionVideo; +exports.view = MotionView; +exports.wbr = MotionWbr; +exports.webview = MotionWebview; +//# sourceMappingURL=client.js.map diff --git a/node_modules/framer-motion/dist/cjs/client.js.map b/node_modules/framer-motion/dist/cjs/client.js.map new file mode 100644 index 00000000..ce210286 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/client.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client.js","sources":["../../src/render/components/motion/create.ts","../../src/render/components/motion/elements.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement\n )\n}\n","\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":["createMotionComponent","featureBundle","createDomVisualElement"],"mappings":";;;;;;;;;;AAMgB,SAAA,iCAAiC,CAI7C,SAAwD,EACxD,OAAgC,EAAA;IAEhC,OAAOA,mCAAqB,CACxB,SAAS,EACT,OAAO,EACPC,2BAAa,EACbC,oCAA6D,CAChE,CAAA;AACL;;ACfA;;AAEG;AACU,MAAA,OAAO,iBAAiBF,iCAAqB,CAAC,GAAG,EAAC;AAClD,MAAA,UAAU,iBAAiBA,iCAAqB,CAAC,MAAM,EAAC;AACxD,MAAA,aAAa,iBAAiBA,iCAAqB,CAAC,SAAS,EAAC;A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,kBAAkB;AAC3B,cAAcA,iCAAqB,CAAC,cAAc,EAAC;MAC1C,mBAAmB;AAC5B,cAAcA,iCAAqB,CAAC,eAAe,EAAC;MAC3C,oBAAoB;AAC7B,cAAcA,iCAAqB,CAAC,gBAAgB,EAAC;MAC5C,oBAAoB;AAC7B,cAAcA,iCAAqB,CAAC,gBAAgB,EAAC;AAC5C,MAAA,cAAc,iBAAiBA,iCAAqB,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/debug.js b/node_modules/framer-motion/dist/cjs/debug.js new file mode 100644 index 00000000..6fb2ed65 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/debug.js @@ -0,0 +1,13 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionDom = require('motion-dom'); + + + +Object.defineProperty(exports, "recordStats", { + enumerable: true, + get: function () { return motionDom.recordStats; } +}); +//# sourceMappingURL=debug.js.map diff --git a/node_modules/framer-motion/dist/cjs/debug.js.map b/node_modules/framer-motion/dist/cjs/debug.js.map new file mode 100644 index 00000000..ec4f5cd8 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/debug.js.map @@ -0,0 +1 @@ +{"version":3,"file":"debug.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js b/node_modules/framer-motion/dist/cjs/dom-mini.js new file mode 100644 index 00000000..1ed43308 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom-mini.js @@ -0,0 +1,479 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionDom = require('motion-dom'); +var motionUtils = require('motion-utils'); + +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return motionDom.resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +function calculateRepeatDuration(duration, repeat, _repeatDelay) { + return duration * (repeat + 1); +} + +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + motionUtils.removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: motionDom.mixNumber(startTime, endTime, offset[i]), + easing: motionUtils.getEasingForSegment(easing, i), + }); + } +} + +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + */ +function normalizeTimes(times, repeat) { + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / (repeat + 1); + } +} + +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = motionDom.isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = motionUtils.secondsToMilliseconds(duration); + } + const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && motionDom.fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Handle repeat options + */ + if (repeat) { + motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high"); + duration = calculateRepeatDuration(duration, repeat); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + valueKeyframesAsList.push(...originalKeyframes); + for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + (repeatIndex + 1)); + ease.push(keyframeIndex === 0 + ? "linear" + : motionUtils.getEasingForSegment(originalEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (motionDom.isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(motionUtils.progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +function animateSequence(definition, options) { + const animations = []; + createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => { + animations.push(...animateElements(element, keyframes, transition)); + }); + return new motionDom.GroupAnimationWithThen(animations); +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +exports.animate = animateMini; +exports.animateSequence = animateSequence; +//# sourceMappingURL=dom-mini.js.map diff --git a/node_modules/framer-motion/dist/cjs/dom-mini.js.map b/node_modules/framer-motion/dist/cjs/dom-mini.js.map new file mode 100644 index 00000000..18661d50 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom-mini.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dom-mini.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-sequence.ts","../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n","import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n","export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n _repeatDelay: number\n): number {\n return duration * (repeat + 1)\n}\n","import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n current: number,\n next: SequenceTime,\n prev: number,\n labels: Map\n): number {\n if (typeof next === \"number\") {\n return next\n } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next))\n } else if (next === \"<\") {\n return prev\n } else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)))\n } else {\n return labels.get(next) ?? current\n }\n}\n","import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n sequence: ValueSequence,\n startTime: number,\n endTime: number\n): void {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i]\n\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe)\n\n // If we remove this item we have to push the pointer back one\n i--\n }\n }\n}\n\nexport function addKeyframes(\n sequence: ValueSequence,\n keyframes: UnresolvedValueKeyframe[],\n easing: Easing | Easing[],\n offset: number[],\n startTime: number,\n endTime: number\n): void {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime)\n\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n })\n }\n}\n","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times: number[], repeat: number): void {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1)\n }\n}\n","import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n","import {\n AnimationScope,\n createGeneratorEasing,\n defaultOffset,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n fillOffset,\n GeneratorFactory,\n isGenerator,\n isMotionValue,\n Transition,\n UnresolvedValueKeyframe,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport {\n Easing,\n getEasingForSegment,\n invariant,\n progress,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n AnimationSequence,\n At,\n ResolvedAnimationDefinitions,\n SequenceMap,\n SequenceOptions,\n ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n sequence: AnimationSequence,\n { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n scope?: AnimationScope,\n generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n const defaultDuration = defaultTransition.duration || 0.3\n const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n const sequences = new Map()\n const elementCache = {}\n const timeLabels = new Map()\n\n let prevTime = 0\n let currentTime = 0\n let totalDuration = 0\n\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i]\n\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime)\n continue\n } else if (!Array.isArray(segment)) {\n timeLabels.set(\n segment.name,\n calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n )\n continue\n }\n\n let [subject, keyframes, transition = {}] = segment\n\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(\n currentTime,\n transition.at,\n prevTime,\n timeLabels\n )\n }\n\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0\n\n const resolveValueSequence = (\n valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n valueTransition: Transition | DynamicAnimationOptions,\n valueSequence: ValueSequence,\n elementIndex = 0,\n numSubjects = 0\n ) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n const {\n delay = 0,\n times = defaultOffset(valueKeyframesAsList),\n type = defaultTransition.type || \"keyframes\",\n repeat,\n repeatType,\n repeatDelay = 0,\n ...remainingTransition\n } = valueTransition\n let { ease = defaultTransition.ease || \"easeOut\", duration } =\n valueTransition\n\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay =\n typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay\n\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"]\n\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100\n if (\n numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)\n ) {\n const delta =\n valueKeyframesAsList[1] - valueKeyframesAsList[0]\n absoluteDelta = Math.abs(delta)\n }\n\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n }\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration)\n }\n\n const springEasing = createGeneratorEasing(\n springTransition,\n absoluteDelta,\n createGenerator\n )\n\n ease = springEasing.ease\n duration = springEasing.duration\n }\n\n duration ??= defaultDuration\n\n const startTime = currentTime + calculatedDelay\n\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1\n }\n\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length\n remainder > 0 && fillOffset(times, remainder)\n\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null)\n\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(\n repeat < MAX_REPEAT,\n \"Repeat count too high, must be less than 20\",\n \"repeat-count-high\"\n )\n\n duration = calculateRepeatDuration(\n duration,\n repeat,\n repeatDelay\n )\n\n const originalKeyframes = [...valueKeyframesAsList]\n const originalTimes = [...times]\n ease = Array.isArray(ease) ? [...ease] : [ease]\n const originalEase = [...ease]\n\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes)\n\n for (\n let keyframeIndex = 0;\n keyframeIndex < originalKeyframes.length;\n keyframeIndex++\n ) {\n times.push(\n originalTimes[keyframeIndex] + (repeatIndex + 1)\n )\n ease.push(\n keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(\n originalEase,\n keyframeIndex - 1\n )\n )\n }\n }\n\n normalizeTimes(times, repeat)\n }\n\n const targetTime = startTime + duration\n\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(\n valueSequence,\n valueKeyframesAsList,\n ease as Easing | Easing[],\n times,\n startTime,\n targetTime\n )\n\n maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n totalDuration = Math.max(targetTime, totalDuration)\n }\n\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences)\n resolveValueSequence(\n keyframes as AnyResolvedKeyframe,\n transition,\n getValueSequence(\"default\", subjectSequence)\n )\n } else {\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope,\n elementCache\n )\n\n const numSubjects = subjects.length\n\n /**\n * For every element in this segment, process the defined values.\n */\n for (\n let subjectIndex = 0;\n subjectIndex < numSubjects;\n subjectIndex++\n ) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes as DOMKeyframesDefinition\n transition = transition as DynamicAnimationOptions\n\n const thisSubject = subjects[subjectIndex]\n const subjectSequence = getSubjectSequence(\n thisSubject,\n sequences\n )\n\n for (const key in keyframes) {\n resolveValueSequence(\n keyframes[\n key as keyof typeof keyframes\n ] as UnresolvedValueKeyframe,\n getValueTransition(transition, key),\n getValueSequence(key, subjectSequence),\n subjectIndex,\n numSubjects\n )\n }\n }\n }\n\n prevTime = currentTime\n currentTime += maxDuration\n }\n\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key]\n\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime)\n\n const keyframes: UnresolvedValueKeyframe[] = []\n const valueOffset: number[] = []\n const valueEasing: Easing[] = []\n\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i]\n keyframes.push(value)\n valueOffset.push(progress(0, totalDuration, at))\n valueEasing.push(easing || \"easeOut\")\n }\n\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0)\n keyframes.unshift(keyframes[0])\n valueEasing.unshift(defaultSegmentEasing)\n }\n\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1)\n keyframes.push(null)\n }\n\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n })\n }\n\n const definition = animationDefinitions.get(element)!\n\n definition.keyframes[key] = keyframes\n\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } =\n defaultTransition\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n }\n }\n })\n\n return animationDefinitions\n}\n\nfunction getSubjectSequence(\n subject: Element | MotionValue | O,\n sequences: Map\n): SequenceMap {\n !sequences.has(subject) && sequences.set(subject, {})\n return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n if (!sequences[name]) sequences[name] = []\n return sequences[name]\n}\n\nfunction keyframesAsList(\n keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n transition: DynamicAnimationOptions & At,\n key: string\n): DynamicAnimationOptions {\n return transition && transition[key as keyof typeof transition]\n ? {\n ...transition,\n ...(transition[key as keyof typeof transition] as Transition),\n }\n : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n","import {\n animationMapKey,\n AnimationPlaybackControls,\n AnimationScope,\n applyPxDefaults,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n fillWildcards,\n getAnimationMap,\n getComputedStyle,\n getValueTransition,\n NativeAnimation,\n NativeAnimationOptions,\n resolveElements,\n UnresolvedValueKeyframe,\n ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n map: Map>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\n keyframes?: ValueKeyframe[]\n }\n}\n\nexport function animateElements(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return []\n }\n\n const elements = resolveElements(elementOrSelector, scope) as Array<\n HTMLElement | SVGElement\n >\n const numElements = elements.length\n\n invariant(\n Boolean(numElements),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions: AnimationDefinition[] = []\n\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i]\n const elementTransition: DynamicAnimationOptions = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements)\n }\n\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes]\n }\n\n const valueOptions = {\n ...getValueTransition(elementTransition as any, valueName),\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element)\n const key = animationMapKey(\n valueName,\n valueOptions.pseudoElement || \"\"\n )\n const currentAnimation = map.get(key)\n currentAnimation && currentAnimation.stop()\n\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten:\n !elementTransition.type && !elementTransition.ease,\n },\n })\n }\n }\n\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } =\n animationDefinitions[i]\n\n const { element, name, pseudoElement } = animationOptions\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name)\n }\n\n fillWildcards(unresolvedKeyframes)\n applyPxDefaults(unresolvedKeyframes, name)\n\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name))\n }\n\n animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n }\n\n /**\n * Step 3: Create new animations (write)\n */\n const animations: AnimationPlaybackControls[] = []\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i]\n const animation = new NativeAnimation(\n animationOptions as NativeAnimationOptions\n )\n\n map.set(key, animation)\n animation.finished.finally(() => map.delete(key))\n\n animations.push(animation)\n }\n\n return animations\n}\n","import { AnimationPlaybackControls, GroupAnimationWithThen } from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../../sequence/types\"\nimport { animateElements } from \"./animate-elements\"\n\nexport function animateSequence(\n definition: AnimationSequence,\n options?: SequenceOptions\n) {\n const animations: AnimationPlaybackControls[] = []\n\n createAnimationsFromSequence(definition, options).forEach(\n ({ keyframes, transition }, element: Element) => {\n animations.push(...animateElements(element, keyframes, transition))\n }\n )\n\n return new GroupAnimationWithThen(animations)\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","invariant","isMotionValue","progress","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","GroupAnimationWithThen"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,I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U,CAAC,CAAC,CAAA;AACvE,KAAC,CACJ,CAAA;AAED,IAAA,OAAO,IAAIC,gCAAsB,CAAC,UAAU,CAAC,CAAA;AACjD;;ACRO,MAAM,wBAAwB,GAAG,CAAC,KAAsB,KAAI;AAC/D,IAAA,SAAS,aAAa,CAClB,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EAAA;AAEjC,QAAA,OAAO,IAAIA,gCAAsB,CAC7B,eAAe,CACX,iBAAiB,EACjB,SAAmC,EACnC,OAAO,EACP,KAAK,CACR,CACJ,CAAA;KACJ;AAED,IAAA,OAAO,aAAa,CAAA;AACxB,CAAC,CAAA;MAEY,WAAW,iBAAiB,wBAAwB;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/dom.js b/node_modules/framer-motion/dist/cjs/dom.js new file mode 100644 index 00000000..737c7b61 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom.js @@ -0,0 +1,1165 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionDom = require('motion-dom'); +var motionUtils = require('motion-utils'); + +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return motionDom.resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +function calculateRepeatDuration(duration, repeat, _repeatDelay) { + return duration * (repeat + 1); +} + +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + motionUtils.removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: motionDom.mixNumber(startTime, endTime, offset[i]), + easing: motionUtils.getEasingForSegment(easing, i), + }); + } +} + +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + */ +function normalizeTimes(times, repeat) { + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / (repeat + 1); + } +} + +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = motionDom.isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = motionUtils.secondsToMilliseconds(duration); + } + const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && motionDom.fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Handle repeat options + */ + if (repeat) { + motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high"); + duration = calculateRepeatDuration(duration, repeat); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + valueKeyframesAsList.push(...originalKeyframes); + for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + (repeatIndex + 1)); + ease.push(keyframeIndex === 0 + ? "linear" + : motionUtils.getEasingForSegment(originalEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (motionDom.isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(motionUtils.progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element) + ? new motionDom.SVGVisualElement(options) + : new motionDom.HTMLVisualElement(options); + node.mount(element); + motionDom.visualElementStore.set(element, node); +} +function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new motionDom.ObjectVisualElement(options); + node.mount(subject); + motionDom.visualElementStore.set(subject, node); +} + +function isSingleValue(subject, keyframes) { + return (motionDom.isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); +} +/** + * Implementation + */ +function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!motionDom.visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = motionDom.visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; +} + +function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionDom.motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; +} + +function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +function createScopedAnimate(options = {}) { + const { scope, reduceMotion } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + if (isSequence(subjectOrSequence)) { + animations = animateSequence(subjectOrSequence, reduceMotion !== undefined + ? { reduceMotion, ...optionsOrKeyframes } + : optionsOrKeyframes, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, (reduceMotion !== undefined + ? { reduceMotion, ...rest } + : rest), scope); + } + const animation = new motionDom.GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + motionUtils.removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; +} +const animate = createScopedAnimate(); + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +/** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ +const maxElapsed = 50; +const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, +}); +const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), +}); +const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, +}; +function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = element[`scroll${position}`]; + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : motionUtils.velocityPerSecond(axis.current - prev, elapsed); +} +function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; +} + +function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (motionDom.isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; +} + +const namedEdges = { + start: 0, + center: 0.5, + end: 1, +}; +function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; +} + +const defaultOffset = [0, 0]; +function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; +} + +const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], +}; + +const point = { x: 0, y: 0 }; +function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; +} +function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current)); +} + +function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. + */ + if (process.env.NODE_ENV !== "production") { + if (container && target && target !== container) { + motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } +} +function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; +} + +const scrollListeners = new WeakMap(); +const resizeListeners = new WeakMap(); +const onScrollHandlers = new WeakMap(); +const scrollSize = new WeakMap(); +const dimensionCheckProcesses = new WeakMap(); +const getEventTarget = (element) => element === document.scrollingElement ? window : element; +function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return motionUtils.noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(motionDom.frameData.timestamp); + } + motionDom.frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => motionDom.frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener, { passive: true }); + if (container !== document.documentElement) { + resizeListeners.set(container, motionDom.resize(container, listener)); + } + target.addEventListener("scroll", listener, { passive: true }); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + motionDom.frame.read(listener, false, true); + return () => { + motionDom.cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + motionDom.cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; +} + +function canUseNativeTimeline(target) { + return (typeof window !== "undefined" && !target && motionDom.supportsScrollTimeline()); +} + +const timelineCache = new Map(); +function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; +} +function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + const containerCache = timelineCache.get(container) ?? new Map(); + timelineCache.set(container, containerCache); + const targetKey = options.target ?? "self"; + const targetCache = containerCache.get(targetKey) ?? {}; + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + targetCache[axisKey] = + canUseNativeTimeline(options.target) + ? new ScrollTimeline({ source: container, axis }) + : scrollTimelineFallback({ container, ...options }); + } + return targetCache[axisKey]; +} + +function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + return animation.attachTimeline({ + timeline: options.target ? undefined : timeline, + observe: (valueAnimation) => { + valueAnimation.pause(); + return motionDom.observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); +} + +/** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ +function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; +} +function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return motionDom.observeTimeline(onScroll, getTimeline(options)); + } +} + +function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return motionUtils.noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); +} + +const thresholds = { + some: 0, + all: 1, +}; +function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = motionDom.resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); +} + +const distance = (a, b) => Math.abs(a - b); +function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); +} + +Object.defineProperty(exports, "delay", { + enumerable: true, + get: function () { return motionDom.delayInSeconds; } +}); +exports.animate = animate; +exports.animateMini = animateMini; +exports.createScopedAnimate = createScopedAnimate; +exports.distance = distance; +exports.distance2D = distance2D; +exports.inView = inView; +exports.scroll = scroll; +exports.scrollInfo = scrollInfo; +Object.keys(motionDom).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionDom[k]; } + }); +}); +Object.keys(motionUtils).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionUtils[k]; } + }); +}); +//# sourceMappingURL=dom.js.map diff --git a/node_modules/framer-motion/dist/cjs/dom.js.map b/node_modules/framer-motion/dist/cjs/dom.js.map new file mode 100644 index 00000000..903e1545 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/dom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.js","sources":["../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/utils/distance.ts"],"sourcesContent":["import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n","import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n","export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n _repeatDelay: number\n): number {\n return duration * (repeat + 1)\n}\n","import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n current: number,\n next: SequenceTime,\n prev: number,\n labels: Map\n): number {\n if (typeof next === \"number\") {\n return next\n } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next))\n } else if (next === \"<\") {\n return prev\n } else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)))\n } else {\n return labels.get(next) ?? current\n }\n}\n","import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n sequence: ValueSequence,\n startTime: number,\n endTime: number\n): void {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i]\n\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe)\n\n // If we remove this item we have to push the pointer back one\n i--\n }\n }\n}\n\nexport function addKeyframes(\n sequence: ValueSequence,\n keyframes: UnresolvedValueKeyframe[],\n easing: Easing | Easing[],\n offset: number[],\n startTime: number,\n endTime: number\n): void {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime)\n\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n })\n }\n}\n","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times: number[], repeat: number): void {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1)\n }\n}\n","import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n","import {\n AnimationScope,\n createGeneratorEasing,\n defaultOffset,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n fillOffset,\n GeneratorFactory,\n isGenerator,\n isMotionValue,\n Transition,\n UnresolvedValueKeyframe,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport {\n Easing,\n getEasingForSegment,\n invariant,\n progress,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n AnimationSequence,\n At,\n ResolvedAnimationDefinitions,\n SequenceMap,\n SequenceOptions,\n ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n sequence: AnimationSequence,\n { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n scope?: AnimationScope,\n generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n const defaultDuration = defaultTransition.duration || 0.3\n const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n const sequences = new Map()\n const elementCache = {}\n const timeLabels = new Map()\n\n let prevTime = 0\n let currentTime = 0\n let totalDuration = 0\n\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i]\n\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime)\n continue\n } else if (!Array.isArray(segment)) {\n timeLabels.set(\n segment.name,\n calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n )\n continue\n }\n\n let [subject, keyframes, transition = {}] = segment\n\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(\n currentTime,\n transition.at,\n prevTime,\n timeLabels\n )\n }\n\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0\n\n const resolveValueSequence = (\n valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n valueTransition: Transition | DynamicAnimationOptions,\n valueSequence: ValueSequence,\n elementIndex = 0,\n numSubjects = 0\n ) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n const {\n delay = 0,\n times = defaultOffset(valueKeyframesAsList),\n type = defaultTransition.type || \"keyframes\",\n repeat,\n repeatType,\n repeatDelay = 0,\n ...remainingTransition\n } = valueTransition\n let { ease = defaultTransition.ease || \"easeOut\", duration } =\n valueTransition\n\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay =\n typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay\n\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"]\n\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100\n if (\n numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)\n ) {\n const delta =\n valueKeyframesAsList[1] - valueKeyframesAsList[0]\n absoluteDelta = Math.abs(delta)\n }\n\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n }\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration)\n }\n\n const springEasing = createGeneratorEasing(\n springTransition,\n absoluteDelta,\n createGenerator\n )\n\n ease = springEasing.ease\n duration = springEasing.duration\n }\n\n duration ??= defaultDuration\n\n const startTime = currentTime + calculatedDelay\n\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1\n }\n\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length\n remainder > 0 && fillOffset(times, remainder)\n\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null)\n\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(\n repeat < MAX_REPEAT,\n \"Repeat count too high, must be less than 20\",\n \"repeat-count-high\"\n )\n\n duration = calculateRepeatDuration(\n duration,\n repeat,\n repeatDelay\n )\n\n const originalKeyframes = [...valueKeyframesAsList]\n const originalTimes = [...times]\n ease = Array.isArray(ease) ? [...ease] : [ease]\n const originalEase = [...ease]\n\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes)\n\n for (\n let keyframeIndex = 0;\n keyframeIndex < originalKeyframes.length;\n keyframeIndex++\n ) {\n times.push(\n originalTimes[keyframeIndex] + (repeatIndex + 1)\n )\n ease.push(\n keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(\n originalEase,\n keyframeIndex - 1\n )\n )\n }\n }\n\n normalizeTimes(times, repeat)\n }\n\n const targetTime = startTime + duration\n\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(\n valueSequence,\n valueKeyframesAsList,\n ease as Easing | Easing[],\n times,\n startTime,\n targetTime\n )\n\n maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n totalDuration = Math.max(targetTime, totalDuration)\n }\n\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences)\n resolveValueSequence(\n keyframes as AnyResolvedKeyframe,\n transition,\n getValueSequence(\"default\", subjectSequence)\n )\n } else {\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope,\n elementCache\n )\n\n const numSubjects = subjects.length\n\n /**\n * For every element in this segment, process the defined values.\n */\n for (\n let subjectIndex = 0;\n subjectIndex < numSubjects;\n subjectIndex++\n ) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes as DOMKeyframesDefinition\n transition = transition as DynamicAnimationOptions\n\n const thisSubject = subjects[subjectIndex]\n const subjectSequence = getSubjectSequence(\n thisSubject,\n sequences\n )\n\n for (const key in keyframes) {\n resolveValueSequence(\n keyframes[\n key as keyof typeof keyframes\n ] as UnresolvedValueKeyframe,\n getValueTransition(transition, key),\n getValueSequence(key, subjectSequence),\n subjectIndex,\n numSubjects\n )\n }\n }\n }\n\n prevTime = currentTime\n currentTime += maxDuration\n }\n\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key]\n\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime)\n\n const keyframes: UnresolvedValueKeyframe[] = []\n const valueOffset: number[] = []\n const valueEasing: Easing[] = []\n\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i]\n keyframes.push(value)\n valueOffset.push(progress(0, totalDuration, at))\n valueEasing.push(easing || \"easeOut\")\n }\n\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0)\n keyframes.unshift(keyframes[0])\n valueEasing.unshift(defaultSegmentEasing)\n }\n\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1)\n keyframes.push(null)\n }\n\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n })\n }\n\n const definition = animationDefinitions.get(element)!\n\n definition.keyframes[key] = keyframes\n\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } =\n defaultTransition\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n }\n }\n })\n\n return animationDefinitions\n}\n\nfunction getSubjectSequence(\n subject: Element | MotionValue | O,\n sequences: Map\n): SequenceMap {\n !sequences.has(subject) && sequences.set(subject, {})\n return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n if (!sequences[name]) sequences[name] = []\n return sequences[name]\n}\n\nfunction keyframesAsList(\n keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n transition: DynamicAnimationOptions & At,\n key: string\n): DynamicAnimationOptions {\n return transition && transition[key as keyof typeof transition]\n ? {\n ...transition,\n ...(transition[key as keyof typeof transition] as Transition),\n }\n : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n","import {\n HTMLVisualElement,\n isSVGElement,\n isSVGSVGElement,\n ObjectVisualElement,\n SVGVisualElement,\n visualElementStore,\n} from \"motion-dom\"\n\nexport function createDOMVisualElement(element: HTMLElement | SVGElement) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n }\n const node =\n isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options)\n\n node.mount(element as any)\n\n visualElementStore.set(element, node)\n}\n\nexport function createObjectVisualElement(subject: Object) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n }\n const node = new ObjectVisualElement(options)\n\n node.mount(subject)\n\n visualElementStore.set(subject, node)\n}\n","import {\n animateTarget,\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n AnyResolvedKeyframe,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n isMotionValue,\n MotionValue,\n TargetAndTransition,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n visualElementStore,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport {\n createDOMVisualElement,\n createObjectVisualElement,\n} from \"../utils/create-visual-element\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\nimport { resolveSubjects } from \"./resolve-subjects\"\nimport { animateSingleValue } from \"motion-dom\"\n\nexport type AnimationSubject = Element | MotionValue | any\n\nfunction isSingleValue(\n subject: unknown,\n keyframes: unknown\n): subject is MotionValue | AnyResolvedKeyframe {\n return (\n isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes))\n )\n}\n\n/**\n * Animate a string\n */\nexport function animateSubject(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a Element\n */\nexport function animateSubject(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a object\n */\nexport function animateSubject(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[] {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n if (isSingleValue(subject, keyframes)) {\n animations.push(\n animateSingleValue(\n subject,\n isDOMKeyframes(keyframes)\n ? (keyframes as any).default || keyframes\n : keyframes,\n options ? (options as any).default || options : options\n )\n )\n } else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations\n }\n\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope\n )\n\n const numSubjects = subjects.length\n\n invariant(\n Boolean(numSubjects),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i]\n\n const createVisualElement =\n thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement\n\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject as any)\n }\n\n const visualElement = visualElementStore.get(thisSubject)!\n const transition = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (\n \"delay\" in transition &&\n typeof transition.delay === \"function\"\n ) {\n transition.delay = transition.delay(i, numSubjects)\n }\n\n animations.push(\n ...animateTarget(\n visualElement,\n { ...(keyframes as {}), transition } as TargetAndTransition,\n {}\n )\n )\n }\n }\n\n return animations\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n motionValue,\n spring,\n} from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../sequence/types\"\nimport { animateSubject } from \"./subject\"\n\nexport function animateSequence(\n sequence: AnimationSequence,\n options?: SequenceOptions,\n scope?: AnimationScope\n) {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n /**\n * Pre-process: replace function segments with MotionValue segments,\n * subscribe callbacks immediately\n */\n const processedSequence = sequence.map((segment) => {\n if (Array.isArray(segment) && typeof segment[0] === \"function\") {\n const callback = segment[0] as (value: any) => void\n const mv = motionValue(0)\n mv.on(\"change\", callback)\n\n if (segment.length === 1) {\n return [mv, [0, 1]] as any\n } else if (segment.length === 2) {\n return [mv, [0, 1], segment[1]] as any\n } else {\n return [mv, segment[1], segment[2]] as any\n }\n }\n return segment\n }) as AnimationSequence\n\n const animationDefinitions = createAnimationsFromSequence(\n processedSequence,\n options,\n scope,\n { spring }\n )\n\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition))\n })\n\n return animations\n}\n","import type {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n MotionValue,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"motion-dom\"\nimport { GroupAnimationWithThen } from \"motion-dom\"\nimport { removeItem } from \"motion-utils\"\nimport {\n AnimationSequence,\n ObjectTarget,\n SequenceOptions,\n} from \"../sequence/types\"\nimport { animateSequence } from \"./sequence\"\nimport { animateSubject } from \"./subject\"\n\nfunction isSequence(value: unknown): value is AnimationSequence {\n return Array.isArray(value) && value.some(Array.isArray)\n}\n\ninterface ScopedAnimateOptions {\n scope?: AnimationScope\n reduceMotion?: boolean\n}\n\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options: ScopedAnimateOptions = {}) {\n const { scope, reduceMotion } = options\n /**\n * Animate a sequence\n */\n function scopedAnimate(\n sequence: AnimationSequence,\n options?: SequenceOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a string\n */\n function scopedAnimate(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an Element\n */\n function scopedAnimate(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an object\n */\n function scopedAnimate(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n let animations: AnimationPlaybackControlsWithThen[] = []\n let animationOnComplete: VoidFunction | undefined\n\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(\n subjectOrSequence,\n reduceMotion !== undefined\n ? { reduceMotion, ...(optionsOrKeyframes as SequenceOptions) }\n : (optionsOrKeyframes as SequenceOptions),\n scope\n )\n } else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {}\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete as VoidFunction\n }\n animations = animateSubject(\n subjectOrSequence as ElementOrSelector,\n optionsOrKeyframes as DOMKeyframesDefinition,\n (reduceMotion !== undefined\n ? { reduceMotion, ...rest }\n : rest) as DynamicAnimationOptions,\n scope\n )\n }\n\n const animation = new GroupAnimationWithThen(animations)\n\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete)\n }\n\n if (scope) {\n scope.animations.push(animation)\n animation.finished.then(() => {\n removeItem(scope.animations, animation)\n })\n }\n\n return animation\n }\n\n return scopedAnimate\n}\n\nexport const animate = createScopedAnimate()\n","import {\n animationMapKey,\n AnimationPlaybackControls,\n AnimationScope,\n applyPxDefaults,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n fillWildcards,\n getAnimationMap,\n getComputedStyle,\n getValueTransition,\n NativeAnimation,\n NativeAnimationOptions,\n resolveElements,\n UnresolvedValueKeyframe,\n ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n map: Map>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\n keyframes?: ValueKeyframe[]\n }\n}\n\nexport function animateElements(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return []\n }\n\n const elements = resolveElements(elementOrSelector, scope) as Array<\n HTMLElement | SVGElement\n >\n const numElements = elements.length\n\n invariant(\n Boolean(numElements),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions: AnimationDefinition[] = []\n\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i]\n const elementTransition: DynamicAnimationOptions = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements)\n }\n\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes]\n }\n\n const valueOptions = {\n ...getValueTransition(elementTransition as any, valueName),\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element)\n const key = animationMapKey(\n valueName,\n valueOptions.pseudoElement || \"\"\n )\n const currentAnimation = map.get(key)\n currentAnimation && currentAnimation.stop()\n\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten:\n !elementTransition.type && !elementTransition.ease,\n },\n })\n }\n }\n\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } =\n animationDefinitions[i]\n\n const { element, name, pseudoElement } = animationOptions\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name)\n }\n\n fillWildcards(unresolvedKeyframes)\n applyPxDefaults(unresolvedKeyframes, name)\n\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name))\n }\n\n animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n }\n\n /**\n * Step 3: Create new animations (write)\n */\n const animations: AnimationPlaybackControls[] = []\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i]\n const animation = new NativeAnimation(\n animationOptions as NativeAnimationOptions\n )\n\n map.set(key, animation)\n animation.finished.finally(() => map.delete(key))\n\n animations.push(animation)\n }\n\n return animations\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n","import { progress, velocityPerSecond } from \"motion-utils\"\nimport { AxisScrollInfo, ScrollInfo } from \"./types\"\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50\n\nconst createAxisInfo = (): AxisScrollInfo => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n})\n\nexport const createScrollInfo = (): ScrollInfo => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n})\n\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n} as const\n\nfunction updateAxisInfo(\n element: Element,\n axisName: \"x\" | \"y\",\n info: ScrollInfo,\n time: number\n) {\n const axis = info[axisName]\n const { length, position } = keys[axisName]\n\n const prev = axis.current\n const prevTime = info.time\n\n axis.current = element[`scroll${position}`]\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]\n\n axis.offset.length = 0\n axis.offset[0] = 0\n axis.offset[1] = axis.scrollLength\n axis.progress = progress(0, axis.scrollLength, axis.current)\n\n const elapsed = time - prevTime\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed)\n}\n\nexport function updateScrollInfo(\n element: Element,\n info: ScrollInfo,\n time: number\n) {\n updateAxisInfo(element, \"x\", info, time)\n updateAxisInfo(element, \"y\", info, time)\n info.time = time\n}\n","import { isHTMLElement } from \"motion-dom\"\n\nexport function calcInset(element: Element, container: Element) {\n const inset = { x: 0, y: 0 }\n\n let current: Element | null = element\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft\n inset.y += current.offsetTop\n current = current.offsetParent\n } else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect()\n current = current.parentElement!\n const parentBoundingBox = current.getBoundingClientRect()\n inset.x += svgBoundingBox.left - parentBoundingBox.left\n inset.y += svgBoundingBox.top - parentBoundingBox.top\n } else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox()\n inset.x += x\n inset.y += y\n\n let svg: SVGElement | null = null\n let parent: SVGElement = current.parentNode as SVGElement\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent\n }\n parent = current.parentNode as SVGElement\n }\n current = svg\n } else {\n break\n }\n }\n\n return inset\n}\n","import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record = {\n start: 0,\n center: 0.5,\n end: 1,\n}\n\nexport function resolveEdge(edge: Edge, length: number, inset = 0) {\n let delta = 0\n\n /**\n * If we have this edge defined as a preset, replace the definition\n * with the numerical value.\n */\n if (edge in namedEdges) {\n edge = namedEdges[edge as NamedEdges]\n }\n\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge)\n\n if (edge.endsWith(\"px\")) {\n delta = asNumber\n } else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100\n } else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth\n } else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight\n } else {\n edge = asNumber\n }\n }\n\n /**\n * If the edge is defined as a number, handle as a progress value.\n */\n if (typeof edge === \"number\") {\n delta = length * edge\n }\n\n return inset + delta\n}\n","import { Edge, EdgeString, Intersection, ProgressIntersection } from \"../types\"\nimport { namedEdges, resolveEdge } from \"./edge\"\n\nconst defaultOffset: ProgressIntersection = [0, 0]\n\nexport function resolveOffset(\n offset: Edge | Intersection | ProgressIntersection,\n containerLength: number,\n targetLength: number,\n targetInset: number\n) {\n let offsetDefinition: ProgressIntersection | [EdgeString, EdgeString] =\n Array.isArray(offset) ? offset : defaultOffset\n\n let targetPoint = 0\n let containerPoint = 0\n\n if (typeof offset === \"number\") {\n /**\n * If we're provided offset: [0, 0.5, 1] then each number x should become\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n * and container etc.\n */\n offsetDefinition = [offset, offset]\n } else if (typeof offset === \"string\") {\n offset = offset.trim() as EdgeString\n\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \") as [EdgeString, EdgeString]\n } else {\n /**\n * If we're provided a definition like \"100px\" then we want to apply\n * that only to the top of the target point, leaving the container at 0.\n * Whereas a named offset like \"end\" should be applied to both.\n */\n offsetDefinition = [offset, namedEdges[offset as keyof typeof namedEdges] ? offset : `0`]\n }\n }\n\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset)\n containerPoint = resolveEdge(offsetDefinition[1], containerLength)\n\n return targetPoint - containerPoint\n}\n","import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record = {\n Enter: [\n [0, 1],\n [1, 1],\n ],\n Exit: [\n [0, 0],\n [1, 0],\n ],\n Any: [\n [1, 0],\n [0, 1],\n ],\n All: [\n [0, 0],\n [1, 1],\n ],\n}\n","import { defaultOffset, interpolate } from \"motion-dom\"\nimport { clamp } from \"motion-utils\"\nimport { ScrollInfo, ScrollInfoOptions } from \"../types\"\nimport { calcInset } from \"./inset\"\nimport { resolveOffset } from \"./offset\"\nimport { ScrollOffset } from \"./presets\"\n\nconst point = { x: 0, y: 0 }\n\nfunction getTargetSize(target: Element) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? (target as SVGGraphicsElement).getBBox()\n : { width: target.clientWidth, height: target.clientHeight }\n}\n\nexport function resolveOffsets(\n container: Element,\n info: ScrollInfo,\n options: ScrollInfoOptions\n) {\n const { offset: offsetDefinition = ScrollOffset.All } = options\n const { target = container, axis = \"y\" } = options\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\"\n\n const inset = target !== container ? calcInset(target, container) : point\n\n /**\n * Measure the target and container. If they're the same thing then we\n * use the container's scrollWidth/Height as the target, from there\n * all other calculations can remain the same.\n */\n const targetSize =\n target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target)\n\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\n }\n\n /**\n * Reset the length of the resolved offset array rather than creating a new one.\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\n */\n info[axis].offset.length = 0\n\n /**\n * Populate the offset array by resolving the user's offset definition into\n * a list of pixel scroll offets.\n */\n let hasChanged = !info[axis].interpolate\n\n const numOffsets = offsetDefinition.length\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(\n offsetDefinition[i],\n containerSize[lengthLabel],\n targetSize[lengthLabel],\n inset[axis]\n )\n\n if (!hasChanged && offset !== info[axis].interpolatorOffsets![i]) {\n hasChanged = true\n }\n\n info[axis].offset[i] = offset\n }\n\n /**\n * If the pixel scroll offsets have changed, create a new interpolator function\n * to map scroll value into a progress.\n */\n if (hasChanged) {\n info[axis].interpolate = interpolate(\n info[axis].offset,\n defaultOffset(offsetDefinition),\n { clamp: false }\n )\n\n info[axis].interpolatorOffsets = [...info[axis].offset]\n }\n\n info[axis].progress = clamp(\n 0,\n 1,\n info[axis].interpolate!(info[axis].current)\n )\n}\n","import { warnOnce } from \"motion-utils\"\nimport { updateScrollInfo } from \"./info\"\nimport { resolveOffsets } from \"./offsets/index\"\nimport {\n OnScrollHandler,\n OnScrollInfo,\n ScrollInfo,\n ScrollInfoOptions,\n} from \"./types\"\n\nfunction measure(\n container: Element,\n target: Element = container,\n info: ScrollInfo\n) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0\n info.y.targetOffset = 0\n if (target !== container) {\n let node = target as HTMLElement\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft\n info.y.targetOffset += node.offsetTop\n node = node.offsetParent as HTMLElement\n }\n }\n\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight\n info.x.containerLength = container.clientWidth\n info.y.containerLength = container.clientHeight\n\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(\n getComputedStyle(container).position !== \"static\",\n \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\"\n )\n }\n }\n}\n\nexport function createOnScrollHandler(\n element: Element,\n onScroll: OnScrollInfo,\n info: ScrollInfo,\n options: ScrollInfoOptions = {}\n): OnScrollHandler {\n return {\n measure: (time) => {\n measure(element, options.target, info)\n updateScrollInfo(element, info, time)\n\n if (options.offset || options.target) {\n resolveOffsets(element, info, options)\n }\n },\n notify: () => onScroll(info),\n }\n}\n","import { cancelFrame, frame, frameData, resize, Process } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { createScrollInfo } from \"./info\"\nimport { createOnScrollHandler } from \"./on-scroll-handler\"\nimport { OnScrollHandler, OnScrollInfo, ScrollInfoOptions } from \"./types\"\n\nconst scrollListeners = new WeakMap()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\n\nconst getEventTarget = (element: Element) =>\n element === document.scrollingElement ? window : element\n\nexport function scrollInfo(\n onScroll: OnScrollInfo,\n {\n container = document.scrollingElement as Element,\n trackContentSize = false,\n ...options\n }: ScrollInfoOptions = {}\n) {\n if (!container) return noop as VoidFunction\n\n let containerHandlers = onScrollHandlers.get(container)\n\n /**\n * Get the onScroll handlers for this container.\n * If one isn't found, create a new one.\n */\n if (!containerHandlers) {\n containerHandlers = new Set()\n onScrollHandlers.set(container, containerHandlers)\n }\n\n /**\n * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo()\n const containerHandler = createOnScrollHandler(\n container,\n onScroll,\n info,\n options\n )\n containerHandlers.add(containerHandler)\n\n /**\n * Check if there's a scroll event listener for this container.\n * If not, create one.\n */\n if (!scrollListeners.has(container)) {\n const measureAll = () => {\n for (const handler of containerHandlers) {\n handler.measure(frameData.timestamp)\n }\n\n frame.preUpdate(notifyAll)\n }\n\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify()\n }\n }\n\n const listener = () => frame.read(measureAll)\n\n scrollListeners.set(container, listener)\n\n const target = getEventTarget(container)\n window.addEventListener(\"resize\", listener, { passive: true })\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener))\n }\n\n target.addEventListener(\"scroll\", listener, { passive: true })\n\n listener()\n }\n\n /**\n * Enable content size tracking if requested and not already enabled.\n */\n if (trackContentSize && !dimensionCheckProcesses.has(container)) {\n const listener = scrollListeners.get(container)!\n\n // Store initial scroll dimensions (object is reused to avoid allocation)\n const size = {\n width: container.scrollWidth,\n height: container.scrollHeight,\n }\n scrollSize.set(container, size)\n\n // Add frame-based scroll dimension checking to detect content changes\n const checkScrollDimensions: Process = () => {\n const newWidth = container.scrollWidth\n const newHeight = container.scrollHeight\n\n if (size.width !== newWidth || size.height !== newHeight) {\n listener()\n size.width = newWidth\n size.height = newHeight\n }\n }\n\n // Schedule with keepAlive=true to run every frame\n const dimensionCheckProcess = frame.read(checkScrollDimensions, true)\n dimensionCheckProcesses.set(container, dimensionCheckProcess)\n }\n\n const listener = scrollListeners.get(container)!\n frame.read(listener, false, true)\n\n return () => {\n cancelFrame(listener)\n\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container)\n if (!currentHandlers) return\n\n currentHandlers.delete(containerHandler)\n\n if (currentHandlers.size) return\n\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container)\n scrollListeners.delete(container)\n\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\n \"scroll\",\n scrollListener\n )\n resizeListeners.get(container)?.()\n window.removeEventListener(\"resize\", scrollListener)\n }\n\n // Clean up scroll dimension checking\n const dimensionCheckProcess = dimensionCheckProcesses.get(container)\n if (dimensionCheckProcess) {\n cancelFrame(dimensionCheckProcess)\n dimensionCheckProcesses.delete(container)\n }\n scrollSize.delete(container)\n }\n}\n","import { supportsScrollTimeline } from \"motion-dom\"\n\nexport function canUseNativeTimeline(target?: Element) {\n return (\n typeof window !== \"undefined\" && !target && supportsScrollTimeline()\n )\n}\n","import { ProgressTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"../track\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n Element,\n Map\n>()\n\nfunction scrollTimelineFallback(options: ScrollOptionsWithDefaults) {\n const currentTime = { value: 0 }\n\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis!].progress * 100\n }, options)\n\n return { currentTime, cancel }\n}\n\nexport function getTimeline({\n source,\n container,\n ...options\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n const { axis } = options\n\n if (source) container = source\n\n const containerCache = timelineCache.get(container) ?? new Map()\n timelineCache.set(container, containerCache)\n\n const targetKey = options.target ?? \"self\"\n const targetCache = containerCache.get(targetKey) ?? {}\n\n const axisKey = axis + (options.offset ?? []).join(\",\")\n\n if (!targetCache[axisKey]) {\n targetCache[axisKey] =\n canUseNativeTimeline(options.target)\n ? new ScrollTimeline({ source: container, axis } as any)\n : scrollTimelineFallback({ container, ...options })\n }\n\n return targetCache[axisKey]!\n}\n","import { AnimationPlaybackControls, observeTimeline } from \"motion-dom\"\nimport { ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\nexport function attachToAnimation(\n animation: AnimationPlaybackControls,\n options: ScrollOptionsWithDefaults\n) {\n const timeline = getTimeline(options)\n\n return animation.attachTimeline({\n timeline: options.target ? undefined : timeline,\n observe: (valueAnimation) => {\n valueAnimation.pause()\n\n return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress\n }, timeline)\n },\n })\n}\n","import { observeTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"./track\"\nimport { OnScroll, OnScrollWithInfo, ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\n/**\n * If the onScroll function has two arguments, it's expecting\n * more specific information about the scroll from scrollInfo.\n */\nfunction isOnScrollWithInfo(onScroll: OnScroll): onScroll is OnScrollWithInfo {\n return onScroll.length === 2\n}\n\nexport function attachToFunction(\n onScroll: OnScroll,\n options: ScrollOptionsWithDefaults\n) {\n if (isOnScrollWithInfo(onScroll)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis!].progress, info)\n }, options)\n } else {\n return observeTimeline(onScroll, getTimeline(options))\n }\n}\n","import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { attachToFunction } from \"./attach-function\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n onScroll: OnScroll | AnimationPlaybackControls,\n {\n axis = \"y\",\n container = document.scrollingElement as Element,\n ...options\n }: ScrollOptions = {}\n): VoidFunction {\n if (!container) return noop as VoidFunction\n\n const optionsWithDefaults = { axis, container, ...options }\n\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults)\n}\n","import { ElementOrSelector, resolveElements } from \"motion-dom\"\n\nexport type ViewChangeHandler = (entry: IntersectionObserverEntry) => void\n\ntype MarginValue = `${number}${\"px\" | \"%\"}`\ntype MarginType =\n | MarginValue\n | `${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`\n\nexport interface InViewOptions {\n root?: Element | Document\n margin?: MarginType\n amount?: \"some\" | \"all\" | number\n}\n\nconst thresholds = {\n some: 0,\n all: 1,\n}\n\nexport function inView(\n elementOrSelector: ElementOrSelector,\n onStart: (\n element: Element,\n entry: IntersectionObserverEntry\n ) => void | ViewChangeHandler,\n { root, margin: rootMargin, amount = \"some\" }: InViewOptions = {}\n): VoidFunction {\n const elements = resolveElements(elementOrSelector)\n\n const activeIntersections = new WeakMap()\n\n const onIntersectionChange: IntersectionObserverCallback = (entries) => {\n entries.forEach((entry) => {\n const onEnd = activeIntersections.get(entry.target)\n\n /**\n * If there's no change to the intersection, we don't need to\n * do anything here.\n */\n if (entry.isIntersecting === Boolean(onEnd)) return\n\n if (entry.isIntersecting) {\n const newOnEnd = onStart(entry.target, entry)\n if (typeof newOnEnd === \"function\") {\n activeIntersections.set(entry.target, newOnEnd)\n } else {\n observer.unobserve(entry.target)\n }\n } else if (typeof onEnd === \"function\") {\n onEnd(entry)\n activeIntersections.delete(entry.target)\n }\n })\n }\n\n const observer = new IntersectionObserver(onIntersectionChange, {\n root,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n })\n\n elements.forEach((element) => observer.observe(element))\n\n return () => observer.disconnect()\n}\n","import { Point } from \"motion-utils\"\n\nexport const distance = (a: number, b: number) => Math.abs(a - b)\n\nexport function distance2D(a: Point, b: Point): number {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x)\n const yDelta = distance(a.y, b.y)\n return Math.sqrt(xDelta ** 2 + yDelta ** 2)\n}\n"],"names":["resolveElements","removeItem","mixNumber","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","invariant","isMotionValue","progress","isSVGElement","isSVGSVGElement","SVGVisualElement","HTMLVisualElement","visualElementStore","ObjectVisualElement","animateSingleValue","animateTarget","motionValue","spring","GroupAnimationWithThen","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","velocityPerSecond","isHTMLElement","interpolate","clamp","warnOnce","noop","frameData","frame","resize","cancelFrame","supportsScrollTimeline","observeTimeline"],"mappings":";;;;;;;AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACrE;;ACGM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE,CAAA;KACZ;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAOA,yBAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,CAAA;KACxD;AAAM,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;KAC7B;AAAM,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAA;KAC1C;SAAM;QACH,OAAO,CAAC,OAAO,CAAC,CAAA;KACnB;AACL;;SCpCgB,uBAAuB,CACnC,QAAgB,EAChB,MAAc,EACd,YAAoB,EAAA;AAEpB,IAAA,OAAO,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC,CAAA;AAClC;;ACJA;;;AAGG;AACG,SAAU,YAAY,CACxB,OAAe,EACf,IAAkB,EAClB,IAAY,EACZ,MAA2B,EAAA;AAE3B,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,OAAO,IAAI,CAAA;KACd;AAAM,SAAA,IAAI,IAAI,CAAC,U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A,SAAS,EAAE,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;AACtE,KAAA,CAAC,CAAA;AAEF,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;AAExD,IAAA,OAAO,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAA;AACtC;;ACjEa,MAAA,QAAQ,GAAG,CAAC,CAAS,EAAE,CAAS,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAC;AAEjD,SAAA,UAAU,CAAC,CAAQ,EAAE,CAAQ,EAAA;;AAEzC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,IAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAA;AAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/feature-bundle-Cb13qNcx.js b/node_modules/framer-motion/dist/cjs/feature-bundle-Cb13qNcx.js new file mode 100644 index 00000000..46c961ca --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/feature-bundle-Cb13qNcx.js @@ -0,0 +1,2380 @@ +'use strict'; + +var motionDom = require('motion-dom'); +var React = require('react'); +var jsxRuntime = require('react/jsx-runtime'); +var motionUtils = require('motion-utils'); + +const LayoutGroupContext = React.createContext({}); + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + const ref = React.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +const isBrowser = typeof window !== "undefined"; + +const useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect; + +/** + * @public + */ +const PresenceContext = +/* @__PURE__ */ React.createContext(null); + +/** + * @public + */ +const MotionConfigContext = React.createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never", +}); + +/** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ +function usePresence(subscribe = true) { + const context = React.useContext(PresenceContext); + if (context === null) + return [true, null]; + const { isPresent, onExitComplete, register } = context; + // It's safe to call the following hooks conditionally (after an early return) because the context will always + // either be null or non-null for the lifespan of the component. + const id = React.useId(); + React.useEffect(() => { + if (subscribe) { + return register(id); + } + }, [subscribe]); + const safeToRemove = React.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; +} +/** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ +function useIsPresent() { + return isPresent(React.useContext(PresenceContext)); +} +function isPresent(context) { + return context === null ? true : context.isPresent; +} + +const LazyContext = React.createContext({ strict: false }); + +const featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag", + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"], +}; +let isInitialized = false; +/** + * Initialize feature definitions with isEnabled checks. + * This must be called before any motion components are rendered. + */ +function initFeatureDefinitions() { + if (isInitialized) + return; + const initialFeatureDefinitions = {}; + for (const key in featureProps) { + initialFeatureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]), + }; + } + motionDom.setFeatureDefinitions(initialFeatureDefinitions); + isInitialized = true; +} +/** + * Get the current feature definitions, initializing if needed. + */ +function getInitializedFeatureDefinitions() { + initFeatureDefinitions(); + return motionDom.getFeatureDefinitions(); +} + +function loadFeatures(features) { + const featureDefinitions = getInitializedFeatureDefinitions(); + for (const key in features) { + featureDefinitions[key] = { + ...featureDefinitions[key], + ...features[key], + }; + } + motionDom.setFeatureDefinitions(featureDefinitions); +} + +/** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ +const validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "custom", + "inherit", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "globalTapTarget", + "propagate", + "ignoreStrict", + "viewport", +]); +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +function isValidMotionProp(key) { + return (key.startsWith("while") || + (key.startsWith("drag") && key !== "draggable") || + key.startsWith("layout") || + key.startsWith("onTap") || + key.startsWith("onPan") || + key.startsWith("onLayout") || + validMotionProps.has(key)); +} + +let shouldForward = (key) => !isValidMotionProp(key); +function loadExternalIsValidProp(isValidProp) { + if (typeof isValidProp !== "function") + return; + // Explicitly filter our events + shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); +} +/** + * Emotion and Styled Components both allow users to pass through arbitrary props to their components + * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which + * of these should be passed to the underlying DOM node. + * + * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props + * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props + * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of + * `@emotion/is-prop-valid`, however to fix this problem we need to use it. + * + * By making it an optionalDependency we can offer this functionality only in the situations where it's + * actually required. + */ +try { + /** + * We attempt to import this package but require won't be defined in esm environments, in that case + * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed + * in favour of explicit injection. + */ + loadExternalIsValidProp(require("@emotion/is-prop-valid").default); +} +catch { + // We don't need to actually do anything here - the fallback is the existing `isPropValid`. +} +function filterProps(props, isDom, forwardMotionProps) { + const filteredProps = {}; + for (const key in props) { + /** + * values is considered a valid prop by Emotion, so if it's present + * this will be rendered out to the DOM unless explicitly filtered. + * + * We check the type as it could be used with the `feColorMatrix` + * element, which we support. + */ + if (key === "values" && typeof props.values === "object") + continue; + if (shouldForward(key) || + (forwardMotionProps === true && isValidMotionProp(key)) || + (!isDom && !isValidMotionProp(key)) || + // If trying to use native HTML drag events, forward drag listeners + (props["draggable"] && + key.startsWith("onDrag"))) { + filteredProps[key] = + props[key]; + } + } + return filteredProps; +} + +/** + * We keep these listed separately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ +const lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view", +]; + +function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } + else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/u.test(Component)) { + return true; + } + return false; +} + +const createDomVisualElement = (Component, options) => { + /** + * Use explicit isSVG override if provided, otherwise auto-detect + */ + const isSVG = options.isSVG ?? isSVGComponent(Component); + return isSVG + ? new motionDom.SVGVisualElement(options) + : new motionDom.HTMLVisualElement(options, { + allowProjection: Component !== React.Fragment, + }); +}; + +const MotionContext = /* @__PURE__ */ React.createContext({}); + +function getCurrentTreeVariants(props, context) { + if (motionDom.isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || motionDom.isVariantLabel(initial) + ? initial + : undefined, + animate: motionDom.isVariantLabel(animate) ? animate : undefined, + }; + } + return props.inherit !== false ? context : {}; +} + +function useCreateMotionContext(props) { + const { initial, animate } = getCurrentTreeVariants(props, React.useContext(MotionContext)); + return React.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); +} +function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; +} + +const createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {}, +}); + +function copyRawValuesOnly(target, source, props) { + for (const key in source) { + if (!motionDom.isMotionValue(source[key]) && !motionDom.isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } +} +function useInitialMotionValues({ transformTemplate }, visualState) { + return React.useMemo(() => { + const state = createHtmlRenderState(); + motionDom.buildHTMLStyles(state, visualState, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); +} +function useStyle(props, visualState) { + const styleProp = props.style || {}; + const style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState)); + return style; +} +function useHTMLProps(props, visualState) { + // The `any` isn't ideal but it is the type of createElement props argument + const htmlProps = {}; + const style = useStyle(props, visualState); + if (props.drag && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = + style.WebkitUserSelect = + style.WebkitTouchCallout = + "none"; + // Disable scrolling on the draggable direction + style.touchAction = + props.drag === true + ? "none" + : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && + (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; +} + +const createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {}, +}); + +function useSVGProps(props, visualState, _isStatic, Component) { + const visualProps = React.useMemo(() => { + const state = createSvgRenderState(); + motionDom.buildSVGAttrs(state, visualState, motionDom.isSVGTag(Component), props.transformTemplate, props.style); + return { + ...state.attrs, + style: { ...state.style }, + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; +} + +function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) { + const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); + const elementProps = Component !== React.Fragment ? { ...filteredProps, ...visualProps, ref } : {}; + /** + * If component has been handed a motion value as its child, + * memoise its initial value and render that. Subsequent updates + * will be handled by the onChange handler + */ + const { children } = props; + const renderedChildren = React.useMemo(() => (motionDom.isMotionValue(children) ? children.get() : children), [children]); + return React.createElement(Component, { + ...elementProps, + children: renderedChildren, + }); +} + +function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState(), + }; + return state; +} +function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = motionDom.resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants = motionDom.isControllingVariants(props); + const isVariantNode = motionDom.isVariantNode(props); + if (context && + isVariantNode && + !isControllingVariants && + props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext + ? presenceContext.initial === false + : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && + typeof variantToSet !== "boolean" && + !motionDom.isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + for (let i = 0; i < list.length; i++) { + const resolved = motionDom.resolveVariantFromProps(props, list[i]); + if (resolved) { + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + const index = isInitialAnimationBlocked + ? valueTarget.length - 1 + : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) { + values[key] = transitionEnd[key]; + } + } + } + } + return values; +} +const makeUseVisualState = (config) => (props, isStatic) => { + const context = React.useContext(MotionContext); + const presenceContext = React.useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); +}; + +const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: motionDom.scrapeHTMLMotionValuesFromProps, + createRenderState: createHtmlRenderState, +}); + +const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: motionDom.scrapeSVGMotionValuesFromProps, + createRenderState: createSvgRenderState, +}); + +const motionComponentSymbol = Symbol.for("motionComponentSymbol"); + +/** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ +function useMotionRef(visualState, visualElement, externalRef) { + /** + * Store externalRef in a ref to avoid including it in the useCallback + * dependency array. Including externalRef in dependencies causes issues + * with libraries like Radix UI that create new callback refs on each render + * when using asChild - this would cause the callback to be recreated, + * triggering element remounts and breaking AnimatePresence exit animations. + */ + const externalRefContainer = React.useRef(externalRef); + React.useInsertionEffect(() => { + externalRefContainer.current = externalRef; + }); + // Store cleanup function returned by callback refs (React 19 feature) + const refCleanup = React.useRef(null); + return React.useCallback((instance) => { + if (instance) { + visualState.onMount?.(instance); + } + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + const ref = externalRefContainer.current; + if (typeof ref === "function") { + if (instance) { + const cleanup = ref(instance); + if (typeof cleanup === "function") { + refCleanup.current = cleanup; + } + } + else if (refCleanup.current) { + refCleanup.current(); + refCleanup.current = null; + } + else { + ref(instance); + } + } + else if (ref) { + ref.current = instance; + } + }, [visualElement]); +} + +/** + * Internal, exported only for usage in Framer + */ +const SwitchLayoutGroupContext = React.createContext({}); + +function isRefObject(ref) { + return (ref && + typeof ref === "object" && + Object.prototype.hasOwnProperty.call(ref, "current")); +} + +function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { + const { visualElement: parent } = React.useContext(MotionContext); + const lazyContext = React.useContext(LazyContext); + const presenceContext = React.useContext(PresenceContext); + const motionConfig = React.useContext(MotionConfigContext); + const reducedMotionConfig = motionConfig.reducedMotion; + const skipAnimations = motionConfig.skipAnimations; + const visualElementRef = React.useRef(null); + /** + * Track whether the component has been through React's commit phase. + * Used to detect when LazyMotion features load after the component has mounted. + */ + const hasMountedOnce = React.useRef(false); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + createVisualElement = + createVisualElement || + lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext + ? presenceContext.initial === false + : false, + reducedMotionConfig, + skipAnimations, + isSVG, + }); + /** + * If the component has already mounted before features loaded (e.g. via + * LazyMotion with async feature loading), we need to force the initial + * animation to run. Otherwise state changes that occurred before features + * loaded will be lost and the element will snap to its final state. + */ + if (hasMountedOnce.current && visualElementRef.current) { + visualElementRef.current.manuallyAnimateOnMount = true; + } + } + const visualElement = visualElementRef.current; + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + const initialLayoutGroupConfig = React.useContext(SwitchLayoutGroupContext); + if (visualElement && + !visualElement.projection && + ProjectionNodeConstructor && + (visualElement.type === "html" || visualElement.type === "svg")) { + createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); + } + const isMounted = React.useRef(false); + React.useInsertionEffect(() => { + /** + * Check the component has already mounted before calling + * `update` unnecessarily. This ensures we skip the initial update. + */ + if (visualElement && isMounted.current) { + visualElement.update(props, presenceContext); + } + }); + /** + * Cache this value as we want to know whether HandoffAppearAnimations + * was present on initial render - it will be deleted after this. + */ + const optimisedAppearId = props[motionDom.optimizedAppearDataAttribute]; + const wantsHandoff = React.useRef(Boolean(optimisedAppearId) && + !window.MotionHandoffIsComplete?.(optimisedAppearId) && + window.MotionHasOptimisedAnimation?.(optimisedAppearId)); + useIsomorphicLayoutEffect(() => { + /** + * Track that this component has mounted. This is used to detect when + * LazyMotion features load after the component has already committed. + */ + hasMountedOnce.current = true; + if (!visualElement) + return; + isMounted.current = true; + window.MotionIsMounted = true; + visualElement.updateFeatures(); + visualElement.scheduleRenderMicrotask(); + /** + * Ideally this function would always run in a useEffect. + * + * However, if we have optimised appear animations to handoff from, + * it needs to happen synchronously to ensure there's no flash of + * incorrect styles in the event of a hydration error. + * + * So if we detect a situtation where optimised appear animations + * are running, we use useLayoutEffect to trigger animations. + */ + if (wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + React.useEffect(() => { + if (!visualElement) + return; + if (!wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + if (wantsHandoff.current) { + // This ensures all future calls to animateChanges() in this component will run in useEffect + queueMicrotask(() => { + window.MotionHandoffMarkAsComplete?.(optimisedAppearId); + }); + wantsHandoff.current = false; + } + /** + * Now we've finished triggering animations for this element we + * can wipe the enteringChildren set for the next render. + */ + visualElement.enteringChildren = undefined; + }); + return visualElement; +} +function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { + const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props; + visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] + ? undefined + : getClosestProjectingNode(visualElement.parent)); + visualElement.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), + visualElement, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig, + crossfade: layoutCrossfade, + layoutScroll, + layoutRoot, + }); +} +function getClosestProjectingNode(visualElement) { + if (!visualElement) + return undefined; + return visualElement.options.allowProjection !== false + ? visualElement.projection + : getClosestProjectingNode(visualElement.parent); +} + +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { + preloadedFeatures && loadFeatures(preloadedFeatures); + /** + * Determine whether to use SVG or HTML rendering based on: + * 1. Explicit `type` option (highest priority) + * 2. Auto-detection via `isSVGComponent` + */ + const isSVG = type ? type === "svg" : isSVGComponent(Component); + const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; + function MotionDOMComponent(props, externalRef) { + /** + * If we need to measure the element we load this functionality in a + * separate class component in order to gain access to getSnapshotBeforeUpdate. + */ + let MeasureLayout; + const configAndProps = { + ...React.useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props), + }; + const { isStatic } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && isBrowser) { + useStrictMode(configAndProps, preloadedFeatures); + const layoutProjection = getProjectionFunctionality(configAndProps); + MeasureLayout = layoutProjection.MeasureLayout; + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return (jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsxRuntime.jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] })); + } + MotionDOMComponent.displayName = `motion.${typeof Component === "string" + ? Component + : `create(${Component.displayName ?? Component.name ?? ""})`}`; + const ForwardRefMotionComponent = React.forwardRef(MotionDOMComponent); + ForwardRefMotionComponent[motionComponentSymbol] = Component; + return ForwardRefMotionComponent; +} +function useLayoutId({ layoutId }) { + const layoutGroupId = React.useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined + ? layoutGroupId + "-" + layoutId + : layoutId; +} +function useStrictMode(configAndProps, preloadedFeatures) { + const isStrict = React.useContext(LazyContext).strict; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (process.env.NODE_ENV !== "production" && + preloadedFeatures && + isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + configAndProps.ignoreStrict + ? motionUtils.warning(false, strictMessage, "lazy-strict-mode") + : motionUtils.invariant(false, strictMessage, "lazy-strict-mode"); + } +} +function getProjectionFunctionality(props) { + const featureDefinitions = getInitializedFeatureDefinitions(); + const { drag, layout } = featureDefinitions; + if (!drag && !layout) + return {}; + const combined = { ...drag, ...layout }; + return { + MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) + ? combined.MeasureLayout + : undefined, + ProjectionNode: combined.ProjectionNode, + }; +} + +class AnimationFeature extends motionDom.Feature { + /** + * We dynamically generate the AnimationState manager as it contains a reference + * to the underlying animation library. We only want to load that if we load this, + * so people can optionally code split it out using the `m` component. + */ + constructor(node) { + super(node); + node.animationState || (node.animationState = motionDom.createAnimationState(node)); + } + updateAnimationControlsSubscription() { + const { animate } = this.node.getProps(); + if (motionDom.isAnimationControls(animate)) { + this.unmountControls = animate.subscribe(this.node); + } + } + /** + * Subscribe any provided AnimationControls to the component's VisualElement + */ + mount() { + this.updateAnimationControlsSubscription(); + } + update() { + const { animate } = this.node.getProps(); + const { animate: prevAnimate } = this.node.prevProps || {}; + if (animate !== prevAnimate) { + this.updateAnimationControlsSubscription(); + } + } + unmount() { + this.node.animationState.reset(); + this.unmountControls?.(); + } +} + +let id = 0; +class ExitAnimationFeature extends motionDom.Feature { + constructor() { + super(...arguments); + this.id = id++; + } + update() { + if (!this.node.presenceContext) + return; + const { isPresent, onExitComplete } = this.node.presenceContext; + const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; + if (!this.node.animationState || isPresent === prevIsPresent) { + return; + } + const exitAnimation = this.node.animationState.setActive("exit", !isPresent); + if (onExitComplete && !isPresent) { + exitAnimation.then(() => { + onExitComplete(this.id); + }); + } + } + mount() { + const { register, onExitComplete } = this.node.presenceContext || {}; + if (onExitComplete) { + onExitComplete(this.id); + } + if (register) { + this.unmount = register(this.id); + } + } + unmount() { } +} + +const animations = { + animation: { + Feature: AnimationFeature, + }, + exit: { + Feature: ExitAnimationFeature, + }, +}; + +function extractEventInfo(event) { + return { + point: { + x: event.pageX, + y: event.pageY, + }, + }; +} +const addPointerInfo = (handler) => { + return (event) => motionDom.isPrimaryPointer(event) && handler(event, extractEventInfo(event)); +}; + +function addPointerEvent(target, eventName, handler, options) { + return motionDom.addDomEvent(target, eventName, addPointerInfo(handler), options); +} + +// Fixes https://github.com/motiondivision/motion/issues/2270 +const getContextWindow = ({ current }) => { + return current ? current.ownerDocument.defaultView : null; +}; + +const distance = (a, b) => Math.abs(a - b); +function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); +} + +const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]); +/** + * @internal + */ +class PanSession { + constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { + /** + * @internal + */ + this.startEvent = null; + /** + * @internal + */ + this.lastMoveEvent = null; + /** + * @internal + */ + this.lastMoveEventInfo = null; + /** + * @internal + */ + this.handlers = {}; + /** + * @internal + */ + this.contextWindow = window; + /** + * Scroll positions of scrollable ancestors and window. + * @internal + */ + this.scrollPositions = new Map(); + /** + * Cleanup function for scroll listeners. + * @internal + */ + this.removeScrollListeners = null; + this.onElementScroll = (event) => { + this.handleScroll(event.target); + }; + this.onWindowScroll = () => { + this.handleScroll(window); + }; + this.updatePoint = () => { + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const info = getPanInfo(this.lastMoveEventInfo, this.history); + const isPanStarted = this.startEvent !== null; + // Only start panning if the offset is larger than 3 pixels. If we make it + // any larger than this we'll want to reset the pointer history + // on the first update to avoid visual snapping to the cursor. + const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; + if (!isPanStarted && !isDistancePastThreshold) + return; + const { point } = info; + const { timestamp } = motionDom.frameData; + this.history.push({ ...point, timestamp }); + const { onStart, onMove } = this.handlers; + if (!isPanStarted) { + onStart && onStart(this.lastMoveEvent, info); + this.startEvent = this.lastMoveEvent; + } + onMove && onMove(this.lastMoveEvent, info); + }; + this.handlePointerMove = (event, info) => { + this.lastMoveEvent = event; + this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); + // Throttle mouse move event to once per frame + motionDom.frame.update(this.updatePoint, true); + }; + this.handlePointerUp = (event, info) => { + this.end(); + const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; + // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) + // This ensures constraint animations continue when interrupted by a click + if (this.dragSnapToOrigin || !this.startEvent) { + resumeAnimation && resumeAnimation(); + } + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const panInfo = getPanInfo(event.type === "pointercancel" + ? this.lastMoveEventInfo + : transformPoint(info, this.transformPagePoint), this.history); + if (this.startEvent && onEnd) { + onEnd(event, panInfo); + } + onSessionEnd && onSessionEnd(event, panInfo); + }; + // If we have more than one touch, don't start detecting this gesture + if (!motionDom.isPrimaryPointer(event)) + return; + this.dragSnapToOrigin = dragSnapToOrigin; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + this.distanceThreshold = distanceThreshold; + this.contextWindow = contextWindow || window; + const info = extractEventInfo(event); + const initialInfo = transformPoint(info, this.transformPagePoint); + const { point } = initialInfo; + const { timestamp } = motionDom.frameData; + this.history = [{ ...point, timestamp }]; + const { onSessionStart } = handlers; + onSessionStart && + onSessionStart(event, getPanInfo(initialInfo, this.history)); + this.removeListeners = motionUtils.pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp)); + // Start scroll tracking if element provided + if (element) { + this.startScrollTracking(element); + } + } + /** + * Start tracking scroll on ancestors and window. + */ + startScrollTracking(element) { + // Store initial scroll positions for scrollable ancestors + let current = element.parentElement; + while (current) { + const style = getComputedStyle(current); + if (overflowStyles.has(style.overflowX) || + overflowStyles.has(style.overflowY)) { + this.scrollPositions.set(current, { + x: current.scrollLeft, + y: current.scrollTop, + }); + } + current = current.parentElement; + } + // Track window scroll + this.scrollPositions.set(window, { + x: window.scrollX, + y: window.scrollY, + }); + // Capture listener catches element scroll events as they bubble + window.addEventListener("scroll", this.onElementScroll, { + capture: true, + passive: true, + }); + // Direct window scroll listener (window scroll doesn't bubble) + window.addEventListener("scroll", this.onWindowScroll, { + passive: true, + }); + this.removeScrollListeners = () => { + window.removeEventListener("scroll", this.onElementScroll, { + capture: true, + }); + window.removeEventListener("scroll", this.onWindowScroll); + }; + } + /** + * Handle scroll compensation during drag. + * + * For element scroll: adjusts history origin since pageX/pageY doesn't change. + * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. + */ + handleScroll(target) { + const initial = this.scrollPositions.get(target); + if (!initial) + return; + const isWindow = target === window; + const current = isWindow + ? { x: window.scrollX, y: window.scrollY } + : { + x: target.scrollLeft, + y: target.scrollTop, + }; + const delta = { x: current.x - initial.x, y: current.y - initial.y }; + if (delta.x === 0 && delta.y === 0) + return; + if (isWindow) { + // Window scroll: pageX/pageY changes, so update lastMoveEventInfo + if (this.lastMoveEventInfo) { + this.lastMoveEventInfo.point.x += delta.x; + this.lastMoveEventInfo.point.y += delta.y; + } + } + else { + // Element scroll: pageX/pageY unchanged, so adjust history origin + if (this.history.length > 0) { + this.history[0].x -= delta.x; + this.history[0].y -= delta.y; + } + } + this.scrollPositions.set(target, current); + motionDom.frame.update(this.updatePoint, true); + } + updateHandlers(handlers) { + this.handlers = handlers; + } + end() { + this.removeListeners && this.removeListeners(); + this.removeScrollListeners && this.removeScrollListeners(); + this.scrollPositions.clear(); + motionDom.cancelFrame(this.updatePoint); + } +} +function transformPoint(info, transformPagePoint) { + return transformPagePoint ? { point: transformPagePoint(info.point) } : info; +} +function subtractPoint(a, b) { + return { x: a.x - b.x, y: a.y - b.y }; +} +function getPanInfo({ point }, history) { + return { + point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity(history, 0.1), + }; +} +function startDevicePoint(history) { + return history[0]; +} +function lastDevicePoint(history) { + return history[history.length - 1]; +} +function getVelocity(history, timeDelta) { + if (history.length < 2) { + return { x: 0, y: 0 }; + } + let i = history.length - 1; + let timestampedPoint = null; + const lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > + motionUtils.secondsToMilliseconds(timeDelta)) { + break; + } + i--; + } + if (!timestampedPoint) { + return { x: 0, y: 0 }; + } + /** + * If the selected point is the pointer-down origin (history[0]), + * there are better movement points available, and the time gap + * is suspiciously large (>2x timeDelta), use the next point instead. + * This prevents stale pointer-down points from diluting velocity + * in hold-then-flick gestures. + */ + if (timestampedPoint === history[0] && + history.length > 2 && + lastPoint.timestamp - timestampedPoint.timestamp > + motionUtils.secondsToMilliseconds(timeDelta) * 2) { + timestampedPoint = history[1]; + } + const time = motionUtils.millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); + if (time === 0) { + return { x: 0, y: 0 }; + } + const currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time, + y: (lastPoint.y - timestampedPoint.y) / time, + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; + } + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; + } + return currentVelocity; +} + +/** + * Apply constraints to a point. These constraints are both physical along an + * axis, and an elastic factor that determines how much to constrain the point + * by if it does lie outside the defined parameters. + */ +function applyConstraints(point, { min, max }, elastic) { + if (min !== undefined && point < min) { + // If we have a min point defined, and this is outside of that, constrain + point = elastic + ? motionDom.mixNumber(min, point, elastic.min) + : Math.max(point, min); + } + else if (max !== undefined && point > max) { + // If we have a max point defined, and this is outside of that, constrain + point = elastic + ? motionDom.mixNumber(max, point, elastic.max) + : Math.min(point, max); + } + return point; +} +/** + * Calculate constraints in terms of the viewport when defined relatively to the + * measured axis. This is measured from the nearest edge, so a max constraint of 200 + * on an axis with a max value of 300 would return a constraint of 500 - axis length + */ +function calcRelativeAxisConstraints(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined + ? axis.max + max - (axis.max - axis.min) + : undefined, + }; +} +/** + * Calculate constraints in terms of the viewport when + * defined relatively to the measured bounding box. + */ +function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), + }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative axis + */ +function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { + let min = constraintsAxis.min - layoutAxis.min; + let max = constraintsAxis.max - layoutAxis.max; + // If the constraints axis is actually smaller than the layout axis then we can + // flip the constraints + if (constraintsAxis.max - constraintsAxis.min < + layoutAxis.max - layoutAxis.min) { + [min, max] = [max, min]; + } + return { min, max }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative box + */ +function calcViewportConstraints(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), + }; +} +/** + * Calculate a transform origin relative to the source axis, between 0-1, that results + * in an asthetically pleasing scale/transform needed to project from source to target. + */ +function calcOrigin(source, target) { + let origin = 0.5; + const sourceLength = motionDom.calcLength(source); + const targetLength = motionDom.calcLength(target); + if (targetLength > sourceLength) { + origin = motionUtils.progress(target.min, target.max - sourceLength, source.min); + } + else if (sourceLength > targetLength) { + origin = motionUtils.progress(source.min, source.max - targetLength, target.min); + } + return motionUtils.clamp(0, 1, origin); +} +/** + * Rebase the calculated viewport constraints relative to the layout.min point. + */ +function rebaseAxisConstraints(layout, constraints) { + const relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; + } + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; + } + return relativeConstraints; +} +const defaultElastic = 0.35; +/** + * Accepts a dragElastic prop and returns resolved elastic values for each axis. + */ +function resolveDragElastic(dragElastic = defaultElastic) { + if (dragElastic === false) { + dragElastic = 0; + } + else if (dragElastic === true) { + dragElastic = defaultElastic; + } + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom"), + }; +} +function resolveAxisElastic(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel), + }; +} +function resolvePointElastic(dragElastic, label) { + return typeof dragElastic === "number" + ? dragElastic + : dragElastic[label] || 0; +} + +const elementDragControls = new WeakMap(); +class VisualElementDragControls { + constructor(visualElement) { + this.openDragLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { x: 0, y: 0 }; + /** + * The permitted boundaries of travel, in pixels. + */ + this.constraints = false; + this.hasMutatedConstraints = false; + /** + * The per-axis resolved elastic values. + */ + this.elastic = motionDom.createBox(); + /** + * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPointerEvent = null; + /** + * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPanInfo = null; + this.visualElement = visualElement; + } + start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { + /** + * Don't start dragging if this component is exiting + */ + const { presenceContext } = this.visualElement; + if (presenceContext && presenceContext.isPresent === false) + return; + const onSessionStart = (event) => { + if (snapToCursor) { + this.snapToCursor(extractEventInfo(event).point); + } + this.stopAnimation(); + }; + const onStart = (event, info) => { + // Attempt to grab the global drag gesture lock - maybe make this part of PanSession + const { drag, dragPropagation, onDragStart } = this.getProps(); + if (drag && !dragPropagation) { + if (this.openDragLock) + this.openDragLock(); + this.openDragLock = motionDom.setDragLock(drag); + // If we don 't have the lock, don't start dragging + if (!this.openDragLock) + return; + } + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.isDragging = true; + this.currentDirection = null; + this.resolveConstraints(); + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = true; + this.visualElement.projection.target = undefined; + } + /** + * Record gesture origin and pointer offset + */ + motionDom.eachAxis((axis) => { + let current = this.getAxisMotionValue(axis).get() || 0; + /** + * If the MotionValue is a percentage value convert to px + */ + if (motionDom.percent.test(current)) { + const { projection } = this.visualElement; + if (projection && projection.layout) { + const measuredAxis = projection.layout.layoutBox[axis]; + if (measuredAxis) { + const length = motionDom.calcLength(measuredAxis); + current = length * (parseFloat(current) / 100); + } + } + } + this.originPoint[axis] = current; + }); + // Fire onDragStart event + if (onDragStart) { + motionDom.frame.update(() => onDragStart(event, info), false, true); + } + motionDom.addValueToWillChange(this.visualElement, "transform"); + const { animationState } = this.visualElement; + animationState && animationState.setActive("whileDrag", true); + }; + const onMove = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); + // If we didn't successfully receive the gesture lock, early return. + if (!dragPropagation && !this.openDragLock) + return; + const { offset } = info; + // Attempt to detect drag direction if directionLock is true + if (dragDirectionLock && this.currentDirection === null) { + this.currentDirection = getCurrentDirection(offset); + // If we've successfully set a direction, notify listener + if (this.currentDirection !== null) { + onDirectionLock && onDirectionLock(this.currentDirection); + } + return; + } + // Update each point with the latest position + this.updateAxis("x", info.point, offset); + this.updateAxis("y", info.point, offset); + /** + * Ideally we would leave the renderer to fire naturally at the end of + * this frame but if the element is about to change layout as the result + * of a re-render we want to ensure the browser can read the latest + * bounding box to ensure the pointer and element don't fall out of sync. + */ + this.visualElement.render(); + /** + * This must fire after the render call as it might trigger a state + * change which itself might trigger a layout update. + */ + if (onDrag) { + motionDom.frame.update(() => onDrag(event, info), false, true); + } + }; + const onSessionEnd = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.stop(event, info); + this.latestPointerEvent = null; + this.latestPanInfo = null; + }; + const resumeAnimation = () => { + const { dragSnapToOrigin: snap } = this.getProps(); + if (snap || this.constraints) { + this.startAnimation({ x: 0, y: 0 }); + } + }; + const { dragSnapToOrigin } = this.getProps(); + this.panSession = new PanSession(originEvent, { + onSessionStart, + onStart, + onMove, + onSessionEnd, + resumeAnimation, + }, { + transformPagePoint: this.visualElement.getTransformPagePoint(), + dragSnapToOrigin, + distanceThreshold, + contextWindow: getContextWindow(this.visualElement), + element: this.visualElement.current, + }); + } + /** + * @internal + */ + stop(event, panInfo) { + const finalEvent = event || this.latestPointerEvent; + const finalPanInfo = panInfo || this.latestPanInfo; + const isDragging = this.isDragging; + this.cancel(); + if (!isDragging || !finalPanInfo || !finalEvent) + return; + const { velocity } = finalPanInfo; + this.startAnimation(velocity); + const { onDragEnd } = this.getProps(); + if (onDragEnd) { + motionDom.frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); + } + } + /** + * @internal + */ + cancel() { + this.isDragging = false; + const { projection, animationState } = this.visualElement; + if (projection) { + projection.isAnimationBlocked = false; + } + this.endPanSession(); + const { dragPropagation } = this.getProps(); + if (!dragPropagation && this.openDragLock) { + this.openDragLock(); + this.openDragLock = null; + } + animationState && animationState.setActive("whileDrag", false); + } + /** + * Clean up the pan session without modifying other drag state. + * This is used during unmount to ensure event listeners are removed + * without affecting projection animations or drag locks. + * @internal + */ + endPanSession() { + this.panSession && this.panSession.end(); + this.panSession = undefined; + } + updateAxis(axis, _point, offset) { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) + return; + const axisValue = this.getAxisMotionValue(axis); + let next = this.originPoint[axis] + offset[axis]; + // Apply constraints + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); + } + axisValue.set(next); + } + resolveConstraints() { + const { dragConstraints, dragElastic } = this.getProps(); + const layout = this.visualElement.projection && + !this.visualElement.projection.layout + ? this.visualElement.projection.measure(false) + : this.visualElement.projection?.layout; + const prevConstraints = this.constraints; + if (dragConstraints && isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } + else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); + } + else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + /** + * If we're outputting to external MotionValues, we want to rebase the measured constraints + * from viewport-relative to component-relative. This only applies to relative (non-ref) + * constraints, as ref-based constraints from calcViewportConstraints are already in the + * correct coordinate space for the motion value transform offset. + */ + if (prevConstraints !== this.constraints && + !isRefObject(dragConstraints) && + layout && + this.constraints && + !this.hasMutatedConstraints) { + motionDom.eachAxis((axis) => { + if (this.constraints !== false && + this.getAxisMotionValue(axis)) { + this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); + } + }); + } + } + resolveRefConstraints() { + const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); + if (!constraints || !isRefObject(constraints)) + return false; + const constraintsElement = constraints.current; + motionUtils.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); + const { projection } = this.visualElement; + // TODO + if (!projection || !projection.layout) + return false; + const constraintsBox = motionDom.measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); + /** + * If there's an onMeasureDragConstraints listener we call it and + * if different constraints are returned, set constraints to that + */ + if (onMeasureDragConstraints) { + const userConstraints = onMeasureDragConstraints(motionDom.convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = motionDom.convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + } + startAnimation(velocity) { + const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); + const constraints = this.constraints || {}; + const momentumAnimations = motionDom.eachAxis((axis) => { + if (!shouldDrag(axis, drag, this.currentDirection)) { + return; + } + let transition = (constraints && constraints[axis]) || {}; + if (dragSnapToOrigin) + transition = { min: 0, max: 0 }; + /** + * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame + * of spring animations so we should look into adding a disable spring option to `inertia`. + * We could do something here where we affect the `bounceStiffness` and `bounceDamping` + * using the value of `dragElastic`. + */ + const bounceStiffness = dragElastic ? 200 : 1000000; + const bounceDamping = dragElastic ? 40 : 10000000; + const inertia = { + type: "inertia", + velocity: dragMomentum ? velocity[axis] : 0, + bounceStiffness, + bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10, + ...dragTransition, + ...transition, + }; + // If we're not animating on an externally-provided `MotionValue` we can use the + // component's animation controls which will handle interactions with whileHover (etc), + // otherwise we just have to animate the `MotionValue` itself. + return this.startAxisValueAnimation(axis, inertia); + }); + // Run all animations and then resolve the new drag constraints. + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + } + startAxisValueAnimation(axis, transition) { + const axisValue = this.getAxisMotionValue(axis); + motionDom.addValueToWillChange(this.visualElement, axis); + return axisValue.start(motionDom.animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); + } + stopAnimation() { + motionDom.eachAxis((axis) => this.getAxisMotionValue(axis).stop()); + } + /** + * Drag works differently depending on which props are provided. + * + * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. + * - Otherwise, we apply the delta to the x/y motion values. + */ + getAxisMotionValue(axis) { + const dragKey = `_drag${axis.toUpperCase()}`; + const props = this.visualElement.getProps(); + const externalMotionValue = props[dragKey]; + return externalMotionValue + ? externalMotionValue + : this.visualElement.getValue(axis, (props.initial + ? props.initial[axis] + : undefined) || 0); + } + snapToCursor(point) { + motionDom.eachAxis((axis) => { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!shouldDrag(axis, drag, this.currentDirection)) + return; + const { projection } = this.visualElement; + const axisValue = this.getAxisMotionValue(axis); + if (projection && projection.layout) { + const { min, max } = projection.layout.layoutBox[axis]; + /** + * The layout measurement includes the current transform value, + * so we need to add it back to get the correct snap position. + * This fixes an issue where elements with initial coordinates + * would snap to the wrong position on the first drag. + */ + const current = axisValue.get() || 0; + axisValue.set(point[axis] - motionDom.mixNumber(min, max, 0.5) + current); + } + }); + } + /** + * When the viewport resizes we want to check if the measured constraints + * have changed and, if so, reposition the element within those new constraints + * relative to where it was before the resize. + */ + scalePositionWithinConstraints() { + if (!this.visualElement.current) + return; + const { drag, dragConstraints } = this.getProps(); + const { projection } = this.visualElement; + if (!isRefObject(dragConstraints) || !projection || !this.constraints) + return; + /** + * Stop current animations as there can be visual glitching if we try to do + * this mid-animation + */ + this.stopAnimation(); + /** + * Record the relative position of the dragged element relative to the + * constraints box and save as a progress value. + */ + const boxProgress = { x: 0, y: 0 }; + motionDom.eachAxis((axis) => { + const axisValue = this.getAxisMotionValue(axis); + if (axisValue && this.constraints !== false) { + const latest = axisValue.get(); + boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); + } + }); + /** + * Update the layout of this element and resolve the latest drag constraints + */ + const { transformTemplate } = this.visualElement.getProps(); + this.visualElement.current.style.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + /** + * Reset constraints so resolveConstraints() will recalculate them + * with the freshly measured layout rather than returning the cached value. + */ + this.constraints = false; + this.resolveConstraints(); + /** + * For each axis, calculate the current progress of the layout axis + * within the new constraints. + */ + motionDom.eachAxis((axis) => { + if (!shouldDrag(axis, drag, null)) + return; + /** + * Calculate a new transform based on the previous box progress + */ + const axisValue = this.getAxisMotionValue(axis); + const { min, max } = this.constraints[axis]; + axisValue.set(motionDom.mixNumber(min, max, boxProgress[axis])); + }); + /** + * Flush the updated transform to the DOM synchronously to prevent + * a visual flash at the element's CSS layout position (0,0) when + * the transform was stripped for measurement. + */ + this.visualElement.render(); + } + addListeners() { + if (!this.visualElement.current) + return; + elementDragControls.set(this.visualElement, this); + const element = this.visualElement.current; + /** + * Attach a pointerdown event listener on this DOM element to initiate drag tracking. + */ + const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { + const { drag, dragListener = true } = this.getProps(); + const target = event.target; + /** + * Only block drag if clicking on a text input child element + * (input, textarea, select, contenteditable) where users might + * want to select text or interact with the control. + * + * Buttons and links don't block drag since they don't have + * click-and-move actions of their own. + */ + const isClickingTextInputChild = target !== element && motionDom.isElementTextInput(target); + if (drag && dragListener && !isClickingTextInputChild) { + this.start(event); + } + }); + /** + * If using ref-based constraints, observe both the draggable element + * and the constraint container for size changes via ResizeObserver. + * Setup is deferred because dragConstraints.current is null when + * addListeners first runs (React hasn't committed the ref yet). + */ + let stopResizeObservers; + const measureDragConstraints = () => { + const { dragConstraints } = this.getProps(); + if (isRefObject(dragConstraints) && dragConstraints.current) { + this.constraints = this.resolveRefConstraints(); + if (!stopResizeObservers) { + stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); + } + } + }; + const { projection } = this.visualElement; + const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + } + motionDom.frame.read(measureDragConstraints); + /** + * Attach a window resize listener to scale the draggable target within its defined + * constraints as the window resizes. + */ + const stopResizeListener = motionDom.addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); + /** + * If the element's layout changes, calculate the delta and apply that to + * the drag gesture's origin point. + */ + const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { + if (this.isDragging && hasLayoutChanged) { + motionDom.eachAxis((axis) => { + const motionValue = this.getAxisMotionValue(axis); + if (!motionValue) + return; + this.originPoint[axis] += delta[axis].translate; + motionValue.set(motionValue.get() + delta[axis].translate); + }); + this.visualElement.render(); + } + })); + return () => { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + stopLayoutUpdateListener && stopLayoutUpdateListener(); + stopResizeObservers && stopResizeObservers(); + }; + } + getProps() { + const props = this.visualElement.getProps(); + const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; + return { + ...props, + drag, + dragDirectionLock, + dragPropagation, + dragConstraints, + dragElastic, + dragMomentum, + }; + } +} +function skipFirstCall(callback) { + let isFirst = true; + return () => { + if (isFirst) { + isFirst = false; + return; + } + callback(); + }; +} +function startResizeObservers(element, constraintsElement, onResize) { + const stopElement = motionDom.resize(element, skipFirstCall(onResize)); + const stopContainer = motionDom.resize(constraintsElement, skipFirstCall(onResize)); + return () => { + stopElement(); + stopContainer(); + }; +} +function shouldDrag(direction, drag, currentDirection) { + return ((drag === true || drag === direction) && + (currentDirection === null || currentDirection === direction)); +} +/** + * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower + * than the provided threshold, return `null`. + * + * @param offset - The x/y offset from origin. + * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. + */ +function getCurrentDirection(offset, lockThreshold = 10) { + let direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } + else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; + } + return direction; +} + +class DragGesture extends motionDom.Feature { + constructor(node) { + super(node); + this.removeGroupControls = motionUtils.noop; + this.removeListeners = motionUtils.noop; + this.controls = new VisualElementDragControls(node); + } + mount() { + // If we've been provided a DragControls for manual control over the drag gesture, + // subscribe this component to it on mount. + const { dragControls } = this.node.getProps(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + this.removeListeners = this.controls.addListeners() || motionUtils.noop; + } + update() { + const { dragControls } = this.node.getProps(); + const { dragControls: prevDragControls } = this.node.prevProps || {}; + if (dragControls !== prevDragControls) { + this.removeGroupControls(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + } + } + unmount() { + this.removeGroupControls(); + this.removeListeners(); + /** + * In React 19, during list reorder reconciliation, components may + * briefly unmount and remount while the drag is still active. If we're + * actively dragging, we should NOT end the pan session - it will + * continue tracking pointer events via its window-level listeners. + * + * The pan session will be properly cleaned up when: + * 1. The drag ends naturally (pointerup/pointercancel) + * 2. The component is truly removed from the DOM + */ + if (!this.controls.isDragging) { + this.controls.endPanSession(); + } + } +} + +const asyncHandler = (handler) => (event, info) => { + if (handler) { + motionDom.frame.update(() => handler(event, info), false, true); + } +}; +class PanGesture extends motionDom.Feature { + constructor() { + super(...arguments); + this.removePointerDownListener = motionUtils.noop; + } + onPointerDown(pointerDownEvent) { + this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { + transformPagePoint: this.node.getTransformPagePoint(), + contextWindow: getContextWindow(this.node), + }); + } + createPanHandlers() { + const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); + return { + onSessionStart: asyncHandler(onPanSessionStart), + onStart: asyncHandler(onPanStart), + onMove: asyncHandler(onPan), + onEnd: (event, info) => { + delete this.session; + if (onPanEnd) { + motionDom.frame.postRender(() => onPanEnd(event, info)); + } + }, + }; + } + mount() { + this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); + } + update() { + this.session && this.session.updateHandlers(this.createPanHandlers()); + } + unmount() { + this.removePointerDownListener(); + this.session && this.session.end(); + } +} + +/** + * Track whether we've taken any snapshots yet. If not, + * we can safely skip notification of didUpdate. + * + * Difficult to capture in a test but to prevent flickering + * we must set this to true either on update or unmount. + * Running `next-env/layout-id` in Safari will show this behaviour if broken. + */ +let hasTakenAnySnapshot = false; +class MeasureLayoutWithContext extends React.Component { + /** + * This only mounts projection nodes for components that + * need measuring, we might want to do it for all components + * in order to incorporate transforms + */ + componentDidMount() { + const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; + const { projection } = visualElement; + if (projection) { + if (layoutGroup.group) + layoutGroup.group.add(projection); + if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { + switchLayoutGroup.register(projection); + } + if (hasTakenAnySnapshot) { + projection.root.didUpdate(); + } + projection.addEventListener("animationComplete", () => { + this.safeToRemove(); + }); + projection.setOptions({ + ...projection.options, + layoutDependency: this.props.layoutDependency, + onExitComplete: () => this.safeToRemove(), + }); + } + motionDom.globalProjectionState.hasEverUpdated = true; + } + getSnapshotBeforeUpdate(prevProps) { + const { layoutDependency, visualElement, drag, isPresent } = this.props; + const { projection } = visualElement; + if (!projection) + return null; + /** + * TODO: We use this data in relegate to determine whether to + * promote a previous element. There's no guarantee its presence data + * will have updated by this point - if a bug like this arises it will + * have to be that we markForRelegation and then find a new lead some other way, + * perhaps in didUpdate + */ + projection.isPresent = isPresent; + if (prevProps.layoutDependency !== layoutDependency) { + projection.setOptions({ + ...projection.options, + layoutDependency, + }); + } + hasTakenAnySnapshot = true; + if (drag || + prevProps.layoutDependency !== layoutDependency || + layoutDependency === undefined || + prevProps.isPresent !== isPresent) { + projection.willUpdate(); + } + else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } + else if (!projection.relegate()) { + /** + * If there's another stack member taking over from this one, + * it's in charge of the exit animation and therefore should + * be in charge of the safe to remove. Otherwise we call it here. + */ + motionDom.frame.postRender(() => { + const stack = projection.getStack(); + if (!stack || !stack.members.length) { + this.safeToRemove(); + } + }); + } + } + return null; + } + componentDidUpdate() { + const { projection } = this.props.visualElement; + if (projection) { + projection.root.didUpdate(); + motionDom.microtask.postRender(() => { + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + }); + } + } + componentWillUnmount() { + const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; + const { projection } = visualElement; + hasTakenAnySnapshot = true; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup && layoutGroup.group) + layoutGroup.group.remove(projection); + if (promoteContext && promoteContext.deregister) + promoteContext.deregister(projection); + } + } + safeToRemove() { + const { safeToRemove } = this.props; + safeToRemove && safeToRemove(); + } + render() { + return null; + } +} +function MeasureLayout(props) { + const [isPresent, safeToRemove] = usePresence(); + const layoutGroup = React.useContext(LayoutGroupContext); + return (jsxRuntime.jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: React.useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); +} + +const drag = { + pan: { + Feature: PanGesture, + }, + drag: { + Feature: DragGesture, + ProjectionNode: motionDom.HTMLProjectionNode, + MeasureLayout, + }, +}; + +function handleHoverEvent(node, event, lifecycle) { + const { props } = node; + if (node.animationState && props.whileHover) { + node.animationState.setActive("whileHover", lifecycle === "Start"); + } + const eventName = ("onHover" + lifecycle); + const callback = props[eventName]; + if (callback) { + motionDom.frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class HoverGesture extends motionDom.Feature { + mount() { + const { current } = this.node; + if (!current) + return; + this.unmount = motionDom.hover(current, (_element, startEvent) => { + handleHoverEvent(this.node, startEvent, "Start"); + return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); + }); + } + unmount() { } +} + +class FocusGesture extends motionDom.Feature { + constructor() { + super(...arguments); + this.isActive = false; + } + onFocus() { + let isFocusVisible = false; + /** + * If this element doesn't match focus-visible then don't + * apply whileHover. But, if matches throws that focus-visible + * is not a valid selector then in that browser outline styles will be applied + * to the element by default and we want to match that behaviour with whileFocus. + */ + try { + isFocusVisible = this.node.current.matches(":focus-visible"); + } + catch (e) { + isFocusVisible = true; + } + if (!isFocusVisible || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", true); + this.isActive = true; + } + onBlur() { + if (!this.isActive || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", false); + this.isActive = false; + } + mount() { + this.unmount = motionUtils.pipe(motionDom.addDomEvent(this.node.current, "focus", () => this.onFocus()), motionDom.addDomEvent(this.node.current, "blur", () => this.onBlur())); + } + unmount() { } +} + +function handlePressEvent(node, event, lifecycle) { + const { props } = node; + if (node.current instanceof HTMLButtonElement && node.current.disabled) { + return; + } + if (node.animationState && props.whileTap) { + node.animationState.setActive("whileTap", lifecycle === "Start"); + } + const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); + const callback = props[eventName]; + if (callback) { + motionDom.frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class PressGesture extends motionDom.Feature { + mount() { + const { current } = this.node; + if (!current) + return; + const { globalTapTarget, propagate } = this.node.props; + this.unmount = motionDom.press(current, (_element, startEvent) => { + handlePressEvent(this.node, startEvent, "Start"); + return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); + }, { + useGlobalTarget: globalTapTarget, + stopPropagation: propagate?.tap === false, + }); + } + unmount() { } +} + +/** + * Map an IntersectionHandler callback to an element. We only ever make one handler for one + * element, so even though these handlers might all be triggered by different + * observers, we can keep them in the same map. + */ +const observerCallbacks = new WeakMap(); +/** + * Multiple observers can be created for multiple element/document roots. Each with + * different settings. So here we store dictionaries of observers to each root, + * using serialised settings (threshold/margin) as lookup keys. + */ +const observers = new WeakMap(); +const fireObserverCallback = (entry) => { + const callback = observerCallbacks.get(entry.target); + callback && callback(entry); +}; +const fireAllObserverCallbacks = (entries) => { + entries.forEach(fireObserverCallback); +}; +function initIntersectionObserver({ root, ...options }) { + const lookupRoot = root || document; + /** + * If we don't have an observer lookup map for this root, create one. + */ + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + const rootObservers = observers.get(lookupRoot); + const key = JSON.stringify(options); + /** + * If we don't have an observer for this combination of root and settings, + * create one. + */ + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); + } + return rootObservers[key]; +} +function observeIntersection(element, options, callback) { + const rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return () => { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; +} + +const thresholdNames = { + some: 0, + all: 1, +}; +class InViewFeature extends motionDom.Feature { + constructor() { + super(...arguments); + this.hasEnteredView = false; + this.isInView = false; + } + startObserver() { + this.unmount(); + const { viewport = {} } = this.node.getProps(); + const { root, margin: rootMargin, amount = "some", once } = viewport; + const options = { + root: root ? root.current : undefined, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount], + }; + const onIntersectionUpdate = (entry) => { + const { isIntersecting } = entry; + /** + * If there's been no change in the viewport state, early return. + */ + if (this.isInView === isIntersecting) + return; + this.isInView = isIntersecting; + /** + * Handle hasEnteredView. If this is only meant to run once, and + * element isn't visible, early return. Otherwise set hasEnteredView to true. + */ + if (once && !isIntersecting && this.hasEnteredView) { + return; + } + else if (isIntersecting) { + this.hasEnteredView = true; + } + if (this.node.animationState) { + this.node.animationState.setActive("whileInView", isIntersecting); + } + /** + * Use the latest committed props rather than the ones in scope + * when this observer is created + */ + const { onViewportEnter, onViewportLeave } = this.node.getProps(); + const callback = isIntersecting ? onViewportEnter : onViewportLeave; + callback && callback(entry); + }; + return observeIntersection(this.node.current, options, onIntersectionUpdate); + } + mount() { + this.startObserver(); + } + update() { + if (typeof IntersectionObserver === "undefined") + return; + const { props, prevProps } = this.node; + const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); + if (hasOptionsChanged) { + this.startObserver(); + } + } + unmount() { } +} +function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { + return (name) => viewport[name] !== prevViewport[name]; +} + +const gestureAnimations = { + inView: { + Feature: InViewFeature, + }, + tap: { + Feature: PressGesture, + }, + focus: { + Feature: FocusGesture, + }, + hover: { + Feature: HoverGesture, + }, +}; + +const layout = { + layout: { + ProjectionNode: motionDom.HTMLProjectionNode, + MeasureLayout, + }, +}; + +const featureBundle = { + ...animations, + ...gestureAnimations, + ...drag, + ...layout, +}; + +exports.LayoutGroupContext = LayoutGroupContext; +exports.LazyContext = LazyContext; +exports.MotionConfigContext = MotionConfigContext; +exports.MotionContext = MotionContext; +exports.PresenceContext = PresenceContext; +exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext; +exports.addPointerEvent = addPointerEvent; +exports.addPointerInfo = addPointerInfo; +exports.animations = animations; +exports.createDomVisualElement = createDomVisualElement; +exports.createMotionComponent = createMotionComponent; +exports.distance = distance; +exports.distance2D = distance2D; +exports.drag = drag; +exports.featureBundle = featureBundle; +exports.filterProps = filterProps; +exports.gestureAnimations = gestureAnimations; +exports.isBrowser = isBrowser; +exports.isValidMotionProp = isValidMotionProp; +exports.layout = layout; +exports.loadExternalIsValidProp = loadExternalIsValidProp; +exports.loadFeatures = loadFeatures; +exports.makeUseVisualState = makeUseVisualState; +exports.motionComponentSymbol = motionComponentSymbol; +exports.useConstant = useConstant; +exports.useIsPresent = useIsPresent; +exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; +exports.usePresence = usePresence; +//# sourceMappingURL=feature-bundle-Cb13qNcx.js.map diff --git a/node_modules/framer-motion/dist/cjs/feature-bundle-Cb13qNcx.js.map b/node_modules/framer-motion/dist/cjs/feature-bundle-Cb13qNcx.js.map new file mode 100644 index 00000000..7c6388f4 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/feature-bundle-Cb13qNcx.js.map @@ -0,0 +1 @@ +{"version":3,"file":"feature-bundle-Cb13qNcx.js","sources":["../../src/context/LayoutGroupContext.ts","../../src/utils/use-constant.ts","../../src/utils/is-browser.ts","../../src/utils/use-isomorphic-effect.ts","../../src/context/PresenceContext.ts","../../src/context/MotionConfigContext.tsx","../../src/components/AnimatePresence/use-presence.ts","../../src/context/LazyContext.ts","../../src/motion/features/definitions.ts","../../src/motion/features/load-features.ts","../../src/motion/utils/valid-prop.ts","../../src/render/dom/utils/filter-props.ts","../../src/render/svg/lowercase-elements.ts","../../src/render/dom/utils/is-svg-component.ts","../../src/render/dom/create-visual-element.ts","../../src/context/MotionContext/index.ts","../../src/context/MotionContext/utils.ts","../../src/context/MotionContext/create.ts","../../src/render/html/utils/create-render-state.ts","../../src/render/html/use-props.ts","../../src/render/svg/utils/create-render-state.ts","../../src/render/svg/use-props.ts","../../src/render/dom/use-render.ts","../../src/motion/utils/use-visual-state.ts","../../src/render/html/use-html-visual-state.ts","../../src/render/svg/use-svg-visual-state.ts","../../src/motion/utils/symbol.ts","../../src/motion/utils/use-motion-ref.ts","../../src/context/SwitchLayoutGroupContext.ts","../../src/utils/is-ref-object.ts","../../src/motion/utils/use-visual-element.ts","../../src/motion/index.tsx","../../src/motion/features/animation/index.ts","../../src/motion/features/animation/exit.ts","../../src/motion/features/animations.ts","../../src/events/event-info.ts","../../src/events/add-pointer-event.ts","../../src/utils/get-context-window.ts","../../src/utils/distance.ts","../../src/gestures/pan/PanSession.ts","../../src/gestures/drag/utils/constraints.ts","../../src/gestures/drag/VisualElementDragControls.ts","../../src/gestures/drag/index.ts","../../src/gestures/pan/index.ts","../../src/motion/features/layout/MeasureLayout.tsx","../../src/motion/features/drag.ts","../../src/gestures/hover.ts","../../src/gestures/focus.ts","../../src/gestures/press.ts","../../src/motion/features/viewport/observers.ts","../../src/motion/features/viewport/index.ts","../../src/motion/features/gestures.ts","../../src/motion/features/layout.ts","../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { NodeGroup } from \"motion-dom\"\n\nexport interface LayoutGroupContextProps {\n id?: string\n group?: NodeGroup\n forceRender?: VoidFunction\n}\n\nexport const LayoutGroupContext = createContext({})\n","\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","export const isBrowser = typeof window !== \"undefined\"\n","\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n","\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n","\"use client\"\n\nimport { useCallback, useContext, useEffect, useId } from \"react\"\nimport {\n PresenceContext,\n PresenceContextProps,\n} from \"../../context/PresenceContext\"\n\nexport type SafeToRemove = () => void\n\ntype AlwaysPresent = [true, null]\n\ntype Present = [true]\n\ntype NotPresent = [false, SafeToRemove]\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(\n subscribe: boolean = true\n): AlwaysPresent | Present | NotPresent {\n const context = useContext(PresenceContext)\n\n if (context === null) return [true, null]\n\n const { isPresent, onExitComplete, register } = context\n\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n\n const id = useId()\n useEffect(() => {\n if (subscribe) {\n return register(id)\n }\n }, [subscribe])\n\n const safeToRemove = useCallback(\n () => subscribe && onExitComplete && onExitComplete(id),\n [id, onExitComplete, subscribe]\n )\n\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true]\n}\n\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext))\n}\n\nexport function isPresent(context: PresenceContextProps | null) {\n return context === null ? true : context.isPresent\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n","import { setFeatureDefinitions } from \"motion-dom\"\nimport { getInitializedFeatureDefinitions } from \"./definitions\"\nimport { FeaturePackages } from \"./types\"\n\nexport function loadFeatures(features: FeaturePackages) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n\n for (const key in features) {\n featureDefinitions[key as keyof typeof featureDefinitions] = {\n ...featureDefinitions[key as keyof typeof featureDefinitions],\n ...features[key as keyof typeof features],\n } as any\n }\n\n setFeatureDefinitions(featureDefinitions)\n}\n","import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n","import type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n","import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\"\nimport { ComponentType, Fragment } from \"react\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType>,\n options: VisualElementOptions\n) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component)\n\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n","import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n","import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n","\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n","import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n","\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n","\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n","\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n","\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n","import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n","\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n","\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { isBrowser } from \"../utils/is-browser\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps

[\"children\"]\n : MotionComponentProps

[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n","import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n","import { Feature } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature {\n private id: number = id++\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n","import { AnimationFeature } from \"./animation\"\nimport { ExitAnimationFeature } from \"./animation/exit\"\nimport { FeaturePackages } from \"./types\"\n\nexport const animations: FeaturePackages = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n}\n","import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo = (\n handler: EventListenerWithPointInfo\n): EventListener => {\n return (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n}\n","import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n","import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement) => {\n return current ? current.ownerDocument.defaultView : null\n}\n","import { Point } from \"motion-utils\"\n\nexport const distance = (a: number, b: number) => Math.abs(a - b)\n\nexport function distance2D(a: Point, b: Point): number {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x)\n const yDelta = distance(a.y, b.y)\n return Math.sqrt(xDelta ** 2 + yDelta ** 2)\n}\n","import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n passive: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll, {\n passive: true,\n })\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n","import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial\n): Partial {\n const relativeConstraints: Partial = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n","import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (dragSnapToOrigin) transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n (props.initial\n ? props.initial[axis as keyof typeof props.initial]\n : undefined) || 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n","import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n","import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n","\"use client\"\n\nimport { frame, microtask, globalProjectionState, type VisualElement } from \"motion-dom\"\nimport { Component, useContext } from \"react\"\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../../context/LayoutGroupContext\"\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../types\"\n\ninterface MeasureContextProps {\n layoutGroup: LayoutGroupContextProps\n switchLayoutGroup?: SwitchLayoutGroupContext\n isPresent: boolean\n safeToRemove?: VoidFunction | null\n}\n\ntype MeasureProps = MotionProps &\n MeasureContextProps & { visualElement: VisualElement }\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } =\n this.props\n const { projection } = visualElement\n\n if (projection) {\n if (layoutGroup.group) layoutGroup.group.add(projection)\n\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection)\n }\n\n if (hasTakenAnySnapshot) {\n projection.root!.didUpdate()\n }\n\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove()\n })\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n })\n }\n\n globalProjectionState.hasEverUpdated = true\n }\n\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props\n const { projection } = visualElement\n\n if (!projection) return null\n\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent\n\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n })\n }\n\n hasTakenAnySnapshot = true\n\n if (\n drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent\n ) {\n projection.willUpdate()\n } else {\n this.safeToRemove()\n }\n\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote()\n } else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack()\n if (!stack || !stack.members.length) {\n this.safeToRemove()\n }\n })\n }\n }\n\n return null\n }\n\n componentDidUpdate() {\n const { projection } = this.props.visualElement\n if (projection) {\n projection.root!.didUpdate()\n\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove()\n }\n })\n }\n }\n\n componentWillUnmount() {\n const {\n visualElement,\n layoutGroup,\n switchLayoutGroup: promoteContext,\n } = this.props\n const { projection } = visualElement\n\n hasTakenAnySnapshot = true\n\n if (projection) {\n projection.scheduleCheckAfterUnmount()\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection)\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection)\n }\n }\n\n safeToRemove() {\n const { safeToRemove } = this.props\n safeToRemove && safeToRemove()\n }\n\n render() {\n return null\n }\n}\n\nexport function MeasureLayout(\n props: MotionProps & { visualElement: VisualElement }\n) {\n const [isPresent, safeToRemove] = usePresence()\n const layoutGroup = useContext(LayoutGroupContext)\n\n return (\n \n )\n}\n","import { DragGesture } from \"../../gestures/drag\"\nimport { PanGesture } from \"../../gestures/pan\"\nimport { HTMLProjectionNode } from \"../../projection\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const drag: FeaturePackages = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n","import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n","import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n }\n )\n }\n\n unmount() {}\n}\n","type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)\n }\n}\n","import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature {\n private hasEnteredView = false\n\n private isInView = false\n\n private startObserver() {\n this.unmount()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n return observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {}\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n","import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n","import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":["createContext","useRef","useLayoutEffect","useEffect","useContext","useId","useCallback","setFeatureDefinitions","getFeatureDefinitions","SVGVisualElement","HTMLVisualElement","Fragment","isControllingVariants","isVariantLabel","useMemo","isMotionValue","isForcedMotionValue","buildHTMLStyles","buildSVGAttrs","isSVGTag","createElement","resolveMotionValue","checkIsControllingVariants","checkIsVariantNode","isAnimationControls","resolveVariantFromProps","scrapeHTMLMotionValuesFromProps","scrapeSVGMotionValuesFromProps","useInsertionEffect","optimizedAppearDataAttribute","_jsxs","_jsx","forwardRef","warning","invariant","Feature","createAnimationState","isPrimaryPointer","addDomEvent","frameData","frame","pipe","cancelFrame","secondsToMilliseconds","millisecondsToSeconds","mixNumber","calcLength","calcProgress","clamp","createBox","setDragLock","eachAxis","percent","addValueToWillChange","measurePageBox","convertBoxToBoundingBox","convertBoundingBoxToBox","animateMotionValue","isElementTextInput","resize","noop","Component","globalProjectionState","microtask","HTMLProjectionNode","hover","press"],"mappings":";;;;;;;MAWa,kBAAkB,GAAGA,mBAAa,CAA0B,EAAE;;ACL3E;;;;;;AAMG;AACG,SAAU,WAAW,CAAI,IAAa,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGC,YAAM,CAAW,IAAI,CAAC,CAAA;AAElC,IAAA,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE;AACtB,QAAA,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE,CAAA;KACvB;IAED,OAAO,GAAG,CAAC,OAAO,CAAA;AACtB;;MCrBa,SAAS,GAAG,OAAO,MAAM,KAAK;;ACKpC,MAAM,yBAAyB,GAAG,SAAS,GAAGC,qBAAe,GAAGC;;ACEvE;;AAEG;MACU,eAAe;AACxB,gBAAgBH,mBAAa,CAA8B,IAAI;;AC8CnE;;AAEG;AACI,MAAM,mBAAmB,GAAGA,mBAAa,CAAsB;AAClE,IAAA,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC;AAC5B,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,aAAa,EAAE,OAAO;AACzB,CAAA;;AChDD;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa,SAAA,WAAW,CACvB,SAAA,GAAqB,IAAI,EAAA;AAEzB,IAAA,MAAM,OAAO,GAAGI,gBAAU,CAAC,eAAe,CAAC,CAAA;IAE3C,IAAI,OAAO,KAAK,IAAI;AAAE,QAAA,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAEzC,MAAM,EA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AAC,IAAI,CACvD,wBAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAC7C,CAAA;QAED,IAAI,iBAAiB,EAAE;YACnB,IAAI,CAAC,aAAa,EAAE,CAAA;SACvB;KACJ;AAED,IAAA,OAAO,MAAK;AACf,CAAA;AAED,SAAS,wBAAwB,CAC7B,EAAE,QAAQ,GAAG,EAAE,EAAe,EAC9B,EAAE,QAAQ,EAAE,YAAY,GAAG,EAAE,KAAkB,EAAE,EAAA;AAEjD,IAAA,OAAO,CAAC,IAA2B,KAC/B,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAA;AAC7C;;AC1Fa,MAAA,iBAAiB,GAAoB;AAC9C,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAE,aAAa;AACzB,KAAA;AACD,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;;;ACdQ,MAAA,MAAM,GAAoB;AACnC,IAAA,MAAM,EAAE;AACJ,QAAA,cAAc,EAAE6B,4BAAkB;QAClC,aAAa;AAChB,KAAA;;;ACHQ,MAAA,aAAa,GAAG;AACzB,IAAA,GAAG,UAAU;AACb,IAAA,GAAG,iBAAiB;AACpB,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/index.js b/node_modules/framer-motion/dist/cjs/index.js new file mode 100644 index 00000000..792dc9f0 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/index.js @@ -0,0 +1,3383 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var jsxRuntime = require('react/jsx-runtime'); +var React = require('react'); +var featureBundle = require('./feature-bundle-Cb13qNcx.js'); +var motionDom = require('motion-dom'); +var motionUtils = require('motion-utils'); + +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} + +var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); + +/** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ +/** + * Set a given ref to a given value + * This utility takes care of different types of refs: callback refs and RefObject(s) + */ +function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } + else if (ref !== null && ref !== undefined) { + ref.current = value; + } +} +/** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ +function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup === "function") { + hasCleanup = true; + } + return cleanup; + }); + // React <19 will log an error to the console if a callback ref returns a + // value. We don't use ref cleanups internally so this will only happen if a + // user's ref callback returns a value, which we only expect if they are + // using the cleanup functionality added in React 19. + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup === "function") { + cleanup(); + } + else { + setRef(refs[i], null); + } + } + }; + } + }; +} +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +function useComposedRefs(...refs) { + // eslint-disable-next-line react-hooks/exhaustive-deps + return React__namespace.useCallback(composeRefs(...refs), refs); +} + +/** + * Measurement functionality has to be within a separate component + * to leverage snapshot lifecycle. + */ +class PopChildMeasure extends React__namespace.Component { + getSnapshotBeforeUpdate(prevProps) { + const element = this.props.childRef.current; + if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { + const parent = element.offsetParent; + const parentWidth = motionDom.isHTMLElement(parent) + ? parent.offsetWidth || 0 + : 0; + const parentHeight = motionDom.isHTMLElement(parent) + ? parent.offsetHeight || 0 + : 0; + const size = this.props.sizeRef.current; + size.height = element.offsetHeight || 0; + size.width = element.offsetWidth || 0; + size.top = element.offsetTop; + size.left = element.offsetLeft; + size.right = parentWidth - size.width - size.left; + size.bottom = parentHeight - size.height - size.top; + } + return null; + } + /** + * Required with getSnapshotBeforeUpdate to stop React complaining. + */ + componentDidUpdate() { } + render() { + return this.props.children; + } +} +function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { + const id = React.useId(); + const ref = React.useRef(null); + const size = React.useRef({ + width: 0, + height: 0, + top: 0, + left: 0, + right: 0, + bottom: 0, + }); + const { nonce } = React.useContext(featureBundle.MotionConfigContext); + /** + * In React 19, refs are passed via props.ref instead of element.ref. + * We check props.ref first (React 19) and fall back to element.ref (React 18). + */ + const childRef = children.props?.ref ?? + children?.ref; + const composedRef = useComposedRefs(ref, childRef); + /** + * We create and inject a style block so we can apply this explicit + * sizing in a non-destructive manner by just deleting the style block. + * + * We can't apply size via render as the measurement happens + * in getSnapshotBeforeUpdate (post-render), likewise if we apply the + * styles directly on the DOM node, we might be overwriting + * styles set via the style prop. + */ + React.useInsertionEffect(() => { + const { width, height, top, left, right, bottom } = size.current; + if (isPresent || pop === false || !ref.current || !width || !height) + return; + const x = anchorX === "left" ? `left: ${left}` : `right: ${right}`; + const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; + ref.current.dataset.motionPopId = id; + const style = document.createElement("style"); + if (nonce) + style.nonce = nonce; + const parent = root ?? document.head; + parent.appendChild(style); + if (style.sheet) { + style.sheet.insertRule(` + [data-motion-pop-id="${id}"] { + position: absolute !important; + width: ${width}px !important; + height: ${height}px !important; + ${x}px !important; + ${y}px !important; + } + `); + } + return () => { + if (parent.contains(style)) { + parent.removeChild(style); + } + }; + }, [isPresent]); + return (jsxRuntime.jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false + ? children + : React__namespace.cloneElement(children, { ref: composedRef }) })); +} + +const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { + const presenceChildren = featureBundle.useConstant(newChildrenMap); + const id = React.useId(); + let isReusedContext = true; + let context = React.useMemo(() => { + isReusedContext = false; + return { + id, + initial, + isPresent, + custom, + onExitComplete: (childId) => { + presenceChildren.set(childId, true); + for (const isComplete of presenceChildren.values()) { + if (!isComplete) + return; // can stop searching when any is incomplete + } + onExitComplete && onExitComplete(); + }, + register: (childId) => { + presenceChildren.set(childId, false); + return () => presenceChildren.delete(childId); + }, + }; + }, [isPresent, presenceChildren, onExitComplete]); + /** + * If the presence of a child affects the layout of the components around it, + * we want to make a new context value to ensure they get re-rendered + * so they can detect that layout change. + */ + if (presenceAffectsLayout && isReusedContext) { + context = { ...context }; + } + React.useMemo(() => { + presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); + }, [isPresent]); + /** + * If there's no `motion` components to fire exit animations, we want to remove this + * component immediately. + */ + React__namespace.useEffect(() => { + !isPresent && + !presenceChildren.size && + onExitComplete && + onExitComplete(); + }, [isPresent]); + children = (jsxRuntime.jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); + return (jsxRuntime.jsx(featureBundle.PresenceContext.Provider, { value: context, children: children })); +}; +function newChildrenMap() { + return new Map(); +} + +const getChildKey = (child) => child.key || ""; +function onlyElements(children) { + const filtered = []; + // We use forEach here instead of map as map mutates the component key by preprending `.$` + React.Children.forEach(children, (child) => { + if (React.isValidElement(child)) + filtered.push(child); + }); + return filtered; +} + +/** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ +const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { + const [isParentPresent, safeToRemove] = featureBundle.usePresence(propagate); + /** + * Filter any children that aren't ReactElements. We can only track components + * between renders with a props.key. + */ + const presentChildren = React.useMemo(() => onlyElements(children), [children]); + /** + * Track the keys of the currently rendered children. This is used to + * determine which children are exiting. + */ + const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); + /** + * If `initial={false}` we only want to pass this to components in the first render. + */ + const isInitialRender = React.useRef(true); + /** + * A ref containing the currently present children. When all exit animations + * are complete, we use this to re-render the component with the latest children + * *committed* rather than the latest children *rendered*. + */ + const pendingPresentChildren = React.useRef(presentChildren); + /** + * Track which exiting children have finished animating out. + */ + const exitComplete = featureBundle.useConstant(() => new Map()); + /** + * Track which components are currently processing exit to prevent duplicate processing. + */ + const exitingComponents = React.useRef(new Set()); + /** + * Save children to render as React state. To ensure this component is concurrent-safe, + * we check for exiting children via an effect. + */ + const [diffedChildren, setDiffedChildren] = React.useState(presentChildren); + const [renderedChildren, setRenderedChildren] = React.useState(presentChildren); + featureBundle.useIsomorphicLayoutEffect(() => { + isInitialRender.current = false; + pendingPresentChildren.current = presentChildren; + /** + * Update complete status of exiting children. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const key = getChildKey(renderedChildren[i]); + if (!presentKeys.includes(key)) { + if (exitComplete.get(key) !== true) { + exitComplete.set(key, false); + } + } + else { + exitComplete.delete(key); + exitingComponents.current.delete(key); + } + } + }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); + const exitingChildren = []; + if (presentChildren !== diffedChildren) { + let nextChildren = [...presentChildren]; + /** + * Loop through all the currently rendered components and decide which + * are exiting. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const child = renderedChildren[i]; + const key = getChildKey(child); + if (!presentKeys.includes(key)) { + nextChildren.splice(i, 0, child); + exitingChildren.push(child); + } + } + /** + * If we're in "wait" mode, and we have exiting children, we want to + * only render these until they've all exited. + */ + if (mode === "wait" && exitingChildren.length) { + nextChildren = exitingChildren; + } + setRenderedChildren(onlyElements(nextChildren)); + setDiffedChildren(presentChildren); + /** + * Early return to ensure once we've set state with the latest diffed + * children, we can immediately re-render. + */ + return null; + } + if (process.env.NODE_ENV !== "production" && + mode === "wait" && + renderedChildren.length > 1) { + console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); + } + /** + * If we've been provided a forceRender function by the LayoutGroupContext, + * we can use it to force a re-render amongst all surrounding components once + * all components have finished animating out. + */ + const { forceRender } = React.useContext(featureBundle.LayoutGroupContext); + return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderedChildren.map((child) => { + const key = getChildKey(child); + const isPresent = propagate && !isParentPresent + ? false + : presentChildren === renderedChildren || + presentKeys.includes(key); + const onExit = () => { + if (exitingComponents.current.has(key)) { + return; + } + exitingComponents.current.add(key); + if (exitComplete.has(key)) { + exitComplete.set(key, true); + } + else { + return; + } + let isEveryExitComplete = true; + exitComplete.forEach((isExitComplete) => { + if (!isExitComplete) + isEveryExitComplete = false; + }); + if (isEveryExitComplete) { + forceRender?.(); + setRenderedChildren(pendingPresentChildren.current); + propagate && safeToRemove?.(); + onExitComplete && onExitComplete(); + } + }; + return (jsxRuntime.jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial + ? undefined + : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); + }) })); +}; + +/** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ +const DeprecatedLayoutGroupContext = React.createContext(null); + +function useIsMounted() { + const isMounted = React.useRef(false); + featureBundle.useIsomorphicLayoutEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + return isMounted; +} + +function useForceUpdate() { + const isMounted = useIsMounted(); + const [forcedRenderCount, setForcedRenderCount] = React.useState(0); + const forceRender = React.useCallback(() => { + isMounted.current && setForcedRenderCount(forcedRenderCount + 1); + }, [forcedRenderCount]); + /** + * Defer this to the end of the next animation frame in case there are multiple + * synchronous calls. + */ + const deferredForceRender = React.useCallback(() => motionDom.frame.postRender(forceRender), [forceRender]); + return [deferredForceRender, forcedRenderCount]; +} + +const shouldInheritGroup = (inherit) => inherit === true; +const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; +const LayoutGroup = ({ children, id, inherit = true }) => { + const layoutGroupContext = React.useContext(featureBundle.LayoutGroupContext); + const deprecatedLayoutGroupContext = React.useContext(DeprecatedLayoutGroupContext); + const [forceRender, key] = useForceUpdate(); + const context = React.useRef(null); + const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id, + group: shouldInheritGroup(inherit) + ? layoutGroupContext.group || motionDom.nodeGroup() + : motionDom.nodeGroup(), + }; + } + const memoizedContext = React.useMemo(() => ({ ...context.current, forceRender }), [key]); + return (jsxRuntime.jsx(featureBundle.LayoutGroupContext.Provider, { value: memoizedContext, children: children })); +}; + +/** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ +function LazyMotion({ children, features, strict = false }) { + const [, setIsLoaded] = React.useState(!isLazyBundle(features)); + const loadedRenderer = React.useRef(undefined); + /** + * If this is a synchronous load, load features immediately + */ + if (!isLazyBundle(features)) { + const { renderer, ...loadedFeatures } = features; + loadedRenderer.current = renderer; + featureBundle.loadFeatures(loadedFeatures); + } + React.useEffect(() => { + if (isLazyBundle(features)) { + features().then(({ renderer, ...loadedFeatures }) => { + featureBundle.loadFeatures(loadedFeatures); + loadedRenderer.current = renderer; + setIsLoaded(true); + }); + } + }, []); + return (jsxRuntime.jsx(featureBundle.LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); +} +function isLazyBundle(features) { + return typeof features === "function"; +} + +/** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ +function MotionConfig({ children, isValidProp, ...config }) { + isValidProp && featureBundle.loadExternalIsValidProp(isValidProp); + /** + * Inherit props from any parent MotionConfig components + */ + const parentConfig = React.useContext(featureBundle.MotionConfigContext); + config = { ...parentConfig, ...config }; + config.transition = motionDom.resolveTransition(config.transition, parentConfig.transition); + /** + * Don't allow isStatic to change between renders as it affects how many hooks + * motion components fire. + */ + config.isStatic = featureBundle.useConstant(() => config.isStatic); + /** + * Creating a new config context object will re-render every `motion` component + * every time it renders. So we only want to create a new one sparingly. + */ + const context = React.useMemo(() => config, [ + JSON.stringify(config.transition), + config.transformPagePoint, + config.reducedMotion, + config.skipAnimations, + ]); + return (jsxRuntime.jsx(featureBundle.MotionConfigContext.Provider, { value: context, children: children })); +} + +const ReorderContext = React.createContext(null); + +function createMotionProxy(preloadedFeatures, createVisualElement) { + if (typeof Proxy === "undefined") { + return featureBundle.createMotionComponent; + } + /** + * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. + * Rather than generating them anew every render. + */ + const componentCache = new Map(); + const factory = (Component, options) => { + return featureBundle.createMotionComponent(Component, options, preloadedFeatures, createVisualElement); + }; + /** + * Support for deprecated`motion(Component)` pattern + */ + const deprecatedFactoryFunction = (Component, options) => { + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(false, "motion() is deprecated. Use motion.create() instead."); + } + return factory(Component, options); + }; + return new Proxy(deprecatedFactoryFunction, { + /** + * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. + * The prop name is passed through as `key` and we can use that to generate a `motion` + * DOM component with that name. + */ + get: (_target, key) => { + if (key === "create") + return factory; + /** + * If this element doesn't exist in the component cache, create it and cache. + */ + if (!componentCache.has(key)) { + componentCache.set(key, featureBundle.createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); + } + return componentCache.get(key); + }, + }); +} + +const motion = /*@__PURE__*/ createMotionProxy(featureBundle.featureBundle, featureBundle.createDomVisualElement); + +function checkReorder(order, value, offset, velocity) { + if (!velocity) + return order; + const index = order.findIndex((item) => item.value === value); + if (index === -1) + return order; + const nextOffset = velocity > 0 ? 1 : -1; + const nextItem = order[index + nextOffset]; + if (!nextItem) + return order; + const item = order[index]; + const nextLayout = nextItem.layout; + const nextItemCenter = motionDom.mixNumber(nextLayout.min, nextLayout.max, 0.5); + if ((nextOffset === 1 && item.layout.max + offset > nextItemCenter) || + (nextOffset === -1 && item.layout.min + offset < nextItemCenter)) { + return motionUtils.moveItem(order, index, index + nextOffset); + } + return order; +} + +function ReorderGroupComponent({ children, as = "ul", axis = "y", onReorder, values, ...props }, externalRef) { + const Component = featureBundle.useConstant(() => motion[as]); + const order = []; + const isReordering = React.useRef(false); + const groupRef = React.useRef(null); + motionUtils.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); + const context = { + axis, + groupRef, + registerItem: (value, layout) => { + // If the entry was already added, update it rather than adding it again + const idx = order.findIndex((entry) => value === entry.value); + if (idx !== -1) { + order[idx].layout = layout[axis]; + } + else { + order.push({ value: value, layout: layout[axis] }); + } + order.sort(compareMin); + }, + updateOrder: (item, offset, velocity) => { + if (isReordering.current) + return; + const newOrder = checkReorder(order, item, offset, velocity); + if (order !== newOrder) { + isReordering.current = true; + onReorder(newOrder + .map(getValue) + .filter((value) => values.indexOf(value) !== -1)); + } + }, + }; + React.useEffect(() => { + isReordering.current = false; + }); + // Combine refs if external ref is provided + const setRef = (element) => { + groupRef.current = element; + if (typeof externalRef === "function") { + externalRef(element); + } + else if (externalRef) { + externalRef.current = element; + } + }; + /** + * Disable browser scroll anchoring on the group container. + * When items reorder, scroll anchoring can cause the browser to adjust + * the scroll position, which interferes with drag position calculations. + */ + const groupStyle = { + overflowAnchor: "none", + ...props.style, + }; + return (jsxRuntime.jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsxRuntime.jsx(ReorderContext.Provider, { value: context, children: children }) })); +} +const ReorderGroup = /*@__PURE__*/ React.forwardRef(ReorderGroupComponent); +function getValue(item) { + return item.value; +} +function compareMin(a, b) { + return a.layout.min - b.layout.min; +} + +/** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ +function useMotionValue(initial) { + const value = featureBundle.useConstant(() => motionDom.motionValue(initial)); + /** + * If this motion value is being used in static mode, like on + * the Framer canvas, force components to rerender when the motion + * value is updated. + */ + const { isStatic } = React.useContext(featureBundle.MotionConfigContext); + if (isStatic) { + const [, setLatest] = React.useState(initial); + React.useEffect(() => value.on("change", setLatest), []); + } + return value; +} + +function useCombineMotionValues(values, combineValues) { + /** + * Initialise the returned motion value. This remains the same between renders. + */ + const value = useMotionValue(combineValues()); + /** + * Create a function that will update the template motion value with the latest values. + * This is pre-bound so whenever a motion value updates it can schedule its + * execution in Framesync. If it's already been scheduled it won't be fired twice + * in a single frame. + */ + const updateValue = () => value.set(combineValues()); + /** + * Synchronously update the motion value with the latest values during the render. + * This ensures that within a React render, the styles applied to the DOM are up-to-date. + */ + updateValue(); + /** + * Subscribe to all motion values found within the template. Whenever any of them change, + * schedule an update. + */ + featureBundle.useIsomorphicLayoutEffect(() => { + const scheduleUpdate = () => motionDom.frame.preRender(updateValue, false, true); + const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); + return () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + motionDom.cancelFrame(updateValue); + }; + }); + return value; +} + +function useComputed(compute) { + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * will be saved into this array. + */ + motionDom.collectMotionValues.current = []; + compute(); + const value = useCombineMotionValues(motionDom.collectMotionValues.current, compute); + /** + * Synchronously close session of collectMotionValues. + */ + motionDom.collectMotionValues.current = undefined; + return value; +} + +function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { + if (typeof input === "function") { + return useComputed(input); + } + /** + * Detect if outputRangeOrMap is an output map (object with keys) + * rather than an output range (array). + */ + const isOutputMap = outputRangeOrMap !== undefined && + !Array.isArray(outputRangeOrMap) && + typeof inputRangeOrTransformer !== "function"; + if (isOutputMap) { + return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); + } + const outputRange = outputRangeOrMap; + const transformer = typeof inputRangeOrTransformer === "function" + ? inputRangeOrTransformer + : motionDom.transform(inputRangeOrTransformer, outputRange, options); + const result = Array.isArray(input) + ? useListTransform(input, transformer) + : useListTransform([input], ([latest]) => transformer(latest)); + const inputAccelerate = !Array.isArray(input) + ? input.accelerate + : undefined; + if (inputAccelerate && + !inputAccelerate.isTransformed && + typeof inputRangeOrTransformer !== "function" && + Array.isArray(outputRangeOrMap) && + options?.clamp !== false) { + result.accelerate = { + ...inputAccelerate, + times: inputRangeOrTransformer, + keyframes: outputRangeOrMap, + isTransformed: true, + ...(options?.ease ? { ease: options.ease } : {}), + }; + } + return result; +} +function useListTransform(values, transformer) { + const latest = featureBundle.useConstant(() => []); + return useCombineMotionValues(values, () => { + latest.length = 0; + const numValues = values.length; + for (let i = 0; i < numValues; i++) { + latest[i] = values[i].get(); + } + return transformer(latest); + }); +} +function useMapTransform(inputValue, inputRange, outputMap, options) { + /** + * Capture keys once to ensure hooks are called in consistent order. + */ + const keys = featureBundle.useConstant(() => Object.keys(outputMap)); + const output = featureBundle.useConstant(() => ({})); + for (const key of keys) { + output[key] = useTransform(inputValue, inputRange, outputMap[key], options); + } + return output; +} + +const threshold = 50; +const maxSpeed = 25; +const overflowStyles = new Set(["auto", "scroll"]); +// Track initial scroll limits per scrollable element (Bug 1 fix) +const initialScrollLimits = new WeakMap(); +const activeScrollEdge = new WeakMap(); +// Track which group element is currently dragging to clear state on end +let currentGroupElement = null; +function resetAutoScrollState() { + if (currentGroupElement) { + const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); + if (scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + } + // Also try x axis + const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); + if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestorX); + initialScrollLimits.delete(scrollableAncestorX); + } + currentGroupElement = null; + } +} +function isScrollableElement(element, axis) { + const style = getComputedStyle(element); + const overflow = axis === "x" ? style.overflowX : style.overflowY; + const isDocumentScroll = element === document.body || + element === document.documentElement; + return overflowStyles.has(overflow) || isDocumentScroll; +} +function findScrollableAncestor(element, axis) { + let current = element?.parentElement; + while (current) { + if (isScrollableElement(current, axis)) { + return current; + } + current = current.parentElement; + } + return null; +} +function getScrollAmount(pointerPosition, scrollElement, axis) { + const rect = scrollElement.getBoundingClientRect(); + const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); + const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); + const distanceFromStart = pointerPosition - start; + const distanceFromEnd = end - pointerPosition; + if (distanceFromStart < threshold) { + const intensity = 1 - distanceFromStart / threshold; + return { amount: -maxSpeed * intensity * intensity, edge: "start" }; + } + else if (distanceFromEnd < threshold) { + const intensity = 1 - distanceFromEnd / threshold; + return { amount: maxSpeed * intensity * intensity, edge: "end" }; + } + return { amount: 0, edge: null }; +} +function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { + if (!groupElement) + return; + // Track the group element for cleanup + currentGroupElement = groupElement; + const scrollableAncestor = findScrollableAncestor(groupElement, axis); + if (!scrollableAncestor) + return; + // Convert pointer position from page coordinates to viewport coordinates. + // The gesture system uses pageX/pageY but getBoundingClientRect() returns + // viewport-relative coordinates, so we need to account for page scroll. + const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); + const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); + // If not in any threshold zone, clear all state + if (edge === null) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + return; + } + const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); + const isDocumentScroll = scrollableAncestor === document.body || + scrollableAncestor === document.documentElement; + // If not currently scrolling this edge, check velocity to see if we should start + if (currentActiveEdge !== edge) { + // Only start scrolling if velocity is towards the edge + const shouldStart = (edge === "start" && velocity < 0) || + (edge === "end" && velocity > 0); + if (!shouldStart) + return; + // Activate this edge + activeScrollEdge.set(scrollableAncestor, edge); + // Record initial scroll limit (prevents infinite scroll) + const maxScroll = axis === "x" + ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) + : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); + initialScrollLimits.set(scrollableAncestor, maxScroll); + } + // Cap scrolling at initial limit (prevents infinite scroll) + if (scrollAmount > 0) { + const initialLimit = initialScrollLimits.get(scrollableAncestor); + const currentScroll = axis === "x" + ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) + : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); + if (currentScroll >= initialLimit) + return; + } + // Apply scroll + if (axis === "x") { + if (isDocumentScroll) { + window.scrollBy({ left: scrollAmount }); + } + else { + scrollableAncestor.scrollLeft += scrollAmount; + } + } + else { + if (isDocumentScroll) { + window.scrollBy({ top: scrollAmount }); + } + else { + scrollableAncestor.scrollTop += scrollAmount; + } + } +} + +function useDefaultMotionValue(value, defaultValue = 0) { + return motionDom.isMotionValue(value) ? value : useMotionValue(defaultValue); +} +function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { + const Component = featureBundle.useConstant(() => motion[as]); + const context = React.useContext(ReorderContext); + const point = { + x: useDefaultMotionValue(style.x), + y: useDefaultMotionValue(style.y), + }; + const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); + motionUtils.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); + const { axis, registerItem, updateOrder, groupRef } = context; + return (jsxRuntime.jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { + const { velocity, point: pointerPoint } = gesturePoint; + const offset = point[axis].get(); + // Always attempt to update order - checkReorder handles the logic + updateOrder(value, offset, velocity[axis]); + autoScrollIfNeeded(groupRef.current, pointerPoint[axis], axis, velocity[axis]); + onDrag && onDrag(event, gesturePoint); + }, onDragEnd: (event, gesturePoint) => { + resetAutoScrollState(); + onDragEnd && onDragEnd(event, gesturePoint); + }, onLayoutMeasure: (measured) => { + registerItem(value, measured); + }, ref: externalRef, ignoreStrict: true, children: children })); +} +const ReorderItem = /*@__PURE__*/ React.forwardRef(ReorderItemComponent); + +var namespace = /*#__PURE__*/Object.freeze({ + __proto__: null, + Group: ReorderGroup, + Item: ReorderItem +}); + +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return motionDom.resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +function calculateRepeatDuration(duration, repeat, _repeatDelay) { + return duration * (repeat + 1); +} + +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + motionUtils.removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: motionDom.mixNumber(startTime, endTime, offset[i]), + easing: motionUtils.getEasingForSegment(easing, i), + }); + } +} + +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + */ +function normalizeTimes(times, repeat) { + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / (repeat + 1); + } +} + +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = motionDom.defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = motionDom.isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = motionUtils.secondsToMilliseconds(duration); + } + const springEasing = motionDom.createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && motionDom.fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Handle repeat options + */ + if (repeat) { + motionUtils.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high"); + duration = calculateRepeatDuration(duration, repeat); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + valueKeyframesAsList.push(...originalKeyframes); + for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + (repeatIndex + 1)); + ease.push(keyframeIndex === 0 + ? "linear" + : motionUtils.getEasingForSegment(originalEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (motionDom.isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(motionUtils.progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = motionDom.isSVGElement(element) && !motionDom.isSVGSVGElement(element) + ? new motionDom.SVGVisualElement(options) + : new motionDom.HTMLVisualElement(options); + node.mount(element); + motionDom.visualElementStore.set(element, node); +} +function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new motionDom.ObjectVisualElement(options); + node.mount(subject); + motionDom.visualElementStore.set(subject, node); +} + +function isSingleValue(subject, keyframes) { + return (motionDom.isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); +} +/** + * Implementation + */ +function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(motionDom.animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + motionUtils.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!motionDom.visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = motionDom.visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...motionDom.animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; +} + +function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionDom.motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring: motionDom.spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; +} + +function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +function createScopedAnimate(options = {}) { + const { scope, reduceMotion } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + if (isSequence(subjectOrSequence)) { + animations = animateSequence(subjectOrSequence, reduceMotion !== undefined + ? { reduceMotion, ...optionsOrKeyframes } + : optionsOrKeyframes, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, (reduceMotion !== undefined + ? { reduceMotion, ...rest } + : rest), scope); + } + const animation = new motionDom.GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + motionUtils.removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; +} +const animate = createScopedAnimate(); + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +/** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ +const maxElapsed = 50; +const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, +}); +const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), +}); +const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, +}; +function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = element[`scroll${position}`]; + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = motionUtils.progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : motionUtils.velocityPerSecond(axis.current - prev, elapsed); +} +function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; +} + +function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (motionDom.isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; +} + +const namedEdges = { + start: 0, + center: 0.5, + end: 1, +}; +function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; +} + +const defaultOffset = [0, 0]; +function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; +} + +const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], +}; + +const point = { x: 0, y: 0 }; +function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; +} +function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = motionDom.interpolate(info[axis].offset, motionDom.defaultOffset(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = motionUtils.clamp(0, 1, info[axis].interpolate(info[axis].current)); +} + +function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. + */ + if (process.env.NODE_ENV !== "production") { + if (container && target && target !== container) { + motionUtils.warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } +} +function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; +} + +const scrollListeners = new WeakMap(); +const resizeListeners = new WeakMap(); +const onScrollHandlers = new WeakMap(); +const scrollSize = new WeakMap(); +const dimensionCheckProcesses = new WeakMap(); +const getEventTarget = (element) => element === document.scrollingElement ? window : element; +function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return motionUtils.noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(motionDom.frameData.timestamp); + } + motionDom.frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => motionDom.frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener, { passive: true }); + if (container !== document.documentElement) { + resizeListeners.set(container, motionDom.resize(container, listener)); + } + target.addEventListener("scroll", listener, { passive: true }); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = motionDom.frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + motionDom.frame.read(listener, false, true); + return () => { + motionDom.cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + motionDom.cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; +} + +function canUseNativeTimeline(target) { + return (typeof window !== "undefined" && !target && motionDom.supportsScrollTimeline()); +} + +const timelineCache = new Map(); +function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; +} +function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + const containerCache = timelineCache.get(container) ?? new Map(); + timelineCache.set(container, containerCache); + const targetKey = options.target ?? "self"; + const targetCache = containerCache.get(targetKey) ?? {}; + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + targetCache[axisKey] = + canUseNativeTimeline(options.target) + ? new ScrollTimeline({ source: container, axis }) + : scrollTimelineFallback({ container, ...options }); + } + return targetCache[axisKey]; +} + +function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + return animation.attachTimeline({ + timeline: options.target ? undefined : timeline, + observe: (valueAnimation) => { + valueAnimation.pause(); + return motionDom.observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); +} + +/** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ +function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; +} +function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return motionDom.observeTimeline(onScroll, getTimeline(options)); + } +} + +function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return motionUtils.noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); +} + +const thresholds = { + some: 0, + all: 1, +}; +function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = motionDom.resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); +} + +const m = /*@__PURE__*/ createMotionProxy(); + +function useUnmountEffect(callback) { + return React.useEffect(() => () => callback(), []); +} + +/** + * @public + */ +const domAnimation = { + renderer: featureBundle.createDomVisualElement, + ...featureBundle.animations, + ...featureBundle.gestureAnimations, +}; + +/** + * @public + */ +const domMax = { + ...domAnimation, + ...featureBundle.drag, + ...featureBundle.layout, +}; + +/** + * @public + */ +const domMin = { + renderer: featureBundle.createDomVisualElement, + ...featureBundle.animations, +}; + +function useMotionValueEvent(value, event, callback) { + /** + * useInsertionEffect will create subscriptions before any other + * effects will run. Effects run upwards through the tree so it + * can be that binding a useLayoutEffect higher up the tree can + * miss changes from lower down the tree. + */ + React.useInsertionEffect(() => value.on(event, callback), [value, event, callback]); +} + +const createScrollMotionValues = () => ({ + scrollX: motionDom.motionValue(0), + scrollY: motionDom.motionValue(0), + scrollXProgress: motionDom.motionValue(0), + scrollYProgress: motionDom.motionValue(0), +}); +const isRefPending = (ref) => { + if (!ref) + return false; + return !ref.current; +}; +function makeAccelerateConfig(axis, options, container) { + return { + factory: (animation) => scroll(animation, { ...options, axis, container }), + times: [0, 1], + keyframes: [0, 1], + ease: (v) => v, + duration: 1, + }; +} +function useScroll({ container, target, ...options } = {}) { + const values = featureBundle.useConstant(createScrollMotionValues); + if (!target && canUseNativeTimeline()) { + const resolvedContainer = container?.current || undefined; + values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, resolvedContainer); + values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, resolvedContainer); + } + const scrollAnimation = React.useRef(null); + const needsStart = React.useRef(false); + const start = React.useCallback(() => { + scrollAnimation.current = scroll((_progress, { x, y, }) => { + values.scrollX.set(x.current); + values.scrollXProgress.set(x.progress); + values.scrollY.set(y.current); + values.scrollYProgress.set(y.progress); + }, { + ...options, + container: container?.current || undefined, + target: target?.current || undefined, + }); + return () => { + scrollAnimation.current?.(); + }; + }, [container, target, JSON.stringify(options.offset)]); + featureBundle.useIsomorphicLayoutEffect(() => { + needsStart.current = false; + if (isRefPending(container) || isRefPending(target)) { + needsStart.current = true; + return; + } + else { + return start(); + } + }, [start]); + React.useEffect(() => { + if (needsStart.current) { + motionUtils.invariant(!isRefPending(container), "Container ref is defined but not hydrated", "use-scroll-ref"); + motionUtils.invariant(!isRefPending(target), "Target ref is defined but not hydrated", "use-scroll-ref"); + return start(); + } + else { + return; + } + }, [start]); + return values; +} + +/** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ +function useElementScroll(ref) { + if (process.env.NODE_ENV === "development") { + motionUtils.warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); + } + return useScroll({ container: ref }); +} + +/** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ +function useViewportScroll() { + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); + } + return useScroll(); +} + +/** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ +function useMotionTemplate(fragments, ...values) { + /** + * Create a function that will build a string from the latest motion values. + */ + const numFragments = fragments.length; + function buildValue() { + let output = ``; + for (let i = 0; i < numFragments; i++) { + output += fragments[i]; + const value = values[i]; + if (value) { + output += motionDom.isMotionValue(value) ? value.get() : value; + } + } + return output; + } + return useCombineMotionValues(values.filter(motionDom.isMotionValue), buildValue); +} + +function useFollowValue(source, options = {}) { + const { isStatic } = React.useContext(featureBundle.MotionConfigContext); + const getFromSource = () => (motionDom.isMotionValue(source) ? source.get() : source); + // isStatic will never change, allowing early hooks return + if (isStatic) { + return useTransform(getFromSource); + } + const value = useMotionValue(getFromSource()); + React.useInsertionEffect(() => { + return motionDom.attachFollow(value, source, options); + }, [value, JSON.stringify(options)]); + return value; +} + +function useSpring(source, options = {}) { + return useFollowValue(source, { type: "spring", ...options }); +} + +function useAnimationFrame(callback) { + const initialTimestamp = React.useRef(0); + const { isStatic } = React.useContext(featureBundle.MotionConfigContext); + React.useEffect(() => { + if (isStatic) + return; + const provideTimeSinceStart = ({ timestamp, delta }) => { + if (!initialTimestamp.current) + initialTimestamp.current = timestamp; + callback(timestamp - initialTimestamp.current, delta); + }; + motionDom.frame.update(provideTimeSinceStart, true); + return () => motionDom.cancelFrame(provideTimeSinceStart); + }, [callback]); +} + +function useTime() { + const time = useMotionValue(0); + useAnimationFrame((t) => time.set(t)); + return time; +} + +/** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ +function useVelocity(value) { + const velocity = useMotionValue(value.getVelocity()); + const updateVelocity = () => { + const latest = value.getVelocity(); + velocity.set(latest); + /** + * If we still have velocity, schedule an update for the next frame + * to keep checking until it is zero. + */ + if (latest) + motionDom.frame.update(updateVelocity); + }; + useMotionValueEvent(value, "change", () => { + // Schedule an update to this value at the end of the current frame. + motionDom.frame.update(updateVelocity, false, true); + }); + return velocity; +} + +class WillChangeMotionValue extends motionDom.MotionValue { + constructor() { + super(...arguments); + this.isEnabled = false; + } + add(name) { + if (motionDom.transformProps.has(name) || motionDom.acceleratedValues.has(name)) { + this.isEnabled = true; + this.update(); + } + } + update() { + this.set(this.isEnabled ? "transform" : "auto"); + } +} + +function useWillChange() { + return featureBundle.useConstant(() => new WillChangeMotionValue("auto")); +} + +/** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ +function useReducedMotion() { + /** + * Lazy initialisation of prefersReducedMotion + */ + !motionDom.hasReducedMotionListener.current && motionDom.initPrefersReducedMotion(); + const [shouldReduceMotion] = React.useState(motionDom.prefersReducedMotion.current); + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * TODO See if people miss automatically updating shouldReduceMotion setting + */ + return shouldReduceMotion; +} + +function useReducedMotionConfig() { + const reducedMotionPreference = useReducedMotion(); + const { reducedMotion } = React.useContext(featureBundle.MotionConfigContext); + if (reducedMotion === "never") { + return false; + } + else if (reducedMotion === "always") { + return true; + } + else { + return reducedMotionPreference; + } +} + +function stopAnimation(visualElement) { + visualElement.values.forEach((value) => value.stop()); +} +function setVariants(visualElement, variantLabels) { + const reversedLabels = [...variantLabels].reverse(); + reversedLabels.forEach((key) => { + const variant = visualElement.getVariant(key); + variant && motionDom.setTarget(visualElement, variant); + if (visualElement.variantChildren) { + visualElement.variantChildren.forEach((child) => { + setVariants(child, variantLabels); + }); + } + }); +} +function setValues(visualElement, definition) { + if (Array.isArray(definition)) { + return setVariants(visualElement, definition); + } + else if (typeof definition === "string") { + return setVariants(visualElement, [definition]); + } + else { + motionDom.setTarget(visualElement, definition); + } +} +/** + * @public + */ +function animationControls() { + /** + * Track whether the host component has mounted. + */ + let hasMounted = false; + /** + * A collection of linked component animation controls. + */ + const subscribers = new Set(); + const controls = { + subscribe(visualElement) { + subscribers.add(visualElement); + return () => void subscribers.delete(visualElement); + }, + start(definition, transitionOverride) { + motionUtils.invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); + const animations = []; + subscribers.forEach((visualElement) => { + animations.push(motionDom.animateVisualElement(visualElement, definition, { + transitionOverride, + })); + }); + return Promise.all(animations); + }, + set(definition) { + motionUtils.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); + return subscribers.forEach((visualElement) => { + setValues(visualElement, definition); + }); + }, + stop() { + subscribers.forEach((visualElement) => { + stopAnimation(visualElement); + }); + }, + mount() { + hasMounted = true; + return () => { + hasMounted = false; + controls.stop(); + }; + }, + }; + return controls; +} + +function useAnimate() { + const scope = featureBundle.useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const reduceMotion = useReducedMotionConfig() ?? undefined; + const animate = React.useMemo(() => createScopedAnimate({ scope, reduceMotion }), [scope, reduceMotion]); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + scope.animations.length = 0; + }); + return [scope, animate]; +} + +function useAnimateMini() { + const scope = featureBundle.useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = featureBundle.useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; +} + +/** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ +function useAnimationControls() { + const controls = featureBundle.useConstant(animationControls); + featureBundle.useIsomorphicLayoutEffect(controls.mount, []); + return controls; +} +const useAnimation = useAnimationControls; + +function usePresenceData() { + const context = React.useContext(featureBundle.PresenceContext); + return context ? context.custom : undefined; +} + +/** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return

+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ +function useDomEvent(ref, eventName, handler, options) { + React.useEffect(() => { + const element = ref.current; + if (handler && element) { + return motionDom.addDomEvent(element, eventName, handler, options); + } + }, [ref, eventName, handler, options]); +} + +/** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +class DragControls { + constructor() { + this.componentControls = new Set(); + } + /** + * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. + * + * @internal + */ + subscribe(controls) { + this.componentControls.add(controls); + return () => this.componentControls.delete(controls); + } + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event, options) { + this.componentControls.forEach((controls) => { + controls.start(event.nativeEvent || event, options); + }); + } + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel() { + this.componentControls.forEach((controls) => { + controls.cancel(); + }); + } + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop() { + this.componentControls.forEach((controls) => { + controls.stop(); + }); + } +} +const createDragControls = () => new DragControls(); +/** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +function useDragControls() { + return featureBundle.useConstant(createDragControls); +} + +/** + * Checks if a component is a `motion` component. + */ +function isMotionComponent(component) { + return (component !== null && + typeof component === "object" && + featureBundle.motionComponentSymbol in component); +} + +/** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ +function unwrapMotionComponent(component) { + if (isMotionComponent(component)) { + return component[featureBundle.motionComponentSymbol]; + } + return undefined; +} + +function useInstantLayoutTransition() { + return startTransition; +} +function startTransition(callback) { + if (!motionDom.rootProjectionNode.current) + return; + motionDom.rootProjectionNode.current.isUpdating = false; + motionDom.rootProjectionNode.current.blockUpdate(); + callback && callback(); +} + +function useResetProjection() { + const reset = React.useCallback(() => { + const root = motionDom.rootProjectionNode.current; + if (!root) + return; + root.resetTree(); + }, []); + return reset; +} + +/** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ +function useCycle(...items) { + const index = React.useRef(0); + const [item, setItem] = React.useState(items[index.current]); + const runCycle = React.useCallback((next) => { + index.current = + typeof next !== "number" + ? motionUtils.wrap(0, items.length, index.current + 1) + : next; + setItem(items[index.current]); + }, + // The array will change on each call, but by putting items.length at + // the front of this array, we guarantee the dependency comparison will match up + // eslint-disable-next-line react-hooks/exhaustive-deps + [items.length, ...items]); + return [item, runCycle]; +} + +function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { + const [isInView, setInView] = React.useState(initial); + React.useEffect(() => { + if (!ref.current || (once && isInView)) + return; + const onEnter = () => { + setInView(true); + return once ? undefined : () => setInView(false); + }; + const options = { + root: (root && root.current) || undefined, + margin, + amount, + }; + return inView(ref.current, onEnter, options); + }, [root, ref, margin, once, amount]); + return isInView; +} + +function useInstantTransition() { + const [forceUpdate, forcedRenderCount] = useForceUpdate(); + const startInstantLayoutTransition = useInstantLayoutTransition(); + const unlockOnFrameRef = React.useRef(-1); + React.useEffect(() => { + /** + * Unblock after two animation frames, otherwise this will unblock too soon. + */ + motionDom.frame.postRender(() => motionDom.frame.postRender(() => { + /** + * If the callback has been called again after the effect + * triggered this 2 frame delay, don't unblock animations. This + * prevents the previous effect from unblocking the current + * instant transition too soon. This becomes more likely when + * used in conjunction with React.startTransition(). + */ + if (forcedRenderCount !== unlockOnFrameRef.current) + return; + motionUtils.MotionGlobalConfig.instantAnimations = false; + })); + }, [forcedRenderCount]); + return (callback) => { + startInstantLayoutTransition(() => { + motionUtils.MotionGlobalConfig.instantAnimations = true; + forceUpdate(); + callback(); + unlockOnFrameRef.current = forcedRenderCount + 1; + }); + }; +} +function disableInstantTransitions() { + motionUtils.MotionGlobalConfig.instantAnimations = false; +} + +function usePageInView() { + const [isInView, setIsInView] = React.useState(true); + React.useEffect(() => { + const handleVisibilityChange = () => setIsInView(!document.hidden); + if (document.hidden) { + handleVisibilityChange(); + } + document.addEventListener("visibilitychange", handleVisibilityChange); + return () => { + document.removeEventListener("visibilitychange", handleVisibilityChange); + }; + }, []); + return isInView; +} + +/** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +function transformViewBoxPoint(svgRef) { + return (point) => { + const svg = svgRef.current; + if (!svg) { + return point; + } + // Get the viewBox attribute + const viewBox = svg.viewBox?.baseVal; + if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { + // No viewBox or empty viewBox - no transformation needed + return point; + } + // Get the rendered dimensions of the SVG + const bbox = svg.getBoundingClientRect(); + if (bbox.width === 0 || bbox.height === 0) { + return point; + } + // Calculate scale factors + const scaleX = viewBox.width / bbox.width; + const scaleY = viewBox.height / bbox.height; + // Get the SVG's position on the page + const svgX = bbox.left + window.scrollX; + const svgY = bbox.top + window.scrollY; + // Transform the point: + // 1. Calculate position relative to SVG + // 2. Scale by viewBox/viewport ratio + // 3. Add back the SVG position (but in SVG coordinates) + return { + x: (point.x - svgX) * scaleX + svgX, + y: (point.y - svgY) * scaleY + svgY, + }; + }; +} + +const appearAnimationStore = new Map(); +const appearComplete = new Map(); + +const appearStoreId = (elementId, valueName) => { + const key = motionDom.transformProps.has(valueName) ? "transform" : valueName; + return `${elementId}: ${key}`; +}; + +function handoffOptimizedAppearAnimation(elementId, valueName, frame) { + const storeId = appearStoreId(elementId, valueName); + const optimisedAnimation = appearAnimationStore.get(storeId); + if (!optimisedAnimation) { + return null; + } + const { animation, startTime } = optimisedAnimation; + function cancelAnimation() { + window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); + } + /** + * We can cancel the animation once it's finished now that we've synced + * with Motion. + * + * Prefer onfinish over finished as onfinish is backwards compatible with + * older browsers. + */ + animation.onfinish = cancelAnimation; + if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { + /** + * If the startTime is null, this animation is the Paint Ready detection animation + * and we can cancel it immediately without handoff. + * + * Or if we've already handed off the animation then we're now interrupting it. + * In which case we need to cancel it. + */ + cancelAnimation(); + return null; + } + else { + return startTime; + } +} + +/** + * A single time to use across all animations to manually set startTime + * and ensure they're all in sync. + */ +let startFrameTime; +/** + * A dummy animation to detect when Chrome is ready to start + * painting the page and hold off from triggering the real animation + * until then. We only need one animation to detect paint ready. + * + * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 + */ +let readyAnimation; +/** + * Keep track of animations that were suspended vs cancelled so we + * can easily resume them when we're done measuring layout. + */ +const suspendedAnimations = new Set(); +function resumeSuspendedAnimations() { + suspendedAnimations.forEach((data) => { + data.animation.play(); + data.animation.startTime = data.startTime; + }); + suspendedAnimations.clear(); +} +function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { + // Prevent optimised appear animations if Motion has already started animating. + if (window.MotionIsMounted) { + return; + } + const id = element.dataset[motionDom.optimizedAppearDataId]; + if (!id) + return; + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + const storeId = appearStoreId(id, name); + if (!readyAnimation) { + readyAnimation = motionDom.startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], + /** + * 10 secs is basically just a super-safe duration to give Chrome + * long enough to get the animation ready. + */ + { duration: 10000, ease: "linear" }); + appearAnimationStore.set(storeId, { + animation: readyAnimation, + startTime: null, + }); + /** + * If there's no readyAnimation then there's been no instantiation + * of handoff animations. + */ + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + window.MotionHasOptimisedAnimation = (elementId, valueName) => { + if (!elementId) + return false; + /** + * Keep a map of elementIds that have started animating. We check + * via ID instead of Element because of hydration errors and + * pre-hydration checks. We also actively record IDs as they start + * animating rather than simply checking for data-appear-id as + * this attrbute might be present but not lead to an animation, for + * instance if the element's appear animation is on a different + * breakpoint. + */ + if (!valueName) { + return appearComplete.has(elementId); + } + const animationId = appearStoreId(elementId, valueName); + return Boolean(appearAnimationStore.get(animationId)); + }; + window.MotionHandoffMarkAsComplete = (elementId) => { + if (appearComplete.has(elementId)) { + appearComplete.set(elementId, true); + } + }; + window.MotionHandoffIsComplete = (elementId) => { + return appearComplete.get(elementId) === true; + }; + /** + * We only need to cancel transform animations as + * they're the ones that will interfere with the + * layout animation measurements. + */ + window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { + const animationId = appearStoreId(elementId, valueName); + const data = appearAnimationStore.get(animationId); + if (!data) + return; + if (frame && canResume === undefined) { + /** + * Wait until the end of the subsequent frame to cancel the animation + * to ensure we don't remove the animation before the main thread has + * had a chance to resolve keyframes and render. + */ + frame.postRender(() => { + frame.postRender(() => { + data.animation.cancel(); + }); + }); + } + else { + data.animation.cancel(); + } + if (frame && canResume) { + suspendedAnimations.add(data); + frame.render(resumeSuspendedAnimations); + } + else { + appearAnimationStore.delete(animationId); + /** + * If there are no more animations left, we can remove the cancel function. + * This will let us know when we can stop checking for conflicting layout animations. + */ + if (!appearAnimationStore.size) { + window.MotionCancelOptimisedAnimation = undefined; + } + } + }; + window.MotionCheckAppearSync = (visualElement, valueName, value) => { + const appearId = motionDom.getOptimisedAppearId(visualElement); + if (!appearId) + return; + const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); + const externalAnimationValue = visualElement.props.values?.[valueName]; + if (!valueIsOptimised || !externalAnimationValue) + return; + const removeSyncCheck = value.on("change", (latestValue) => { + if (externalAnimationValue.get() !== latestValue) { + window.MotionCancelOptimisedAnimation?.(appearId, valueName); + removeSyncCheck(); + } + }); + return removeSyncCheck; + }; + } + const startAnimation = () => { + readyAnimation.cancel(); + const appearAnimation = motionDom.startWaapiAnimation(element, name, keyframes, options); + /** + * Record the time of the first started animation. We call performance.now() once + * here and once in handoff to ensure we're getting + * close to a frame-locked time. This keeps all animations in sync. + */ + if (startFrameTime === undefined) { + startFrameTime = performance.now(); + } + appearAnimation.startTime = startFrameTime; + appearAnimationStore.set(storeId, { + animation: appearAnimation, + startTime: startFrameTime, + }); + if (onReady) + onReady(appearAnimation); + }; + appearComplete.set(id, false); + if (readyAnimation.ready) { + readyAnimation.ready.then(startAnimation).catch(motionUtils.noop); + } + else { + startAnimation(); + } +} + +const createObject = () => ({}); +class StateVisualElement extends motionDom.VisualElement { + constructor() { + super(...arguments); + this.measureInstanceViewportBox = motionDom.createBox; + } + build() { } + resetTransform() { } + restoreTransform() { } + removeValueFromRenderState() { } + renderInstance() { } + scrapeMotionValuesFromProps() { + return createObject(); + } + getBaseTargetFromProps() { + return undefined; + } + readValueFromInstance(_state, key, options) { + return options.initialState[key] || 0; + } + sortInstanceNodePosition() { + return 0; + } +} +const useVisualState = featureBundle.makeUseVisualState({ + scrapeMotionValuesFromProps: createObject, + createRenderState: createObject, +}); +/** + * This is not an officially supported API and may be removed + * on any version. + */ +function useAnimatedState(initialState) { + const [animationState, setAnimationState] = React.useState(initialState); + const visualState = useVisualState({}, false); + const element = featureBundle.useConstant(() => { + return new StateVisualElement({ + props: { + onUpdate: (v) => { + setAnimationState({ ...v }); + }, + }, + visualState, + presenceContext: null, + }, { initialState }); + }); + React.useLayoutEffect(() => { + element.mount({}); + return () => element.unmount(); + }, [element]); + const startAnimation = featureBundle.useConstant(() => (animationDefinition) => { + return motionDom.animateVisualElement(element, animationDefinition); + }); + return [animationState, startAnimation]; +} + +let id = 0; +const AnimateSharedLayout = ({ children }) => { + React__namespace.useEffect(() => { + motionUtils.invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); + }, []); + return (jsxRuntime.jsx(LayoutGroup, { id: featureBundle.useConstant(() => `asl-${id++}`), children: children })); +}; + +// Keep things reasonable and avoid scale: Infinity. In practise we might need +// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] +// to simply hide content at unreasonable scales. +const maxScale = 100000; +const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; +let hasWarned = false; +/** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ +function useInvertedScale(scale) { + let parentScaleX = useMotionValue(1); + let parentScaleY = useMotionValue(1); + const { visualElement } = React.useContext(featureBundle.MotionContext); + motionUtils.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); + motionUtils.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); + hasWarned = true; + if (scale) { + parentScaleX = scale.scaleX || parentScaleX; + parentScaleY = scale.scaleY || parentScaleY; + } + else if (visualElement) { + parentScaleX = visualElement.getValue("scaleX", 1); + parentScaleY = visualElement.getValue("scaleY", 1); + } + const scaleX = useTransform(parentScaleX, invertScale); + const scaleY = useTransform(parentScaleY, invertScale); + return { scaleX, scaleY }; +} + +exports.LayoutGroupContext = featureBundle.LayoutGroupContext; +exports.MotionConfigContext = featureBundle.MotionConfigContext; +exports.MotionContext = featureBundle.MotionContext; +exports.PresenceContext = featureBundle.PresenceContext; +exports.SwitchLayoutGroupContext = featureBundle.SwitchLayoutGroupContext; +exports.addPointerEvent = featureBundle.addPointerEvent; +exports.addPointerInfo = featureBundle.addPointerInfo; +exports.animations = featureBundle.animations; +exports.distance = featureBundle.distance; +exports.distance2D = featureBundle.distance2D; +exports.filterProps = featureBundle.filterProps; +exports.isBrowser = featureBundle.isBrowser; +exports.isValidMotionProp = featureBundle.isValidMotionProp; +exports.makeUseVisualState = featureBundle.makeUseVisualState; +exports.useIsPresent = featureBundle.useIsPresent; +exports.useIsomorphicLayoutEffect = featureBundle.useIsomorphicLayoutEffect; +exports.usePresence = featureBundle.usePresence; +Object.defineProperty(exports, "VisualElement", { + enumerable: true, + get: function () { return motionDom.VisualElement; } +}); +Object.defineProperty(exports, "addScaleCorrector", { + enumerable: true, + get: function () { return motionDom.addScaleCorrector; } +}); +Object.defineProperty(exports, "animateVisualElement", { + enumerable: true, + get: function () { return motionDom.animateVisualElement; } +}); +Object.defineProperty(exports, "buildTransform", { + enumerable: true, + get: function () { return motionDom.buildTransform; } +}); +Object.defineProperty(exports, "calcLength", { + enumerable: true, + get: function () { return motionDom.calcLength; } +}); +Object.defineProperty(exports, "createBox", { + enumerable: true, + get: function () { return motionDom.createBox; } +}); +Object.defineProperty(exports, "delay", { + enumerable: true, + get: function () { return motionDom.delay; } +}); +Object.defineProperty(exports, "optimizedAppearDataAttribute", { + enumerable: true, + get: function () { return motionDom.optimizedAppearDataAttribute; } +}); +Object.defineProperty(exports, "resolveMotionValue", { + enumerable: true, + get: function () { return motionDom.resolveMotionValue; } +}); +Object.defineProperty(exports, "visualElementStore", { + enumerable: true, + get: function () { return motionDom.visualElementStore; } +}); +Object.defineProperty(exports, "MotionGlobalConfig", { + enumerable: true, + get: function () { return motionUtils.MotionGlobalConfig; } +}); +exports.AnimatePresence = AnimatePresence; +exports.AnimateSharedLayout = AnimateSharedLayout; +exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext; +exports.DragControls = DragControls; +exports.LayoutGroup = LayoutGroup; +exports.LazyMotion = LazyMotion; +exports.MotionConfig = MotionConfig; +exports.PopChild = PopChild; +exports.PresenceChild = PresenceChild; +exports.Reorder = namespace; +exports.WillChangeMotionValue = WillChangeMotionValue; +exports.animate = animate; +exports.animateMini = animateMini; +exports.animationControls = animationControls; +exports.createScopedAnimate = createScopedAnimate; +exports.disableInstantTransitions = disableInstantTransitions; +exports.domAnimation = domAnimation; +exports.domMax = domMax; +exports.domMin = domMin; +exports.inView = inView; +exports.isMotionComponent = isMotionComponent; +exports.m = m; +exports.motion = motion; +exports.scroll = scroll; +exports.scrollInfo = scrollInfo; +exports.startOptimizedAppearAnimation = startOptimizedAppearAnimation; +exports.transformViewBoxPoint = transformViewBoxPoint; +exports.unwrapMotionComponent = unwrapMotionComponent; +exports.useAnimate = useAnimate; +exports.useAnimateMini = useAnimateMini; +exports.useAnimation = useAnimation; +exports.useAnimationControls = useAnimationControls; +exports.useAnimationFrame = useAnimationFrame; +exports.useComposedRefs = useComposedRefs; +exports.useCycle = useCycle; +exports.useDeprecatedAnimatedState = useAnimatedState; +exports.useDeprecatedInvertedScale = useInvertedScale; +exports.useDomEvent = useDomEvent; +exports.useDragControls = useDragControls; +exports.useElementScroll = useElementScroll; +exports.useFollowValue = useFollowValue; +exports.useForceUpdate = useForceUpdate; +exports.useInView = useInView; +exports.useInstantLayoutTransition = useInstantLayoutTransition; +exports.useInstantTransition = useInstantTransition; +exports.useMotionTemplate = useMotionTemplate; +exports.useMotionValue = useMotionValue; +exports.useMotionValueEvent = useMotionValueEvent; +exports.usePageInView = usePageInView; +exports.usePresenceData = usePresenceData; +exports.useReducedMotion = useReducedMotion; +exports.useReducedMotionConfig = useReducedMotionConfig; +exports.useResetProjection = useResetProjection; +exports.useScroll = useScroll; +exports.useSpring = useSpring; +exports.useTime = useTime; +exports.useTransform = useTransform; +exports.useUnmountEffect = useUnmountEffect; +exports.useVelocity = useVelocity; +exports.useViewportScroll = useViewportScroll; +exports.useWillChange = useWillChange; +Object.keys(motionDom).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionDom[k]; } + }); +}); +Object.keys(motionUtils).forEach(function (k) { + if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, { + enumerable: true, + get: function () { return motionUtils[k]; } + }); +}); +//# sourceMappingURL=index.js.map diff --git a/node_modules/framer-motion/dist/cjs/index.js.map b/node_modules/framer-motion/dist/cjs/index.js.map new file mode 100644 index 00000000..3c990f11 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../src/utils/use-composed-ref.ts","../../src/components/AnimatePresence/PopChild.tsx","../../src/components/AnimatePresence/PresenceChild.tsx","../../src/components/AnimatePresence/utils.ts","../../src/components/AnimatePresence/index.tsx","../../src/context/DeprecatedLayoutGroupContext.ts","../../src/utils/use-is-mounted.ts","../../src/utils/use-force-update.ts","../../src/components/LayoutGroup/index.tsx","../../src/components/LazyMotion/index.tsx","../../src/components/MotionConfig/index.tsx","../../src/context/ReorderContext.ts","../../src/render/components/create-proxy.ts","../../src/render/components/motion/proxy.ts","../../src/components/Reorder/utils/check-reorder.ts","../../src/components/Reorder/Group.tsx","../../src/value/use-motion-value.ts","../../src/value/use-combine-values.ts","../../src/value/use-computed.ts","../../src/value/use-transform.ts","../../src/components/Reorder/utils/auto-scroll.ts","../../src/components/Reorder/Item.tsx","../../src/animation/utils/is-dom-keyframes.ts","../../src/animation/animate/resolve-subjects.ts","../../src/animation/sequence/utils/calc-repeat-duration.ts","../../src/animation/sequence/utils/calc-time.ts","../../src/animation/sequence/utils/edit.ts","../../src/animation/sequence/utils/normalize-times.ts","../../src/animation/sequence/utils/sort.ts","../../src/animation/sequence/create.ts","../../src/animation/utils/create-visual-element.ts","../../src/animation/animate/subject.ts","../../src/animation/animate/sequence.ts","../../src/animation/animate/index.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/render/dom/scroll/info.ts","../../src/render/dom/scroll/offsets/inset.ts","../../src/render/dom/scroll/offsets/edge.ts","../../src/render/dom/scroll/offsets/offset.ts","../../src/render/dom/scroll/offsets/presets.ts","../../src/render/dom/scroll/offsets/index.ts","../../src/render/dom/scroll/on-scroll-handler.ts","../../src/render/dom/scroll/track.ts","../../src/render/dom/scroll/utils/can-use-native-timeline.ts","../../src/render/dom/scroll/utils/get-timeline.ts","../../src/render/dom/scroll/attach-animation.ts","../../src/render/dom/scroll/attach-function.ts","../../src/render/dom/scroll/index.ts","../../src/render/dom/viewport/index.ts","../../src/render/components/m/proxy.ts","../../src/utils/use-unmount-effect.ts","../../src/render/dom/features-animation.ts","../../src/render/dom/features-max.ts","../../src/render/dom/features-min.ts","../../src/utils/use-motion-value-event.ts","../../src/value/use-scroll.ts","../../src/value/scroll/use-element-scroll.ts","../../src/value/scroll/use-viewport-scroll.ts","../../src/value/use-motion-template.ts","../../src/value/use-follow-value.ts","../../src/value/use-spring.ts","../../src/utils/use-animation-frame.ts","../../src/value/use-time.ts","../../src/value/use-velocity.ts","../../src/value/use-will-change/WillChangeMotionValue.ts","../../src/value/use-will-change/index.ts","../../src/utils/reduced-motion/use-reduced-motion.ts","../../src/utils/reduced-motion/use-reduced-motion-config.ts","../../src/animation/hooks/animation-controls.ts","../../src/animation/hooks/use-animate.ts","../../src/animation/hooks/use-animate-style.ts","../../src/animation/hooks/use-animation.ts","../../src/components/AnimatePresence/use-presence-data.ts","../../src/events/use-dom-event.ts","../../src/gestures/drag/use-drag-controls.ts","../../src/motion/utils/is-motion-component.ts","../../src/motion/utils/unwrap-motion-component.ts","../../src/projection/use-instant-layout-transition.ts","../../src/projection/use-reset-projection.ts","../../src/utils/use-cycle.ts","../../src/utils/use-in-view.ts","../../src/utils/use-instant-transition.ts","../../src/utils/use-page-in-view.ts","../../src/utils/transform-viewbox-point.ts","../../src/animation/optimized-appear/store.ts","../../src/animation/optimized-appear/store-id.ts","../../src/animation/optimized-appear/handoff.ts","../../src/animation/optimized-appear/start.ts","../../src/animation/hooks/use-animated-state.ts","../../src/components/AnimateSharedLayout.tsx","../../src/value/use-inverted-scale.ts"],"sourcesContent":["/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\nimport * as React from \"react\"\n\ntype PossibleRef = React.Ref | undefined\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T): void | (() => void) {\n if (typeof ref === \"function\") {\n return ref(value)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as React.MutableRefObject).current = value\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node)\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true\n }\n return cleanup\n })\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i]\n if (typeof cleanup === \"function\") {\n cleanup()\n } else {\n setRef(refs[i], null)\n }\n }\n }\n }\n }\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs)\n}\n\nexport { useComposedRefs }\n","\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject\n sizeRef: React.RefObject\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const size = this.props.sizeRef.current!\n size.height = element.offsetHeight || 0\n size.width = element.offsetWidth || 0\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef(null)\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n */\n const childRef =\n (children.props as { ref?: React.Ref })?.ref ??\n (children as unknown as { ref?: React.Ref })?.ref\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n \n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n \n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useId, useMemo } from \"react\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { VariantLabels } from \"../../motion/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { PopChild } from \"./PopChild\"\n\ninterface PresenceChildProps {\n children: React.ReactElement\n isPresent: boolean\n onExitComplete?: () => void\n initial?: false | VariantLabels\n custom?: any\n presenceAffectsLayout: boolean\n mode: \"sync\" | \"popLayout\" | \"wait\"\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n}\n\nexport const PresenceChild = ({\n children,\n initial,\n isPresent,\n onExitComplete,\n custom,\n presenceAffectsLayout,\n mode,\n anchorX,\n anchorY,\n root\n}: PresenceChildProps) => {\n const presenceChildren = useConstant(newChildrenMap)\n const id = useId()\n\n let isReusedContext = true\n let context = useMemo((): PresenceContextProps => {\n isReusedContext = false\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId: string) => {\n presenceChildren.set(childId, true)\n\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete) return // can stop searching when any is incomplete\n }\n\n onExitComplete && onExitComplete()\n },\n register: (childId: string) => {\n presenceChildren.set(childId, false)\n return () => presenceChildren.delete(childId)\n },\n }\n }, [isPresent, presenceChildren, onExitComplete])\n\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context }\n }\n\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false))\n }, [isPresent])\n\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete()\n }, [isPresent])\n\n children = (\n \n {children}\n \n )\n\n return (\n \n {children}\n \n )\n}\n\nfunction newChildrenMap(): Map {\n return new Map()\n}\n","import { isValidElement, Children, ReactElement, ReactNode } from \"react\"\n\nexport type ComponentKey = string | number\n\nexport const getChildKey = (child: ReactElement): ComponentKey =>\n child.key || \"\"\n\nexport function onlyElements(children: ReactNode): ReactElement[] {\n const filtered: ReactElement[] = []\n\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child)) filtered.push(child)\n })\n\n return filtered\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n exitingComponents.current.add(key)\n\n if (exitComplete.has(key)) {\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n \n {child}\n \n )\n })}\n \n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\n\n/**\n * Note: Still used by components generated by old versions of Framer\n *\n * @deprecated\n */\nexport const DeprecatedLayoutGroupContext = createContext(null)\n","\"use client\"\n\nimport { useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-effect\"\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { MutableRefObject, useContext, useMemo, useRef } from \"react\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../context/LayoutGroupContext\"\nimport { DeprecatedLayoutGroupContext } from \"../../context/DeprecatedLayoutGroupContext\"\nimport { nodeGroup } from \"../../projection\"\nimport { useForceUpdate } from \"../../utils/use-force-update\"\n\ntype InheritOption = boolean | \"id\"\n\nexport interface Props {\n id?: string\n inherit?: InheritOption\n}\n\nconst shouldInheritGroup = (inherit: InheritOption) => inherit === true\nconst shouldInheritId = (inherit: InheritOption) =>\n shouldInheritGroup(inherit === true) || inherit === \"id\"\n\nexport const LayoutGroup: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children, id, inherit = true }) => {\n const layoutGroupContext = useContext(LayoutGroupContext)\n const deprecatedLayoutGroupContext = useContext(\n DeprecatedLayoutGroupContext\n )\n const [forceRender, key] = useForceUpdate()\n const context = useRef(\n null\n ) as MutableRefObject\n\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext\n if (context.current === null) {\n if (shouldInheritId(inherit) && upstreamId) {\n id = id ? upstreamId + \"-\" + id : upstreamId\n }\n\n context.current = {\n id,\n group: shouldInheritGroup(inherit)\n ? layoutGroupContext.group || nodeGroup()\n : nodeGroup(),\n }\n }\n\n const memoizedContext = useMemo(\n () => ({ ...context.current, forceRender }),\n [key]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { loadFeatures } from \"../../motion/features/load-features\"\nimport { FeatureBundle, LazyFeatureBundle } from \"../../motion/features/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { LazyProps } from \"./types\"\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }: LazyProps) {\n const [, setIsLoaded] = useState(!isLazyBundle(features))\n const loadedRenderer = useRef(undefined)\n\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features\n loadedRenderer.current = renderer\n loadFeatures(loadedFeatures)\n }\n\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures)\n loadedRenderer.current = renderer\n setIsLoaded(true)\n })\n }\n }, [])\n\n return (\n \n {children}\n \n )\n}\n\nfunction isLazyBundle(\n features: FeatureBundle | LazyFeatureBundle\n): features is LazyFeatureBundle {\n return typeof features === \"function\"\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo } from \"react\"\nimport { resolveTransition } from \"motion-dom\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport {\n loadExternalIsValidProp,\n IsValidProp,\n} from \"../../render/dom/utils/filter-props\"\nimport { useConstant } from \"../../utils/use-constant\"\n\nexport interface MotionConfigProps extends Partial {\n children?: React.ReactNode\n isValidProp?: IsValidProp\n}\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function MotionConfig({\n children,\n isValidProp,\n ...config\n}: MotionConfigProps) {\n isValidProp && loadExternalIsValidProp(isValidProp)\n\n /**\n * Inherit props from any parent MotionConfig components\n */\n const parentConfig = useContext(MotionConfigContext)\n config = { ...parentConfig, ...config }\n\n config.transition = resolveTransition(\n config.transition,\n parentConfig.transition\n )\n\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(() => config.isStatic)\n\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n const context = useMemo(\n () => config,\n [\n JSON.stringify(config.transition),\n config.transformPagePoint,\n config.reducedMotion,\n config.skipAnimations,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { ReorderContextProps } from \"../components/Reorder/types\"\n\nexport const ReorderContext = createContext | null>(\n null\n)\n","import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps = React.PropsWithoutRef &\n React.RefAttributes\nexport type CustomDomComponent = React.ComponentType<\n ComponentProps\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n","import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n","import { mixNumber } from \"motion-dom\"\nimport { moveItem } from \"motion-utils\"\nimport { ItemData } from \"../types\"\n\nexport function checkReorder(\n order: ItemData[],\n value: T,\n offset: number,\n velocity: number\n): ItemData[] {\n if (!velocity) return order\n\n const index = order.findIndex((item) => item.value === value)\n\n if (index === -1) return order\n\n const nextOffset = velocity > 0 ? 1 : -1\n const nextItem = order[index + nextOffset]\n\n if (!nextItem) return order\n\n const item = order[index]\n const nextLayout = nextItem.layout\n const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5)\n\n if (\n (nextOffset === 1 && item.layout.max + offset > nextItemCenter) ||\n (nextOffset === -1 && item.layout.min + offset < nextItemCenter)\n ) {\n return moveItem(order, index, index + nextOffset)\n }\n\n return order\n}\n","\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, JSX, useEffect, useRef } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, items will be draggable on this axis.\n * To make draggable on both axes, set ``\n *\n * @public\n */\n axis?: \"x\" | \"y\"\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * \n * {items.map((item) => )}\n * \n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props &\n Omit, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis = \"y\",\n onReorder,\n values,\n ...props\n }: ReorderGroupProps,\n externalRef?: React.ForwardedRef\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const order: ItemData[] = []\n const isReordering = useRef(false)\n const groupRef = useRef(null)\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const context: ReorderContextProps = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n // If the entry was already added, update it rather than adding it again\n const idx = order.findIndex((entry) => value === entry.value)\n if (idx !== -1) {\n order[idx].layout = layout[axis]\n } else {\n order.push({ value: value, layout: layout[axis] })\n }\n order.sort(compareMin)\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const newOrder = checkReorder(order, item, offset, velocity)\n\n if (order !== newOrder) {\n isReordering.current = true\n onReorder(\n newOrder\n .map(getValue)\n .filter((value) => values.indexOf(value) !== -1)\n )\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(\n externalRef as React.MutableRefObject\n ).current = element\n }\n }\n\n /**\n * Disable browser scroll anchoring on the group container.\n * When items reorder, scroll anchoring can cause the browser to adjust\n * the scroll position, which interferes with drag position calculations.\n */\n const groupStyle = {\n overflowAnchor: \"none\" as const,\n ...props.style,\n }\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n props: ReorderGroupProps & { ref?: React.ForwardedRef }\n) => ReturnType\n\nfunction getValue(item: ItemData) {\n return item.value\n}\n\nfunction compareMin(a: ItemData, b: ItemData) {\n return a.layout.min - b.layout.min\n}\n","\"use client\"\n\nimport { motionValue, MotionValue } from \"motion-dom\"\nimport { useContext, useEffect, useState } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useConstant } from \"../utils/use-constant\"\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return \n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nexport function useMotionValue(initial: T): MotionValue {\n const value = useConstant(() => motionValue(initial))\n\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext)\n if (isStatic) {\n const [, setLatest] = useState(initial)\n useEffect(() => value.on(\"change\", setLatest), [])\n }\n\n return value\n}\n","\"use client\"\n\nimport { cancelFrame, frame, MotionValue } from \"motion-dom\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useCombineMotionValues(\n values: MotionValue[],\n combineValues: () => R\n) {\n /**\n * Initialise the returned motion value. This remains the same between renders.\n */\n const value = useMotionValue(combineValues())\n\n /**\n * Create a function that will update the template motion value with the latest values.\n * This is pre-bound so whenever a motion value updates it can schedule its\n * execution in Framesync. If it's already been scheduled it won't be fired twice\n * in a single frame.\n */\n const updateValue = () => value.set(combineValues())\n\n /**\n * Synchronously update the motion value with the latest values during the render.\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\n */\n updateValue()\n\n /**\n * Subscribe to all motion values found within the template. Whenever any of them change,\n * schedule an update.\n */\n useIsomorphicLayoutEffect(() => {\n const scheduleUpdate = () => frame.preRender(updateValue, false, true)\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate))\n\n return () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(updateValue)\n }\n })\n\n return value\n}\n","\"use client\"\n\nimport { collectMotionValues, type MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\nexport function useComputed(compute: () => O): MotionValue {\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * will be saved into this array.\n */\n collectMotionValues.current = []\n\n compute()\n\n const value = useCombineMotionValues(collectMotionValues.current, compute)\n\n /**\n * Synchronously close session of collectMotionValues.\n */\n collectMotionValues.current = undefined\n\n return value\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer = (input: I) => O\ntype MultiTransformer = (input: I[]) => O\ntype Transformer =\n | SingleTransformer\n /**\n * Ideally, this would be typed in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer\n\ninterface OutputMap {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform>(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions\n): { [K in keyof T]: MotionValue }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n value: MotionValue,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return \n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input: MotionValue,\n transformer: SingleTransformer\n): MotionValue\n\n/**\n * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY)\n *\n * return \n * }\n * ```\n *\n * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest values from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input:\n | MotionValue[]\n | MotionValue[]\n | MotionValue[],\n transformer: MultiTransformer\n): MotionValue\nexport function useTransform(transformer: () => O): MotionValue\n\nexport function useTransform(\n input:\n | MotionValue\n | MotionValue[]\n | MotionValue[]\n | MotionValue[]\n | (() => O),\n inputRangeOrTransformer?: InputRange | Transformer,\n outputRangeOrMap?: O[] | OutputMap,\n options?: TransformOptions\n): MotionValue | { [key in K]: MotionValue } {\n if (typeof input === \"function\") {\n return useComputed(input)\n }\n\n /**\n * Detect if outputRangeOrMap is an output map (object with keys)\n * rather than an output range (array).\n */\n const isOutputMap =\n outputRangeOrMap !== undefined &&\n !Array.isArray(outputRangeOrMap) &&\n typeof inputRangeOrTransformer !== \"function\"\n\n if (isOutputMap) {\n return useMapTransform(\n input as MotionValue,\n inputRangeOrTransformer as InputRange,\n outputRangeOrMap as OutputMap,\n options\n ) as { [key in K]: MotionValue }\n }\n\n const outputRange = outputRangeOrMap as O[] | undefined\n const transformer =\n typeof inputRangeOrTransformer === \"function\"\n ? inputRangeOrTransformer\n : transform(inputRangeOrTransformer!, outputRange!, options)\n\n const result = Array.isArray(input)\n ? useListTransform(\n input,\n transformer as MultiTransformer\n )\n : useListTransform([input], ([latest]) =>\n (transformer as SingleTransformer)(latest)\n )\n\n const inputAccelerate = !Array.isArray(input)\n ? (input as MotionValue).accelerate\n : undefined\n\n if (\n inputAccelerate &&\n !inputAccelerate.isTransformed &&\n typeof inputRangeOrTransformer !== \"function\" &&\n Array.isArray(outputRangeOrMap) &&\n options?.clamp !== false\n ) {\n result.accelerate = {\n ...inputAccelerate,\n times: inputRangeOrTransformer as number[],\n keyframes: outputRangeOrMap,\n isTransformed: true,\n ...(options?.ease ? { ease: options.ease } : {}),\n }\n }\n\n return result\n}\n\nfunction useListTransform(\n values: MotionValue[],\n transformer: MultiTransformer\n): MotionValue {\n const latest = useConstant(() => [])\n\n return useCombineMotionValues(values, () => {\n latest.length = 0\n const numValues = values.length\n for (let i = 0; i < numValues; i++) {\n latest[i] = values[i].get()\n }\n\n return transformer(latest)\n })\n}\n\nfunction useMapTransform(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: OutputMap,\n options?: TransformOptions\n): { [key: string]: MotionValue } {\n /**\n * Capture keys once to ensure hooks are called in consistent order.\n */\n const keys = useConstant(() => Object.keys(outputMap))\n const output = useConstant<{ [key: string]: MotionValue }>(() => ({}))\n\n for (const key of keys) {\n output[key] = useTransform(inputValue, inputRange, outputMap[key], options)\n }\n\n return output\n}\n","const threshold = 50\nconst maxSpeed = 25\n\nconst overflowStyles = new Set([\"auto\", \"scroll\"])\n\n// Track initial scroll limits per scrollable element (Bug 1 fix)\nconst initialScrollLimits = new WeakMap()\n\n// Track auto-scroll active state per edge: \"start\" (top/left) or \"end\" (bottom/right)\ntype ActiveEdge = \"start\" | \"end\" | null\nconst activeScrollEdge = new WeakMap()\n\n// Track which group element is currently dragging to clear state on end\nlet currentGroupElement: Element | null = null\n\nexport function resetAutoScrollState(): void {\n if (currentGroupElement) {\n const scrollableAncestor = findScrollableAncestor(\n currentGroupElement,\n \"y\"\n )\n if (scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n }\n // Also try x axis\n const scrollableAncestorX = findScrollableAncestor(\n currentGroupElement,\n \"x\"\n )\n if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestorX)\n initialScrollLimits.delete(scrollableAncestorX)\n }\n currentGroupElement = null\n }\n}\n\nfunction isScrollableElement(element: Element, axis: \"x\" | \"y\"): boolean {\n const style = getComputedStyle(element)\n const overflow = axis === \"x\" ? style.overflowX : style.overflowY\n\n const isDocumentScroll =\n element === document.body ||\n element === document.documentElement\n\n return overflowStyles.has(overflow) || isDocumentScroll\n}\n\nfunction findScrollableAncestor(\n element: Element | null,\n axis: \"x\" | \"y\"\n): HTMLElement | null {\n let current = element?.parentElement\n while (current) {\n if (isScrollableElement(current, axis)) {\n return current\n }\n current = current.parentElement\n }\n return null\n}\n\nfunction getScrollAmount(\n pointerPosition: number,\n scrollElement: HTMLElement,\n axis: \"x\" | \"y\"\n): { amount: number; edge: ActiveEdge } {\n const rect = scrollElement.getBoundingClientRect()\n\n const start = axis === \"x\" ? Math.max(0, rect.left) : Math.max(0, rect.top)\n const end = axis === \"x\" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom)\n\n const distanceFromStart = pointerPosition - start\n const distanceFromEnd = end - pointerPosition\n\n if (distanceFromStart < threshold) {\n const intensity = 1 - distanceFromStart / threshold\n return { amount: -maxSpeed * intensity * intensity, edge: \"start\" }\n } else if (distanceFromEnd < threshold) {\n const intensity = 1 - distanceFromEnd / threshold\n return { amount: maxSpeed * intensity * intensity, edge: \"end\" }\n }\n\n return { amount: 0, edge: null }\n}\n\nexport function autoScrollIfNeeded(\n groupElement: Element | null,\n pointerPosition: number,\n axis: \"x\" | \"y\",\n velocity: number\n): void {\n if (!groupElement) return\n\n // Track the group element for cleanup\n currentGroupElement = groupElement\n\n const scrollableAncestor = findScrollableAncestor(groupElement, axis)\n if (!scrollableAncestor) return\n\n // Convert pointer position from page coordinates to viewport coordinates.\n // The gesture system uses pageX/pageY but getBoundingClientRect() returns\n // viewport-relative coordinates, so we need to account for page scroll.\n const viewportPointerPosition =\n pointerPosition - (axis === \"x\" ? window.scrollX : window.scrollY)\n\n const { amount: scrollAmount, edge } = getScrollAmount(\n viewportPointerPosition,\n scrollableAncestor,\n axis\n )\n\n // If not in any threshold zone, clear all state\n if (edge === null) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n return\n }\n\n const currentActiveEdge = activeScrollEdge.get(scrollableAncestor)\n\n const isDocumentScroll =\n scrollableAncestor === document.body ||\n scrollableAncestor === document.documentElement\n\n // If not currently scrolling this edge, check velocity to see if we should start\n if (currentActiveEdge !== edge) {\n // Only start scrolling if velocity is towards the edge\n const shouldStart =\n (edge === \"start\" && velocity < 0) ||\n (edge === \"end\" && velocity > 0)\n if (!shouldStart) return\n\n // Activate this edge\n activeScrollEdge.set(scrollableAncestor, edge)\n\n // Record initial scroll limit (prevents infinite scroll)\n const maxScroll =\n axis === \"x\"\n ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)\n : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight)\n\n initialScrollLimits.set(scrollableAncestor, maxScroll)\n }\n\n // Cap scrolling at initial limit (prevents infinite scroll)\n if (scrollAmount > 0) {\n const initialLimit = initialScrollLimits.get(scrollableAncestor)!\n const currentScroll =\n axis === \"x\"\n ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)\n : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop)\n if (currentScroll >= initialLimit) return\n }\n\n // Apply scroll\n if (axis === \"x\") {\n if (isDocumentScroll) {\n window.scrollBy({ left: scrollAmount })\n } else {\n scrollableAncestor.scrollLeft += scrollAmount\n }\n } else {\n if (isDocumentScroll) {\n window.scrollBy({ top: scrollAmount })\n } else {\n scrollableAncestor.scrollTop += scrollAmount\n }\n }\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, useContext } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useMotionValue } from \"../../value/use-motion-value\"\nimport { useTransform } from \"../../value/use-transform\"\n\nimport { DefaultItemElement, ReorderElementTag } from \"./types\"\nimport {\n autoScrollIfNeeded,\n resetAutoScrollState,\n} from \"./utils/auto-scroll\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"li\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The value in the list that this component represents.\n *\n * @public\n */\n value: V\n\n /**\n * A subset of layout options primarily used to disable layout=\"size\"\n *\n * @public\n * @default true\n */\n layout?: true | \"position\"\n}\n\nfunction useDefaultMotionValue(value: any, defaultValue: number = 0) {\n return isMotionValue(value) ? value : useMotionValue(defaultValue)\n}\n\ntype ReorderItemProps<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> = Props &\n Omit, \"value\" | \"layout\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderItemComponent<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n {\n children,\n style = {},\n value,\n as = \"li\" as TagName,\n onDrag,\n onDragEnd,\n layout = true,\n ...props\n }: ReorderItemProps,\n externalRef?: React.ForwardedRef\n): React.JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const context = useContext(ReorderContext)\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y),\n }\n\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) =>\n latestX || latestY ? 1 : \"unset\"\n )\n\n invariant(\n Boolean(context),\n \"Reorder.Item must be a child of Reorder.Group\",\n \"reorder-item-child\"\n )\n\n const { axis, registerItem, updateOrder, groupRef } = context!\n\n return (\n {\n const { velocity, point: pointerPoint } = gesturePoint\n const offset = point[axis].get()\n\n // Always attempt to update order - checkReorder handles the logic\n updateOrder(value, offset, velocity[axis])\n\n autoScrollIfNeeded(\n groupRef.current,\n pointerPoint[axis],\n axis,\n velocity[axis]\n )\n\n onDrag && onDrag(event, gesturePoint)\n }}\n onDragEnd={(event, gesturePoint) => {\n resetAutoScrollState()\n onDragEnd && onDragEnd(event, gesturePoint)\n }}\n onLayoutMeasure={(measured) => {\n registerItem(value, measured)\n }}\n ref={externalRef}\n ignoreStrict\n >\n {children}\n \n )\n}\n\nexport const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n props: ReorderItemProps & { ref?: React.ForwardedRef }\n) => ReturnType\n","import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n","import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n","export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n _repeatDelay: number\n): number {\n return duration * (repeat + 1)\n}\n","import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n current: number,\n next: SequenceTime,\n prev: number,\n labels: Map\n): number {\n if (typeof next === \"number\") {\n return next\n } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next))\n } else if (next === \"<\") {\n return prev\n } else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)))\n } else {\n return labels.get(next) ?? current\n }\n}\n","import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n sequence: ValueSequence,\n startTime: number,\n endTime: number\n): void {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i]\n\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe)\n\n // If we remove this item we have to push the pointer back one\n i--\n }\n }\n}\n\nexport function addKeyframes(\n sequence: ValueSequence,\n keyframes: UnresolvedValueKeyframe[],\n easing: Easing | Easing[],\n offset: number[],\n startTime: number,\n endTime: number\n): void {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime)\n\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n })\n }\n}\n","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times: number[], repeat: number): void {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1)\n }\n}\n","import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n","import {\n AnimationScope,\n createGeneratorEasing,\n defaultOffset,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n fillOffset,\n GeneratorFactory,\n isGenerator,\n isMotionValue,\n Transition,\n UnresolvedValueKeyframe,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport {\n Easing,\n getEasingForSegment,\n invariant,\n progress,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n AnimationSequence,\n At,\n ResolvedAnimationDefinitions,\n SequenceMap,\n SequenceOptions,\n ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n sequence: AnimationSequence,\n { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n scope?: AnimationScope,\n generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n const defaultDuration = defaultTransition.duration || 0.3\n const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n const sequences = new Map()\n const elementCache = {}\n const timeLabels = new Map()\n\n let prevTime = 0\n let currentTime = 0\n let totalDuration = 0\n\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i]\n\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime)\n continue\n } else if (!Array.isArray(segment)) {\n timeLabels.set(\n segment.name,\n calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n )\n continue\n }\n\n let [subject, keyframes, transition = {}] = segment\n\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(\n currentTime,\n transition.at,\n prevTime,\n timeLabels\n )\n }\n\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0\n\n const resolveValueSequence = (\n valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n valueTransition: Transition | DynamicAnimationOptions,\n valueSequence: ValueSequence,\n elementIndex = 0,\n numSubjects = 0\n ) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n const {\n delay = 0,\n times = defaultOffset(valueKeyframesAsList),\n type = defaultTransition.type || \"keyframes\",\n repeat,\n repeatType,\n repeatDelay = 0,\n ...remainingTransition\n } = valueTransition\n let { ease = defaultTransition.ease || \"easeOut\", duration } =\n valueTransition\n\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay =\n typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay\n\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"]\n\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100\n if (\n numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)\n ) {\n const delta =\n valueKeyframesAsList[1] - valueKeyframesAsList[0]\n absoluteDelta = Math.abs(delta)\n }\n\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n }\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration)\n }\n\n const springEasing = createGeneratorEasing(\n springTransition,\n absoluteDelta,\n createGenerator\n )\n\n ease = springEasing.ease\n duration = springEasing.duration\n }\n\n duration ??= defaultDuration\n\n const startTime = currentTime + calculatedDelay\n\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1\n }\n\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length\n remainder > 0 && fillOffset(times, remainder)\n\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null)\n\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(\n repeat < MAX_REPEAT,\n \"Repeat count too high, must be less than 20\",\n \"repeat-count-high\"\n )\n\n duration = calculateRepeatDuration(\n duration,\n repeat,\n repeatDelay\n )\n\n const originalKeyframes = [...valueKeyframesAsList]\n const originalTimes = [...times]\n ease = Array.isArray(ease) ? [...ease] : [ease]\n const originalEase = [...ease]\n\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes)\n\n for (\n let keyframeIndex = 0;\n keyframeIndex < originalKeyframes.length;\n keyframeIndex++\n ) {\n times.push(\n originalTimes[keyframeIndex] + (repeatIndex + 1)\n )\n ease.push(\n keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(\n originalEase,\n keyframeIndex - 1\n )\n )\n }\n }\n\n normalizeTimes(times, repeat)\n }\n\n const targetTime = startTime + duration\n\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(\n valueSequence,\n valueKeyframesAsList,\n ease as Easing | Easing[],\n times,\n startTime,\n targetTime\n )\n\n maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n totalDuration = Math.max(targetTime, totalDuration)\n }\n\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences)\n resolveValueSequence(\n keyframes as AnyResolvedKeyframe,\n transition,\n getValueSequence(\"default\", subjectSequence)\n )\n } else {\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope,\n elementCache\n )\n\n const numSubjects = subjects.length\n\n /**\n * For every element in this segment, process the defined values.\n */\n for (\n let subjectIndex = 0;\n subjectIndex < numSubjects;\n subjectIndex++\n ) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes as DOMKeyframesDefinition\n transition = transition as DynamicAnimationOptions\n\n const thisSubject = subjects[subjectIndex]\n const subjectSequence = getSubjectSequence(\n thisSubject,\n sequences\n )\n\n for (const key in keyframes) {\n resolveValueSequence(\n keyframes[\n key as keyof typeof keyframes\n ] as UnresolvedValueKeyframe,\n getValueTransition(transition, key),\n getValueSequence(key, subjectSequence),\n subjectIndex,\n numSubjects\n )\n }\n }\n }\n\n prevTime = currentTime\n currentTime += maxDuration\n }\n\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key]\n\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime)\n\n const keyframes: UnresolvedValueKeyframe[] = []\n const valueOffset: number[] = []\n const valueEasing: Easing[] = []\n\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i]\n keyframes.push(value)\n valueOffset.push(progress(0, totalDuration, at))\n valueEasing.push(easing || \"easeOut\")\n }\n\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0)\n keyframes.unshift(keyframes[0])\n valueEasing.unshift(defaultSegmentEasing)\n }\n\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1)\n keyframes.push(null)\n }\n\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n })\n }\n\n const definition = animationDefinitions.get(element)!\n\n definition.keyframes[key] = keyframes\n\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } =\n defaultTransition\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n }\n }\n })\n\n return animationDefinitions\n}\n\nfunction getSubjectSequence(\n subject: Element | MotionValue | O,\n sequences: Map\n): SequenceMap {\n !sequences.has(subject) && sequences.set(subject, {})\n return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n if (!sequences[name]) sequences[name] = []\n return sequences[name]\n}\n\nfunction keyframesAsList(\n keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n transition: DynamicAnimationOptions & At,\n key: string\n): DynamicAnimationOptions {\n return transition && transition[key as keyof typeof transition]\n ? {\n ...transition,\n ...(transition[key as keyof typeof transition] as Transition),\n }\n : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n","import {\n HTMLVisualElement,\n isSVGElement,\n isSVGSVGElement,\n ObjectVisualElement,\n SVGVisualElement,\n visualElementStore,\n} from \"motion-dom\"\n\nexport function createDOMVisualElement(element: HTMLElement | SVGElement) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n }\n const node =\n isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options)\n\n node.mount(element as any)\n\n visualElementStore.set(element, node)\n}\n\nexport function createObjectVisualElement(subject: Object) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n }\n const node = new ObjectVisualElement(options)\n\n node.mount(subject)\n\n visualElementStore.set(subject, node)\n}\n","import {\n animateTarget,\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n AnyResolvedKeyframe,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n isMotionValue,\n MotionValue,\n TargetAndTransition,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n visualElementStore,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport {\n createDOMVisualElement,\n createObjectVisualElement,\n} from \"../utils/create-visual-element\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\nimport { resolveSubjects } from \"./resolve-subjects\"\nimport { animateSingleValue } from \"motion-dom\"\n\nexport type AnimationSubject = Element | MotionValue | any\n\nfunction isSingleValue(\n subject: unknown,\n keyframes: unknown\n): subject is MotionValue | AnyResolvedKeyframe {\n return (\n isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes))\n )\n}\n\n/**\n * Animate a string\n */\nexport function animateSubject(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a Element\n */\nexport function animateSubject(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a object\n */\nexport function animateSubject(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[] {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n if (isSingleValue(subject, keyframes)) {\n animations.push(\n animateSingleValue(\n subject,\n isDOMKeyframes(keyframes)\n ? (keyframes as any).default || keyframes\n : keyframes,\n options ? (options as any).default || options : options\n )\n )\n } else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations\n }\n\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope\n )\n\n const numSubjects = subjects.length\n\n invariant(\n Boolean(numSubjects),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i]\n\n const createVisualElement =\n thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement\n\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject as any)\n }\n\n const visualElement = visualElementStore.get(thisSubject)!\n const transition = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (\n \"delay\" in transition &&\n typeof transition.delay === \"function\"\n ) {\n transition.delay = transition.delay(i, numSubjects)\n }\n\n animations.push(\n ...animateTarget(\n visualElement,\n { ...(keyframes as {}), transition } as TargetAndTransition,\n {}\n )\n )\n }\n }\n\n return animations\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n motionValue,\n spring,\n} from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../sequence/types\"\nimport { animateSubject } from \"./subject\"\n\nexport function animateSequence(\n sequence: AnimationSequence,\n options?: SequenceOptions,\n scope?: AnimationScope\n) {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n /**\n * Pre-process: replace function segments with MotionValue segments,\n * subscribe callbacks immediately\n */\n const processedSequence = sequence.map((segment) => {\n if (Array.isArray(segment) && typeof segment[0] === \"function\") {\n const callback = segment[0] as (value: any) => void\n const mv = motionValue(0)\n mv.on(\"change\", callback)\n\n if (segment.length === 1) {\n return [mv, [0, 1]] as any\n } else if (segment.length === 2) {\n return [mv, [0, 1], segment[1]] as any\n } else {\n return [mv, segment[1], segment[2]] as any\n }\n }\n return segment\n }) as AnimationSequence\n\n const animationDefinitions = createAnimationsFromSequence(\n processedSequence,\n options,\n scope,\n { spring }\n )\n\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition))\n })\n\n return animations\n}\n","import type {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n MotionValue,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"motion-dom\"\nimport { GroupAnimationWithThen } from \"motion-dom\"\nimport { removeItem } from \"motion-utils\"\nimport {\n AnimationSequence,\n ObjectTarget,\n SequenceOptions,\n} from \"../sequence/types\"\nimport { animateSequence } from \"./sequence\"\nimport { animateSubject } from \"./subject\"\n\nfunction isSequence(value: unknown): value is AnimationSequence {\n return Array.isArray(value) && value.some(Array.isArray)\n}\n\ninterface ScopedAnimateOptions {\n scope?: AnimationScope\n reduceMotion?: boolean\n}\n\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options: ScopedAnimateOptions = {}) {\n const { scope, reduceMotion } = options\n /**\n * Animate a sequence\n */\n function scopedAnimate(\n sequence: AnimationSequence,\n options?: SequenceOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a string\n */\n function scopedAnimate(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an Element\n */\n function scopedAnimate(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an object\n */\n function scopedAnimate(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n let animations: AnimationPlaybackControlsWithThen[] = []\n let animationOnComplete: VoidFunction | undefined\n\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(\n subjectOrSequence,\n reduceMotion !== undefined\n ? { reduceMotion, ...(optionsOrKeyframes as SequenceOptions) }\n : (optionsOrKeyframes as SequenceOptions),\n scope\n )\n } else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {}\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete as VoidFunction\n }\n animations = animateSubject(\n subjectOrSequence as ElementOrSelector,\n optionsOrKeyframes as DOMKeyframesDefinition,\n (reduceMotion !== undefined\n ? { reduceMotion, ...rest }\n : rest) as DynamicAnimationOptions,\n scope\n )\n }\n\n const animation = new GroupAnimationWithThen(animations)\n\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete)\n }\n\n if (scope) {\n scope.animations.push(animation)\n animation.finished.then(() => {\n removeItem(scope.animations, animation)\n })\n }\n\n return animation\n }\n\n return scopedAnimate\n}\n\nexport const animate = createScopedAnimate()\n","import {\n animationMapKey,\n AnimationPlaybackControls,\n AnimationScope,\n applyPxDefaults,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n fillWildcards,\n getAnimationMap,\n getComputedStyle,\n getValueTransition,\n NativeAnimation,\n NativeAnimationOptions,\n resolveElements,\n UnresolvedValueKeyframe,\n ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n map: Map>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\n keyframes?: ValueKeyframe[]\n }\n}\n\nexport function animateElements(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return []\n }\n\n const elements = resolveElements(elementOrSelector, scope) as Array<\n HTMLElement | SVGElement\n >\n const numElements = elements.length\n\n invariant(\n Boolean(numElements),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions: AnimationDefinition[] = []\n\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i]\n const elementTransition: DynamicAnimationOptions = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements)\n }\n\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes]\n }\n\n const valueOptions = {\n ...getValueTransition(elementTransition as any, valueName),\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element)\n const key = animationMapKey(\n valueName,\n valueOptions.pseudoElement || \"\"\n )\n const currentAnimation = map.get(key)\n currentAnimation && currentAnimation.stop()\n\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten:\n !elementTransition.type && !elementTransition.ease,\n },\n })\n }\n }\n\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } =\n animationDefinitions[i]\n\n const { element, name, pseudoElement } = animationOptions\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name)\n }\n\n fillWildcards(unresolvedKeyframes)\n applyPxDefaults(unresolvedKeyframes, name)\n\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name))\n }\n\n animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n }\n\n /**\n * Step 3: Create new animations (write)\n */\n const animations: AnimationPlaybackControls[] = []\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i]\n const animation = new NativeAnimation(\n animationOptions as NativeAnimationOptions\n )\n\n map.set(key, animation)\n animation.finished.finally(() => map.delete(key))\n\n animations.push(animation)\n }\n\n return animations\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n","import { progress, velocityPerSecond } from \"motion-utils\"\nimport { AxisScrollInfo, ScrollInfo } from \"./types\"\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50\n\nconst createAxisInfo = (): AxisScrollInfo => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n})\n\nexport const createScrollInfo = (): ScrollInfo => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n})\n\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n} as const\n\nfunction updateAxisInfo(\n element: Element,\n axisName: \"x\" | \"y\",\n info: ScrollInfo,\n time: number\n) {\n const axis = info[axisName]\n const { length, position } = keys[axisName]\n\n const prev = axis.current\n const prevTime = info.time\n\n axis.current = element[`scroll${position}`]\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]\n\n axis.offset.length = 0\n axis.offset[0] = 0\n axis.offset[1] = axis.scrollLength\n axis.progress = progress(0, axis.scrollLength, axis.current)\n\n const elapsed = time - prevTime\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed)\n}\n\nexport function updateScrollInfo(\n element: Element,\n info: ScrollInfo,\n time: number\n) {\n updateAxisInfo(element, \"x\", info, time)\n updateAxisInfo(element, \"y\", info, time)\n info.time = time\n}\n","import { isHTMLElement } from \"motion-dom\"\n\nexport function calcInset(element: Element, container: Element) {\n const inset = { x: 0, y: 0 }\n\n let current: Element | null = element\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft\n inset.y += current.offsetTop\n current = current.offsetParent\n } else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect()\n current = current.parentElement!\n const parentBoundingBox = current.getBoundingClientRect()\n inset.x += svgBoundingBox.left - parentBoundingBox.left\n inset.y += svgBoundingBox.top - parentBoundingBox.top\n } else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox()\n inset.x += x\n inset.y += y\n\n let svg: SVGElement | null = null\n let parent: SVGElement = current.parentNode as SVGElement\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent\n }\n parent = current.parentNode as SVGElement\n }\n current = svg\n } else {\n break\n }\n }\n\n return inset\n}\n","import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record = {\n start: 0,\n center: 0.5,\n end: 1,\n}\n\nexport function resolveEdge(edge: Edge, length: number, inset = 0) {\n let delta = 0\n\n /**\n * If we have this edge defined as a preset, replace the definition\n * with the numerical value.\n */\n if (edge in namedEdges) {\n edge = namedEdges[edge as NamedEdges]\n }\n\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge)\n\n if (edge.endsWith(\"px\")) {\n delta = asNumber\n } else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100\n } else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth\n } else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight\n } else {\n edge = asNumber\n }\n }\n\n /**\n * If the edge is defined as a number, handle as a progress value.\n */\n if (typeof edge === \"number\") {\n delta = length * edge\n }\n\n return inset + delta\n}\n","import { Edge, EdgeString, Intersection, ProgressIntersection } from \"../types\"\nimport { namedEdges, resolveEdge } from \"./edge\"\n\nconst defaultOffset: ProgressIntersection = [0, 0]\n\nexport function resolveOffset(\n offset: Edge | Intersection | ProgressIntersection,\n containerLength: number,\n targetLength: number,\n targetInset: number\n) {\n let offsetDefinition: ProgressIntersection | [EdgeString, EdgeString] =\n Array.isArray(offset) ? offset : defaultOffset\n\n let targetPoint = 0\n let containerPoint = 0\n\n if (typeof offset === \"number\") {\n /**\n * If we're provided offset: [0, 0.5, 1] then each number x should become\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n * and container etc.\n */\n offsetDefinition = [offset, offset]\n } else if (typeof offset === \"string\") {\n offset = offset.trim() as EdgeString\n\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \") as [EdgeString, EdgeString]\n } else {\n /**\n * If we're provided a definition like \"100px\" then we want to apply\n * that only to the top of the target point, leaving the container at 0.\n * Whereas a named offset like \"end\" should be applied to both.\n */\n offsetDefinition = [offset, namedEdges[offset as keyof typeof namedEdges] ? offset : `0`]\n }\n }\n\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset)\n containerPoint = resolveEdge(offsetDefinition[1], containerLength)\n\n return targetPoint - containerPoint\n}\n","import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record = {\n Enter: [\n [0, 1],\n [1, 1],\n ],\n Exit: [\n [0, 0],\n [1, 0],\n ],\n Any: [\n [1, 0],\n [0, 1],\n ],\n All: [\n [0, 0],\n [1, 1],\n ],\n}\n","import { defaultOffset, interpolate } from \"motion-dom\"\nimport { clamp } from \"motion-utils\"\nimport { ScrollInfo, ScrollInfoOptions } from \"../types\"\nimport { calcInset } from \"./inset\"\nimport { resolveOffset } from \"./offset\"\nimport { ScrollOffset } from \"./presets\"\n\nconst point = { x: 0, y: 0 }\n\nfunction getTargetSize(target: Element) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? (target as SVGGraphicsElement).getBBox()\n : { width: target.clientWidth, height: target.clientHeight }\n}\n\nexport function resolveOffsets(\n container: Element,\n info: ScrollInfo,\n options: ScrollInfoOptions\n) {\n const { offset: offsetDefinition = ScrollOffset.All } = options\n const { target = container, axis = \"y\" } = options\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\"\n\n const inset = target !== container ? calcInset(target, container) : point\n\n /**\n * Measure the target and container. If they're the same thing then we\n * use the container's scrollWidth/Height as the target, from there\n * all other calculations can remain the same.\n */\n const targetSize =\n target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target)\n\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\n }\n\n /**\n * Reset the length of the resolved offset array rather than creating a new one.\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\n */\n info[axis].offset.length = 0\n\n /**\n * Populate the offset array by resolving the user's offset definition into\n * a list of pixel scroll offets.\n */\n let hasChanged = !info[axis].interpolate\n\n const numOffsets = offsetDefinition.length\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(\n offsetDefinition[i],\n containerSize[lengthLabel],\n targetSize[lengthLabel],\n inset[axis]\n )\n\n if (!hasChanged && offset !== info[axis].interpolatorOffsets![i]) {\n hasChanged = true\n }\n\n info[axis].offset[i] = offset\n }\n\n /**\n * If the pixel scroll offsets have changed, create a new interpolator function\n * to map scroll value into a progress.\n */\n if (hasChanged) {\n info[axis].interpolate = interpolate(\n info[axis].offset,\n defaultOffset(offsetDefinition),\n { clamp: false }\n )\n\n info[axis].interpolatorOffsets = [...info[axis].offset]\n }\n\n info[axis].progress = clamp(\n 0,\n 1,\n info[axis].interpolate!(info[axis].current)\n )\n}\n","import { warnOnce } from \"motion-utils\"\nimport { updateScrollInfo } from \"./info\"\nimport { resolveOffsets } from \"./offsets/index\"\nimport {\n OnScrollHandler,\n OnScrollInfo,\n ScrollInfo,\n ScrollInfoOptions,\n} from \"./types\"\n\nfunction measure(\n container: Element,\n target: Element = container,\n info: ScrollInfo\n) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0\n info.y.targetOffset = 0\n if (target !== container) {\n let node = target as HTMLElement\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft\n info.y.targetOffset += node.offsetTop\n node = node.offsetParent as HTMLElement\n }\n }\n\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight\n info.x.containerLength = container.clientWidth\n info.y.containerLength = container.clientHeight\n\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(\n getComputedStyle(container).position !== \"static\",\n \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\"\n )\n }\n }\n}\n\nexport function createOnScrollHandler(\n element: Element,\n onScroll: OnScrollInfo,\n info: ScrollInfo,\n options: ScrollInfoOptions = {}\n): OnScrollHandler {\n return {\n measure: (time) => {\n measure(element, options.target, info)\n updateScrollInfo(element, info, time)\n\n if (options.offset || options.target) {\n resolveOffsets(element, info, options)\n }\n },\n notify: () => onScroll(info),\n }\n}\n","import { cancelFrame, frame, frameData, resize, Process } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { createScrollInfo } from \"./info\"\nimport { createOnScrollHandler } from \"./on-scroll-handler\"\nimport { OnScrollHandler, OnScrollInfo, ScrollInfoOptions } from \"./types\"\n\nconst scrollListeners = new WeakMap()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\n\nconst getEventTarget = (element: Element) =>\n element === document.scrollingElement ? window : element\n\nexport function scrollInfo(\n onScroll: OnScrollInfo,\n {\n container = document.scrollingElement as Element,\n trackContentSize = false,\n ...options\n }: ScrollInfoOptions = {}\n) {\n if (!container) return noop as VoidFunction\n\n let containerHandlers = onScrollHandlers.get(container)\n\n /**\n * Get the onScroll handlers for this container.\n * If one isn't found, create a new one.\n */\n if (!containerHandlers) {\n containerHandlers = new Set()\n onScrollHandlers.set(container, containerHandlers)\n }\n\n /**\n * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo()\n const containerHandler = createOnScrollHandler(\n container,\n onScroll,\n info,\n options\n )\n containerHandlers.add(containerHandler)\n\n /**\n * Check if there's a scroll event listener for this container.\n * If not, create one.\n */\n if (!scrollListeners.has(container)) {\n const measureAll = () => {\n for (const handler of containerHandlers) {\n handler.measure(frameData.timestamp)\n }\n\n frame.preUpdate(notifyAll)\n }\n\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify()\n }\n }\n\n const listener = () => frame.read(measureAll)\n\n scrollListeners.set(container, listener)\n\n const target = getEventTarget(container)\n window.addEventListener(\"resize\", listener, { passive: true })\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener))\n }\n\n target.addEventListener(\"scroll\", listener, { passive: true })\n\n listener()\n }\n\n /**\n * Enable content size tracking if requested and not already enabled.\n */\n if (trackContentSize && !dimensionCheckProcesses.has(container)) {\n const listener = scrollListeners.get(container)!\n\n // Store initial scroll dimensions (object is reused to avoid allocation)\n const size = {\n width: container.scrollWidth,\n height: container.scrollHeight,\n }\n scrollSize.set(container, size)\n\n // Add frame-based scroll dimension checking to detect content changes\n const checkScrollDimensions: Process = () => {\n const newWidth = container.scrollWidth\n const newHeight = container.scrollHeight\n\n if (size.width !== newWidth || size.height !== newHeight) {\n listener()\n size.width = newWidth\n size.height = newHeight\n }\n }\n\n // Schedule with keepAlive=true to run every frame\n const dimensionCheckProcess = frame.read(checkScrollDimensions, true)\n dimensionCheckProcesses.set(container, dimensionCheckProcess)\n }\n\n const listener = scrollListeners.get(container)!\n frame.read(listener, false, true)\n\n return () => {\n cancelFrame(listener)\n\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container)\n if (!currentHandlers) return\n\n currentHandlers.delete(containerHandler)\n\n if (currentHandlers.size) return\n\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container)\n scrollListeners.delete(container)\n\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\n \"scroll\",\n scrollListener\n )\n resizeListeners.get(container)?.()\n window.removeEventListener(\"resize\", scrollListener)\n }\n\n // Clean up scroll dimension checking\n const dimensionCheckProcess = dimensionCheckProcesses.get(container)\n if (dimensionCheckProcess) {\n cancelFrame(dimensionCheckProcess)\n dimensionCheckProcesses.delete(container)\n }\n scrollSize.delete(container)\n }\n}\n","import { supportsScrollTimeline } from \"motion-dom\"\n\nexport function canUseNativeTimeline(target?: Element) {\n return (\n typeof window !== \"undefined\" && !target && supportsScrollTimeline()\n )\n}\n","import { ProgressTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"../track\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n Element,\n Map\n>()\n\nfunction scrollTimelineFallback(options: ScrollOptionsWithDefaults) {\n const currentTime = { value: 0 }\n\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis!].progress * 100\n }, options)\n\n return { currentTime, cancel }\n}\n\nexport function getTimeline({\n source,\n container,\n ...options\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n const { axis } = options\n\n if (source) container = source\n\n const containerCache = timelineCache.get(container) ?? new Map()\n timelineCache.set(container, containerCache)\n\n const targetKey = options.target ?? \"self\"\n const targetCache = containerCache.get(targetKey) ?? {}\n\n const axisKey = axis + (options.offset ?? []).join(\",\")\n\n if (!targetCache[axisKey]) {\n targetCache[axisKey] =\n canUseNativeTimeline(options.target)\n ? new ScrollTimeline({ source: container, axis } as any)\n : scrollTimelineFallback({ container, ...options })\n }\n\n return targetCache[axisKey]!\n}\n","import { AnimationPlaybackControls, observeTimeline } from \"motion-dom\"\nimport { ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\nexport function attachToAnimation(\n animation: AnimationPlaybackControls,\n options: ScrollOptionsWithDefaults\n) {\n const timeline = getTimeline(options)\n\n return animation.attachTimeline({\n timeline: options.target ? undefined : timeline,\n observe: (valueAnimation) => {\n valueAnimation.pause()\n\n return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress\n }, timeline)\n },\n })\n}\n","import { observeTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"./track\"\nimport { OnScroll, OnScrollWithInfo, ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\n/**\n * If the onScroll function has two arguments, it's expecting\n * more specific information about the scroll from scrollInfo.\n */\nfunction isOnScrollWithInfo(onScroll: OnScroll): onScroll is OnScrollWithInfo {\n return onScroll.length === 2\n}\n\nexport function attachToFunction(\n onScroll: OnScroll,\n options: ScrollOptionsWithDefaults\n) {\n if (isOnScrollWithInfo(onScroll)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis!].progress, info)\n }, options)\n } else {\n return observeTimeline(onScroll, getTimeline(options))\n }\n}\n","import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { attachToFunction } from \"./attach-function\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n onScroll: OnScroll | AnimationPlaybackControls,\n {\n axis = \"y\",\n container = document.scrollingElement as Element,\n ...options\n }: ScrollOptions = {}\n): VoidFunction {\n if (!container) return noop as VoidFunction\n\n const optionsWithDefaults = { axis, container, ...options }\n\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults)\n}\n","import { ElementOrSelector, resolveElements } from \"motion-dom\"\n\nexport type ViewChangeHandler = (entry: IntersectionObserverEntry) => void\n\ntype MarginValue = `${number}${\"px\" | \"%\"}`\ntype MarginType =\n | MarginValue\n | `${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`\n\nexport interface InViewOptions {\n root?: Element | Document\n margin?: MarginType\n amount?: \"some\" | \"all\" | number\n}\n\nconst thresholds = {\n some: 0,\n all: 1,\n}\n\nexport function inView(\n elementOrSelector: ElementOrSelector,\n onStart: (\n element: Element,\n entry: IntersectionObserverEntry\n ) => void | ViewChangeHandler,\n { root, margin: rootMargin, amount = \"some\" }: InViewOptions = {}\n): VoidFunction {\n const elements = resolveElements(elementOrSelector)\n\n const activeIntersections = new WeakMap()\n\n const onIntersectionChange: IntersectionObserverCallback = (entries) => {\n entries.forEach((entry) => {\n const onEnd = activeIntersections.get(entry.target)\n\n /**\n * If there's no change to the intersection, we don't need to\n * do anything here.\n */\n if (entry.isIntersecting === Boolean(onEnd)) return\n\n if (entry.isIntersecting) {\n const newOnEnd = onStart(entry.target, entry)\n if (typeof newOnEnd === \"function\") {\n activeIntersections.set(entry.target, newOnEnd)\n } else {\n observer.unobserve(entry.target)\n }\n } else if (typeof onEnd === \"function\") {\n onEnd(entry)\n activeIntersections.delete(entry.target)\n }\n })\n }\n\n const observer = new IntersectionObserver(onIntersectionChange, {\n root,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n })\n\n elements.forEach((element) => observer.observe(element))\n\n return () => observer.disconnect()\n}\n","import { createMotionProxy } from \"../create-proxy\"\n\nexport const m = /*@__PURE__*/ createMotionProxy()\n","\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n","\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { gestureAnimations } from \"../../motion/features/gestures\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domAnimation: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n}\n","\"use client\"\n\nimport { drag } from \"../../motion/features/drag\"\nimport { layout } from \"../../motion/features/layout\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { domAnimation } from \"./features-animation\"\n\n/**\n * @public\n */\nexport const domMax: FeatureBundle = {\n ...domAnimation,\n ...drag,\n ...layout,\n}\n","\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domMin: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n}\n","\"use client\"\n\nimport { MotionValue, MotionValueEventCallbacks } from \"motion-dom\"\nimport { useInsertionEffect } from \"react\"\n\nexport function useMotionValueEvent<\n V,\n EventName extends keyof MotionValueEventCallbacks\n>(\n value: MotionValue,\n event: EventName,\n callback: MotionValueEventCallbacks[EventName]\n) {\n /**\n * useInsertionEffect will create subscriptions before any other\n * effects will run. Effects run upwards through the tree so it\n * can be that binding a useLayoutEffect higher up the tree can\n * miss changes from lower down the tree.\n */\n useInsertionEffect(\n () => value.on(event, callback),\n [value, event, callback]\n )\n}\n","\"use client\"\n\nimport { AnimationPlaybackControls, motionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { RefObject, useCallback, useEffect, useRef } from \"react\"\nimport { scroll } from \"../render/dom/scroll\"\nimport { ScrollInfoOptions } from \"../render/dom/scroll/types\"\nimport { canUseNativeTimeline } from \"../render/dom/scroll/utils/can-use-native-timeline\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\n\nexport interface UseScrollOptions\n extends Omit {\n container?: RefObject\n target?: RefObject\n}\n\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0),\n})\n\nconst isRefPending = (ref?: RefObject) => {\n if (!ref) return false\n return !ref.current\n}\n\nfunction makeAccelerateConfig(\n axis: \"x\" | \"y\",\n options: Omit,\n container?: Element\n) {\n return {\n factory: (animation: AnimationPlaybackControls) =>\n scroll(animation, { ...options, axis, container }),\n times: [0, 1],\n keyframes: [0, 1],\n ease: (v: number) => v,\n duration: 1,\n }\n}\n\nexport function useScroll({\n container,\n target,\n ...options\n}: UseScrollOptions = {}) {\n const values = useConstant(createScrollMotionValues)\n\n if (!target && canUseNativeTimeline()) {\n const resolvedContainer = container?.current || undefined\n values.scrollXProgress.accelerate = makeAccelerateConfig(\n \"x\",\n options,\n resolvedContainer\n )\n values.scrollYProgress.accelerate = makeAccelerateConfig(\n \"y\",\n options,\n resolvedContainer\n )\n }\n\n const scrollAnimation = useRef(null)\n const needsStart = useRef(false)\n\n const start = useCallback(() => {\n scrollAnimation.current = scroll(\n (\n _progress: number,\n {\n x,\n y,\n }: {\n x: { current: number; progress: number }\n y: { current: number; progress: number }\n }\n ) => {\n values.scrollX.set(x.current)\n values.scrollXProgress.set(x.progress)\n values.scrollY.set(y.current)\n values.scrollYProgress.set(y.progress)\n },\n {\n ...options,\n container: container?.current || undefined,\n target: target?.current || undefined,\n }\n )\n\n return () => {\n scrollAnimation.current?.()\n }\n }, [container, target, JSON.stringify(options.offset)])\n\n useIsomorphicLayoutEffect(() => {\n needsStart.current = false\n\n if (isRefPending(container) || isRefPending(target)) {\n needsStart.current = true\n return\n } else {\n return start()\n }\n }, [start])\n\n useEffect(() => {\n if (needsStart.current) {\n invariant(\n !isRefPending(container),\n \"Container ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n invariant(\n !isRefPending(target),\n \"Target ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n return start()\n } else {\n return\n }\n }, [start])\n\n return values\n}\n","import { warnOnce } from \"motion-utils\"\nimport { RefObject } from \"react\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\n */\nexport function useElementScroll(ref: RefObject) {\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(\n false,\n \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\"\n )\n }\n\n return useScroll({ container: ref })\n}\n","import { warnOnce } from \"motion-utils\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\n */\nexport function useViewportScroll() {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"useViewportScroll is deprecated. Convert to useScroll().\"\n )\n }\n return useScroll()\n}\n","\"use client\"\n\nimport { isMotionValue, MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\n/**\n * Combine multiple motion values into a new one using a string template literal.\n *\n * ```jsx\n * import {\n * motion,\n * useSpring,\n * useMotionValue,\n * useMotionTemplate\n * } from \"framer-motion\"\n *\n * function Component() {\n * const shadowX = useSpring(0)\n * const shadowY = useMotionValue(0)\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport function useMotionTemplate(\n fragments: TemplateStringsArray,\n ...values: Array\n) {\n /**\n * Create a function that will build a string from the latest motion values.\n */\n const numFragments = fragments.length\n\n function buildValue() {\n let output = ``\n\n for (let i = 0; i < numFragments; i++) {\n output += fragments[i]\n const value = values[i]\n if (value) {\n output += isMotionValue(value) ? value.get() : value\n }\n }\n\n return output\n }\n\n return useCombineMotionValues(values.filter(isMotionValue), buildValue)\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n attachFollow,\n FollowValueOptions,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { useContext, useInsertionEffect } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state.\n *\n * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition\n * including spring, tween, inertia, and keyframes.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * // Spring animation (default)\n * const x = useFollowValue(0, { stiffness: 300 })\n *\n * // Tween animation\n * const y = useFollowValue(0, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n *\n * // Track another MotionValue with spring\n * const source = useMotionValue(0)\n * const z = useFollowValue(source, { type: \"spring\", damping: 10 })\n *\n * // Inertia animation\n * const w = useFollowValue(0, { type: \"inertia\", velocity: 100 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition.\n * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: string,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: number,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue | MotionValue | AnyResolvedKeyframe,\n options: FollowValueOptions = {}\n) {\n const { isStatic } = useContext(MotionConfigContext)\n const getFromSource = () => (isMotionValue(source) ? source.get() : source)\n\n // isStatic will never change, allowing early hooks return\n if (isStatic) {\n return useTransform(getFromSource)\n }\n\n const value = useMotionValue(getFromSource())\n\n useInsertionEffect(() => {\n return attachFollow(value, source, options)\n }, [value, JSON.stringify(options)])\n\n return value\n}\n","\"use client\"\n\nimport { MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: string,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: number,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue | MotionValue | string | number,\n options: SpringOptions = {}\n): MotionValue | MotionValue {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n","\"use client\"\n\nimport { cancelFrame, frame, FrameData } from \"motion-dom\"\nimport { useContext, useEffect, useRef } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\n\nexport type FrameCallback = (timestamp: number, delta: number) => void\n\nexport function useAnimationFrame(callback: FrameCallback) {\n const initialTimestamp = useRef(0)\n const { isStatic } = useContext(MotionConfigContext)\n\n useEffect(() => {\n if (isStatic) return\n\n const provideTimeSinceStart = ({ timestamp, delta }: FrameData) => {\n if (!initialTimestamp.current) initialTimestamp.current = timestamp\n\n callback(timestamp - initialTimestamp.current, delta)\n }\n\n frame.update(provideTimeSinceStart, true)\n return () => cancelFrame(provideTimeSinceStart)\n }, [callback])\n}\n","\"use client\"\n\nimport { useAnimationFrame } from \"../utils/use-animation-frame\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useTime() {\n const time = useMotionValue(0)\n useAnimationFrame((t) => time.set(t))\n return time\n}\n","\"use client\"\n\nimport { frame, MotionValue } from \"motion-dom\"\nimport { useMotionValueEvent } from \"../utils/use-motion-value-event\"\nimport { useMotionValue } from \"./use-motion-value\"\n/**\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\n *\n * ```javascript\n * const x = useMotionValue(0)\n * const xVelocity = useVelocity(x)\n * const xAcceleration = useVelocity(xVelocity)\n * ```\n *\n * @public\n */\nexport function useVelocity(value: MotionValue): MotionValue {\n const velocity = useMotionValue(value.getVelocity())\n\n const updateVelocity = () => {\n const latest = value.getVelocity()\n velocity.set(latest)\n\n /**\n * If we still have velocity, schedule an update for the next frame\n * to keep checking until it is zero.\n */\n if (latest) frame.update(updateVelocity)\n }\n\n useMotionValueEvent(value, \"change\", () => {\n // Schedule an update to this value at the end of the current frame.\n frame.update(updateVelocity, false, true)\n })\n\n return velocity\n}\n","import {\n acceleratedValues,\n MotionValue,\n transformProps,\n type WillChange,\n} from \"motion-dom\"\n\nexport class WillChangeMotionValue\n extends MotionValue\n implements WillChange\n{\n private isEnabled = false\n\n add(name: string) {\n if (transformProps.has(name) || acceleratedValues.has(name)) {\n this.isEnabled = true\n this.update()\n }\n }\n\n private update() {\n this.set(this.isEnabled ? \"transform\" : \"auto\")\n }\n}\n","\"use client\"\n\nimport type { WillChange } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { WillChangeMotionValue } from \"./WillChangeMotionValue\"\n\nexport function useWillChange(): WillChange {\n return useConstant(() => new WillChangeMotionValue(\"auto\"))\n}\n","\"use client\"\n\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"motion-dom\"\nimport { warnOnce } from \"motion-utils\"\nimport { useState } from \"react\"\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nexport function useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion()\n\n const [shouldReduceMotion] = useState(prefersReducedMotion.current)\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n\n return shouldReduceMotion\n}\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useReducedMotion } from \"./use-reduced-motion\"\n\nexport function useReducedMotionConfig() {\n const reducedMotionPreference = useReducedMotion()\n const { reducedMotion } = useContext(MotionConfigContext)\n\n if (reducedMotion === \"never\") {\n return false\n } else if (reducedMotion === \"always\") {\n return true\n } else {\n return reducedMotionPreference\n }\n}\n","import {\n animateVisualElement,\n setTarget,\n type AnimationDefinition,\n type LegacyAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\n\nfunction stopAnimation(visualElement: VisualElement) {\n visualElement.values.forEach((value) => value.stop())\n}\n\nfunction setVariants(visualElement: VisualElement, variantLabels: string[]) {\n const reversedLabels = [...variantLabels].reverse()\n\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key)\n variant && setTarget(visualElement, variant)\n\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels)\n })\n }\n })\n}\n\nexport function setValues(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition)\n } else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition])\n } else {\n setTarget(visualElement, definition as any)\n }\n}\n\n/**\n * @public\n */\nexport function animationControls(): LegacyAnimationControls {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false\n\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set()\n\n const controls: LegacyAnimationControls = {\n subscribe(visualElement) {\n subscribers.add(visualElement)\n return () => void subscribers.delete(visualElement)\n },\n\n start(definition, transitionOverride) {\n invariant(\n hasMounted,\n \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n const animations: Array> = []\n subscribers.forEach((visualElement) => {\n animations.push(\n animateVisualElement(visualElement, definition, {\n transitionOverride,\n })\n )\n })\n\n return Promise.all(animations)\n },\n\n set(definition) {\n invariant(\n hasMounted,\n \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition)\n })\n },\n\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement)\n })\n },\n\n mount() {\n hasMounted = true\n\n return () => {\n hasMounted = false\n controls.stop()\n }\n },\n }\n\n return controls\n}\n","\"use client\"\n\nimport { useMemo } from \"react\"\nimport { AnimationScope } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { useReducedMotionConfig } from \"../../utils/reduced-motion/use-reduced-motion-config\"\nimport { createScopedAnimate } from \"../animate\"\n\nexport function useAnimate() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const reduceMotion = useReducedMotionConfig() ?? undefined\n\n const animate = useMemo(\n () => createScopedAnimate({ scope, reduceMotion }),\n [scope, reduceMotion]\n )\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n scope.animations.length = 0\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n","\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n","\"use client\"\n\nimport { LegacyAnimationControls } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { animationControls } from \"./animation-controls\"\n\n/**\n * Creates `LegacyAnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `LegacyAnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return \n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nexport function useAnimationControls(): LegacyAnimationControls {\n const controls = useConstant(animationControls)\n\n useIsomorphicLayoutEffect(controls.mount, [])\n\n return controls\n}\n\nexport const useAnimation = useAnimationControls\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\n\nexport function usePresenceData() {\n const context = useContext(PresenceContext)\n return context ? context.custom : undefined\n}\n","\"use client\"\n\nimport { RefObject, useEffect } from \"react\"\nimport { addDomEvent } from \"motion-dom\"\n\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return
\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nexport function useDomEvent(\n ref: RefObject,\n eventName: string,\n handler?: EventListener | undefined,\n options?: AddEventListenerOptions\n) {\n useEffect(() => {\n const element = ref.current\n\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options)\n }\n }, [ref, eventName, handler, options])\n}\n","import * as React from \"react\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DragControlOptions,\n VisualElementDragControls,\n} from \"./VisualElementDragControls\"\n\n/**\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport class DragControls {\n private componentControls = new Set()\n\n /**\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\n *\n * @internal\n */\n subscribe(controls: VisualElementDragControls): () => void {\n this.componentControls.add(controls)\n\n return () => this.componentControls.delete(controls)\n }\n\n /**\n * Start a drag gesture on every `motion` component that has this set of drag controls\n * passed into it via the `dragControls` prop.\n *\n * ```jsx\n * dragControls.start(e, {\n * snapToCursor: true\n * })\n * ```\n *\n * @param event - PointerEvent\n * @param options - Options\n *\n * @public\n */\n start(\n event: React.PointerEvent | PointerEvent,\n options?: DragControlOptions\n ) {\n this.componentControls.forEach((controls) => {\n controls.start(\n (event as React.PointerEvent).nativeEvent || event,\n options\n )\n })\n }\n\n /**\n * Cancels a drag gesture.\n *\n * ```jsx\n * dragControls.cancel()\n * ```\n *\n * @public\n */\n cancel() {\n this.componentControls.forEach((controls) => {\n controls.cancel()\n })\n }\n\n /**\n * Stops a drag gesture.\n *\n * ```jsx\n * dragControls.stop()\n * ```\n *\n * @public\n */\n stop() {\n this.componentControls.forEach((controls) => {\n controls.stop()\n })\n }\n}\n\nconst createDragControls = () => new DragControls()\n\n/**\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\n * might want to initiate that dragging from a different component than the draggable one.\n *\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\n * the draggable component's `dragControls` prop. It exposes a `start` method\n * that can start dragging from pointer events on other components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport function useDragControls() {\n return useConstant(createDragControls)\n}\n","import { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Checks if a component is a `motion` component.\n */\nexport function isMotionComponent(component: React.ComponentType | string) {\n return (\n component !== null &&\n typeof component === \"object\" &&\n motionComponentSymbol in component\n )\n}\n","import { isMotionComponent } from \"./is-motion-component\"\nimport { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Unwraps a `motion` component and returns either a string for `motion.div` or\n * the React component for `motion(Component)`.\n *\n * If the component is not a `motion` component it returns undefined.\n */\nexport function unwrapMotionComponent(\n component: React.ComponentType | string\n): React.ComponentType | string | undefined {\n if (isMotionComponent(component)) {\n return component[motionComponentSymbol as keyof typeof component]\n }\n\n return undefined\n}\n","import { rootProjectionNode } from \"motion-dom\"\n\nexport function useInstantLayoutTransition(): (\n cb?: (() => void) | undefined\n) => void {\n return startTransition\n}\n\nfunction startTransition(callback?: () => void) {\n if (!rootProjectionNode.current) return\n rootProjectionNode.current.isUpdating = false\n rootProjectionNode.current.blockUpdate()\n callback && callback()\n}\n","import { useCallback } from \"react\";\nimport { rootProjectionNode } from \"motion-dom\"\n\nexport function useResetProjection() {\n const reset = useCallback(() => {\n const root = rootProjectionNode.current\n if (!root) return\n root.resetTree()\n }, [])\n\n return reset\n}\n","\"use client\"\n\nimport { wrap } from \"motion-utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\nexport type Cycle = (i?: number) => void\n\nexport type CycleState = [T, Cycle]\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nexport function useCycle(...items: T[]): CycleState {\n const index = useRef(0)\n const [item, setItem] = useState(items[index.current])\n\n const runCycle = useCallback(\n (next?: number) => {\n index.current =\n typeof next !== \"number\"\n ? wrap(0, items.length, index.current + 1)\n : next\n\n setItem(items[index.current])\n },\n // The array will change on each call, but by putting items.length at\n // the front of this array, we guarantee the dependency comparison will match up\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [items.length, ...items]\n )\n return [item, runCycle]\n}\n","\"use client\"\n\nimport { RefObject, useEffect, useState } from \"react\"\nimport { inView, InViewOptions } from \"../render/dom/viewport\"\n\nexport interface UseInViewOptions\n extends Omit {\n root?: RefObject\n once?: boolean\n amount?: \"some\" | \"all\" | number\n initial?: boolean\n}\n\nexport function useInView(\n ref: RefObject,\n {\n root,\n margin,\n amount,\n once = false,\n initial = false,\n }: UseInViewOptions = {}\n) {\n const [isInView, setInView] = useState(initial)\n\n useEffect(() => {\n if (!ref.current || (once && isInView)) return\n\n const onEnter = () => {\n setInView(true)\n\n return once ? undefined : () => setInView(false)\n }\n\n const options: InViewOptions = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n }\n\n return inView(ref.current, onEnter, options)\n }, [root, ref, margin, once, amount])\n\n return isInView\n}\n","\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { MotionGlobalConfig } from \"motion-utils\"\nimport { useEffect, useRef } from \"react\"\nimport { useInstantLayoutTransition } from \"../projection/use-instant-layout-transition\"\nimport { useForceUpdate } from \"./use-force-update\"\n\nexport function useInstantTransition() {\n const [forceUpdate, forcedRenderCount] = useForceUpdate()\n const startInstantLayoutTransition = useInstantLayoutTransition()\n const unlockOnFrameRef = useRef(-1)\n\n useEffect(() => {\n /**\n * Unblock after two animation frames, otherwise this will unblock too soon.\n */\n frame.postRender(() =>\n frame.postRender(() => {\n /**\n * If the callback has been called again after the effect\n * triggered this 2 frame delay, don't unblock animations. This\n * prevents the previous effect from unblocking the current\n * instant transition too soon. This becomes more likely when\n * used in conjunction with React.startTransition().\n */\n if (forcedRenderCount !== unlockOnFrameRef.current) return\n MotionGlobalConfig.instantAnimations = false\n })\n )\n }, [forcedRenderCount])\n\n return (callback: () => void) => {\n startInstantLayoutTransition(() => {\n MotionGlobalConfig.instantAnimations = true\n forceUpdate()\n callback()\n unlockOnFrameRef.current = forcedRenderCount + 1\n })\n }\n}\n\nexport function disableInstantTransitions() {\n MotionGlobalConfig.instantAnimations = false\n}\n","\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nexport function usePageInView() {\n const [isInView, setIsInView] = useState(true)\n\n useEffect(() => {\n const handleVisibilityChange = () => setIsInView(!document.hidden)\n\n if (document.hidden) {\n handleVisibilityChange()\n }\n\n document.addEventListener(\"visibilitychange\", handleVisibilityChange)\n\n return () => {\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n )\n }\n }, [])\n\n return isInView\n}\n","import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.\n *\n * When dragging SVG elements inside an SVG with a viewBox that differs from\n * the rendered dimensions (e.g., `viewBox=\"0 0 100 100\"` but rendered at 500x500 pixels),\n * pointer coordinates need to be transformed to match the SVG's coordinate system.\n *\n * @example\n * ```jsx\n * function App() {\n * const svgRef = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param svgRef - A React ref to the SVG element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function transformViewBoxPoint(\n svgRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const svg = svgRef.current\n if (!svg) {\n return point\n }\n\n // Get the viewBox attribute\n const viewBox = svg.viewBox?.baseVal\n if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {\n // No viewBox or empty viewBox - no transformation needed\n return point\n }\n\n // Get the rendered dimensions of the SVG\n const bbox = svg.getBoundingClientRect()\n if (bbox.width === 0 || bbox.height === 0) {\n return point\n }\n\n // Calculate scale factors\n const scaleX = viewBox.width / bbox.width\n const scaleY = viewBox.height / bbox.height\n\n // Get the SVG's position on the page\n const svgX = bbox.left + window.scrollX\n const svgY = bbox.top + window.scrollY\n\n // Transform the point:\n // 1. Calculate position relative to SVG\n // 2. Scale by viewBox/viewport ratio\n // 3. Add back the SVG position (but in SVG coordinates)\n return {\n x: (point.x - svgX) * scaleX + svgX,\n y: (point.y - svgY) * scaleY + svgY,\n }\n }\n}\n","export interface AppearStoreEntry {\n animation: Animation\n startTime: number | null\n}\n\nexport type AppearElementId = string\n\nexport type IsComplete = boolean\n\nexport const appearAnimationStore = new Map()\n\nexport const appearComplete = new Map()\n","import { transformProps } from \"motion-dom\"\n\nexport const appearStoreId = (elementId: string, valueName: string) => {\n const key = transformProps.has(valueName) ? \"transform\" : valueName\n\n return `${elementId}: ${key}`\n}\n","import type { Batcher } from \"motion-dom\"\nimport { appearAnimationStore } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\nexport function handoffOptimizedAppearAnimation(\n elementId: string,\n valueName: string,\n frame: Batcher\n): number | null {\n const storeId = appearStoreId(elementId, valueName)\n const optimisedAnimation = appearAnimationStore.get(storeId)\n\n if (!optimisedAnimation) {\n return null\n }\n\n const { animation, startTime } = optimisedAnimation\n\n function cancelAnimation() {\n window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame)\n }\n\n /**\n * We can cancel the animation once it's finished now that we've synced\n * with Motion.\n *\n * Prefer onfinish over finished as onfinish is backwards compatible with\n * older browsers.\n */\n animation.onfinish = cancelAnimation\n\n if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) {\n /**\n * If the startTime is null, this animation is the Paint Ready detection animation\n * and we can cancel it immediately without handoff.\n *\n * Or if we've already handed off the animation then we're now interrupting it.\n * In which case we need to cancel it.\n */\n cancelAnimation()\n return null\n } else {\n return startTime\n }\n}\n","import {\n AnyResolvedKeyframe,\n Batcher,\n getOptimisedAppearId,\n MotionValue,\n optimizedAppearDataId,\n startWaapiAnimation,\n ValueAnimationTransition,\n type WithAppearProps,\n} from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { handoffOptimizedAppearAnimation } from \"./handoff\"\nimport { appearAnimationStore, appearComplete, AppearStoreEntry } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\n/**\n * A single time to use across all animations to manually set startTime\n * and ensure they're all in sync.\n */\nlet startFrameTime: number\n\n/**\n * A dummy animation to detect when Chrome is ready to start\n * painting the page and hold off from triggering the real animation\n * until then. We only need one animation to detect paint ready.\n *\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\n */\nlet readyAnimation: Animation\n\n/**\n * Keep track of animations that were suspended vs cancelled so we\n * can easily resume them when we're done measuring layout.\n */\nconst suspendedAnimations = new Set()\n\nfunction resumeSuspendedAnimations() {\n suspendedAnimations.forEach((data) => {\n data.animation.play()\n data.animation.startTime = data.startTime\n })\n suspendedAnimations.clear()\n}\n\nexport function startOptimizedAppearAnimation(\n element: HTMLElement,\n name: string,\n keyframes: string[] | number[],\n options: ValueAnimationTransition,\n onReady?: (animation: Animation) => void\n): void {\n // Prevent optimised appear animations if Motion has already started animating.\n if (window.MotionIsMounted) {\n return\n }\n\n const id = element.dataset[optimizedAppearDataId]\n if (!id) return\n\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n const storeId = appearStoreId(id, name)\n if (!readyAnimation) {\n readyAnimation = startWaapiAnimation(\n element,\n name,\n [keyframes[0] as number, keyframes[0] as number],\n /**\n * 10 secs is basically just a super-safe duration to give Chrome\n * long enough to get the animation ready.\n */\n { duration: 10000, ease: \"linear\" }\n )\n\n appearAnimationStore.set(storeId, {\n animation: readyAnimation,\n startTime: null,\n })\n\n /**\n * If there's no readyAnimation then there's been no instantiation\n * of handoff animations.\n */\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n window.MotionHasOptimisedAnimation = (\n elementId?: string,\n valueName?: string\n ) => {\n if (!elementId) return false\n\n /**\n * Keep a map of elementIds that have started animating. We check\n * via ID instead of Element because of hydration errors and\n * pre-hydration checks. We also actively record IDs as they start\n * animating rather than simply checking for data-appear-id as\n * this attrbute might be present but not lead to an animation, for\n * instance if the element's appear animation is on a different\n * breakpoint.\n */\n if (!valueName) {\n return appearComplete.has(elementId)\n }\n\n const animationId = appearStoreId(elementId, valueName)\n return Boolean(appearAnimationStore.get(animationId))\n }\n\n window.MotionHandoffMarkAsComplete = (elementId: string): void => {\n if (appearComplete.has(elementId)) {\n appearComplete.set(elementId, true)\n }\n }\n\n window.MotionHandoffIsComplete = (elementId: string): boolean => {\n return appearComplete.get(elementId) === true\n }\n\n /**\n * We only need to cancel transform animations as\n * they're the ones that will interfere with the\n * layout animation measurements.\n */\n window.MotionCancelOptimisedAnimation = (\n elementId: string,\n valueName: string,\n frame?: Batcher,\n canResume?: boolean\n ) => {\n const animationId = appearStoreId(elementId, valueName)\n const data = appearAnimationStore.get(animationId)\n\n if (!data) return\n\n if (frame && canResume === undefined) {\n /**\n * Wait until the end of the subsequent frame to cancel the animation\n * to ensure we don't remove the animation before the main thread has\n * had a chance to resolve keyframes and render.\n */\n frame.postRender(() => {\n frame.postRender(() => {\n data.animation.cancel()\n })\n })\n } else {\n data.animation.cancel()\n }\n\n if (frame && canResume) {\n suspendedAnimations.add(data)\n frame.render(resumeSuspendedAnimations)\n } else {\n appearAnimationStore.delete(animationId)\n\n /**\n * If there are no more animations left, we can remove the cancel function.\n * This will let us know when we can stop checking for conflicting layout animations.\n */\n if (!appearAnimationStore.size) {\n window.MotionCancelOptimisedAnimation = undefined\n }\n }\n }\n\n window.MotionCheckAppearSync = (\n visualElement: WithAppearProps,\n valueName: string,\n value: MotionValue\n ) => {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (!appearId) return\n\n const valueIsOptimised = window.MotionHasOptimisedAnimation?.(\n appearId,\n valueName\n )\n const externalAnimationValue =\n visualElement.props.values?.[valueName]\n\n if (!valueIsOptimised || !externalAnimationValue) return\n\n const removeSyncCheck = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n if (externalAnimationValue.get() !== latestValue) {\n window.MotionCancelOptimisedAnimation?.(\n appearId,\n valueName\n )\n removeSyncCheck()\n }\n }\n )\n\n return removeSyncCheck\n }\n }\n\n const startAnimation = () => {\n readyAnimation.cancel()\n\n const appearAnimation = startWaapiAnimation(\n element,\n name,\n keyframes,\n options\n )\n\n /**\n * Record the time of the first started animation. We call performance.now() once\n * here and once in handoff to ensure we're getting\n * close to a frame-locked time. This keeps all animations in sync.\n */\n if (startFrameTime === undefined) {\n startFrameTime = performance.now()\n }\n\n appearAnimation.startTime = startFrameTime\n\n appearAnimationStore.set(storeId, {\n animation: appearAnimation,\n startTime: startFrameTime,\n })\n\n if (onReady) onReady(appearAnimation)\n }\n\n appearComplete.set(id, false)\n\n if (readyAnimation.ready) {\n readyAnimation.ready.then(startAnimation).catch(noop)\n } else {\n startAnimation()\n }\n}\n","\"use client\"\n\nimport {\n animateVisualElement,\n createBox,\n ResolvedValues,\n TargetAndTransition,\n VisualElement,\n} from \"motion-dom\"\nimport { useLayoutEffect, useState } from \"react\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { useConstant } from \"../../utils/use-constant\"\n\ninterface AnimatedStateOptions {\n initialState: ResolvedValues\n}\n\nconst createObject = () => ({})\n\nclass StateVisualElement extends VisualElement<\n ResolvedValues,\n {},\n AnimatedStateOptions\n> {\n type: \"state\"\n build() {}\n measureInstanceViewportBox = createBox\n resetTransform() {}\n restoreTransform() {}\n removeValueFromRenderState() {}\n renderInstance() {}\n scrapeMotionValuesFromProps() {\n return createObject()\n }\n getBaseTargetFromProps() {\n return undefined\n }\n\n readValueFromInstance(\n _state: ResolvedValues,\n key: string,\n options: AnimatedStateOptions\n ) {\n return options.initialState[key] || 0\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n\nconst useVisualState = makeUseVisualState({\n scrapeMotionValuesFromProps: createObject,\n createRenderState: createObject,\n})\n\n/**\n * This is not an officially supported API and may be removed\n * on any version.\n */\nexport function useAnimatedState(initialState: any) {\n const [animationState, setAnimationState] = useState(initialState)\n const visualState = useVisualState({}, false)\n\n const element = useConstant(() => {\n return new StateVisualElement(\n {\n props: {\n onUpdate: (v) => {\n setAnimationState({ ...v })\n },\n },\n visualState,\n presenceContext: null,\n },\n { initialState }\n )\n })\n\n useLayoutEffect(() => {\n element.mount({})\n return () => element.unmount()\n }, [element])\n\n const startAnimation = useConstant(\n () => (animationDefinition: TargetAndTransition) => {\n return animateVisualElement(element, animationDefinition)\n }\n )\n\n return [animationState, startAnimation]\n}\n","\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { LayoutGroup } from \"./LayoutGroup\"\n\nlet id = 0\nexport const AnimateSharedLayout: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children }: React.PropsWithChildren<{}>) => {\n React.useEffect(() => {\n invariant(\n false,\n \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\"\n )\n }, [])\n\n return (\n `asl-${id++}`)}>\n {children}\n \n )\n}\n","\"use client\"\n\nimport { MotionValue } from \"motion-dom\"\nimport { invariant, warning } from \"motion-utils\"\nimport { useContext } from \"react\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\ninterface ScaleMotionValues {\n scaleX: MotionValue\n scaleY: MotionValue\n}\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000\nexport const invertScale = (scale: number) =>\n scale > 0.001 ? 1 / scale : maxScale\n\nlet hasWarned = false\n\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n * const { scaleX, scaleY } = useInvertedScale()\n * return \n * }\n * ```\n *\n * @deprecated\n */\nexport function useInvertedScale(\n scale?: Partial\n): ScaleMotionValues {\n let parentScaleX = useMotionValue(1)\n let parentScaleY = useMotionValue(1)\n const { visualElement } = useContext(MotionContext)\n\n invariant(\n !!(scale || visualElement),\n \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\"\n )\n\n warning(\n hasWarned,\n \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\"\n )\n\n hasWarned = true\n\n if (scale) {\n parentScaleX = scale.scaleX || parentScaleX\n parentScaleY = scale.scaleY || parentScaleY\n } else if (visualElement) {\n parentScaleX = visualElement.getValue(\"scaleX\", 1)\n parentScaleY = visualElement.getValue(\"scaleY\", 1)\n }\n\n const scaleX = useTransform(parentScaleX, invertScale)\n const scaleY = useTransform(parentScaleY, invertScale)\n\n return { scaleX, scaleY }\n}\n"],"names":["React","isHTMLElement","useId","useRef","useContext","MotionConfigContext","useInsertionEffect","_jsx","useConstant","useMemo","PresenceContext","Children","isValidElement","usePresence","useState","useIsomorphicLayoutEffect","LayoutGroupContext","createContext","useCallback","frame","nodeGroup","loadFeatures","useEffect","LazyContext","loadExternalIsValidProp","resolveTransition","createMotionComponent","warnOnce","featureBundle","createDomVisualElement","mixNumber","moveItem","invariant","forwardRef","motionValue","cancelFrame","collectMotionValues","transform","isMotionValue","resolveElements","removeItem","getEasingForSegment","defaultOffset","isGenerator","secondsToMilliseconds","createGeneratorEasing","fillOffset","progress","isSVGElement","isSVGSVGElement","SVGVisualElement","HTMLVisualElement","visualElementStore","ObjectVisualElement","animateSingleValue","animateTarget","spring","GroupAnimationWithThen","getValueTransition","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","velocityPerSecond","interpolate","clamp","noop","frameData","resize","supportsScrollTimeline","observeTimeline","animations","gestureAnimations","drag","layout","attachFollow","MotionValue","transformProps","acceleratedValues","hasReducedMotionListener","initPrefersReducedMotion","prefersReducedMotion","setTarget","animateVisualElement","addDomEvent","motionComponentSymbol","rootProjectionNode","wrap","MotionGlobalConfig","optimizedAppearDataId","startWaapiAnimation","getOptimisedAppearId","VisualElement","createBox","makeUseVisualState","useLayoutEffect","MotionContext","warning"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG;AAKH;;;AAGG;AACH,SAAS,MAAM,CAAI,GAAmB,EAAE,KAAQ,EAAA;AAC5C,IAAA,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AAC3B,QAAA,OAAO,GAAG,CAAC,KAAK,CAAC,CAAA;KACpB;SAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;AACxC,QAAA,GAAiC,CAAC,OAAO,GAAG,KAAK,CAAA;KACtD;AACL,CAAC;AAED;;;AAGG;AACH,SAAS,WAAW,CAAI,GAAG,IAAsB,EAAA;IAC7C,OAAO,CAAC,IAAI,KAAI;QACZ,IAAI,UAAU,GAAG,KAAK,CAAA;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI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AAG,cAAc,CAAC,CAAC,CAAC,CAAA;IACpC,MAAM,EAAE,aAAa,EAAE,GAAGJ,gBAAU,CAAC8F,2BAAa,CAAC,CAAA;IAEnDlE,qBAAS,CACL,CAAC,EAAE,KAAK,IAAI,aAAa,CAAC,EAC1B,4GAA4G,CAC/G,CAAA;AAED,IAAAmE,mBAAO,CACH,SAAS,EACT,yFAAyF,CAC5F,CAAA;IAED,SAAS,GAAG,IAAI,CAAA;IAEhB,IAAI,KAAK,EAAE;AACP,QAAA,YAAY,GAAG,KAAK,CAAC,MAAM,IAAI,YAAY,CAAA;AAC3C,QAAA,YAAY,GAAG,KAAK,CAAC,MAAM,IAAI,YAAY,CAAA;KAC9C;SAAM,IAAI,aAAa,EAAE;QACtB,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;QAClD,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;KACrD;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;IACtD,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;AAEtD,IAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/m.js b/node_modules/framer-motion/dist/cjs/m.js new file mode 100644 index 00000000..5e7d0540 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/m.js @@ -0,0 +1,1158 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var jsxRuntime = require('react/jsx-runtime'); +var motionUtils = require('motion-utils'); +var react = require('react'); +var motionDom = require('motion-dom'); + +const LayoutGroupContext = react.createContext({}); + +const LazyContext = react.createContext({ strict: false }); + +/** + * @public + */ +const MotionConfigContext = react.createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never", +}); + +const MotionContext = /* @__PURE__ */ react.createContext({}); + +function getCurrentTreeVariants(props, context) { + if (motionDom.isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || motionDom.isVariantLabel(initial) + ? initial + : undefined, + animate: motionDom.isVariantLabel(animate) ? animate : undefined, + }; + } + return props.inherit !== false ? context : {}; +} + +function useCreateMotionContext(props) { + const { initial, animate } = getCurrentTreeVariants(props, react.useContext(MotionContext)); + return react.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); +} +function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; +} + +const createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {}, +}); + +function copyRawValuesOnly(target, source, props) { + for (const key in source) { + if (!motionDom.isMotionValue(source[key]) && !motionDom.isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } +} +function useInitialMotionValues({ transformTemplate }, visualState) { + return react.useMemo(() => { + const state = createHtmlRenderState(); + motionDom.buildHTMLStyles(state, visualState, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); +} +function useStyle(props, visualState) { + const styleProp = props.style || {}; + const style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState)); + return style; +} +function useHTMLProps(props, visualState) { + // The `any` isn't ideal but it is the type of createElement props argument + const htmlProps = {}; + const style = useStyle(props, visualState); + if (props.drag && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = + style.WebkitUserSelect = + style.WebkitTouchCallout = + "none"; + // Disable scrolling on the draggable direction + style.touchAction = + props.drag === true + ? "none" + : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && + (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; +} + +const createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {}, +}); + +function useSVGProps(props, visualState, _isStatic, Component) { + const visualProps = react.useMemo(() => { + const state = createSvgRenderState(); + motionDom.buildSVGAttrs(state, visualState, motionDom.isSVGTag(Component), props.transformTemplate, props.style); + return { + ...state.attrs, + style: { ...state.style }, + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; +} + +/** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ +const validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "custom", + "inherit", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "globalTapTarget", + "propagate", + "ignoreStrict", + "viewport", +]); +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +function isValidMotionProp(key) { + return (key.startsWith("while") || + (key.startsWith("drag") && key !== "draggable") || + key.startsWith("layout") || + key.startsWith("onTap") || + key.startsWith("onPan") || + key.startsWith("onLayout") || + validMotionProps.has(key)); +} + +let shouldForward = (key) => !isValidMotionProp(key); +function loadExternalIsValidProp(isValidProp) { + if (typeof isValidProp !== "function") + return; + // Explicitly filter our events + shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); +} +/** + * Emotion and Styled Components both allow users to pass through arbitrary props to their components + * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which + * of these should be passed to the underlying DOM node. + * + * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props + * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props + * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of + * `@emotion/is-prop-valid`, however to fix this problem we need to use it. + * + * By making it an optionalDependency we can offer this functionality only in the situations where it's + * actually required. + */ +try { + /** + * We attempt to import this package but require won't be defined in esm environments, in that case + * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed + * in favour of explicit injection. + */ + loadExternalIsValidProp(require("@emotion/is-prop-valid").default); +} +catch { + // We don't need to actually do anything here - the fallback is the existing `isPropValid`. +} +function filterProps(props, isDom, forwardMotionProps) { + const filteredProps = {}; + for (const key in props) { + /** + * values is considered a valid prop by Emotion, so if it's present + * this will be rendered out to the DOM unless explicitly filtered. + * + * We check the type as it could be used with the `feColorMatrix` + * element, which we support. + */ + if (key === "values" && typeof props.values === "object") + continue; + if (shouldForward(key) || + (forwardMotionProps === true && isValidMotionProp(key)) || + (!isDom && !isValidMotionProp(key)) || + // If trying to use native HTML drag events, forward drag listeners + (props["draggable"] && + key.startsWith("onDrag"))) { + filteredProps[key] = + props[key]; + } + } + return filteredProps; +} + +/** + * We keep these listed separately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ +const lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view", +]; + +function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } + else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/u.test(Component)) { + return true; + } + return false; +} + +function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) { + const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); + const elementProps = Component !== react.Fragment ? { ...filteredProps, ...visualProps, ref } : {}; + /** + * If component has been handed a motion value as its child, + * memoise its initial value and render that. Subsequent updates + * will be handled by the onChange handler + */ + const { children } = props; + const renderedChildren = react.useMemo(() => (motionDom.isMotionValue(children) ? children.get() : children), [children]); + return react.createElement(Component, { + ...elementProps, + children: renderedChildren, + }); +} + +/** + * @public + */ +const PresenceContext = +/* @__PURE__ */ react.createContext(null); + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + const ref = react.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState(), + }; + return state; +} +function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = motionDom.resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants = motionDom.isControllingVariants(props); + const isVariantNode = motionDom.isVariantNode(props); + if (context && + isVariantNode && + !isControllingVariants && + props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext + ? presenceContext.initial === false + : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && + typeof variantToSet !== "boolean" && + !motionDom.isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + for (let i = 0; i < list.length; i++) { + const resolved = motionDom.resolveVariantFromProps(props, list[i]); + if (resolved) { + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + const index = isInitialAnimationBlocked + ? valueTarget.length - 1 + : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) { + values[key] = transitionEnd[key]; + } + } + } + } + return values; +} +const makeUseVisualState = (config) => (props, isStatic) => { + const context = react.useContext(MotionContext); + const presenceContext = react.useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); +}; + +const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: motionDom.scrapeHTMLMotionValuesFromProps, + createRenderState: createHtmlRenderState, +}); + +const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: motionDom.scrapeSVGMotionValuesFromProps, + createRenderState: createSvgRenderState, +}); + +const isBrowser = typeof window !== "undefined"; + +const featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag", + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"], +}; +let isInitialized = false; +/** + * Initialize feature definitions with isEnabled checks. + * This must be called before any motion components are rendered. + */ +function initFeatureDefinitions() { + if (isInitialized) + return; + const initialFeatureDefinitions = {}; + for (const key in featureProps) { + initialFeatureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]), + }; + } + motionDom.setFeatureDefinitions(initialFeatureDefinitions); + isInitialized = true; +} +/** + * Get the current feature definitions, initializing if needed. + */ +function getInitializedFeatureDefinitions() { + initFeatureDefinitions(); + return motionDom.getFeatureDefinitions(); +} + +const motionComponentSymbol = Symbol.for("motionComponentSymbol"); + +/** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ +function useMotionRef(visualState, visualElement, externalRef) { + /** + * Store externalRef in a ref to avoid including it in the useCallback + * dependency array. Including externalRef in dependencies causes issues + * with libraries like Radix UI that create new callback refs on each render + * when using asChild - this would cause the callback to be recreated, + * triggering element remounts and breaking AnimatePresence exit animations. + */ + const externalRefContainer = react.useRef(externalRef); + react.useInsertionEffect(() => { + externalRefContainer.current = externalRef; + }); + // Store cleanup function returned by callback refs (React 19 feature) + const refCleanup = react.useRef(null); + return react.useCallback((instance) => { + if (instance) { + visualState.onMount?.(instance); + } + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + const ref = externalRefContainer.current; + if (typeof ref === "function") { + if (instance) { + const cleanup = ref(instance); + if (typeof cleanup === "function") { + refCleanup.current = cleanup; + } + } + else if (refCleanup.current) { + refCleanup.current(); + refCleanup.current = null; + } + else { + ref(instance); + } + } + else if (ref) { + ref.current = instance; + } + }, [visualElement]); +} + +/** + * Internal, exported only for usage in Framer + */ +const SwitchLayoutGroupContext = react.createContext({}); + +function isRefObject(ref) { + return (ref && + typeof ref === "object" && + Object.prototype.hasOwnProperty.call(ref, "current")); +} + +const useIsomorphicLayoutEffect = isBrowser ? react.useLayoutEffect : react.useEffect; + +function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { + const { visualElement: parent } = react.useContext(MotionContext); + const lazyContext = react.useContext(LazyContext); + const presenceContext = react.useContext(PresenceContext); + const motionConfig = react.useContext(MotionConfigContext); + const reducedMotionConfig = motionConfig.reducedMotion; + const skipAnimations = motionConfig.skipAnimations; + const visualElementRef = react.useRef(null); + /** + * Track whether the component has been through React's commit phase. + * Used to detect when LazyMotion features load after the component has mounted. + */ + const hasMountedOnce = react.useRef(false); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + createVisualElement = + createVisualElement || + lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext + ? presenceContext.initial === false + : false, + reducedMotionConfig, + skipAnimations, + isSVG, + }); + /** + * If the component has already mounted before features loaded (e.g. via + * LazyMotion with async feature loading), we need to force the initial + * animation to run. Otherwise state changes that occurred before features + * loaded will be lost and the element will snap to its final state. + */ + if (hasMountedOnce.current && visualElementRef.current) { + visualElementRef.current.manuallyAnimateOnMount = true; + } + } + const visualElement = visualElementRef.current; + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + const initialLayoutGroupConfig = react.useContext(SwitchLayoutGroupContext); + if (visualElement && + !visualElement.projection && + ProjectionNodeConstructor && + (visualElement.type === "html" || visualElement.type === "svg")) { + createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); + } + const isMounted = react.useRef(false); + react.useInsertionEffect(() => { + /** + * Check the component has already mounted before calling + * `update` unnecessarily. This ensures we skip the initial update. + */ + if (visualElement && isMounted.current) { + visualElement.update(props, presenceContext); + } + }); + /** + * Cache this value as we want to know whether HandoffAppearAnimations + * was present on initial render - it will be deleted after this. + */ + const optimisedAppearId = props[motionDom.optimizedAppearDataAttribute]; + const wantsHandoff = react.useRef(Boolean(optimisedAppearId) && + !window.MotionHandoffIsComplete?.(optimisedAppearId) && + window.MotionHasOptimisedAnimation?.(optimisedAppearId)); + useIsomorphicLayoutEffect(() => { + /** + * Track that this component has mounted. This is used to detect when + * LazyMotion features load after the component has already committed. + */ + hasMountedOnce.current = true; + if (!visualElement) + return; + isMounted.current = true; + window.MotionIsMounted = true; + visualElement.updateFeatures(); + visualElement.scheduleRenderMicrotask(); + /** + * Ideally this function would always run in a useEffect. + * + * However, if we have optimised appear animations to handoff from, + * it needs to happen synchronously to ensure there's no flash of + * incorrect styles in the event of a hydration error. + * + * So if we detect a situtation where optimised appear animations + * are running, we use useLayoutEffect to trigger animations. + */ + if (wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + react.useEffect(() => { + if (!visualElement) + return; + if (!wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + if (wantsHandoff.current) { + // This ensures all future calls to animateChanges() in this component will run in useEffect + queueMicrotask(() => { + window.MotionHandoffMarkAsComplete?.(optimisedAppearId); + }); + wantsHandoff.current = false; + } + /** + * Now we've finished triggering animations for this element we + * can wipe the enteringChildren set for the next render. + */ + visualElement.enteringChildren = undefined; + }); + return visualElement; +} +function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { + const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props; + visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] + ? undefined + : getClosestProjectingNode(visualElement.parent)); + visualElement.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), + visualElement, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig, + crossfade: layoutCrossfade, + layoutScroll, + layoutRoot, + }); +} +function getClosestProjectingNode(visualElement) { + if (!visualElement) + return undefined; + return visualElement.options.allowProjection !== false + ? visualElement.projection + : getClosestProjectingNode(visualElement.parent); +} + +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { + /** + * Determine whether to use SVG or HTML rendering based on: + * 1. Explicit `type` option (highest priority) + * 2. Auto-detection via `isSVGComponent` + */ + const isSVG = type ? type === "svg" : isSVGComponent(Component); + const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; + function MotionDOMComponent(props, externalRef) { + /** + * If we need to measure the element we load this functionality in a + * separate class component in order to gain access to getSnapshotBeforeUpdate. + */ + let MeasureLayout; + const configAndProps = { + ...react.useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props), + }; + const { isStatic } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && isBrowser) { + useStrictMode(configAndProps, preloadedFeatures); + const layoutProjection = getProjectionFunctionality(configAndProps); + MeasureLayout = layoutProjection.MeasureLayout; + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return (jsxRuntime.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsxRuntime.jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] })); + } + MotionDOMComponent.displayName = `motion.${typeof Component === "string" + ? Component + : `create(${Component.displayName ?? Component.name ?? ""})`}`; + const ForwardRefMotionComponent = react.forwardRef(MotionDOMComponent); + ForwardRefMotionComponent[motionComponentSymbol] = Component; + return ForwardRefMotionComponent; +} +function useLayoutId({ layoutId }) { + const layoutGroupId = react.useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined + ? layoutGroupId + "-" + layoutId + : layoutId; +} +function useStrictMode(configAndProps, preloadedFeatures) { + const isStrict = react.useContext(LazyContext).strict; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (process.env.NODE_ENV !== "production" && + preloadedFeatures && + isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + configAndProps.ignoreStrict + ? motionUtils.warning(false, strictMessage, "lazy-strict-mode") + : motionUtils.invariant(false, strictMessage, "lazy-strict-mode"); + } +} +function getProjectionFunctionality(props) { + const featureDefinitions = getInitializedFeatureDefinitions(); + const { drag, layout } = featureDefinitions; + if (!drag && !layout) + return {}; + const combined = { ...drag, ...layout }; + return { + MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) + ? combined.MeasureLayout + : undefined, + ProjectionNode: combined.ProjectionNode, + }; +} + +function createMinimalMotionComponent(Component, options) { + return createMotionComponent(Component, options); +} + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMinimalMotionComponent("a"); +const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent("abbr"); +const MotionAddress = +/*@__PURE__*/ createMinimalMotionComponent("address"); +const MotionArea = /*@__PURE__*/ createMinimalMotionComponent("area"); +const MotionArticle = +/*@__PURE__*/ createMinimalMotionComponent("article"); +const MotionAside = /*@__PURE__*/ createMinimalMotionComponent("aside"); +const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent("audio"); +const MotionB = /*@__PURE__*/ createMinimalMotionComponent("b"); +const MotionBase = /*@__PURE__*/ createMinimalMotionComponent("base"); +const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent("bdi"); +const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent("bdo"); +const MotionBig = /*@__PURE__*/ createMinimalMotionComponent("big"); +const MotionBlockquote = +/*@__PURE__*/ createMinimalMotionComponent("blockquote"); +const MotionBody = /*@__PURE__*/ createMinimalMotionComponent("body"); +const MotionButton = /*@__PURE__*/ createMinimalMotionComponent("button"); +const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent("canvas"); +const MotionCaption = +/*@__PURE__*/ createMinimalMotionComponent("caption"); +const MotionCite = /*@__PURE__*/ createMinimalMotionComponent("cite"); +const MotionCode = /*@__PURE__*/ createMinimalMotionComponent("code"); +const MotionCol = /*@__PURE__*/ createMinimalMotionComponent("col"); +const MotionColgroup = +/*@__PURE__*/ createMinimalMotionComponent("colgroup"); +const MotionData = /*@__PURE__*/ createMinimalMotionComponent("data"); +const MotionDatalist = +/*@__PURE__*/ createMinimalMotionComponent("datalist"); +const MotionDd = /*@__PURE__*/ createMinimalMotionComponent("dd"); +const MotionDel = /*@__PURE__*/ createMinimalMotionComponent("del"); +const MotionDetails = +/*@__PURE__*/ createMinimalMotionComponent("details"); +const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent("dfn"); +const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent("dialog"); +const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent("div"); +const MotionDl = /*@__PURE__*/ createMinimalMotionComponent("dl"); +const MotionDt = /*@__PURE__*/ createMinimalMotionComponent("dt"); +const MotionEm = /*@__PURE__*/ createMinimalMotionComponent("em"); +const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent("embed"); +const MotionFieldset = +/*@__PURE__*/ createMinimalMotionComponent("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMinimalMotionComponent("figcaption"); +const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent("figure"); +const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent("footer"); +const MotionForm = /*@__PURE__*/ createMinimalMotionComponent("form"); +const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent("h1"); +const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent("h2"); +const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent("h3"); +const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent("h4"); +const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent("h5"); +const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent("h6"); +const MotionHead = /*@__PURE__*/ createMinimalMotionComponent("head"); +const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent("header"); +const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent("hgroup"); +const MotionHr = /*@__PURE__*/ createMinimalMotionComponent("hr"); +const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent("html"); +const MotionI = /*@__PURE__*/ createMinimalMotionComponent("i"); +const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent("iframe"); +const MotionImg = /*@__PURE__*/ createMinimalMotionComponent("img"); +const MotionInput = /*@__PURE__*/ createMinimalMotionComponent("input"); +const MotionIns = /*@__PURE__*/ createMinimalMotionComponent("ins"); +const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent("kbd"); +const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent("keygen"); +const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent("label"); +const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent("legend"); +const MotionLi = /*@__PURE__*/ createMinimalMotionComponent("li"); +const MotionLink = /*@__PURE__*/ createMinimalMotionComponent("link"); +const MotionMain = /*@__PURE__*/ createMinimalMotionComponent("main"); +const MotionMap = /*@__PURE__*/ createMinimalMotionComponent("map"); +const MotionMark = /*@__PURE__*/ createMinimalMotionComponent("mark"); +const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent("menu"); +const MotionMenuitem = +/*@__PURE__*/ createMinimalMotionComponent("menuitem"); +const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent("meter"); +const MotionNav = /*@__PURE__*/ createMinimalMotionComponent("nav"); +const MotionObject = /*@__PURE__*/ createMinimalMotionComponent("object"); +const MotionOl = /*@__PURE__*/ createMinimalMotionComponent("ol"); +const MotionOptgroup = +/*@__PURE__*/ createMinimalMotionComponent("optgroup"); +const MotionOption = /*@__PURE__*/ createMinimalMotionComponent("option"); +const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent("output"); +const MotionP = /*@__PURE__*/ createMinimalMotionComponent("p"); +const MotionParam = /*@__PURE__*/ createMinimalMotionComponent("param"); +const MotionPicture = +/*@__PURE__*/ createMinimalMotionComponent("picture"); +const MotionPre = /*@__PURE__*/ createMinimalMotionComponent("pre"); +const MotionProgress = +/*@__PURE__*/ createMinimalMotionComponent("progress"); +const MotionQ = /*@__PURE__*/ createMinimalMotionComponent("q"); +const MotionRp = /*@__PURE__*/ createMinimalMotionComponent("rp"); +const MotionRt = /*@__PURE__*/ createMinimalMotionComponent("rt"); +const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent("ruby"); +const MotionS = /*@__PURE__*/ createMinimalMotionComponent("s"); +const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent("samp"); +const MotionScript = /*@__PURE__*/ createMinimalMotionComponent("script"); +const MotionSection = +/*@__PURE__*/ createMinimalMotionComponent("section"); +const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent("select"); +const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent("small"); +const MotionSource = /*@__PURE__*/ createMinimalMotionComponent("source"); +const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent("span"); +const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent("strong"); +const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent("style"); +const MotionSub = /*@__PURE__*/ createMinimalMotionComponent("sub"); +const MotionSummary = +/*@__PURE__*/ createMinimalMotionComponent("summary"); +const MotionSup = /*@__PURE__*/ createMinimalMotionComponent("sup"); +const MotionTable = /*@__PURE__*/ createMinimalMotionComponent("table"); +const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent("tbody"); +const MotionTd = /*@__PURE__*/ createMinimalMotionComponent("td"); +const MotionTextarea = +/*@__PURE__*/ createMinimalMotionComponent("textarea"); +const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent("tfoot"); +const MotionTh = /*@__PURE__*/ createMinimalMotionComponent("th"); +const MotionThead = /*@__PURE__*/ createMinimalMotionComponent("thead"); +const MotionTime = /*@__PURE__*/ createMinimalMotionComponent("time"); +const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent("title"); +const MotionTr = /*@__PURE__*/ createMinimalMotionComponent("tr"); +const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent("track"); +const MotionU = /*@__PURE__*/ createMinimalMotionComponent("u"); +const MotionUl = /*@__PURE__*/ createMinimalMotionComponent("ul"); +const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent("video"); +const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent("wbr"); +const MotionWebview = +/*@__PURE__*/ createMinimalMotionComponent("webview"); +/** + * SVG components + */ +const MotionAnimate = +/*@__PURE__*/ createMinimalMotionComponent("animate"); +const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent("circle"); +const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent("defs"); +const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent("desc"); +const MotionEllipse = +/*@__PURE__*/ createMinimalMotionComponent("ellipse"); +const MotionG = /*@__PURE__*/ createMinimalMotionComponent("g"); +const MotionImage = /*@__PURE__*/ createMinimalMotionComponent("image"); +const MotionLine = /*@__PURE__*/ createMinimalMotionComponent("line"); +const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent("filter"); +const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent("marker"); +const MotionMask = /*@__PURE__*/ createMinimalMotionComponent("mask"); +const MotionMetadata = +/*@__PURE__*/ createMinimalMotionComponent("metadata"); +const MotionPath = /*@__PURE__*/ createMinimalMotionComponent("path"); +const MotionPattern = +/*@__PURE__*/ createMinimalMotionComponent("pattern"); +const MotionPolygon = +/*@__PURE__*/ createMinimalMotionComponent("polygon"); +const MotionPolyline = +/*@__PURE__*/ createMinimalMotionComponent("polyline"); +const MotionRect = /*@__PURE__*/ createMinimalMotionComponent("rect"); +const MotionStop = /*@__PURE__*/ createMinimalMotionComponent("stop"); +const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent("svg"); +const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent("symbol"); +const MotionText = /*@__PURE__*/ createMinimalMotionComponent("text"); +const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent("tspan"); +const MotionUse = /*@__PURE__*/ createMinimalMotionComponent("use"); +const MotionView = /*@__PURE__*/ createMinimalMotionComponent("view"); +const MotionClipPath = +/*@__PURE__*/ createMinimalMotionComponent("clipPath"); +const MotionFeBlend = +/*@__PURE__*/ createMinimalMotionComponent("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feColorMatrix"); +const MotionFeComponentTransfer = +/*@__PURE__*/ createMinimalMotionComponent("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMinimalMotionComponent("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMinimalMotionComponent("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMinimalMotionComponent("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMinimalMotionComponent("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMinimalMotionComponent("feDropShadow"); +const MotionFeFlood = +/*@__PURE__*/ createMinimalMotionComponent("feFlood"); +const MotionFeFuncA = +/*@__PURE__*/ createMinimalMotionComponent("feFuncA"); +const MotionFeFuncB = +/*@__PURE__*/ createMinimalMotionComponent("feFuncB"); +const MotionFeFuncG = +/*@__PURE__*/ createMinimalMotionComponent("feFuncG"); +const MotionFeFuncR = +/*@__PURE__*/ createMinimalMotionComponent("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMinimalMotionComponent("feGaussianBlur"); +const MotionFeImage = +/*@__PURE__*/ createMinimalMotionComponent("feImage"); +const MotionFeMerge = +/*@__PURE__*/ createMinimalMotionComponent("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMinimalMotionComponent("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMinimalMotionComponent("feMorphology"); +const MotionFeOffset = +/*@__PURE__*/ createMinimalMotionComponent("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMinimalMotionComponent("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMinimalMotionComponent("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMinimalMotionComponent("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMinimalMotionComponent("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMinimalMotionComponent("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMinimalMotionComponent("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMinimalMotionComponent("radialGradient"); +const MotionTextPath = +/*@__PURE__*/ createMinimalMotionComponent("textPath"); + +exports.a = MotionA; +exports.abbr = MotionAbbr; +exports.address = MotionAddress; +exports.animate = MotionAnimate; +exports.area = MotionArea; +exports.article = MotionArticle; +exports.aside = MotionAside; +exports.audio = MotionAudio; +exports.b = MotionB; +exports.base = MotionBase; +exports.bdi = MotionBdi; +exports.bdo = MotionBdo; +exports.big = MotionBig; +exports.blockquote = MotionBlockquote; +exports.body = MotionBody; +exports.button = MotionButton; +exports.canvas = MotionCanvas; +exports.caption = MotionCaption; +exports.circle = MotionCircle; +exports.cite = MotionCite; +exports.clipPath = MotionClipPath; +exports.code = MotionCode; +exports.col = MotionCol; +exports.colgroup = MotionColgroup; +exports.create = createMinimalMotionComponent; +exports.data = MotionData; +exports.datalist = MotionDatalist; +exports.dd = MotionDd; +exports.defs = MotionDefs; +exports.del = MotionDel; +exports.desc = MotionDesc; +exports.details = MotionDetails; +exports.dfn = MotionDfn; +exports.dialog = MotionDialog; +exports.div = MotionDiv; +exports.dl = MotionDl; +exports.dt = MotionDt; +exports.ellipse = MotionEllipse; +exports.em = MotionEm; +exports.embed = MotionEmbed; +exports.feBlend = MotionFeBlend; +exports.feColorMatrix = MotionFeColorMatrix; +exports.feComponentTransfer = MotionFeComponentTransfer; +exports.feComposite = MotionFeComposite; +exports.feConvolveMatrix = MotionFeConvolveMatrix; +exports.feDiffuseLighting = MotionFeDiffuseLighting; +exports.feDisplacementMap = MotionFeDisplacementMap; +exports.feDistantLight = MotionFeDistantLight; +exports.feDropShadow = MotionFeDropShadow; +exports.feFlood = MotionFeFlood; +exports.feFuncA = MotionFeFuncA; +exports.feFuncB = MotionFeFuncB; +exports.feFuncG = MotionFeFuncG; +exports.feFuncR = MotionFeFuncR; +exports.feGaussianBlur = MotionFeGaussianBlur; +exports.feImage = MotionFeImage; +exports.feMerge = MotionFeMerge; +exports.feMergeNode = MotionFeMergeNode; +exports.feMorphology = MotionFeMorphology; +exports.feOffset = MotionFeOffset; +exports.fePointLight = MotionFePointLight; +exports.feSpecularLighting = MotionFeSpecularLighting; +exports.feSpotLight = MotionFeSpotLight; +exports.feTile = MotionFeTile; +exports.feTurbulence = MotionFeTurbulence; +exports.fieldset = MotionFieldset; +exports.figcaption = MotionFigcaption; +exports.figure = MotionFigure; +exports.filter = MotionFilter; +exports.footer = MotionFooter; +exports.foreignObject = MotionForeignObject; +exports.form = MotionForm; +exports.g = MotionG; +exports.h1 = MotionH1; +exports.h2 = MotionH2; +exports.h3 = MotionH3; +exports.h4 = MotionH4; +exports.h5 = MotionH5; +exports.h6 = MotionH6; +exports.head = MotionHead; +exports.header = MotionHeader; +exports.hgroup = MotionHgroup; +exports.hr = MotionHr; +exports.html = MotionHtml; +exports.i = MotionI; +exports.iframe = MotionIframe; +exports.image = MotionImage; +exports.img = MotionImg; +exports.input = MotionInput; +exports.ins = MotionIns; +exports.kbd = MotionKbd; +exports.keygen = MotionKeygen; +exports.label = MotionLabel; +exports.legend = MotionLegend; +exports.li = MotionLi; +exports.line = MotionLine; +exports.linearGradient = MotionLinearGradient; +exports.link = MotionLink; +exports.main = MotionMain; +exports.map = MotionMap; +exports.mark = MotionMark; +exports.marker = MotionMarker; +exports.mask = MotionMask; +exports.menu = MotionMenu; +exports.menuitem = MotionMenuitem; +exports.metadata = MotionMetadata; +exports.meter = MotionMeter; +exports.nav = MotionNav; +exports.object = MotionObject; +exports.ol = MotionOl; +exports.optgroup = MotionOptgroup; +exports.option = MotionOption; +exports.output = MotionOutput; +exports.p = MotionP; +exports.param = MotionParam; +exports.path = MotionPath; +exports.pattern = MotionPattern; +exports.picture = MotionPicture; +exports.polygon = MotionPolygon; +exports.polyline = MotionPolyline; +exports.pre = MotionPre; +exports.progress = MotionProgress; +exports.q = MotionQ; +exports.radialGradient = MotionRadialGradient; +exports.rect = MotionRect; +exports.rp = MotionRp; +exports.rt = MotionRt; +exports.ruby = MotionRuby; +exports.s = MotionS; +exports.samp = MotionSamp; +exports.script = MotionScript; +exports.section = MotionSection; +exports.select = MotionSelect; +exports.small = MotionSmall; +exports.source = MotionSource; +exports.span = MotionSpan; +exports.stop = MotionStop; +exports.strong = MotionStrong; +exports.style = MotionStyle; +exports.sub = MotionSub; +exports.summary = MotionSummary; +exports.sup = MotionSup; +exports.svg = MotionSvg; +exports.symbol = MotionSymbol; +exports.table = MotionTable; +exports.tbody = MotionTbody; +exports.td = MotionTd; +exports.text = MotionText; +exports.textPath = MotionTextPath; +exports.textarea = MotionTextarea; +exports.tfoot = MotionTfoot; +exports.th = MotionTh; +exports.thead = MotionThead; +exports.time = MotionTime; +exports.title = MotionTitle; +exports.tr = MotionTr; +exports.track = MotionTrack; +exports.tspan = MotionTspan; +exports.u = MotionU; +exports.ul = MotionUl; +exports.use = MotionUse; +exports.video = MotionVideo; +exports.view = MotionView; +exports.wbr = MotionWbr; +exports.webview = MotionWebview; +//# sourceMappingURL=m.js.map diff --git a/node_modules/framer-motion/dist/cjs/m.js.map b/node_modules/framer-motion/dist/cjs/m.js.map new file mode 100644 index 00000000..02a22d01 --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/m.js.map @@ -0,0 +1 @@ +{"version":3,"file":"m.js","sources":["../../src/context/LayoutGroupContext.ts","../../src/context/LazyContext.ts","../../src/context/MotionConfigContext.tsx","../../src/context/MotionContext/index.ts","../../src/context/MotionContext/utils.ts","../../src/context/MotionContext/create.ts","../../src/render/html/utils/create-render-state.ts","../../src/render/html/use-props.ts","../../src/render/svg/utils/create-render-state.ts","../../src/render/svg/use-props.ts","../../src/motion/utils/valid-prop.ts","../../src/render/dom/utils/filter-props.ts","../../src/render/svg/lowercase-elements.ts","../../src/render/dom/utils/is-svg-component.ts","../../src/render/dom/use-render.ts","../../src/context/PresenceContext.ts","../../src/utils/use-constant.ts","../../src/motion/utils/use-visual-state.ts","../../src/render/html/use-html-visual-state.ts","../../src/render/svg/use-svg-visual-state.ts","../../src/utils/is-browser.ts","../../src/motion/features/definitions.ts","../../src/motion/utils/symbol.ts","../../src/motion/utils/use-motion-ref.ts","../../src/context/SwitchLayoutGroupContext.ts","../../src/utils/is-ref-object.ts","../../src/utils/use-isomorphic-effect.ts","../../src/motion/utils/use-visual-element.ts","../../src/motion/index.tsx","../../src/render/components/m/create.ts","../../src/render/components/m/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { NodeGroup } from \"motion-dom\"\n\nexport interface LayoutGroupContextProps {\n id?: string\n group?: NodeGroup\n forceRender?: VoidFunction\n}\n\nexport const LayoutGroupContext = createContext({})\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n","\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n","import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n","\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n","import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n","\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n","import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n","\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n","import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n","import type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n","import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n","\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n","\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n","\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n","\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n","\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n","export const isBrowser = typeof window !== \"undefined\"\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n","\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n","\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n","import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n","\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n","\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n","\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { isBrowser } from \"../utils/is-browser\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps

[\"children\"]\n : MotionComponentProps

[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n","import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { DOMMotionComponents } from \"../../dom/types\"\n\nexport function createMinimalMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(Component, options)\n}\n","\"use client\"\n\nimport { createMinimalMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\")\nexport const MotionAddress =\n /*@__PURE__*/ createMinimalMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\")\nexport const MotionArticle =\n /*@__PURE__*/ createMinimalMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMinimalMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\")\nexport const MotionCaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\")\nexport const MotionColgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\")\nexport const MotionDatalist =\n /*@__PURE__*/ createMinimalMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\")\nexport const MotionDetails =\n /*@__PURE__*/ createMinimalMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\")\nexport const MotionFieldset =\n /*@__PURE__*/ createMinimalMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\")\nexport const MotionMenuitem =\n /*@__PURE__*/ createMinimalMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\")\nexport const MotionOptgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\")\nexport const MotionPicture =\n /*@__PURE__*/ createMinimalMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\")\nexport const MotionProgress =\n /*@__PURE__*/ createMinimalMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\")\nexport const MotionSection =\n /*@__PURE__*/ createMinimalMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\")\nexport const MotionSummary =\n /*@__PURE__*/ createMinimalMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\")\nexport const MotionTextarea =\n /*@__PURE__*/ createMinimalMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\")\nexport const MotionWebview =\n /*@__PURE__*/ createMinimalMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate =\n /*@__PURE__*/ createMinimalMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\")\nexport const MotionEllipse =\n /*@__PURE__*/ createMinimalMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\")\nexport const MotionMetadata =\n /*@__PURE__*/ createMinimalMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\")\nexport const MotionPattern =\n /*@__PURE__*/ createMinimalMotionComponent(\"pattern\")\nexport const MotionPolygon =\n /*@__PURE__*/ createMinimalMotionComponent(\"polygon\")\nexport const MotionPolyline =\n /*@__PURE__*/ createMinimalMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\")\nexport const MotionClipPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"clipPath\")\nexport const MotionFeBlend =\n /*@__PURE__*/ createMinimalMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\")\nexport const MotionFeComposite =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFlood\")\nexport const MotionFeFuncA =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage =\n /*@__PURE__*/ createMinimalMotionComponent(\"feImage\")\nexport const MotionFeMerge =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\")\nexport const MotionFeOffset =\n /*@__PURE__*/ createMinimalMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\")\nexport const MotionTextPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"textPath\")\n"],"names":["createContext","isControllingVariants","isVariantLabel","useContext","useMemo","isMotionValue","isForcedMotionValue","buildHTMLStyles","buildSVGAttrs","isSVGTag","Fragment","createElement","useRef","resolveMotionValue","checkIsControllingVariants","checkIsVariantNode","isAnimationControls","resolveVariantFromProps","scrapeHTMLMotionValuesFromProps","scrapeSVGMotionValuesFromProps","setFeatureDefinitions","getFeatureDefinitions","useInsertionEffect","useCallback","useLayoutEffect","useEffect","optimizedAppearDataAttribute","_jsxs","_jsx","forwardRef","warning","invariant"],"mappings":";;;;;;;;;AAWO,MAAM,kBAAkB,GAAGA,mBAAa,CAA0B,EAAE,CAAC;;ACDrE,MAAM,WAAW,GAAGA,mBAAa,CAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;AC+C7E;;AAEG;AACI,MAAM,mBAAmB,GAAGA,mBAAa,CAAsB;AAClE,IAAA,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC;AAC5B,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,aAAa,EAAE,OAAO;AACzB,CAAA,CAAC;;ACrDK,MAAM,aAAa,mBAAmBA,mBAAa,CACtD,EAAE,CACL;;ACTe,SAAA,sBAAsB,CAClC,KAAkB,EAClB,OAA2B,EAAA;AAE3B,IAAA,IAAIC,+BAAqB,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAA,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;QAClC,OAAO;YACH,OAAO,EACH,OAAO,KAAK,KAAK,IAAIC,wBAAc,CAAC,OAAO,CAAC;AAC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BAA4B,CAAC,UAAU,EAAC;MAC7C,kBAAkB;AAC3B,cAAc,4BAA4B,CAAC,cAAc,EAAC;MACjD,wBAAwB;AACjC,cAAc,4BAA4B,CAAC,oBAAoB,EAAC;MACvD,iBAAiB;AAC1B,cAAc,4BAA4B,CAAC,aAAa,EAAC;AAChD,MAAA,YAAY,iBAAiB,4BAA4B,CAAC,QAAQ,EAAC;MACnE,kBAAkB;AAC3B,cAAc,4BAA4B,CAAC,cAAc,EAAC;MACjD,mBAAmB;AAC5B,cAAc,4BAA4B,CAAC,eAAe,EAAC;MAClD,oBAAoB;AAC7B,cAAc,4BAA4B,CAAC,gBAAgB,EAAC;MACnD,oBAAoB;AAC7B,cAAc,4BAA4B,CAAC,gBAAgB,EAAC;MACnD,cAAc;AACvB,cAAc,4BAA4B,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/cjs/mini.js b/node_modules/framer-motion/dist/cjs/mini.js new file mode 100644 index 00000000..d00b5e1e --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/mini.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var react = require('react'); +var motionDom = require('motion-dom'); +var motionUtils = require('motion-utils'); + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + const ref = react.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +function useUnmountEffect(callback) { + return react.useEffect(() => () => callback(), []); +} + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = motionDom.resolveElements(elementOrSelector, scope); + const numElements = elements.length; + motionUtils.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...motionDom.getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = motionDom.getAnimationMap(element); + const key = motionDom.animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = motionDom.getComputedStyle(element, name); + } + motionDom.fillWildcards(unresolvedKeyframes); + motionDom.applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(motionDom.getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new motionDom.NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new motionDom.GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; + +function useAnimateMini() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; +} + +exports.useAnimate = useAnimateMini; +//# sourceMappingURL=mini.js.map diff --git a/node_modules/framer-motion/dist/cjs/mini.js.map b/node_modules/framer-motion/dist/cjs/mini.js.map new file mode 100644 index 00000000..1f6af1ef --- /dev/null +++ b/node_modules/framer-motion/dist/cjs/mini.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mini.js","sources":["../../src/utils/use-constant.ts","../../src/utils/use-unmount-effect.ts","../../src/animation/animators/waapi/animate-elements.ts","../../src/animation/animators/waapi/animate-style.ts","../../src/animation/hooks/use-animate-style.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n","\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n","import {\n animationMapKey,\n AnimationPlaybackControls,\n AnimationScope,\n applyPxDefaults,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n fillWildcards,\n getAnimationMap,\n getComputedStyle,\n getValueTransition,\n NativeAnimation,\n NativeAnimationOptions,\n resolveElements,\n UnresolvedValueKeyframe,\n ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n map: Map>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\n keyframes?: ValueKeyframe[]\n }\n}\n\nexport function animateElements(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return []\n }\n\n const elements = resolveElements(elementOrSelector, scope) as Array<\n HTMLElement | SVGElement\n >\n const numElements = elements.length\n\n invariant(\n Boolean(numElements),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions: AnimationDefinition[] = []\n\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i]\n const elementTransition: DynamicAnimationOptions = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements)\n }\n\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes]\n }\n\n const valueOptions = {\n ...getValueTransition(elementTransition as any, valueName),\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element)\n const key = animationMapKey(\n valueName,\n valueOptions.pseudoElement || \"\"\n )\n const currentAnimation = map.get(key)\n currentAnimation && currentAnimation.stop()\n\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten:\n !elementTransition.type && !elementTransition.ease,\n },\n })\n }\n }\n\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } =\n animationDefinitions[i]\n\n const { element, name, pseudoElement } = animationOptions\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name)\n }\n\n fillWildcards(unresolvedKeyframes)\n applyPxDefaults(unresolvedKeyframes, name)\n\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name))\n }\n\n animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n }\n\n /**\n * Step 3: Create new animations (write)\n */\n const animations: AnimationPlaybackControls[] = []\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i]\n const animation = new NativeAnimation(\n animationOptions as NativeAnimationOptions\n )\n\n map.set(key, animation)\n animation.finished.finally(() => map.delete(key))\n\n animations.push(animation)\n }\n\n return animations\n}\n","import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n","\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":["useRef","useEffect","resolveElements","invariant","getValueTransition","secondsToMilliseconds","getAnimationMap","animationMapKey","getComputedStyle","fillWildcards","applyPxDefaults","NativeAnimation","GroupAnimationWithThen"],"mappings":";;;;;;;;AAMA;;;;;;AAMG;AACG,SAAU,WAAW,CAAI,IAAa,EAAA;AACxC,IAAA,MAAM,GAAG,GAAGA,YAAM,CAAW,IAAI,CAAC,CAAA;AAElC,IAAA,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI,EAAE;AACtB,QAAA,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE,CAAA;KACvB;IAED,OAAO,GAAG,CAAC,OAAO,CAAA;AACtB;;ACjBM,SAAU,gBAAgB,CAAC,QAAoB,EAAA;AACjD,IAAA,OAAOC,eAAS,CAAC,MAAM,MAAM,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAA;AAChD;;ACuBM,SAAU,eAAe,CAC3B,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EACjC,KAAsB,EAAA;;AAGtB,IAAA,IAAI,iBAAiB,IAAI,IAAI,EAAE;AAC3B,QAAA,OAAO,EAAE,CAAA;KACZ;IAED,MAAM,QAAQ,GAAGC,yBAAe,CAAC,iBAAiB,EAAE,KAAK,CAExD,CAAA;AACD,IAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAA;IAEnCC,qBAAS,CACL,OAAO,CAAC,WAAW,CAAC,EACpB,6BAA6B,EAC7B,mBAAmB,CACtB,CAAA;AAED;;;;;;;;;;;;;;;;AAgBG;IACH,MAAM,oBAAoB,GAA0B,EAAE,CAAA;AAEtD;;AAEG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;AAClC,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC3B,QAAA,MAAM,iBAAiB,GAA4B,EAAE,GAAG,OAAO,EAAE,CAAA;AAEjE;;AAEG;AACH,QAAA,IAAI,OAAO,iBAAiB,CAAC,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SAAS,CAAC,CAAA;AACvB,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAEjD,QAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;KAC7B;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;ACnKO,MAAM,wBAAwB,GAAG,CAAC,KAAsB,KAAI;AAC/D,IAAA,SAAS,aAAa,CAClB,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EAAA;AAEjC,QAAA,OAAO,IAAIC,gCAAsB,CAC7B,eAAe,CACX,iBAAiB,EACjB,SAAmC,EACnC,OAAO,EACP,KAAK,CACR,CACJ,CAAA;KACJ;AAED,IAAA,OAAO,aAAa,CAAA;AACxB,CAAC;;SCpBe,cAAc,GAAA;AAC1B,IAAA,MAAM,KAAK,GAAsB,WAAW,CAAC,OAAO;QAChD,OAAO,EAAE,IAAK;AACd,QAAA,UAAU,EAAE,EAAE;AACjB,KAAA,CAAC,CAAC,CAAA;AAEH,IAAA,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;IAElE,gBAAgB,CAAC,MAAK;AAClB,QAAA,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;AAC7D,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,CAAC,KAAK,EAAE,OAAO,CAAwC,CAAA;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/debug.d.ts b/node_modules/framer-motion/dist/debug.d.ts new file mode 100644 index 00000000..a4901bc1 --- /dev/null +++ b/node_modules/framer-motion/dist/debug.d.ts @@ -0,0 +1,2 @@ +export * from 'motion-dom'; +export { recordStats } from 'motion-dom'; diff --git a/node_modules/framer-motion/dist/dom-mini.d.ts b/node_modules/framer-motion/dist/dom-mini.d.ts new file mode 100644 index 00000000..0251be24 --- /dev/null +++ b/node_modules/framer-motion/dist/dom-mini.d.ts @@ -0,0 +1,55 @@ +import { AnimationPlaybackOptions, Transition, MotionValue, UnresolvedValueKeyframe, ElementOrSelector, DOMKeyframesDefinition, AnimationOptions, GroupAnimationWithThen, AnimationPlaybackControlsWithThen } from 'motion-dom'; + +type ObjectTarget = { + [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; +}; +type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; +type SequenceLabel = string; +interface SequenceLabelWithTime { + name: SequenceLabel; + at: SequenceTime; +} +interface At { + at?: SequenceTime; +} +type MotionValueSegment = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[] +]; +type MotionValueSegmentWithTransition = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + Transition & At +]; +type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; +type DOMSegmentWithTransition = [ + ElementOrSelector, + DOMKeyframesDefinition, + AnimationOptions & At +]; +type ObjectSegment = [O, ObjectTarget]; +type ObjectSegmentWithTransition = [ + O, + ObjectTarget, + AnimationOptions & At +]; +type SequenceProgressCallback = (value: any) => void; +type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, AnimationOptions & At] | [ + SequenceProgressCallback, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + AnimationOptions & At +]; +type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; +type AnimationSequence = Segment[]; +interface SequenceOptions extends AnimationPlaybackOptions { + delay?: number; + duration?: number; + defaultTransition?: Transition; + reduceMotion?: boolean; +} + +declare function animateSequence(definition: AnimationSequence, options?: SequenceOptions): GroupAnimationWithThen; + +declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; + +export { animateMini as animate, animateSequence }; diff --git a/node_modules/framer-motion/dist/dom-mini.js b/node_modules/framer-motion/dist/dom-mini.js new file mode 100644 index 00000000..303a9d3f --- /dev/null +++ b/node_modules/framer-motion/dist/dom-mini.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const i=t=>t,s=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},o=t=>1e3*t,a=t=>t/1e3;function r(t,e){return n=t,Array.isArray(n)&&"number"!=typeof n[0]?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t;var n}const l=(t,e,n)=>t+(e-t)*n,u=2e4;function h(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(function(t){let e=0,n=t.next(e);for(;!n.done&&e=u?1/0:e}(i),u);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:a(s)}}function c(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=s(0,e,i);t.push(l(n,1,o))}}function f(t){const e=[0];return c(e,t.length-1),e}const d=t=>null!==t;class m{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function p(t){for(let e=1;et.startsWith("--");const y={};function A(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>y[e]??n()}const T=A(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),b=A(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),v=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,k={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v([0,.65,.55,1]),circOut:v([.55,0,1,.45]),backIn:v([.31,.01,.66,-.59]),backOut:v([.33,1.53,.69,.99])};function S(t,e){return t?"function"==typeof t?b()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?v(t):Array.isArray(t)?t.map(t=>S(t,e)||k.easeOut):k[t]:void 0}function E(t){return"function"==typeof t&&"applyToOptions"in t}class w extends m{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:r,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return E(t)&&b()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const c=S(r,s);Array.isArray(c)&&(h.easing=c);const f={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(h,f)}(e,i,s,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(d),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(s,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){g(e)?t.style.setProperty(e,n):t.style[e]=n}(e,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return a(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+a(t)}get time(){return a(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=o(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&T()?(this.animation.timeline=t,i):e(this)}}class M{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return B(this.animations,"duration")}get iterationDuration(){return B(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function B(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class x extends M{then(t,e){return this.finished.finally(t).then(()=>{})}}const I=new WeakMap,O=(t,e="")=>`${t}:${e}`;function R(t){const e=I.get(t)||new Map;return I.set(t,e),e}function F(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const W=t=>Boolean(t&&t.getVelocity),P=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function $(t,e){for(let n=0;nnull!=t)}function V(t,e){const n=window.getComputedStyle(t);return g(e)?n.getPropertyValue(e):n[e]}function L(t,e,n,i){return null==t?[]:"string"==typeof t&&function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?N(t,0,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function D(t,e,n){return t*(e+1)}function C(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function K(t,n,i,s,o,a){!function(t,n,i){for(let s=0;sn&&o.at"number"==typeof t,G=t=>t.every(Y);function J(t,e,i,s){if(null==t)return[];const a=N(t),r=a.length;n(Boolean(r),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;te.delete(n)),u.push(s)}return u}const Q=(()=>function(t,e,n){return new x(J(t,e,n))})();t.animate=Q,t.animateSequence=function(t,e){const i=[];return function(t,{defaultTransition:e={},...i}={},a,l){const u=e.duration||.3,d=new Map,m=new Map,p={},g=new Map;let y=0,A=0,T=0;for(let i=0;i{const m=H(t),{delay:p=0,times:g=f(m),type:y=e.type||"keyframes",repeat:b,repeatType:k,repeatDelay:S=0,...w}=i;let{ease:M=e.ease||"easeOut",duration:B}=i;const x="function"==typeof p?p(a,d):p,I=m.length,O=E(y)?y:l?.[y||"keyframes"];if(I<=2&&O){let t=100;if(2===I&&G(m)){const e=m[1]-m[0];t=Math.abs(e)}const n={...e,...w};void 0!==B&&(n.duration=o(B));const i=h(n,t,O);M=i.ease,B=i.duration}B??(B=u);const R=A+x;1===g.length&&0===g[0]&&(g[1]=1);const F=g.length-m.length;if(F>0&&c(g,F),1===m.length&&m.unshift(null),b){n(b<20,"Repeat count too high, must be less than 20","repeat-count-high"),B=D(B,b);const t=[...m],e=[...g];M=Array.isArray(M)?[...M]:[M];const i=[...M];for(let n=0;n{for(const o in t){const a=t[o];a.sort(j);const r=[],l=[],u=[];for(let t=0;t{i.push(...J(n,t,e))}),new x(i)}}); diff --git a/node_modules/framer-motion/dist/dom.d.ts b/node_modules/framer-motion/dist/dom.d.ts new file mode 100644 index 00000000..0b504679 --- /dev/null +++ b/node_modules/framer-motion/dist/dom.d.ts @@ -0,0 +1,289 @@ +import { UnresolvedValueKeyframe, MotionValue, Transition, ElementOrSelector, DOMKeyframesDefinition, AnimationOptions, AnimationPlaybackOptions, AnyResolvedKeyframe, AnimationPlaybackControlsWithThen, ValueAnimationTransition, AnimationScope, AnimationPlaybackControls } from 'motion-dom'; +export * from 'motion-dom'; +export { DelayedFunction, delayInSeconds as delay } from 'motion-dom'; +import { Easing, EasingFunction, Point } from 'motion-utils'; +export * from 'motion-utils'; + +type ObjectTarget = { + [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; +}; +type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; +type SequenceLabel = string; +interface SequenceLabelWithTime { + name: SequenceLabel; + at: SequenceTime; +} +interface At { + at?: SequenceTime; +} +type MotionValueSegment = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[] +]; +type MotionValueSegmentWithTransition = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + Transition & At +]; +type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; +type DOMSegmentWithTransition = [ + ElementOrSelector, + DOMKeyframesDefinition, + AnimationOptions & At +]; +type ObjectSegment = [O, ObjectTarget]; +type ObjectSegmentWithTransition = [ + O, + ObjectTarget, + AnimationOptions & At +]; +type SequenceProgressCallback = (value: any) => void; +type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, AnimationOptions & At] | [ + SequenceProgressCallback, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + AnimationOptions & At +]; +type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; +type AnimationSequence = Segment[]; +interface SequenceOptions extends AnimationPlaybackOptions { + delay?: number; + duration?: number; + defaultTransition?: Transition; + reduceMotion?: boolean; +} +interface AbsoluteKeyframe { + value: AnyResolvedKeyframe | null; + at: number; + easing?: Easing; +} +type ValueSequence = AbsoluteKeyframe[]; +interface SequenceMap { + [key: string]: ValueSequence; +} +type ResolvedAnimationDefinition = { + keyframes: { + [key: string]: UnresolvedValueKeyframe[]; + }; + transition: { + [key: string]: Transition; + }; +}; +type ResolvedAnimationDefinitions = Map; + +interface ScopedAnimateOptions { + scope?: AnimationScope; + reduceMotion?: boolean; +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +declare function createScopedAnimate(options?: ScopedAnimateOptions): { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; +declare const animate: { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; + +declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; + +interface ScrollOptions { + source?: HTMLElement; + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; +} +type OnScrollProgress = (progress: number) => void; +type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void; +type OnScroll = OnScrollProgress | OnScrollWithInfo; +interface AxisScrollInfo { + current: number; + offset: number[]; + progress: number; + scrollLength: number; + velocity: number; + targetOffset: number; + targetLength: number; + containerLength: number; + interpolatorOffsets?: number[]; + interpolate?: EasingFunction; +} +interface ScrollInfo { + time: number; + x: AxisScrollInfo; + y: AxisScrollInfo; +} +type OnScrollInfo = (info: ScrollInfo) => void; +type SupportedEdgeUnit = "px" | "vw" | "vh" | "%"; +type EdgeUnit = `${number}${SupportedEdgeUnit}`; +type NamedEdges = "start" | "end" | "center"; +type EdgeString = NamedEdges | EdgeUnit | `${number}`; +type Edge = EdgeString | number; +type ProgressIntersection = [number, number]; +type Intersection = `${Edge} ${Edge}`; +type ScrollOffset = Array; +interface ScrollInfoOptions { + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; + /** + * When true, enables per-frame checking of scrollWidth/scrollHeight + * to detect content size changes and recalculate scroll progress. + * + * @default false + */ + trackContentSize?: boolean; +} + +declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, container, ...options }?: ScrollOptions): VoidFunction; + +declare function scrollInfo(onScroll: OnScrollInfo, { container, trackContentSize, ...options }?: ScrollInfoOptions): VoidFunction; + +type ViewChangeHandler = (entry: IntersectionObserverEntry) => void; +type MarginValue = `${number}${"px" | "%"}`; +type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`; +interface InViewOptions { + root?: Element | Document; + margin?: MarginType; + amount?: "some" | "all" | number; +} +declare function inView(elementOrSelector: ElementOrSelector, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction; + +interface HTMLElements { + a: HTMLAnchorElement; + abbr: HTMLElement; + address: HTMLElement; + area: HTMLAreaElement; + article: HTMLElement; + aside: HTMLElement; + audio: HTMLAudioElement; + b: HTMLElement; + base: HTMLBaseElement; + bdi: HTMLElement; + bdo: HTMLElement; + big: HTMLElement; + blockquote: HTMLQuoteElement; + body: HTMLBodyElement; + br: HTMLBRElement; + button: HTMLButtonElement; + canvas: HTMLCanvasElement; + caption: HTMLElement; + center: HTMLElement; + cite: HTMLElement; + code: HTMLElement; + col: HTMLTableColElement; + colgroup: HTMLTableColElement; + data: HTMLDataElement; + datalist: HTMLDataListElement; + dd: HTMLElement; + del: HTMLModElement; + details: HTMLDetailsElement; + dfn: HTMLElement; + dialog: HTMLDialogElement; + div: HTMLDivElement; + dl: HTMLDListElement; + dt: HTMLElement; + em: HTMLElement; + embed: HTMLEmbedElement; + fieldset: HTMLFieldSetElement; + figcaption: HTMLElement; + figure: HTMLElement; + footer: HTMLElement; + form: HTMLFormElement; + h1: HTMLHeadingElement; + h2: HTMLHeadingElement; + h3: HTMLHeadingElement; + h4: HTMLHeadingElement; + h5: HTMLHeadingElement; + h6: HTMLHeadingElement; + head: HTMLHeadElement; + header: HTMLElement; + hgroup: HTMLElement; + hr: HTMLHRElement; + html: HTMLHtmlElement; + i: HTMLElement; + iframe: HTMLIFrameElement; + img: HTMLImageElement; + input: HTMLInputElement; + ins: HTMLModElement; + kbd: HTMLElement; + keygen: HTMLElement; + label: HTMLLabelElement; + legend: HTMLLegendElement; + li: HTMLLIElement; + link: HTMLLinkElement; + main: HTMLElement; + map: HTMLMapElement; + mark: HTMLElement; + menu: HTMLElement; + menuitem: HTMLElement; + meta: HTMLMetaElement; + meter: HTMLMeterElement; + nav: HTMLElement; + noindex: HTMLElement; + noscript: HTMLElement; + object: HTMLObjectElement; + ol: HTMLOListElement; + optgroup: HTMLOptGroupElement; + option: HTMLOptionElement; + output: HTMLOutputElement; + p: HTMLParagraphElement; + param: HTMLParamElement; + picture: HTMLElement; + pre: HTMLPreElement; + progress: HTMLProgressElement; + q: HTMLQuoteElement; + rp: HTMLElement; + rt: HTMLElement; + ruby: HTMLElement; + s: HTMLElement; + samp: HTMLElement; + search: HTMLElement; + slot: HTMLSlotElement; + script: HTMLScriptElement; + section: HTMLElement; + select: HTMLSelectElement; + small: HTMLElement; + source: HTMLSourceElement; + span: HTMLSpanElement; + strong: HTMLElement; + style: HTMLStyleElement; + sub: HTMLElement; + summary: HTMLElement; + sup: HTMLElement; + table: HTMLTableElement; + template: HTMLTemplateElement; + tbody: HTMLTableSectionElement; + td: HTMLTableDataCellElement; + textarea: HTMLTextAreaElement; + tfoot: HTMLTableSectionElement; + th: HTMLTableHeaderCellElement; + thead: HTMLTableSectionElement; + time: HTMLTimeElement; + title: HTMLTitleElement; + tr: HTMLTableRowElement; + track: HTMLTrackElement; + u: HTMLElement; + ul: HTMLUListElement; + var: HTMLElement; + video: HTMLVideoElement; + wbr: HTMLElement; + webview: HTMLWebViewElement; +} + +declare const distance: (a: number, b: number) => number; +declare function distance2D(a: Point, b: Point): number; + +export { type AbsoluteKeyframe, type AnimationSequence, type At, type DOMSegment, type DOMSegmentWithTransition, type FunctionSegment, type HTMLElements, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type Segment, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceProgressCallback, type SequenceTime, type ValueSequence, animate, animateMini, createScopedAnimate, distance, distance2D, inView, scroll, scrollInfo }; diff --git a/node_modules/framer-motion/dist/dom.js b/node_modules/framer-motion/dist/dom.js new file mode 100644 index 00000000..dd8b9cec --- /dev/null +++ b/node_modules/framer-motion/dist/dom.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(s(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(s(e,n))});const o={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function a(t){return"object"==typeof t&&null!==t}const l=t=>/^0[^.\s]+$/u.test(t);function c(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(t,e)=>n=>e(t(n)),d=(...t)=>t.reduce(h),p=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class m{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,y=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const v=new Set;const x=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},T=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function w(t,e,n,i){if(t===e&&n===i)return u;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=T(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:T(s(t),e,i)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),A=w(.33,1.53,.69,.99),V=S(A),P=b(V),E=t=>(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),M=t=>1-Math.sin(Math.acos(t)),k=S(M),D=b(M),R=w(.42,0,1,1),B=w(0,0,.58,1),C=w(.42,0,.58,1);const j=t=>Array.isArray(t)&&"number"!=typeof t[0];function L(t,e){return j(t)?t[x(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],F={linear:u,easeIn:R,easeInOut:C,easeOut:B,circIn:M,circInOut:D,circOut:k,backIn:V,backInOut:P,backOut:A,anticipate:E},I=e=>{if(O(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,o]=e;return w(n,i,s,o)}return"string"==typeof e?(t.invariant(void 0!==F[e],`Invalid easing type '${e}'`,"invalid-easing-type"),F[e]):e},W=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],N={value:null,addProjectionMetrics:null};function U(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=W.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(c),e&&N.value&&N.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(r,e?n:void 0),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,y=()=>{const r=o.useManualTiming?s.timestamp:performance.now();n=!1,o.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(y))};return{schedule:W.reduce((e,o)=>{const r=a[o];return e[o]=(e,o=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(y)),r.schedule(e,o,a)),e},{}),cancel:t=>{for(let e=0;e(void 0===X&&G.set(K.isProcessing||o.useManualTiming?K.timestamp:performance.now()),X),set:t=>{X=t,queueMicrotask(H)}},q={layout:0,mainThread:0,waapi:0},Z=t=>e=>"string"==typeof e&&e.startsWith(t),_=Z("--"),J=Z("var(--"),Q=t=>!!J(t)&&tt.test(t.split("/*")[0].trim()),tt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function et(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const nt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},it={...nt,transform:t=>i(0,1,t)},st={...nt,default:1},ot=t=>Math.round(1e5*t)/1e5,rt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const at=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lt=(t,e)=>n=>Boolean("string"==typeof n&&at.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(rt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},ut={...nt,transform:t=>Math.round((t=>i(0,255,t))(t))},ht={test:lt("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ut.transform(t)+", "+ut.transform(e)+", "+ut.transform(n)+", "+ot(it.transform(i))+")"};const dt={test:lt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ht.transform},pt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),mt=pt("deg"),ft=pt("%"),yt=pt("px"),gt=pt("vh"),vt=pt("vw"),xt=(()=>({...ft,parse:t=>ft.parse(t)/100,transform:t=>ft.transform(100*t)}))(),Tt={test:lt("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ft.transform(ot(e))+", "+ft.transform(ot(n))+", "+ot(it.transform(i))+")"},wt={test:t=>ht.test(t)||dt.test(t)||Tt.test(t),parse:t=>ht.test(t)?ht.parse(t):Tt.test(t)?Tt.parse(t):dt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ht.transform(t):Tt.transform(t),getAnimatableNone:t=>{const e=wt.parse(t);return e.alpha=0,wt.transform(e)}},bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const St="number",At="color",Vt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Vt,t=>(wt.test(t)?(i.color.push(o),s.push(At),n.push(wt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(St),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Et(t){return Pt(t).values}function Mt(t){const{split:e,types:n}=Pt(t),i=e.length;return t=>{let s="";for(let o=0;o"number"==typeof t?0:wt.test(t)?wt.getAnimatableNone(t):t;const Dt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(rt)?.length||0)+(t.match(bt)?.length||0)>0},parse:Et,createTransformer:Mt,getAnimatableNone:function(t){const e=Et(t);return Mt(t)(e.map(kt))}};function Rt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Bt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Rt(a,i,t+1/3),o=Rt(a,i,t),r=Rt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Ct(t,e){return n=>n>0?e:t}const jt=(t,e,n)=>t+(e-t)*n,Lt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Ot=[dt,ht,Tt];function Ft(e){const n=(i=e,Ot.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===Tt&&(s=Bt(s)),s}const It=(t,e)=>{const n=Ft(t),i=Ft(e);if(!n||!i)return Ct(t,e);const s={...n};return t=>(s.red=Lt(n.red,i.red,t),s.green=Lt(n.green,i.green,t),s.blue=Lt(n.blue,i.blue,t),s.alpha=jt(n.alpha,i.alpha,t),ht.transform(s))},Wt=new Set(["none","hidden"]);function Nt(t,e){return Wt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Ut(t,e){return n=>jt(t,e,n)}function $t(t){return"number"==typeof t?Ut:"string"==typeof t?Q(t)?Ct:wt.test(t)?It:Yt:Array.isArray(t)?zt:"object"==typeof t?wt.test(t)?It:Kt:Ct}function zt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>$t(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Yt=(e,n)=>{const i=Dt.createTransformer(n),s=Pt(e),o=Pt(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Wt.has(e)&&!o.values.length||Wt.has(n)&&!s.values.length?Nt(e,n):d(zt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>z(e),now:()=>K.isProcessing?K.timestamp:G.now()}},Gt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=qt?1/0:e}function _t(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Zt(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}function Jt(t,e,n){const i=Math.max(e-5,0);return g(n-t(i),e-i)}const Qt=100,te=10,ee=1,ne=0,ie=800,se=.3,oe=.3,re={granular:.01,default:2},ae={granular:.005,default:.5},le=.01,ce=10,ue=.05,he=1,de=.001;function pe({duration:e=ie,bounce:n=se,velocity:s=ne,mass:o=ee}){let r,a;t.warning(e<=f(ce),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=i(ue,he,l),e=i(le,ce,y(e)),l<1?(r=t=>{const n=t*l,i=n*e,o=n-s,r=fe(t,l),a=Math.exp(-i);return de-o/r*a},a=t=>{const n=t*l*e,i=n*s+s,o=Math.pow(l,2)*Math.pow(t,2)*e,a=Math.exp(-n),c=fe(Math.pow(t,2),l);return(-r(t)+de>0?-1:1)*((i-o)*a)/c}):(r=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(s-t)));const c=function(t,e,n){let i=n;for(let n=1;nvoid 0!==t[e])}function xe(t=oe,e=se){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:o}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:ne,stiffness:Qt,damping:te,mass:ee,isResolvedFromDuration:!1,...t};if(!ve(t,ge)&&ve(t,ye))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),o=s*s,r=2*i(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:ee,stiffness:o,damping:r}}else{const n=pe(t);e={...e,...n,mass:ee},e.isResolvedFromDuration=!0}return e}({...n,velocity:-y(n.velocity||0)}),g=p||0,v=u/(2*Math.sqrt(c*h)),x=a-r,T=y(Math.sqrt(c/h)),w=Math.abs(x)<5;let b;if(s||(s=w?re.granular:re.default),o||(o=w?ae.granular:ae.default),v<1){const t=fe(T,v);b=e=>{const n=Math.exp(-v*T*e);return a-n*((g+v*T*x)/t*Math.sin(t*e)+x*Math.cos(t*e))}}else if(1===v)b=t=>a-Math.exp(-T*t)*(x+(g+T*x)*t);else{const t=T*Math.sqrt(v*v-1);b=e=>{const n=Math.exp(-v*T*e),i=Math.min(t*e,300);return a-n*((g+v*T*x)*Math.sinh(i)+t*x*Math.cosh(i))/t}}const S={calculatedDuration:m&&d||null,next:t=>{const e=b(t);if(m)l.done=t>=d;else{let n=0===t?g:0;v<1&&(n=0===t?f(g):Jt(b,t,e));const i=Math.abs(n)<=s,r=Math.abs(a-e)<=o;l.done=i&&r}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(Zt(S),qt),e=Gt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function Te({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,w=xe({keyframes:[d.value,p(d.value)],velocity:Jt(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function we(e,n,{clamp:s=!0,ease:r,mixer:a}={}){const l=e.length;if(t.invariant(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(t,e,n){const i=[],s=n||o.mix||Xt,r=t.length-1;for(let n=0;n{if(c&&t1)for(;if(i(e[0],e[l-1],t)):f}function be(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=p(0,e,i);t.push(jt(n,1,s))}}function Se(t){const e=[0];return be(e,t.length-1),e}function Ae(t,e){return t.map(t=>t*e)}function Ve(t,e){return t.map(()=>e||C).splice(0,t.length-1)}function Pe({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=j(i)?i.map(I):I(i),o={done:!1,value:e[0]},r=we(Ae(n&&n.length===e.length?n:Se(e),t),e,{ease:Array.isArray(s)?s:Ve(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}xe.applyToOptions=t=>{const e=_t(t,100,xe);return t.ease=e.ease,t.duration=f(e.duration),t.type="keyframes",t};const Ee=t=>null!==t;function Me(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Ee),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const ke={decay:Te,inertia:Te,tween:Pe,keyframes:Pe,spring:xe};function De(t){"string"==typeof t.type&&(t.type=ke[t.type])}class Re{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Be=t=>t/100;class Ce extends Re{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},q.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;De(t);const{type:e=Pe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Pe;a!==Pe&&"number"!=typeof r[0]&&(this.mixKeyframes=d(Be,Xt(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Zt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(T=r)),x=i(0,1,n)*a}const w=v?{done:!1,value:u[0]}:T.next(x);o&&(w.value=o(w.value));let{done:b}=w;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Te&&(w.value=Me(u,this.options,y,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=f(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(G.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Ht,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(G.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,q.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function je(t){for(let e=1;e180*t/Math.PI,Oe=t=>{const e=Le(Math.atan2(t[1],t[0]));return Ie(e)},Fe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Oe,rotateZ:Oe,skewX:t=>Le(Math.atan(t[1])),skewY:t=>Le(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ie=t=>((t%=360)<0&&(t+=360),t),We=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ne=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ue={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:We,scaleY:Ne,scale:t=>(We(t)+Ne(t))/2,rotateX:t=>Ie(Le(Math.atan2(t[6],t[5]))),rotateY:t=>Ie(Le(Math.atan2(-t[2],t[0]))),rotateZ:Oe,rotate:Oe,skewX:t=>Le(Math.atan(t[4])),skewY:t=>Le(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function $e(t){return t.includes("scale")?1:0}function ze(t,e){if(!t||"none"===t)return $e(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Ue,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Fe,s=e}if(!s)return $e(e);const o=i[e],r=s[1].split(",").map(Ye);return"function"==typeof o?o(r):r[o]}const Ke=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ze(n,e)};function Ye(t){return parseFloat(t.trim())}const Xe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],He=(()=>new Set(Xe))(),Ge=t=>t===nt||t===yt,qe=new Set(["x","y","z"]),Ze=Xe.filter(t=>!qe.has(t));const _e={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ze(e,"x"),y:(t,{transform:e})=>ze(e,"y")};_e.translateX=_e.x,_e.translateY=_e.y;const Je=new Set;let Qe=!1,tn=!1,en=!1;function nn(){if(tn){const t=Array.from(Je).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ze.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}tn=!1,Qe=!1,Je.forEach(t=>t.complete(en)),Je.clear()}function sn(){Je.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(tn=!0)})}function on(){en=!0,sn(),nn(),en=!1}class rn{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Je.add(this),Qe||(Qe=!0,$.read(sn),$.resolveKeyframes(nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}je(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Je.delete(this)}cancel(){"scheduled"===this.state&&(Je.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const an=t=>t.startsWith("--");function ln(t,e,n){an(e)?t.style.setProperty(e,n):t.style[e]=n}const cn={};function un(t,e){const n=c(t);return()=>cn[e]??n()}const hn=un(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),dn=un(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),pn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,mn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function fn(t,e){return t?"function"==typeof t?dn()?Gt(t,e):"ease-out":O(t)?pn(t):Array.isArray(t)?t.map(t=>fn(t,e)||mn.easeOut):mn[t]:void 0}function yn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=fn(a,s);Array.isArray(h)&&(u.easing=h),N.value&&q.waapi++;const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};c&&(d.pseudoElement=c);const p=t.animate(u,d);return N.value&&p.finished.finally(()=>{q.waapi--}),p}function gn(t){return"function"==typeof t&&"applyToOptions"in t}function vn({type:t,...e}){return gn(t)&&dn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class xn extends Re{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=vn(e);this.animation=yn(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Me(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):ln(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return y(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=f(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&hn()?(this.animation.timeline=t,u):e(this)}}const Tn={anticipate:E,backInOut:P,circInOut:D};function wn(t){"string"==typeof t.ease&&t.ease in Tn&&(t.ease=Tn[t.ease])}class bn extends xn{constructor(t){wn(t),De(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:o,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new Ce({...r,autoplay:!1}),l=Math.max(10,G.now()-this.startTime),c=i(0,10,l-10);e.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const Sn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Dt.test(t)&&"0"!==t||t.startsWith("url(")));function An(t){t.duration=0,t.type="keyframes"}const Vn=new Set(["opacity","clipPath","filter","transform"]),Pn=c(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function En(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Pn()&&n&&Vn.has(n)&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class Mn extends Re{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=G.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||rn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:h,onUpdate:d}=i;this.resolvedAt=G.now(),function(e,n,i,s){const o=e[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=Sn(o,n),l=Sn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!h&&En(p),f=p.motionValue?.owner?.current,y=m?new bn({...p,element:f}):new Ce(p);y.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),on()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class kn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Dn(this.animations,"duration")}get iterationDuration(){return Dn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Dn(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Rn extends kn{then(t,e){return this.finished.finally(t).then(()=>{})}}class Bn extends xn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Cn=new WeakMap,jn=(t,e="")=>`${t}:${e}`;function Ln(t){const e=Cn.get(t)||new Map;return Cn.set(t,e),e}function On(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const Fn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function In(t){const e=Fn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Wn(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=In(e);if(!s)return;const a=window.getComputedStyle(n).getPropertyValue(s);if(a){const t=a.trim();return r(t)?parseFloat(t):t}return Q(o)?Wn(o,n,i+1):o}const Nn={type:"spring",stiffness:500,damping:25,restSpeed:10},Un={type:"keyframes",duration:.8},$n={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},zn=(t,{keyframes:e})=>e.length>2?Un:He.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Nn:$n,Kn=t=>null!==t;function Yn(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(Kn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}function Xn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Hn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Xn(n,t):n}function Gn({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const qn=(t,e,n,i={},s,r)=>a=>{const l=Hn(i,t)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=f(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};Gn(l)||Object.assign(h,zn(t,h)),h.duration&&(h.duration=f(h.duration)),h.repeatDelay&&(h.repeatDelay=f(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(An(h),0===h.delay&&(d=!0)),(o.instantAnimations||o.skipAnimations||s?.shouldSkipAnimations)&&(d=!0,An(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){const t=Yn(h.keyframes,l);if(void 0!==t)return void $.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Ce(h):new Mn(h)};function Zn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function _n(t,e,n,i){if("function"==typeof e){const[s,o]=Zn(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Zn(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function Jn(t,e,n){const i=t.getProps();return _n(i,e,void 0!==n?n:i.custom,t)}const Qn=new Set(["width","height","top","left","right","bottom",...Xe]),ti={current:void 0};class ei{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=G.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=G.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new m);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ti.current&&ti.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ni(t,e){return new ei(t,e)}const ii=t=>Array.isArray(t);function si(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ni(n))}function oi(t){return ii(t)?t[t.length-1]||0:t}function ri(t,e){const n=Jn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){si(t,e,oi(o[e]))}}const ai=t=>Boolean(t&&t.getVelocity);function li(t){return Boolean(ai(t)&&t.add)}function ci(t,e){const n=t.getValue("willChange");if(li(n))return n.add(e);if(!n&&o.WillChange){const n=new o.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function ui(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const hi="framerAppearId",di="data-"+ui(hi);function pi(t){return t.props[di]}function mi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function fi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Xn(o,l):l;const c=o?.reduceMotion;i&&(o=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&mi(h,e))continue;const r={delay:n,...Hn(o||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating&&!Array.isArray(s)&&s===l&&!r.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=pi(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(r.startTime=t,d=!0)}}ci(t,e);const p=c??t.shouldReduceMotion;i.start(qn(e,i,s,p&&Qn.has(e)?{type:!1}:r,t,d));const m=i.animation;m&&u.push(m)}if(r){const e=()=>$.update(()=>{r&&ri(t,r)});u.length?Promise.all(u).then(e):e()}return u}function yi(t,e,n={}){const i=Jn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(fi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(yi(l,e,{...r,delay:n+("function"==typeof i?0:i)+On(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function gi(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>yi(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=yi(t,e,n);else{const s="function"==typeof e?Jn(t,e,n.custom):e;i=Promise.all(fi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const vi=t=>e=>e.test(t),xi=[nt,yt,ft,mt,vt,gt,{test:t=>"auto"===t,parse:t=>t}],Ti=t=>xi.find(vi(t));function wi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const bi=new Set(["brightness","contrast","saturate","opacity"]);function Si(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(rt)||[];if(!i)return t;const s=n.replace(i,"");let o=bi.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Ai=/\b([a-z-]*)\(.*?\)/gu,Vi={...Dt,getAnimatableNone:t=>{const e=t.match(Ai);return e?e.map(Si).join(" "):t}},Pi={...Dt,getAnimatableNone:t=>{const e=Dt.parse(t);return Dt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ei={...nt,transform:Math.round},Mi={rotate:mt,rotateX:mt,rotateY:mt,rotateZ:mt,scale:st,scaleX:st,scaleY:st,scaleZ:st,skew:mt,skewX:mt,skewY:mt,distance:yt,translateX:yt,translateY:yt,translateZ:yt,x:yt,y:yt,z:yt,perspective:yt,transformPerspective:yt,opacity:it,originX:xt,originY:xt,originZ:yt},ki={borderWidth:yt,borderTopWidth:yt,borderRightWidth:yt,borderBottomWidth:yt,borderLeftWidth:yt,borderRadius:yt,borderTopLeftRadius:yt,borderTopRightRadius:yt,borderBottomRightRadius:yt,borderBottomLeftRadius:yt,width:yt,maxWidth:yt,height:yt,maxHeight:yt,top:yt,right:yt,bottom:yt,left:yt,inset:yt,insetBlock:yt,insetBlockStart:yt,insetBlockEnd:yt,insetInline:yt,insetInlineStart:yt,insetInlineEnd:yt,padding:yt,paddingTop:yt,paddingRight:yt,paddingBottom:yt,paddingLeft:yt,paddingBlock:yt,paddingBlockStart:yt,paddingBlockEnd:yt,paddingInline:yt,paddingInlineStart:yt,paddingInlineEnd:yt,margin:yt,marginTop:yt,marginRight:yt,marginBottom:yt,marginLeft:yt,marginBlock:yt,marginBlockStart:yt,marginBlockEnd:yt,marginInline:yt,marginInlineStart:yt,marginInlineEnd:yt,fontSize:yt,backgroundPositionX:yt,backgroundPositionY:yt,...Mi,zIndex:Ei,fillOpacity:it,strokeOpacity:it,numOctaves:Ei},Di={...ki,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:Vi,WebkitFilter:Vi,mask:Pi,WebkitMask:Pi},Ri=t=>Di[t],Bi=new Set([Vi,Pi]);function Ci(t,e){let n=Ri(t);return Bi.has(n)||(n=Dt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ji=new Set(["auto","none","0"]);class Li extends rn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Oi=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function Fi(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Wi=new Set(["opacity","clipPath","filter","transform"]);function Ni(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ui(t){return(e,n)=>{const i=Ni(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const $i=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class zi{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const o=this.values.get(t);o&&o.onRemove();const r=()=>{const i=e.get();this.latest[t]=s?$i(i,ki[t]):i,n&&$.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&z(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function Ki(t){const e=new WeakMap,n=[];return(i,s)=>{const o=e.get(i)??new zi;e.set(i,o);for(const e in s){const r=s[e],a=t(i,o,e,r);n.push(a)}return()=>{for(const t of n)t()}}}const Yi=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?ui(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},Xi=Ui(Ki(Yi)),Hi=Ki((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function Gi(t){return a(t)&&"offsetHeight"in t}const qi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const Zi=new Set(["originX","originY","originZ"]),_i=(t,e,n,i)=>{let s,o;return He.has(n)?(e.get("transform")||(Gi(t)||e.get("transformBox")||_i(t,e,"transformBox",new ei("fill-box")),e.set("transform",new ei("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=an(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},Ji=Ui(Ki(_i));const Qi=Ui(Ki((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return $.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new ei("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Yi(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?_i:Yi)(t,e,n,i)}));const{schedule:ts,cancel:es}=U(queueMicrotask,!1),ns={x:!1,y:!1};function is(){return ns.x||ns.y}function ss(t,e){const n=Ni(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const os=(t,e)=>!!e&&(t===e||os(t,e.parentElement)),rs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,as=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ls(t){return as.has(t.tagName)||!0===t.isContentEditable}const cs=new Set(["INPUT","SELECT","TEXTAREA"]);const us=new WeakSet;function hs(t){return e=>{"Enter"===e.key&&t(e)}}function ds(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ps(t){return rs(t)&&!is()}const ms=new WeakSet;function fs(t,e){const n=window.getComputedStyle(t);return an(e)?n.getPropertyValue(e):n[e]}function ys(t){return a(t)&&"ownerSVGElement"in t}const gs=new WeakMap;let vs;const xs=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:ys(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ts=xs("inline","width","offsetWidth"),ws=xs("block","height","offsetHeight");function bs({target:t,borderBoxSize:e}){gs.get(t)?.forEach(n=>{n(t,{get width(){return Ts(t,e)},get height(){return ws(t,e)}})})}function Ss(t){t.forEach(bs)}function As(t,e){vs||"undefined"!=typeof ResizeObserver&&(vs=new ResizeObserver(Ss));const n=Ni(t);return n.forEach(t=>{let n=gs.get(t);n||(n=new Set,gs.set(t,n)),n.add(e),vs?.observe(t)}),()=>{n.forEach(t=>{const n=gs.get(t);n?.delete(e),n?.size||vs?.unobserve(t)})}}const Vs=new Set;let Ps;function Es(t){return Vs.add(t),Ps||(Ps=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Vs.forEach(e=>e(t))},window.addEventListener("resize",Ps)),()=>{Vs.delete(t),Vs.size||"function"!=typeof Ps||(window.removeEventListener("resize",Ps),Ps=void 0)}}function Ms(t,e){return"function"==typeof t?Es(t):As(t,e)}function ks(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return $.preUpdate(i,!0),()=>z(i)}function Ds(){const{value:t}=N;null!==t?(t.frameloop.rate.push(K.delta),t.animations.mainThread.push(q.mainThread),t.animations.waapi.push(q.waapi),t.animations.layout.push(q.layout)):z(Ds)}function Rs(t){return t.reduce((t,e)=>t+e,0)/t.length}function Bs(t,e=Rs){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Cs=t=>Math.round(1e3/t);function js(){N.value=null,N.addProjectionMetrics=null}function Ls(){const{value:t}=N;if(!t)throw new Error("Stats are not being measured");js(),z(Ds);const e={frameloop:{setup:Bs(t.frameloop.setup),rate:Bs(t.frameloop.rate),read:Bs(t.frameloop.read),resolveKeyframes:Bs(t.frameloop.resolveKeyframes),preUpdate:Bs(t.frameloop.preUpdate),update:Bs(t.frameloop.update),preRender:Bs(t.frameloop.preRender),render:Bs(t.frameloop.render),postRender:Bs(t.frameloop.postRender)},animations:{mainThread:Bs(t.animations.mainThread),waapi:Bs(t.animations.waapi),layout:Bs(t.animations.layout)},layoutProjection:{nodes:Bs(t.layoutProjection.nodes),calculatedTargetDeltas:Bs(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:Bs(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Cs(n.min),n.max=Cs(n.max),n.avg=Cs(n.avg),[n.min,n.max]=[n.max,n.min],e}function Os(t){return ys(t)&&"svg"===t.tagName}function Fs(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function Is(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=we(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function Ws(t,e){const n=ni(ai(t)?t.get():t);return Ns(n,t,e),n}function Ns(t,e,n={}){const i=t.get();let s,o=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{o&&(o.stop(),o=null)};if(t.attach((e,i)=>{r=e,s=t=>i(Us(t,a)),$.postRender(()=>{(()=>{l();const e=$s(t.get()),i=$s(r);e!==i&&(o=new Ce({keyframes:[e,i],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}))})(),t.events.animationStart?.notify(),o?.then(()=>{t.events.animationComplete?.notify()})})},l),ai(e)){const n=e.on("change",e=>t.set(Us(e,a))),i=t.on("destroy",n);return()=>{n(),i()}}return l}function Us(t,e){return e?t+e:t}function $s(t){return"number"==typeof t?t:parseFloat(t)}function zs(t){const e=[];ti.current=e;const n=t();ti.current=void 0;const i=ni(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>$.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),z(i)})}(e,i,t),i}const Ks=[...xi,wt,Dt],Ys=t=>Ks.find(vi(t));function Xs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let Hs={},Gs=null;const qs=(t,e)=>{Hs[t]=e},Zs=()=>{Gs||(Gs=document.createElement("style"),Gs.id="motion-view");let t="";for(const e in Hs){const n=Hs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}Gs.textContent=t,document.head.appendChild(Gs),Hs={}},_s=()=>{Gs&&Gs.parentElement&&Gs.parentElement.removeChild(Gs)};function Js(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Qs(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function to(){return document.getAnimations().filter(Qs)}const eo=["layout","enter","exit","new","old"];function no(t){const{update:e,targets:n,options:i}=t;if(!document.startViewTransition)return new Promise(async t=>{await e(),t(new kn([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||qs(":root",{"view-transition-name":"none"}),qs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Zs();const s=document.startViewTransition(async()=>{await e()});return s.finished.finally(()=>{_s()}),new Promise(t=>{s.ready.then(()=>{const e=to(),s=[];n.forEach((t,e)=>{for(const n of eo){if(!t[n])continue;const{keyframes:o,options:r}=t[n];for(let[t,a]of Object.entries(o)){if(!a)continue;const o={...Hn(i,t),...Hn(r,t)},l=Xs(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof o.delay&&(o.delay=o.delay(0,1)),o.duration&&(o.duration=f(o.duration)),o.delay&&(o.delay=f(o.delay));const c=new xn({...o,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});s.push(c)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Js(o);if(!r)continue;const a=n.get(r.layer);if(a)io(a,"enter")&&io(a,"exit")&&e.getKeyframes().some(t=>t.mixBlendMode)?s.push(new Bn(t)):t.cancel();else{const n="group"===r.type?"layout":"";let o={...Hn(i,n)};o.duration&&(o.duration=f(o.duration)),o=vn(o);const a=fn(o.ease,o.duration);e.updateTiming({delay:f(o.delay??0),duration:o.duration,easing:a}),s.push(new Bn(t))}}t(new kn(s))})})}function io(t,e){return t?.[e]?.keyframes.opacity}let so=[],oo=null;function ro(){oo=null;const[t]=so;var e;t&&(n(so,e=t),oo=e,no(e).then(t=>{e.notifyReady(t),t.finished.finally(ro)}))}function ao(){for(let t=so.length-1;t>=0;t--){const e=so[t],{interrupt:n}=e.options;if("immediate"===n){const n=so.slice(0,t+1).map(t=>t.update),i=so.slice(t+1);e.update=()=>{n.forEach(t=>t())},so=[e,...i];break}}oo&&"immediate"!==so[0]?.options.interrupt||ro()}class lo{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.notifyReady=u,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...e},n=this,so.push(n),ts.render(ao)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const co=()=>({translate:0,scale:1,origin:0,originPoint:0}),uo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),ho=()=>({min:0,max:0}),po=()=>({x:{min:0,max:0},y:{min:0,max:0}}),mo=new WeakMap;function fo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function yo(t){return"string"==typeof t||Array.isArray(t)}const go=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vo=["initial",...go];function xo(t){return fo(t.animate)||vo.some(e=>yo(t[e]))}function To(t){return Boolean(xo(t)||t.variants)}function wo(t,e,n){for(const i in e){const s=e[i],o=n[i];if(ai(s))t.addValue(i,s);else if(ai(o))t.addValue(i,ni(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,ni(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const bo={current:null},So={current:!1},Ao="undefined"!=typeof window;function Vo(){if(So.current=!0,Ao)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>bo.current=t.matches;t.addEventListener("change",e),e()}else bo.current=!1}const Po=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Eo={};class Mo{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=rn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=G.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(So.current||Vo(),this.shouldReduceMotion=bo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),z(this.notifyUpdate),z(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Wi.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new xn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:f(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=He.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Eo){const e=Eo[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ni(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(r(n)||l(n))?n=parseFloat(n):!Ys(n)&&Dt.test(e)&&(n=Ci(t,e)),this.setBaseTarget(t,ai(n)?n.get():n)),ai(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=_n(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||ai(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new m),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ts.render(this.render)}}class ko extends Mo{constructor(){super(...arguments),this.KeyframeResolver=Li}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ai(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Do({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ro(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Bo(t){return void 0===t||1===t}function Co({scale:t,scaleX:e,scaleY:n}){return!Bo(t)||!Bo(e)||!Bo(n)}function jo(t){return Co(t)||Lo(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Lo(t){return Oo(t.x)||Oo(t.y)}function Oo(t){return t&&"0%"!==t}function Fo(t,e,n){return n+e*(t-n)}function Io(t,e,n,i,s){return void 0!==s&&(t=Fo(t,s,i)),Fo(t,n,i)+e}function Wo(t,e=0,n=1,i,s){t.min=Io(t.min,e,n,i,s),t.max=Io(t.max,e,n,i,s)}function No(t,{x:e,y:n}){Wo(t.x,e.translate,e.scale,e.originPoint),Wo(t.y,n.translate,n.scale,n.originPoint)}const Uo=.999999999999,$o=1.0000000000001;function zo(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aUo&&(e.x=1),e.y<$o&&e.y>Uo&&(e.y=1)}function Ko(t,e){t.min=t.min+e,t.max=t.max+e}function Yo(t,e,n,i,s=.5){Wo(t,e,n,jt(t.min,t.max,s),i)}function Xo(t,e){Yo(t.x,e.x,e.scaleX,e.scale,e.originX),Yo(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ho(t,e){return Do(Ro(t.getBoundingClientRect(),e))}const Go={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qo=Xe.length;function Zo(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!yt.test(t))return t;t=parseFloat(t)}return`${Qo(t,e.target.x)}% ${Qo(t,e.target.y)}%`}},er={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Dt.parse(t);if(s.length>5)return i;const o=Dt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=jt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},nr={borderRadius:{...tr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tr,borderTopRightRadius:tr,borderBottomLeftRadius:tr,borderBottomRightRadius:tr,boxShadow:er};function ir(t,{layout:e,layoutId:n}){return He.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!nr[t]||"opacity"===t)}function sr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(ai(i[e])||s&&ai(s[e])||ir(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class or extends ko{constructor(){super(...arguments),this.type="html",this.renderInstance=Jo}readValueFromInstance(t,e){if(He.has(e))return this.projection?.isProjecting?$e(e):Ke(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(_(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ho(t,e)}build(t,e,n){_o(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return sr(t,e,n)}}class rr extends Mo{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const ar={offset:"stroke-dashoffset",array:"stroke-dasharray"},lr={offset:"strokeDashoffset",array:"strokeDasharray"};function cr(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?ar:lr;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const ur=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function hr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(_o(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const t of ur)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&cr(h,s,o,r,!1)}const dr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),pr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function mr(t,e,n,i){Jo(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(dr.has(n)?n:ui(n),e.attrs[n])}function fr(t,e,n){const i=sr(t,e,n);for(const n in t)if(ai(t[n])||ai(e[n])){i[-1!==Xe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class yr extends ko{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=po}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(He.has(e)){const t=Ri(e);return t&&t.default||0}return e=dr.has(e)?e:ui(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return fr(t,e,n)}build(t,e,n){hr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){mr(t,e,0,i)}mount(t){this.isSVGTag=pr(t.tagName),super.mount(t)}}const gr=vo.length;function vr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&vr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Rr(t,e,n,i){Dr(t.x,e.x,n.x,i?i.originX:void 0),Dr(t.y,e.y,n.y,i?i.originY:void 0)}function Br(t,e,n){t.min=n.min+e.min,t.max=t.min+Mr(e)}function Cr(t,e,n){Br(t.x,e.x,n.x),Br(t.y,e.y,n.y)}function jr(t,e,n){t.min=e.min-n.min,t.max=t.min+Mr(e)}function Lr(t,e,n){jr(t.x,e.x,n.x),jr(t.y,e.y,n.y)}function Or(t,e,n,i,s){return t=Fo(t-=e,1/n,i),void 0!==s&&(t=Fo(t,1/s,i)),t}function Fr(t,e=0,n=1,i=.5,s,o=t,r=t){if(ft.test(e)){e=parseFloat(e);e=jt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=jt(o.min,o.max,i);t===o&&(a-=e),t.min=Or(t.min,e,n,a,s),t.max=Or(t.max,e,n,a,s)}function Ir(t,e,[n,i,s],o,r){Fr(t,e[n],e[i],e[s],e.scale,o,r)}const Wr=["x","scaleX","originX"],Nr=["y","scaleY","originY"];function Ur(t,e,n,i){Ir(t.x,e,Wr,n?n.x:void 0,i?i.x:void 0),Ir(t.y,e,Nr,n?n.y:void 0,i?i.y:void 0)}function $r(t){return 0===t.translate&&1===t.scale}function zr(t){return $r(t.x)&&$r(t.y)}function Kr(t,e){return t.min===e.min&&t.max===e.max}function Yr(t,e){return Kr(t.x,e.x)&&Kr(t.y,e.y)}function Xr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Hr(t,e){return Xr(t.x,e.x)&&Xr(t.y,e.y)}function Gr(t){return Mr(t.x)/Mr(t.y)}function qr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Zr(t){return[t("x"),t("y")]}function _r(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Jr=["TopLeft","TopRight","BottomLeft","BottomRight"],Qr=Jr.length,ta=t=>"string"==typeof t?parseFloat(t):t,ea=t=>"number"==typeof t||yt.test(t);function na(t,e,n,i,s,o){s?(t.opacity=jt(0,n.opacity??1,sa(i)),t.opacityExit=jt(e.opacity??1,0,oa(i))):o&&(t.opacity=jt(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(p(t,e,i))}function aa(t,e,n){const i=ai(t)?t:ni(t);return i.start(qn("",i,e,n)),i.animation}function la(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const ca=(t,e)=>t.depth-e.depth;class ua{constructor(){this.children=[],this.isDirty=!1}add(t){e(this.children,t),this.isDirty=!0}remove(t){n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ca),this.isDirty=!1,this.children.forEach(t)}}function ha(t,e){const n=G.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(z(i),t(o-e))};return $.setup(i,!0),()=>z(i)}function da(t,e){return ha(t,f(e))}function pa(t){return ai(t)?t.get():t}class ma{constructor(){this.members=[]}add(t){e(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1===s.isConnected&&!1!==i.isPresent&&!i.snapshot&&n(this.members,i)}t.scheduleRender()}remove(t){if(n(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t],i=e.instance;if(!1!==e.isPresent&&(!i||!1!==i.isConnected)){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender();const i=n.options.layoutDependency,s=t.options.layoutDependency;if(!(void 0!==i&&void 0!==s&&i===s)){const i=n.instance;i&&!1===i.isConnected&&!n.snapshot||(t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:o}=t.options;!1===o&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const fa={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ya={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ga=["","X","Y","Z"];let va=0;function xa(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Ta(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=pi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",$,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Ta(i)}function wa({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=va++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,N.value&&(ya.nodes=ya.calculatedTargetDeltas=ya.calculatedProjections=0),this.nodes.forEach(Aa),this.nodes.forEach(Ra),this.nodes.forEach(Ba),this.nodes.forEach(Va),N.addProjectionMetrics&&N.addProjectionMetrics(ya)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;$.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=ha(s,250),fa.hasAnimatedSinceResize&&(fa.hasAnimatedSinceResize=!1,this.nodes.forEach(Da)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Ia,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Hr(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Hn(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||Da(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),z(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ca),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ta(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Mr(this.snapshot.measuredBox.x)||Mr(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3;var l,d,p,m;La(o.x,t.x,n),La(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lr(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=n,Oa(l.x,d.x,p.x,m),Oa(l.y,d.y,p.y,m),h&&Yr(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),Pr(h,this.relativeTarget)),a&&(this.animationValues=s,na(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(z(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$.update(()=>{fa.hasAnimatedSinceResize=!0,q.layout++,this.motionValue||(this.motionValue=ni(0)),this.motionValue.jump(0,!1),this.currentAnimation=aa(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{q.layout--},onComplete:()=>{q.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&$a(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Mr(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Mr(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Pr(e,n),Xo(e,s),Rr(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new ma);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&xa("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(Ea),this.root.sharedNodes.clear()}}}function ba(t){t.updateLayout()}function Sa(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?Zr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Mr(i);i.min=n[t].min,i.max=i.min+s}):$a(s,e.layoutBox,n)&&Zr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Mr(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Rr(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Rr(a,t.applyTransform(i,!0),e.measuredBox):Rr(a,n,e.layoutBox);const l=!zr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Lr(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Lr(a,n,o.layoutBox),Hr(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Aa(t){N.value&&ya.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Va(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Pa(t){t.clearSnapshot()}function Ea(t){t.clearMeasurements()}function Ma(t){t.isLayoutDirty=!1}function ka(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Da(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ra(t){t.resolveTargetDelta()}function Ba(t){t.calcProjection()}function Ca(t){t.resetSkewAndRotation()}function ja(t){t.removeLeadSnapshot()}function La(t,e,n){t.translate=jt(e.translate,0,n),t.scale=jt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Oa(t,e,n,i){t.min=jt(e.min,n.min,i),t.max=jt(e.max,n.max,i)}function Fa(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ia={duration:.45,ease:[.4,0,.1,1]},Wa=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Na=Wa("applewebkit/")&&!Wa("chrome/")?Math.round:u;function Ua(t){t.min=Na(t.min),t.max=Na(t.max)}function $a(t,e,n){return"position"===t||"preserve-aspect"===t&&!kr(Gr(e),Gr(n),.2)}function za(t){return t!==t.root&&t.scroll?.wasRoot}const Ka=wa({attachResizeListener:(t,e)=>la(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ya=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Xa={current:void 0},Ha=wa({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Xa.current){const t=new Ka({});t.mount(window),t.setOptions({layoutScroll:!0}),Xa.current=t}return Xa.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ga="[data-layout], [data-layout-id]",qa=()=>{};function Za(t){const e=Array.from(t.querySelectorAll(Ga));return t instanceof Element&&t.matches(Ga)&&(e.includes(t)||e.unshift(t)),e}function _a(t){const e=t.getAttribute("data-layout-id")||void 0,n=t.getAttribute("data-layout");let i;return""===n||"true"===n?i=!0:n&&(i=n),{layout:i,layoutId:e}}function Ja(t,e,n){const i=mo.get(t),s=i??new or({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0});return i&&s.projection||(s.projection=new Ha(s.latestValues,e)),s.projection.setOptions({...n,visualElement:s}),s.current?s.projection.instance||s.projection.mount(t):s.mount(t),i||mo.set(t,s),{element:t,visualElement:s,projection:s.projection}}function Qa(t,e,n){let i=t.parentElement;for(;i;){const t=e.get(i);if(t)return t;if(i===n)break;i=i.parentElement}}const tl=$,el=W.reduce((t,e)=>(t[e]=t=>z(t),t),{});function nl(t){return"object"==typeof t&&!Array.isArray(t)}function il(t,e,n,i){return null==t?[]:"string"==typeof t&&nl(e)?Ni(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function sl(t,e,n){return t*(e+1)}function ol(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function rl(t,e,i,s,o,r){!function(t,e,i){for(let s=0;se&&o.at"number"==typeof t,ml=t=>t.every(pl);function fl(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ys(t)&&!Os(t)?new yr(e):new or(e);n.mount(t),mo.set(t,n)}function yl(t){const e=new rr({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),mo.set(t,e)}function gl(e,n,i,s){const o=[];if(function(t,e){return ai(t)||"number"==typeof t||"string"==typeof t&&!nl(e)}(e,n))o.push(aa(e,nl(n)&&n.default||n,i&&i.default||i));else{if(null==e)return o;const r=il(e,n,s),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=hl(e),{delay:u=0,times:h=Se(c),type:p=n.type||"keyframes",repeat:y,repeatType:g,repeatDelay:x=0,...T}=i;let{ease:w=n.ease||"easeOut",duration:b}=i;const S="function"==typeof u?u(a,l):u,A=c.length,V=gn(p)?p:o?.[p||"keyframes"];if(A<=2&&V){let t=100;if(2===A&&ml(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...T};void 0!==b&&(e.duration=f(b));const i=_t(e,t,V);w=i.ease,b=i.duration}b??(b=r);const P=d+S;1===h.length&&0===h[0]&&(h[1]=1);const E=h.length-c.length;if(E>0&&be(h,E),1===c.length&&c.unshift(null),y){t.invariant(y<20,"Repeat count too high, must be less than 20","repeat-count-high"),b=sl(b,y);const e=[...c],n=[...h];w=Array.isArray(w)?[...w]:[w];const i=[...w];for(let t=0;t{for(const s in t){const o=t[s];o.sort(ll);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=ni(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:xe});return o.forEach(({keyframes:t,transition:e},n)=>{s.push(...gl(n,t,e))}),s}function xl(t={}){const{scope:e,reduceMotion:i}=t;return function(t,s,o){let r,a=[];if(l=t,Array.isArray(l)&&l.some(Array.isArray))a=vl(t,void 0!==i?{reduceMotion:i,...s}:s,e);else{const{onComplete:n,...l}=o||{};"function"==typeof n&&(r=n),a=gl(t,s,void 0!==i?{reduceMotion:i,...l}:l,e)}var l;const c=new Rn(a);return r&&c.finished.then(r),e&&(e.animations.push(c),c.finished.then(()=>{n(e.animations,c)})),c}}const Tl=xl();const wl=e=>function(n,i,s){return new Rn(function(e,n,i,s){if(null==e)return[];const o=Ni(e,s),r=o.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(s)}return l}(n,i,s,e))},bl=wl(),Sl={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Al(t,e,n,i){const s=n[e],{length:o,position:r}=Sl[e],a=s.current,l=n.time;s.current=t[`scroll${r}`],s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=p(0,s.scrollLength,s.current);const c=i-l;s.velocity=c>50?0:g(s.current-a,c)}const Vl={start:0,center:.5,end:1};function Pl(t,e,n=0){let i=0;if(t in Vl&&(t=Vl[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const El=[0,0];function Ml(t,e,n,i){let s=Array.isArray(t)?t:El,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Vl[t]?t:"0"]),o=Pl(s[0],n,i),r=Pl(s[1],e),o-r}const kl={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Dl={x:0,y:0};function Rl(t,e,n){const{offset:s=kl.All}=n,{target:o=t,axis:r="y"}=n,a="y"===r?"height":"width",l=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(Gi(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(o,t):Dl,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let h=!e[r].interpolate;const d=s.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Al(t,"x",e,n),Al(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&Rl(t,n,i)},notify:()=>e(n)}}const Cl=new WeakMap,jl=new WeakMap,Ll=new WeakMap,Ol=new WeakMap,Fl=new WeakMap,Il=t=>t===document.scrollingElement?window:t;function Wl(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return u;let s=Ll.get(e);s||(s=new Set,Ll.set(e,s));const o=Bl(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!Cl.has(e)){const t=()=>{for(const t of s)t.measure(K.timestamp);$.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>$.read(t);Cl.set(e,i);const o=Il(e);window.addEventListener("resize",i,{passive:!0}),e!==document.documentElement&&jl.set(e,Ms(e,i)),o.addEventListener("scroll",i,{passive:!0}),i()}if(n&&!Fl.has(e)){const t=Cl.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Ol.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=$.read(i,!0);Fl.set(e,s)}const r=Cl.get(e);return $.read(r,!1,!0),()=>{z(r);const t=Ll.get(e);if(!t)return;if(t.delete(o),t.size)return;const n=Cl.get(e);Cl.delete(e),n&&(Il(e).removeEventListener("scroll",n),jl.get(e)?.(),window.removeEventListener("resize",n));const i=Fl.get(e);i&&(z(i),Fl.delete(e)),Ol.delete(e)}}const Nl=new Map;function Ul({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);const s=Nl.get(e)??new Map;Nl.set(e,s);const o=n.target??"self",r=s.get(o)??{},a=i+(n.offset??[]).join(",");var l;return r[a]||(r[a]=(l=n.target,"undefined"!=typeof window&&!l&&hn()?new ScrollTimeline({source:e,axis:i}):function(t){const e={value:0},n=Wl(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}({container:e,...n}))),r[a]}const $l={some:0,all:1};const zl=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=Mn,t.DOMKeyframesResolver=Li,t.DOMVisualElement=ko,t.DocumentProjectionNode=Ka,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=ua,t.GroupAnimation=kn,t.GroupAnimationWithThen=Rn,t.HTMLProjectionNode=Ha,t.HTMLVisualElement=or,t.JSAnimation=Ce,t.KeyframeResolver=rn,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.sharedTransitions=new Map,this.notifyReady=qa,this.rejectReady=qa,this.scope=t,this.updateDom=e,this.defaultOptions=n,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),$.postRender(()=>{this.start().then(this.notifyReady).catch(this.rejectReady)})}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}async start(){const t=Za(this.scope),e=this.buildRecords(t);e.forEach(({projection:t})=>{const e=Boolean(t.currentAnimation),n=Boolean(t.options.layoutId);if(e&&n){const e=function(t){const e=t.targetWithTransforms||t.target;if(!e)return;const n={x:{min:0,max:0},y:{min:0,max:0}},i={x:{min:0,max:0},y:{min:0,max:0}};return Pr(n,e),Pr(i,e),{animationId:t.root?.animationId??0,measuredBox:n,layoutBox:i,latestValues:t.animationValues||t.latestValues||{},source:t.id}}(t);e?t.snapshot=e:t.snapshot&&(t.snapshot=void 0)}else t.snapshot&&(t.currentAnimation||t.isProjecting())&&(t.snapshot=void 0);t.isPresent=!0,t.willUpdate()}),await this.updateDom();const n=Za(this.scope),i=this.buildRecords(n);this.handleExitingElements(e,i),i.forEach(({projection:t})=>{const e=t.instance,n=t.resumeFrom?.instance;if(!e||!n)return;if(!("style"in e))return;const i=e.style.transform,s=n.style.transform;i&&s&&i===s&&(e.style.transform="",e.style.transformOrigin="")}),i.forEach(({projection:t})=>{t.isPresent=!0});const s=function(t,e){const n=t[0]||e[0];return n?.projection.root}(i,e);s?.didUpdate(),await new Promise(t=>{$.postRender(()=>t())});const o=function(t){const e=new Set;return t.forEach(t=>{const n=t.projection.currentAnimation;n&&e.add(n)}),Array.from(e)}(i);return new kn(o)}buildRecords(t){const e=[],n=new Map;for(const i of t){const t=Qa(i,n,this.scope),{layout:s,layoutId:o}=_a(i),r=(o?this.sharedTransitions.get(o):void 0)||this.defaultOptions,a=Ja(i,t?.projection,{layout:s,layoutId:o,animationType:"string"==typeof s?s:"both",transition:r});n.set(i,a),e.push(a)}return e}handleExitingElements(t,e){const n=new Set(e.map(t=>t.element));t.forEach(t=>{n.has(t.element)||(t.projection.options.layoutId&&(t.projection.isPresent=!1,t.projection.relegate()),t.visualElement.unmount(),mo.delete(t.element))});const i=new Set(t.map(t=>t.element));e.forEach(({element:t,projection:e})=>{i.has(t)&&e.resumeFrom&&!e.resumeFrom.instance&&!e.isLead()&&(e.resumeFrom=void 0,e.snapshot=void 0)})}},t.MotionGlobalConfig=o,t.MotionValue=ei,t.NativeAnimation=xn,t.NativeAnimationExtended=bn,t.NativeAnimationWrapper=Bn,t.NodeStack=ma,t.ObjectVisualElement=rr,t.SVGVisualElement=yr,t.SubscriptionManager=m,t.ViewTransitionBuilder=lo,t.VisualElement=Mo,t.acceleratedValues=Wi,t.activeAnimations=q,t.addAttrValue=Yi,t.addDomEvent=la,t.addScaleCorrector=function(t){for(const e in t)nr[e]=t[e],_(e)&&(nr[e].isCSSVariable=!0)},t.addStyleValue=_i,t.addUniqueItem=e,t.addValueToWillChange=ci,t.alpha=it,t.analyseComplexValue=Pt,t.animate=Tl,t.animateMini=bl,t.animateMotionValue=qn,t.animateSingleValue=aa,t.animateTarget=fi,t.animateValue=function(t){return new Ce(t)},t.animateVariant=yi,t.animateView=function(t,e={}){return new lo(t,e)},t.animateVisualElement=gi,t.animationMapKey=jn,t.anticipate=E,t.applyAxisDelta=Wo,t.applyBoxDelta=No,t.applyGeneratorOptions=vn,t.applyPointDelta=Io,t.applyPxDefaults=Fi,t.applyTreeDeltas=zo,t.aspectRatio=Gr,t.attachFollow=Ns,t.attachSpring=function(t,e,n){return Ns(t,e,{type:"spring",...n})},t.attrEffect=Xi,t.axisDeltaEquals=qr,t.axisEquals=Kr,t.axisEqualsRounded=Xr,t.backIn=V,t.backInOut=P,t.backOut=A,t.boxEquals=Yr,t.boxEqualsRounded=Hr,t.buildHTMLStyles=_o,t.buildProjectionTransform=_r,t.buildSVGAttrs=hr,t.buildSVGPath=cr,t.buildTransform=Zo,t.calcAxisDelta=Dr,t.calcBoxDelta=Rr,t.calcChildStagger=On,t.calcGeneratorDuration=Zt,t.calcLength=Mr,t.calcRelativeAxis=Br,t.calcRelativeAxisPosition=jr,t.calcRelativeBox=Cr,t.calcRelativePosition=Lr,t.camelCaseAttributes=dr,t.camelToDash=ui,t.cancelFrame=z,t.cancelMicrotask=es,t.cancelSync=el,t.checkVariantsDidChange=br,t.circIn=M,t.circInOut=D,t.circOut=k,t.clamp=i,t.cleanDirtyNodes=Va,t.collectMotionValues=ti,t.color=wt,t.compareByDepth=ca,t.complex=Dt,t.containsCSSVariable=et,t.convertBoundingBoxToBox=Do,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=Ae,t.copyAxisDeltaInto=Er,t.copyAxisInto=Vr,t.copyBoxInto=Pr,t.correctBorderRadius=tr,t.correctBoxShadow=er,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>gi(t,e,n)))}(t),n=Ar(),i=!0;const s=e=>(n,i)=>{const s=Jn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=vr(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;eh&&f,T=!1;const w=Array.isArray(m)?m:[m];let b=w.reduce(s(d),{});!1===y&&(b={});const{prevResolvedValues:S={}}=p,A={...S,...b},V=e=>{x=!0,c.has(e)&&(T=!0,c.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in A){const e=b[t],n=S[t];if(u.hasOwnProperty(t))continue;let i=!1;i=ii(e)&&ii(n)?!xr(e,n):e!==n,i?null!=e?V(t):c.add(t):void 0!==e&&c.has(t)?V(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=b,p.isActive&&(u={...u,...b}),i&&t.blockInitialAnimation&&(x=!1);const P=g&&v;x&&(!P||T)&&l.push(...w.map(e=>{const n={type:d};if("string"==typeof e&&i&&!P&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Jn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=On(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof r.initial){const n=Jn(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Ar()}}},t.createAxis=ho,t.createAxisDelta=co,t.createBox=po,t.createDelta=uo,t.createGeneratorEasing=_t,t.createProjectionNode=wa,t.createRenderBatcher=U,t.createScopedAnimate=xl,t.cubicBezier=w,t.cubicBezierAsString=pn,t.defaultEasing=Ve,t.defaultOffset=Se,t.defaultTransformValue=$e,t.defaultValueTypes=Di,t.degrees=mt,t.delay=da,t.delayInSeconds=da,t.dimensionValueTypes=xi,t.distance=zl,t.distance2D=function(t,e){const n=zl(t.x,e.x),i=zl(t.y,e.y);return Math.sqrt(n**2+i**2)},t.eachAxis=Zr,t.easeIn=R,t.easeInOut=C,t.easeOut=B,t.easingDefinitionToFunction=I,t.fillOffset=be,t.fillWildcards=je,t.findDimensionValueType=Ti,t.findValueType=Ys,t.flushKeyframeResolvers=on,t.followValue=Ws,t.frame=$,t.frameData=K,t.frameSteps=Y,t.generateLinearEasing=Gt,t.getAnimatableNone=Ci,t.getAnimationMap=Ln,t.getComputedStyle=fs,t.getDefaultTransition=zn,t.getDefaultValueType=Ri,t.getEasingForSegment=L,t.getFeatureDefinitions=function(){return Eo},t.getFinalKeyframe=Yn,t.getMixer=$t,t.getOptimisedAppearId=pi,t.getOriginIndex=Fs,t.getValueAsType=$i,t.getValueTransition=Hn,t.getVariableValue=Wn,t.getVariantContext=vr,t.getViewAnimationLayerInfo=Js,t.getViewAnimations=to,t.globalProjectionState=fa,t.has2DTranslate=Lo,t.hasReducedMotionListener=So,t.hasScale=Co,t.hasTransform=jo,t.hasWarned=function(t){return v.has(t)},t.hex=dt,t.hover=function(t,e,n={}){const[i,s,o]=ss(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||is())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=Tt,t.hslaToRgba=Bt,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Ni(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:$l[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=Te,t.initPrefersReducedMotion=Vo,t.interpolate=we,t.invisibleValues=Wt,t.isAnimationControls=fo,t.isBezierDefinition=O,t.isCSSVariableName=_,t.isCSSVariableToken=Q,t.isControllingVariants=xo,t.isDeltaZero=zr,t.isDragActive=is,t.isDragging=ns,t.isEasingArray=j,t.isElementKeyboardAccessible=ls,t.isElementTextInput=function(t){return cs.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=ir,t.isGenerator=gn,t.isHTMLElement=Gi,t.isKeyframesTarget=ii,t.isMotionValue=ai,t.isNear=kr,t.isNodeOrChild=os,t.isNumericalString=r,t.isObject=a,t.isPrimaryPointer=rs,t.isSVGElement=ys,t.isSVGSVGElement=Os,t.isSVGTag=pr,t.isTransitionDefined=Gn,t.isVariantLabel=yo,t.isVariantNode=To,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&dn()||!e||"string"==typeof e&&(e in mn||dn())||O(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=li,t.isZeroValueString=l,t.keyframes=Pe,t.makeAnimationInstant=An,t.mapEasingToNativeEasing=fn,t.mapValue=function(t,e,n,i){const s=Is(e,n,i);return zs(()=>s(t.get()))},t.maxGeneratorDuration=qt,t.measurePageBox=function(t,e,n){const i=Ho(t,n),{scroll:s}=e;return s&&(Ko(i.x,s.offset.x),Ko(i.y,s.offset.y)),i},t.measureViewportBox=Ho,t.memo=c,t.microtask=ts,t.millisecondsToSeconds=y,t.mirrorEasing=b,t.mix=Xt,t.mixArray=zt,t.mixColor=It,t.mixComplex=Yt,t.mixImmediate=Ct,t.mixLinearColor=Lt,t.mixNumber=jt,t.mixObject=Kt,t.mixValues=na,t.mixVisibility=Nt,t.motionValue=ni,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&it.forEach(Ya);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.noop=u,t.number=nt,t.numberValueTypes=ki,t.observeTimeline=ks,t.optimizedAppearDataAttribute=di,t.optimizedAppearDataId=hi,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:Ni(t)[0]||document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=In,t.parseValueFromTransform=ze,t.percent=ft,t.pipe=d,t.pixelsToPercent=Qo,t.positionalKeys=Qn,t.prefersReducedMotion=bo,t.press=function(t,e,n={}){const[i,s,o]=ss(t,n),r=t=>{const i=t.currentTarget;if(!ps(t))return;if(ms.has(t))return;us.add(i),n.stopPropagation&&ms.add(t);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),us.has(i)&&us.delete(i),ps(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||os(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),Gi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=hs(()=>{if(us.has(n))return;ds(n,"down");const t=hs(()=>{ds(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>ds(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),ls(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progress=p,t.progressPercentage=xt,t.propEffect=Hi,t.propagateDirtyNodes=Aa,t.px=yt,t.readTransformValue=Ke,t.recordStats=function(){if(N.value)throw js(),new Error("Stats are already being measured");const t=N;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},$.postRender(Ds,!0),Ls},t.removeAxisDelta=Fr,t.removeAxisTransforms=Ir,t.removeBoxTransforms=Ur,t.removeItem=n,t.removePointDelta=Or,t.renderHTML=Jo,t.renderSVG=mr,t.resize=Ms,t.resolveElements=Ni,t.resolveMotionValue=pa,t.resolveTransition=Xn,t.resolveVariant=Jn,t.resolveVariantFromProps=_n,t.reverseEasing=S,t.rgbUnit=ut,t.rgba=ht,t.rootProjectionNode=Xa,t.scale=st,t.scaleCorrectors=nr,t.scalePoint=Fo,t.scrapeHTMLMotionValuesFromProps=sr,t.scrapeSVGMotionValuesFromProps=fr,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return u;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?Wl(n=>{t(n[e.axis].progress,n)},e):ks(t,Ul(e))}(t,s):function(t,e){const n=Ul(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),ks(e=>{t.time=t.iterationDuration*e},n))})}(t,s)},t.scrollInfo=Wl,t.secondsToMilliseconds=f,t.setDragLock=function(t){return"x"===t||"y"===t?ns[t]?null:(ns[t]=!0,()=>{ns[t]=!1}):ns.x||ns.y?null:(ns.x=ns.y=!0,()=>{ns.x=ns.y=!1})},t.setFeatureDefinitions=function(t){Eo=t},t.setStyle=ln,t.setTarget=ri,t.spring=xe,t.springValue=function(t,e){return Ws(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:Fs(n,o),a=Math.abs(r-s);let l=t*a;if(i){const e=o*t;l=I(i)(l/e)*e}return e+l}},t.startWaapiAnimation=yn,t.statsBuffer=N,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,o/t)}},t.styleEffect=Ji,t.supportedWaapiEasing=mn,t.supportsBrowserAnimation=En,t.supportsFlags=cn,t.supportsLinearEasing=dn,t.supportsPartialKeyframes=Ii,t.supportsScrollTimeline=hn,t.svgEffect=Qi,t.sync=tl,t.testValueType=vi,t.time=G,t.transform=Is,t.transformAxis=Yo,t.transformBox=Xo,t.transformBoxPoints=Ro,t.transformPropOrder=Xe,t.transformProps=He,t.transformValue=zs,t.transformValueTypes=Mi,t.translateAxis=Ko,t.updateMotionValuesFromProps=wo,t.variantPriorityOrder=go,t.variantProps=vo,t.velocityPerSecond=g,t.vh=gt,t.visualElementStore=mo,t.vw=vt,t.warnOnce=function(t,e,n){t||v.has(e)||(console.warn(s(e,n)),v.add(e))},t.wrap=x}); diff --git a/node_modules/framer-motion/dist/es/animation/animate/index.mjs b/node_modules/framer-motion/dist/es/animation/animate/index.mjs new file mode 100644 index 00000000..3c881fcf --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/index.mjs @@ -0,0 +1,53 @@ +import { GroupAnimationWithThen } from 'motion-dom'; +import { removeItem } from 'motion-utils'; +import { animateSequence } from './sequence.mjs'; +import { animateSubject } from './subject.mjs'; + +function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +function createScopedAnimate(options = {}) { + const { scope, reduceMotion } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + if (isSequence(subjectOrSequence)) { + animations = animateSequence(subjectOrSequence, reduceMotion !== undefined + ? { reduceMotion, ...optionsOrKeyframes } + : optionsOrKeyframes, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, (reduceMotion !== undefined + ? { reduceMotion, ...rest } + : rest), scope); + } + const animation = new GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; +} +const animate = createScopedAnimate(); + +export { animate, createScopedAnimate }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map new file mode 100644 index 00000000..8be4290f --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/animation/animate/index.ts"],"sourcesContent":["import type {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n MotionValue,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"motion-dom\"\nimport { GroupAnimationWithThen } from \"motion-dom\"\nimport { removeItem } from \"motion-utils\"\nimport {\n AnimationSequence,\n ObjectTarget,\n SequenceOptions,\n} from \"../sequence/types\"\nimport { animateSequence } from \"./sequence\"\nimport { animateSubject } from \"./subject\"\n\nfunction isSequence(value: unknown): value is AnimationSequence {\n return Array.isArray(value) && value.some(Array.isArray)\n}\n\ninterface ScopedAnimateOptions {\n scope?: AnimationScope\n reduceMotion?: boolean\n}\n\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options: ScopedAnimateOptions = {}) {\n const { scope, reduceMotion } = options\n /**\n * Animate a sequence\n */\n function scopedAnimate(\n sequence: AnimationSequence,\n options?: SequenceOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a string\n */\n function scopedAnimate(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate(\n value: V | MotionValue,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an Element\n */\n function scopedAnimate(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an object\n */\n function scopedAnimate(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n let animations: AnimationPlaybackControlsWithThen[] = []\n let animationOnComplete: VoidFunction | undefined\n\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(\n subjectOrSequence,\n reduceMotion !== undefined\n ? { reduceMotion, ...(optionsOrKeyframes as SequenceOptions) }\n : (optionsOrKeyframes as SequenceOptions),\n scope\n )\n } else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {}\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete as VoidFunction\n }\n animations = animateSubject(\n subjectOrSequence as ElementOrSelector,\n optionsOrKeyframes as DOMKeyframesDefinition,\n (reduceMotion !== undefined\n ? { reduceMotion, ...rest }\n : rest) as DynamicAnimationOptions,\n scope\n )\n }\n\n const animation = new GroupAnimationWithThen(animations)\n\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete)\n }\n\n if (scope) {\n scope.animations.push(animation)\n animation.finished.then(() => {\n removeItem(scope.animations, animation)\n })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,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;SAC/C;QAED,IAAI,KAAK,EAAE;AACP,YAAA,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAChC,YAAA,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAK;AACzB,gBAAA,UAAU,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;AAC3C,aAAC,CAAC,CAAA;SACL;AAED,QAAA,OAAO,SAAS,CAAA;KACnB;AAED,IAAA,OAAO,aAAa,CAAA;AACxB,CAAC;AAEY,MAAA,OAAO,GAAG,mBAAmB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs new file mode 100644 index 00000000..3888e741 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs @@ -0,0 +1,23 @@ +import { resolveElements } from 'motion-dom'; +import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs'; + +function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } +} + +export { resolveSubjects }; +//# sourceMappingURL=resolve-subjects.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map new file mode 100644 index 00000000..04bf3b5d --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-subjects.mjs","sources":["../../../../src/animation/animate/resolve-subjects.ts"],"sourcesContent":["import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n"],"names":[],"mappings":";;;AASM,SAAU,eAAe,CAC3B,OAQe,EACf,SAAmD,EACnD,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,EAAE,CAAA;KACZ;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,cAAc,CAAC,SAAS,CAAC,EAAE;QAC1D,OAAO,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,CAAA;KACxD;AAAM,SAAA,IAAI,OAAO,YAAY,QAAQ,EAAE;AACpC,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;KAC7B;AAAM,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;AAC/B,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAA;KAC1C;SAAM;QACH,OAAO,CAAC,OAAO,CAAC,CAAA;KACnB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs new file mode 100644 index 00000000..c19af7ac --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs @@ -0,0 +1,36 @@ +import { motionValue, spring } from 'motion-dom'; +import { createAnimationsFromSequence } from '../sequence/create.mjs'; +import { animateSubject } from './subject.mjs'; + +function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; +} + +export { animateSequence }; +//# sourceMappingURL=sequence.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map new file mode 100644 index 00000000..a33d7ee2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/sequence.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sequence.mjs","sources":["../../../../src/animation/animate/sequence.ts"],"sourcesContent":["import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n motionValue,\n spring,\n} from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../sequence/types\"\nimport { animateSubject } from \"./subject\"\n\nexport function animateSequence(\n sequence: AnimationSequence,\n options?: SequenceOptions,\n scope?: AnimationScope\n) {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n /**\n * Pre-process: replace function segments with MotionValue segments,\n * subscribe callbacks immediately\n */\n const processedSequence = sequence.map((segment) => {\n if (Array.isArray(segment) && typeof segment[0] === \"function\") {\n const callback = segment[0] as (value: any) => void\n const mv = motionValue(0)\n mv.on(\"change\", callback)\n\n if (segment.length === 1) {\n return [mv, [0, 1]] as any\n } else if (segment.length === 2) {\n return [mv, [0, 1], segment[1]] as any\n } else {\n return [mv, segment[1], segment[2]] as any\n }\n }\n return segment\n }) as AnimationSequence\n\n const animationDefinitions = createAnimationsFromSequence(\n processedSequence,\n options,\n scope,\n { spring }\n )\n\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition))\n })\n\n return animations\n}\n"],"names":[],"mappings":";;;;SAUgB,eAAe,CAC3B,QAA2B,EAC3B,OAAyB,EACzB,KAAsB,EAAA;IAEtB,MAAM,UAAU,GAAwC,EAAE,CAAA;AAE1D;;;AAGG;IACH,MAAM,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAI;AAC/C,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE;AAC5D,YAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAyB,CAAA;AACnD,YAAA,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;AACzB,YAAA,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAEzB,YAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAQ,CAAA;aAC7B;AAAM,iBAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;AAC7B,gBAAA,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAQ,CAAA;aACzC;iBAAM;AACH,gBAAA,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAQ,CAAA;aAC7C;SACJ;AACD,QAAA,OAAO,OAAO,CAAA;AAClB,KAAC,CAAsB,CAAA;AAEvB,IAAA,MAAM,oBAAoB,GAAG,4BAA4B,CACrD,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,EAAE,MAAM,EAAE,CACb,CAAA;AAED,IAAA,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,OAAO,KAAI;AAChE,QAAA,UAAU,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAA;AACtE,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,UAAU,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs new file mode 100644 index 00000000..c509d689 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs @@ -0,0 +1,54 @@ +import { animateSingleValue, visualElementStore, animateTarget, isMotionValue } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { createDOMVisualElement, createObjectVisualElement } from '../utils/create-visual-element.mjs'; +import { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs'; +import { resolveSubjects } from './resolve-subjects.mjs'; + +function isSingleValue(subject, keyframes) { + return (isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); +} +/** + * Implementation + */ +function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; +} + +export { animateSubject }; +//# sourceMappingURL=subject.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map new file mode 100644 index 00000000..8989deaf --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animate/subject.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"subject.mjs","sources":["../../../../src/animation/animate/subject.ts"],"sourcesContent":["import {\n animateTarget,\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n AnyResolvedKeyframe,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n isMotionValue,\n MotionValue,\n TargetAndTransition,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n visualElementStore,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport {\n createDOMVisualElement,\n createObjectVisualElement,\n} from \"../utils/create-visual-element\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\nimport { resolveSubjects } from \"./resolve-subjects\"\nimport { animateSingleValue } from \"motion-dom\"\n\nexport type AnimationSubject = Element | MotionValue | any\n\nfunction isSingleValue(\n subject: unknown,\n keyframes: unknown\n): subject is MotionValue | AnyResolvedKeyframe {\n return (\n isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes))\n )\n}\n\n/**\n * Animate a string\n */\nexport function animateSubject(\n value: string | MotionValue,\n keyframes: string | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue,\n keyframes: number | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a Element\n */\nexport function animateSubject(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a object\n */\nexport function animateSubject(\n object: O | O[],\n keyframes: ObjectTarget,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject(\n subject:\n | MotionValue\n | MotionValue\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe[]\n | UnresolvedValueKeyframe[]\n | DOMKeyframesDefinition\n | ObjectTarget,\n options?:\n | ValueAnimationTransition\n | ValueAnimationTransition\n | DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[] {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n if (isSingleValue(subject, keyframes)) {\n animations.push(\n animateSingleValue(\n subject,\n isDOMKeyframes(keyframes)\n ? (keyframes as any).default || keyframes\n : keyframes,\n options ? (options as any).default || options : options\n )\n )\n } else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations\n }\n\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope\n )\n\n const numSubjects = subjects.length\n\n invariant(\n Boolean(numSubjects),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i]\n\n const createVisualElement =\n thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement\n\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject as any)\n }\n\n const visualElement = visualElementStore.get(thisSubject)!\n const transition = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (\n \"delay\" in transition &&\n typeof transition.delay === \"function\"\n ) {\n transition.delay = transition.delay(i, numSubjects)\n }\n\n animations.push(\n ...animateTarget(\n visualElement,\n { ...(keyframes as {}), transition } as TargetAndTransition,\n {}\n )\n )\n }\n }\n\n return animations\n}\n"],"names":[],"mappings":";;;;;;AA2BA,SAAS,aAAa,CAClB,OAAgB,EAChB,SAAkB,EAAA;AAElB,IAAA,QACI,aAAa,CAAC,OAAO,CAAC;QACtB,OAAO,OAAO,KAAK,QAAQ;AAC3B,SAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,EAC9D;AACL,CAAC;AAmCD;;AAEG;AACG,SAAU,cAAc,CAC1B,OAOS,EACT,SAMqB,EACrB,OAG6B,EAC7B,KAAsB,EAAA;IAEtB,MAAM,UAAU,GAAwC,EAAE,CAAA;AAE1D,IAAA,IAAI,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;QACnC,UAAU,CAAC,IAAI,CACX,kBAAkB,CACd,OAAO,EACP,cAAc,CAAC,SAAS,CAAC;AACrB,cAAG,SAAiB,CAAC,OAAO,IAAI,SAAS;AACzC,cAAE,SAAS,EACf,OAAO,GAAI,OAAe,CAAC,OAAO,IAAI,OAAO,GAAG,OAAO,CAC1D,CACJ,CAAA;KACJ;SAAM;;AAEH,QAAA,IAAI,OAAO,IAAI,IAAI,EAAE;AACjB,YAAA,OAAO,UAAU,CAAA;SACpB;QAED,MAAM,QAAQ,GAAG,eAAe,CAC5B,OAAO,EACP,SAAmC,EACnC,KAAK,CACR,CAAA;AAED,QAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAA;QAEnC,SAAS,CACL,OAAO,CAAC,WAAW,CAAC,EACpB,6BAA6B,EAC7B,mBAAmB,CACtB,CAAA;AAED,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;AAClC,YAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAE/B,YAAA,MAAM,mBAAmB,GACrB,WAAW,YAAY,OAAO;AAC1B,kBAAE,sBAAsB;kBACtB,yBAAyB,CAAA;YAEnC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;gBACtC,mBAAmB,CAAC,WAAkB,CAAC,CAAA;aAC1C;YAED,MAAM,aAAa,GAAG,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAE,CAAA;AAC1D,YAAA,MAAM,UAAU,GAAG,EAAE,GAAG,OAAO,EAAE,CAAA;AAEjC;;AAEG;YACH,IACI,OAAO,IAAI,UAAU;AACrB,gBAAA,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,EACxC;gBACE,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAA;aACtD;AAED,YAAA,UAAU,CAAC,IAAI,CACX,GAAG,aAAa,CACZ,aAAa,EACb,EAAE,GAAI,SAAgB,EAAE,UAAU,EAAyB,EAC3D,EAAE,CACL,CACJ,CAAA;SACJ;KACJ;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs new file mode 100644 index 00000000..ce716455 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs @@ -0,0 +1,110 @@ +import { resolveElements, getValueTransition, getAnimationMap, animationMapKey, getComputedStyle, fillWildcards, applyPxDefaults, NativeAnimation } from 'motion-dom'; +import { invariant, secondsToMilliseconds } from 'motion-utils'; + +function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = resolveElements(elementOrSelector, scope); + const numElements = elements.length; + invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...getValueTransition(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = getAnimationMap(element); + const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = getComputedStyle(element, name); + } + fillWildcards(unresolvedKeyframes); + applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(getComputedStyle(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; +} + +export { animateElements }; +//# sourceMappingURL=animate-elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map new file mode 100644 index 00000000..1a186b65 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animate-elements.mjs","sources":["../../../../../src/animation/animators/waapi/animate-elements.ts"],"sourcesContent":["import {\n animationMapKey,\n AnimationPlaybackControls,\n AnimationScope,\n applyPxDefaults,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n fillWildcards,\n getAnimationMap,\n getComputedStyle,\n getValueTransition,\n NativeAnimation,\n NativeAnimationOptions,\n resolveElements,\n UnresolvedValueKeyframe,\n ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n map: Map>\n key: string\n unresolvedKeyframes: UnresolvedValueKeyframe[]\n options: Omit & {\n keyframes?: ValueKeyframe[]\n }\n}\n\nexport function animateElements(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return []\n }\n\n const elements = resolveElements(elementOrSelector, scope) as Array<\n HTMLElement | SVGElement\n >\n const numElements = elements.length\n\n invariant(\n Boolean(numElements),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions: AnimationDefinition[] = []\n\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i]\n const elementTransition: DynamicAnimationOptions = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements)\n }\n\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes]\n }\n\n const valueOptions = {\n ...getValueTransition(elementTransition as any, valueName),\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element)\n const key = animationMapKey(\n valueName,\n valueOptions.pseudoElement || \"\"\n )\n const currentAnimation = map.get(key)\n currentAnimation && currentAnimation.stop()\n\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten:\n !elementTransition.type && !elementTransition.ease,\n },\n })\n }\n }\n\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } =\n animationDefinitions[i]\n\n const { element, name, pseudoElement } = animationOptions\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name)\n }\n\n fillWildcards(unresolvedKeyframes)\n applyPxDefaults(unresolvedKeyframes, name)\n\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name))\n }\n\n animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n }\n\n /**\n * Step 3: Create new animations (write)\n */\n const animations: AnimationPlaybackControls[] = []\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i]\n const animation = new NativeAnimation(\n animationOptions as NativeAnimationOptions\n )\n\n map.set(key, animation)\n animation.finished.finally(() => map.delete(key))\n\n animations.push(animation)\n }\n\n return animations\n}\n"],"names":[],"mappings":";;;AA6BM,SAAU,eAAe,CAC3B,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EACjC,KAAsB,EAAA;;AAGtB,IAAA,IAAI,iBAAiB,IAAI,IAAI,EAAE;AAC3B,QAAA,OAAO,EAAE,CAAA;KACZ;IAED,MAAM,QAAQ,GAAG,eAAe,CAAC,iBAAiB,EAAE,KAAK,CAExD,CAAA;AACD,IAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAA;IAEnC,SAAS,CACL,OAAO,CAAC,WAAW,CAAC,EACpB,6BAA6B,EAC7B,mBAAmB,CACtB,CAAA;AAED;;;;;;;;;;;;;;;;AAgBG;IACH,MAAM,oBAAoB,GAA0B,EAA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AAoB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,QAAA,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;AACvE,QAAA,MAAM,SAAS,GAAG,IAAI,eAAe,CACjC,gBAA0C,CAC7C,CAAA;AAED,QAAA,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;AACvB,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAEjD,QAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;KAC7B;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs new file mode 100644 index 00000000..b4a8bf09 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs @@ -0,0 +1,14 @@ +import { GroupAnimationWithThen } from 'motion-dom'; +import { createAnimationsFromSequence } from '../../sequence/create.mjs'; +import { animateElements } from './animate-elements.mjs'; + +function animateSequence(definition, options) { + const animations = []; + createAnimationsFromSequence(definition, options).forEach(({ keyframes, transition }, element) => { + animations.push(...animateElements(element, keyframes, transition)); + }); + return new GroupAnimationWithThen(animations); +} + +export { animateSequence }; +//# sourceMappingURL=animate-sequence.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map new file mode 100644 index 00000000..8a4c2e73 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-sequence.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animate-sequence.mjs","sources":["../../../../../src/animation/animators/waapi/animate-sequence.ts"],"sourcesContent":["import { AnimationPlaybackControls, GroupAnimationWithThen } from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../../sequence/types\"\nimport { animateElements } from \"./animate-elements\"\n\nexport function animateSequence(\n definition: AnimationSequence,\n options?: SequenceOptions\n) {\n const animations: AnimationPlaybackControls[] = []\n\n createAnimationsFromSequence(definition, options).forEach(\n ({ keyframes, transition }, element: Element) => {\n animations.push(...animateElements(element, keyframes, transition))\n }\n )\n\n return new GroupAnimationWithThen(animations)\n}\n"],"names":[],"mappings":";;;;AAKgB,SAAA,eAAe,CAC3B,UAA6B,EAC7B,OAAyB,EAAA;IAEzB,MAAM,UAAU,GAAgC,EAAE,CAAA;AAElD,IAAA,4BAA4B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,OAAO,CACrD,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,OAAgB,KAAI;AAC5C,QAAA,UAAU,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAA;AACvE,KAAC,CACJ,CAAA;AAED,IAAA,OAAO,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAAA;AACjD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs new file mode 100644 index 00000000..070daf12 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs @@ -0,0 +1,13 @@ +import { GroupAnimationWithThen } from 'motion-dom'; +import { animateElements } from './animate-elements.mjs'; + +const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; +}; +const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + +export { animateMini, createScopedWaapiAnimate }; +//# sourceMappingURL=animate-style.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map new file mode 100644 index 00000000..93783246 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/animators/waapi/animate-style.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animate-style.mjs","sources":["../../../../../src/animation/animators/waapi/animate-style.ts"],"sourcesContent":["import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n function scopedAnimate(\n elementOrSelector: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n return new GroupAnimationWithThen(\n animateElements(\n elementOrSelector,\n keyframes as DOMKeyframesDefinition,\n options,\n scope\n )\n )\n }\n\n return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n"],"names":[],"mappings":";;;AAUa,MAAA,wBAAwB,GAAG,CAAC,KAAsB,KAAI;AAC/D,IAAA,SAAS,aAAa,CAClB,iBAAoC,EACpC,SAAiC,EACjC,OAAiC,EAAA;AAEjC,QAAA,OAAO,IAAI,sBAAsB,CAC7B,eAAe,CACX,iBAAiB,EACjB,SAAmC,EACnC,OAAO,EACP,KAAK,CACR,CACJ,CAAA;KACJ;AAED,IAAA,OAAO,aAAa,CAAA;AACxB,EAAC;MAEY,WAAW,iBAAiB,wBAAwB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs new file mode 100644 index 00000000..7fd8c213 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs @@ -0,0 +1,80 @@ +import { animateVisualElement, setTarget } from 'motion-dom'; +import { invariant } from 'motion-utils'; + +function stopAnimation(visualElement) { + visualElement.values.forEach((value) => value.stop()); +} +function setVariants(visualElement, variantLabels) { + const reversedLabels = [...variantLabels].reverse(); + reversedLabels.forEach((key) => { + const variant = visualElement.getVariant(key); + variant && setTarget(visualElement, variant); + if (visualElement.variantChildren) { + visualElement.variantChildren.forEach((child) => { + setVariants(child, variantLabels); + }); + } + }); +} +function setValues(visualElement, definition) { + if (Array.isArray(definition)) { + return setVariants(visualElement, definition); + } + else if (typeof definition === "string") { + return setVariants(visualElement, [definition]); + } + else { + setTarget(visualElement, definition); + } +} +/** + * @public + */ +function animationControls() { + /** + * Track whether the host component has mounted. + */ + let hasMounted = false; + /** + * A collection of linked component animation controls. + */ + const subscribers = new Set(); + const controls = { + subscribe(visualElement) { + subscribers.add(visualElement); + return () => void subscribers.delete(visualElement); + }, + start(definition, transitionOverride) { + invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); + const animations = []; + subscribers.forEach((visualElement) => { + animations.push(animateVisualElement(visualElement, definition, { + transitionOverride, + })); + }); + return Promise.all(animations); + }, + set(definition) { + invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); + return subscribers.forEach((visualElement) => { + setValues(visualElement, definition); + }); + }, + stop() { + subscribers.forEach((visualElement) => { + stopAnimation(visualElement); + }); + }, + mount() { + hasMounted = true; + return () => { + hasMounted = false; + controls.stop(); + }; + }, + }; + return controls; +} + +export { animationControls, setValues }; +//# sourceMappingURL=animation-controls.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map new file mode 100644 index 00000000..edd2357c --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animation-controls.mjs","sources":["../../../../src/animation/hooks/animation-controls.ts"],"sourcesContent":["import {\n animateVisualElement,\n setTarget,\n type AnimationDefinition,\n type LegacyAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\n\nfunction stopAnimation(visualElement: VisualElement) {\n visualElement.values.forEach((value) => value.stop())\n}\n\nfunction setVariants(visualElement: VisualElement, variantLabels: string[]) {\n const reversedLabels = [...variantLabels].reverse()\n\n reversedLabels.forEach((key) => {\n const variant = visualElement.getVariant(key)\n variant && setTarget(visualElement, variant)\n\n if (visualElement.variantChildren) {\n visualElement.variantChildren.forEach((child) => {\n setVariants(child, variantLabels)\n })\n }\n })\n}\n\nexport function setValues(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n if (Array.isArray(definition)) {\n return setVariants(visualElement, definition)\n } else if (typeof definition === \"string\") {\n return setVariants(visualElement, [definition])\n } else {\n setTarget(visualElement, definition as any)\n }\n}\n\n/**\n * @public\n */\nexport function animationControls(): LegacyAnimationControls {\n /**\n * Track whether the host component has mounted.\n */\n let hasMounted = false\n\n /**\n * A collection of linked component animation controls.\n */\n const subscribers = new Set()\n\n const controls: LegacyAnimationControls = {\n subscribe(visualElement) {\n subscribers.add(visualElement)\n return () => void subscribers.delete(visualElement)\n },\n\n start(definition, transitionOverride) {\n invariant(\n hasMounted,\n \"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n const animations: Array> = []\n subscribers.forEach((visualElement) => {\n animations.push(\n animateVisualElement(visualElement, definition, {\n transitionOverride,\n })\n )\n })\n\n return Promise.all(animations)\n },\n\n set(definition) {\n invariant(\n hasMounted,\n \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\"\n )\n\n return subscribers.forEach((visualElement) => {\n setValues(visualElement, definition)\n })\n },\n\n stop() {\n subscribers.forEach((visualElement) => {\n stopAnimation(visualElement)\n })\n },\n\n mount() {\n hasMounted = true\n\n return () => {\n hasMounted = false\n controls.stop()\n }\n },\n }\n\n return controls\n}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style.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs new file mode 100644 index 00000000..b2715b83 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs @@ -0,0 +1,19 @@ +"use client"; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs'; +import { createScopedWaapiAnimate } from '../animators/waapi/animate-style.mjs'; + +function useAnimateMini() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; +} + +export { useAnimateMini }; +//# sourceMappingURL=use-animate-style.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map new file mode 100644 index 00000000..2ccff9f8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate-style.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animate-style.mjs","sources":["../../../../src/animation/hooks/use-animate-style.ts"],"sourcesContent":["\"use client\"\n\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { createScopedWaapiAnimate } from \"../animators/waapi/animate-style\"\nimport { AnimationScope } from \"motion-dom\"\n\nexport function useAnimateMini() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const animate = useConstant(() => createScopedWaapiAnimate(scope))\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":[],"mappings":";;;;;;AAQI;;AAEI;AACH;AAED;;AAGI;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs new file mode 100644 index 00000000..7475e5d7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs @@ -0,0 +1,23 @@ +"use client"; +import { useMemo } from 'react'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useUnmountEffect } from '../../utils/use-unmount-effect.mjs'; +import { useReducedMotionConfig } from '../../utils/reduced-motion/use-reduced-motion-config.mjs'; +import { createScopedAnimate } from '../animate/index.mjs'; + +function useAnimate() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const reduceMotion = useReducedMotionConfig() ?? undefined; + const animate = useMemo(() => createScopedAnimate({ scope, reduceMotion }), [scope, reduceMotion]); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + scope.animations.length = 0; + }); + return [scope, animate]; +} + +export { useAnimate }; +//# sourceMappingURL=use-animate.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map new file mode 100644 index 00000000..c592f745 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animate.mjs","sources":["../../../../src/animation/hooks/use-animate.ts"],"sourcesContent":["\"use client\"\n\nimport { useMemo } from \"react\"\nimport { AnimationScope } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useUnmountEffect } from \"../../utils/use-unmount-effect\"\nimport { useReducedMotionConfig } from \"../../utils/reduced-motion/use-reduced-motion-config\"\nimport { createScopedAnimate } from \"../animate\"\n\nexport function useAnimate() {\n const scope: AnimationScope = useConstant(() => ({\n current: null!, // Will be hydrated by React\n animations: [],\n }))\n\n const reduceMotion = useReducedMotionConfig() ?? undefined\n\n const animate = useMemo(\n () => createScopedAnimate({ scope, reduceMotion }),\n [scope, reduceMotion]\n )\n\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop())\n scope.animations.length = 0\n })\n\n return [scope, animate] as [AnimationScope, typeof animate]\n}\n"],"names":[],"mappings":";;;;;;;;AAUI;;AAEI;AACH;AAED;;;AAQI;AACA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs new file mode 100644 index 00000000..2f48d0fe --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs @@ -0,0 +1,64 @@ +"use client"; +import { animateVisualElement, VisualElement, createBox } from 'motion-dom'; +import { useState, useLayoutEffect } from 'react'; +import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; + +const createObject = () => ({}); +class StateVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.measureInstanceViewportBox = createBox; + } + build() { } + resetTransform() { } + restoreTransform() { } + removeValueFromRenderState() { } + renderInstance() { } + scrapeMotionValuesFromProps() { + return createObject(); + } + getBaseTargetFromProps() { + return undefined; + } + readValueFromInstance(_state, key, options) { + return options.initialState[key] || 0; + } + sortInstanceNodePosition() { + return 0; + } +} +const useVisualState = makeUseVisualState({ + scrapeMotionValuesFromProps: createObject, + createRenderState: createObject, +}); +/** + * This is not an officially supported API and may be removed + * on any version. + */ +function useAnimatedState(initialState) { + const [animationState, setAnimationState] = useState(initialState); + const visualState = useVisualState({}, false); + const element = useConstant(() => { + return new StateVisualElement({ + props: { + onUpdate: (v) => { + setAnimationState({ ...v }); + }, + }, + visualState, + presenceContext: null, + }, { initialState }); + }); + useLayoutEffect(() => { + element.mount({}); + return () => element.unmount(); + }, [element]); + const startAnimation = useConstant(() => (animationDefinition) => { + return animateVisualElement(element, animationDefinition); + }); + return [animationState, startAnimation]; +} + +export { useAnimatedState }; +//# sourceMappingURL=use-animated-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map new file mode 100644 index 00000000..480d4019 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animated-state.mjs","sources":["../../../../src/animation/hooks/use-animated-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n animateVisualElement,\n createBox,\n ResolvedValues,\n TargetAndTransition,\n VisualElement,\n} from \"motion-dom\"\nimport { useLayoutEffect, useState } from \"react\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { useConstant } from \"../../utils/use-constant\"\n\ninterface AnimatedStateOptions {\n initialState: ResolvedValues\n}\n\nconst createObject = () => ({})\n\nclass StateVisualElement extends VisualElement<\n ResolvedValues,\n {},\n AnimatedStateOptions\n> {\n type: \"state\"\n build() {}\n measureInstanceViewportBox = createBox\n resetTransform() {}\n restoreTransform() {}\n removeValueFromRenderState() {}\n renderInstance() {}\n scrapeMotionValuesFromProps() {\n return createObject()\n }\n getBaseTargetFromProps() {\n return undefined\n }\n\n readValueFromInstance(\n _state: ResolvedValues,\n key: string,\n options: AnimatedStateOptions\n ) {\n return options.initialState[key] || 0\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n\nconst useVisualState = makeUseVisualState({\n scrapeMotionValuesFromProps: createObject,\n createRenderState: createObject,\n})\n\n/**\n * This is not an officially supported API and may be removed\n * on any version.\n */\nexport function useAnimatedState(initialState: any) {\n const [animationState, setAnimationState] = useState(initialState)\n const visualState = useVisualState({}, false)\n\n const element = useConstant(() => {\n return new StateVisualElement(\n {\n props: {\n onUpdate: (v) => {\n setAnimationState({ ...v })\n },\n },\n visualState,\n presenceContext: null,\n },\n { initialState }\n )\n })\n\n useLayoutEffect(() => {\n element.mount({})\n return () => element.unmount()\n }, [element])\n\n const startAnimation = useConstant(\n () => (animationDefinition: TargetAndTransition) => {\n return animateVisualElement(element, animationDefinition)\n }\n )\n\n return [animationState, startAnimation]\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AAEA;AAAA;;;;AAMI;AAEA;AACA;AACA;AACA;;;;;AAKI;;AAGJ;;;;AASI;;AAEP;AAED;AACI;AACA;AACH;AAED;;;AAGG;AACG;;;AAIF;;AAGY;AACI;AACI;;AAEP;;AAED;AACH;AAGT;;AAGI;AACA;AACJ;;AAIQ;AACJ;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs new file mode 100644 index 00000000..b40fbe95 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs @@ -0,0 +1,43 @@ +"use client"; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; +import { animationControls } from './animation-controls.mjs'; + +/** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ +function useAnimationControls() { + const controls = useConstant(animationControls); + useIsomorphicLayoutEffect(controls.mount, []); + return controls; +} +const useAnimation = useAnimationControls; + +export { useAnimation, useAnimationControls }; +//# sourceMappingURL=use-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map new file mode 100644 index 00000000..bea4be52 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/hooks/use-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animation.mjs","sources":["../../../../src/animation/hooks/use-animation.ts"],"sourcesContent":["\"use client\"\n\nimport { LegacyAnimationControls } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { animationControls } from \"./animation-controls\"\n\n/**\n * Creates `LegacyAnimationControls`, which can be used to manually start, stop\n * and sequence animations on one or more components.\n *\n * The returned `LegacyAnimationControls` should be passed to the `animate` property\n * of the components you want to animate.\n *\n * These components can then be animated with the `start` method.\n *\n * ```jsx\n * import * as React from 'react'\n * import { motion, useAnimation } from 'framer-motion'\n *\n * export function MyComponent(props) {\n * const controls = useAnimation()\n *\n * controls.start({\n * x: 100,\n * transition: { duration: 0.5 },\n * })\n *\n * return \n * }\n * ```\n *\n * @returns Animation controller with `start` and `stop` methods\n *\n * @public\n */\nexport function useAnimationControls(): LegacyAnimationControls {\n const controls = useConstant(animationControls)\n\n useIsomorphicLayoutEffect(controls.mount, [])\n\n return controls\n}\n\nexport const useAnimation = useAnimationControls\n"],"names":[],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;;AAEC;AAEA;AAEA;AACJ;AAEO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs new file mode 100644 index 00000000..ebdd478d --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs @@ -0,0 +1,39 @@ +import { appearAnimationStore } from './store.mjs'; +import { appearStoreId } from './store-id.mjs'; + +function handoffOptimizedAppearAnimation(elementId, valueName, frame) { + const storeId = appearStoreId(elementId, valueName); + const optimisedAnimation = appearAnimationStore.get(storeId); + if (!optimisedAnimation) { + return null; + } + const { animation, startTime } = optimisedAnimation; + function cancelAnimation() { + window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); + } + /** + * We can cancel the animation once it's finished now that we've synced + * with Motion. + * + * Prefer onfinish over finished as onfinish is backwards compatible with + * older browsers. + */ + animation.onfinish = cancelAnimation; + if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { + /** + * If the startTime is null, this animation is the Paint Ready detection animation + * and we can cancel it immediately without handoff. + * + * Or if we've already handed off the animation then we're now interrupting it. + * In which case we need to cancel it. + */ + cancelAnimation(); + return null; + } + else { + return startTime; + } +} + +export { handoffOptimizedAppearAnimation }; +//# sourceMappingURL=handoff.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map new file mode 100644 index 00000000..366e1bc3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/handoff.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"handoff.mjs","sources":["../../../../src/animation/optimized-appear/handoff.ts"],"sourcesContent":["import type { Batcher } from \"motion-dom\"\nimport { appearAnimationStore } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\nexport function handoffOptimizedAppearAnimation(\n elementId: string,\n valueName: string,\n frame: Batcher\n): number | null {\n const storeId = appearStoreId(elementId, valueName)\n const optimisedAnimation = appearAnimationStore.get(storeId)\n\n if (!optimisedAnimation) {\n return null\n }\n\n const { animation, startTime } = optimisedAnimation\n\n function cancelAnimation() {\n window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame)\n }\n\n /**\n * We can cancel the animation once it's finished now that we've synced\n * with Motion.\n *\n * Prefer onfinish over finished as onfinish is backwards compatible with\n * older browsers.\n */\n animation.onfinish = cancelAnimation\n\n if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) {\n /**\n * If the startTime is null, this animation is the Paint Ready detection animation\n * and we can cancel it immediately without handoff.\n *\n * Or if we've already handed off the animation then we're now interrupting it.\n * In which case we need to cancel it.\n */\n cancelAnimation()\n return null\n } else {\n return startTime\n }\n}\n"],"names":[],"mappings":";;;SAIgB,+BAA+B,CAC3C,SAAiB,EACjB,SAAiB,EACjB,KAAc,EAAA;IAEd,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IACnD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAE5D,IAAI,CAAC,kBAAkB,EAAE;AACrB,QAAA,OAAO,IAAI,CAAA;KACd;AAED,IAAA,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,kBAAkB,CAAA;AAEnD,IAAA,SAAS,eAAe,GAAA;QACpB,MAAM,CAAC,8BAA8B,GAAG,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;KACvE;AAED;;;;;;AAMG;AACH,IAAA,SAAS,CAAC,QAAQ,GAAG,eAAe,CAAA;AAEpC,IAAA,IAAI,SAAS,KAAK,IAAI,IAAI,MAAM,CAAC,uBAAuB,GAAG,SAAS,CAAC,EAAE;AACnE;;;;;;AAMG;AACH,QAAA,eAAe,EAAE,CAAA;AACjB,QAAA,OAAO,IAAI,CAAA;KACd;SAAM;AACH,QAAA,OAAO,SAAS,CAAA;KACnB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs new file mode 100644 index 00000000..e5261855 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs @@ -0,0 +1,170 @@ +import { optimizedAppearDataId, startWaapiAnimation, getOptimisedAppearId } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { handoffOptimizedAppearAnimation } from './handoff.mjs'; +import { appearAnimationStore, appearComplete } from './store.mjs'; +import { appearStoreId } from './store-id.mjs'; + +/** + * A single time to use across all animations to manually set startTime + * and ensure they're all in sync. + */ +let startFrameTime; +/** + * A dummy animation to detect when Chrome is ready to start + * painting the page and hold off from triggering the real animation + * until then. We only need one animation to detect paint ready. + * + * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 + */ +let readyAnimation; +/** + * Keep track of animations that were suspended vs cancelled so we + * can easily resume them when we're done measuring layout. + */ +const suspendedAnimations = new Set(); +function resumeSuspendedAnimations() { + suspendedAnimations.forEach((data) => { + data.animation.play(); + data.animation.startTime = data.startTime; + }); + suspendedAnimations.clear(); +} +function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { + // Prevent optimised appear animations if Motion has already started animating. + if (window.MotionIsMounted) { + return; + } + const id = element.dataset[optimizedAppearDataId]; + if (!id) + return; + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + const storeId = appearStoreId(id, name); + if (!readyAnimation) { + readyAnimation = startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], + /** + * 10 secs is basically just a super-safe duration to give Chrome + * long enough to get the animation ready. + */ + { duration: 10000, ease: "linear" }); + appearAnimationStore.set(storeId, { + animation: readyAnimation, + startTime: null, + }); + /** + * If there's no readyAnimation then there's been no instantiation + * of handoff animations. + */ + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + window.MotionHasOptimisedAnimation = (elementId, valueName) => { + if (!elementId) + return false; + /** + * Keep a map of elementIds that have started animating. We check + * via ID instead of Element because of hydration errors and + * pre-hydration checks. We also actively record IDs as they start + * animating rather than simply checking for data-appear-id as + * this attrbute might be present but not lead to an animation, for + * instance if the element's appear animation is on a different + * breakpoint. + */ + if (!valueName) { + return appearComplete.has(elementId); + } + const animationId = appearStoreId(elementId, valueName); + return Boolean(appearAnimationStore.get(animationId)); + }; + window.MotionHandoffMarkAsComplete = (elementId) => { + if (appearComplete.has(elementId)) { + appearComplete.set(elementId, true); + } + }; + window.MotionHandoffIsComplete = (elementId) => { + return appearComplete.get(elementId) === true; + }; + /** + * We only need to cancel transform animations as + * they're the ones that will interfere with the + * layout animation measurements. + */ + window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { + const animationId = appearStoreId(elementId, valueName); + const data = appearAnimationStore.get(animationId); + if (!data) + return; + if (frame && canResume === undefined) { + /** + * Wait until the end of the subsequent frame to cancel the animation + * to ensure we don't remove the animation before the main thread has + * had a chance to resolve keyframes and render. + */ + frame.postRender(() => { + frame.postRender(() => { + data.animation.cancel(); + }); + }); + } + else { + data.animation.cancel(); + } + if (frame && canResume) { + suspendedAnimations.add(data); + frame.render(resumeSuspendedAnimations); + } + else { + appearAnimationStore.delete(animationId); + /** + * If there are no more animations left, we can remove the cancel function. + * This will let us know when we can stop checking for conflicting layout animations. + */ + if (!appearAnimationStore.size) { + window.MotionCancelOptimisedAnimation = undefined; + } + } + }; + window.MotionCheckAppearSync = (visualElement, valueName, value) => { + const appearId = getOptimisedAppearId(visualElement); + if (!appearId) + return; + const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); + const externalAnimationValue = visualElement.props.values?.[valueName]; + if (!valueIsOptimised || !externalAnimationValue) + return; + const removeSyncCheck = value.on("change", (latestValue) => { + if (externalAnimationValue.get() !== latestValue) { + window.MotionCancelOptimisedAnimation?.(appearId, valueName); + removeSyncCheck(); + } + }); + return removeSyncCheck; + }; + } + const startAnimation = () => { + readyAnimation.cancel(); + const appearAnimation = startWaapiAnimation(element, name, keyframes, options); + /** + * Record the time of the first started animation. We call performance.now() once + * here and once in handoff to ensure we're getting + * close to a frame-locked time. This keeps all animations in sync. + */ + if (startFrameTime === undefined) { + startFrameTime = performance.now(); + } + appearAnimation.startTime = startFrameTime; + appearAnimationStore.set(storeId, { + animation: appearAnimation, + startTime: startFrameTime, + }); + if (onReady) + onReady(appearAnimation); + }; + appearComplete.set(id, false); + if (readyAnimation.ready) { + readyAnimation.ready.then(startAnimation).catch(noop); + } + else { + startAnimation(); + } +} + +export { startOptimizedAppearAnimation }; +//# sourceMappingURL=start.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map new file mode 100644 index 00000000..f9d0a7e2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/start.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"start.mjs","sources":["../../../../src/animation/optimized-appear/start.ts"],"sourcesContent":["import {\n AnyResolvedKeyframe,\n Batcher,\n getOptimisedAppearId,\n MotionValue,\n optimizedAppearDataId,\n startWaapiAnimation,\n ValueAnimationTransition,\n type WithAppearProps,\n} from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { handoffOptimizedAppearAnimation } from \"./handoff\"\nimport { appearAnimationStore, appearComplete, AppearStoreEntry } from \"./store\"\nimport { appearStoreId } from \"./store-id\"\n\n/**\n * A single time to use across all animations to manually set startTime\n * and ensure they're all in sync.\n */\nlet startFrameTime: number\n\n/**\n * A dummy animation to detect when Chrome is ready to start\n * painting the page and hold off from triggering the real animation\n * until then. We only need one animation to detect paint ready.\n *\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850\n */\nlet readyAnimation: Animation\n\n/**\n * Keep track of animations that were suspended vs cancelled so we\n * can easily resume them when we're done measuring layout.\n */\nconst suspendedAnimations = new Set()\n\nfunction resumeSuspendedAnimations() {\n suspendedAnimations.forEach((data) => {\n data.animation.play()\n data.animation.startTime = data.startTime\n })\n suspendedAnimations.clear()\n}\n\nexport function startOptimizedAppearAnimation(\n element: HTMLElement,\n name: string,\n keyframes: string[] | number[],\n options: ValueAnimationTransition,\n onReady?: (animation: Animation) => void\n): void {\n // Prevent optimised appear animations if Motion has already started animating.\n if (window.MotionIsMounted) {\n return\n }\n\n const id = element.dataset[optimizedAppearDataId]\n if (!id) return\n\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n const storeId = appearStoreId(id, name)\n if (!readyAnimation) {\n readyAnimation = startWaapiAnimation(\n element,\n name,\n [keyframes[0] as number, keyframes[0] as number],\n /**\n * 10 secs is basically just a super-safe duration to give Chrome\n * long enough to get the animation ready.\n */\n { duration: 10000, ease: \"linear\" }\n )\n\n appearAnimationStore.set(storeId, {\n animation: readyAnimation,\n startTime: null,\n })\n\n /**\n * If there's no readyAnimation then there's been no instantiation\n * of handoff animations.\n */\n window.MotionHandoffAnimation = handoffOptimizedAppearAnimation\n\n window.MotionHasOptimisedAnimation = (\n elementId?: string,\n valueName?: string\n ) => {\n if (!elementId) return false\n\n /**\n * Keep a map of elementIds that have started animating. We check\n * via ID instead of Element because of hydration errors and\n * pre-hydration checks. We also actively record IDs as they start\n * animating rather than simply checking for data-appear-id as\n * this attrbute might be present but not lead to an animation, for\n * instance if the element's appear animation is on a different\n * breakpoint.\n */\n if (!valueName) {\n return appearComplete.has(elementId)\n }\n\n const animationId = appearStoreId(elementId, valueName)\n return Boolean(appearAnimationStore.get(animationId))\n }\n\n window.MotionHandoffMarkAsComplete = (elementId: string): void => {\n if (appearComplete.has(elementId)) {\n appearComplete.set(elementId, true)\n }\n }\n\n window.MotionHandoffIsComplete = (elementId: string): boolean => {\n return appearComplete.get(elementId) === true\n }\n\n /**\n * We only need to cancel transform animations as\n * they're the ones that will interfere with the\n * layout animation measurements.\n */\n window.MotionCancelOptimisedAnimation = (\n elementId: string,\n valueName: string,\n frame?: Batcher,\n canResume?: boolean\n ) => {\n const animationId = appearStoreId(elementId, valueName)\n const data = appearAnimationStore.get(animationId)\n\n if (!data) return\n\n if (frame && canResume === undefined) {\n /**\n * Wait until the end of the subsequent frame to cancel the animation\n * to ensure we don't remove the animation before the main thread has\n * had a chance to resolve keyframes and render.\n */\n frame.postRender(() => {\n frame.postRender(() => {\n data.animation.cancel()\n })\n })\n } else {\n data.animation.cancel()\n }\n\n if (frame && canResume) {\n suspendedAnimations.add(data)\n frame.render(resumeSuspendedAnimations)\n } else {\n appearAnimationStore.delete(animationId)\n\n /**\n * If there are no more animations left, we can remove the cancel function.\n * This will let us know when we can stop checking for conflicting layout animations.\n */\n if (!appearAnimationStore.size) {\n window.MotionCancelOptimisedAnimation = undefined\n }\n }\n }\n\n window.MotionCheckAppearSync = (\n visualElement: WithAppearProps,\n valueName: string,\n value: MotionValue\n ) => {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (!appearId) return\n\n const valueIsOptimised = window.MotionHasOptimisedAnimation?.(\n appearId,\n valueName\n )\n const externalAnimationValue =\n visualElement.props.values?.[valueName]\n\n if (!valueIsOptimised || !externalAnimationValue) return\n\n const removeSyncCheck = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n if (externalAnimationValue.get() !== latestValue) {\n window.MotionCancelOptimisedAnimation?.(\n appearId,\n valueName\n )\n removeSyncCheck()\n }\n }\n )\n\n return removeSyncCheck\n }\n }\n\n const startAnimation = () => {\n readyAnimation.cancel()\n\n const appearAnimation = startWaapiAnimation(\n element,\n name,\n keyframes,\n options\n )\n\n /**\n * Record the time of the first started animation. We call performance.now() once\n * here and once in handoff to ensure we're getting\n * close to a frame-locked time. This keeps all animations in sync.\n */\n if (startFrameTime === undefined) {\n startFrameTime = performance.now()\n }\n\n appearAnimation.startTime = startFrameTime\n\n appearAnimationStore.set(storeId, {\n animation: appearAnimation,\n startTime: startFrameTime,\n })\n\n if (onReady) onReady(appearAnimation)\n }\n\n appearComplete.set(id, false)\n\n if (readyAnimation.ready) {\n readyAnimation.ready.then(startAnimation).catch(noop)\n } else {\n startAnimation()\n }\n}\n"],"names":[],"mappings":";;;;;;AAeA;;;AAGG;AACH,IAAI,cAAsB,CAAA;AAE1B;;;;;;AAMG;AACH,IAAI,cAAyB,CAAA;AAE7B;;;AAGG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAoB,CAAA;AAEvD,SAAS,yBAAyB,GAAA;AAC9B,IAAA,mBAAmB,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACjC,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;QACrB,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;AAC7C,KAAC,CAAC,CAAA;IACF,mBAAmB,CAAC,KAAK,EAAE,CAAA;AAC/B,CAAC;AAEK,SAAU,6BAA6B,CACzC,OAAoB,EACpB,IAAY,EACZ,SAA8B,EAC9B,OAAkD,EAClD,OAAwC,EAAA;;AAGxC,IAAA,IAAI,MAAM,CA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AAO,CAAC,eAAe,CAAC,CAAA;AACzC,KAAC,CAAA;AAED,IAAA,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;AAE7B,IAAA,IAAI,cAAc,CAAC,KAAK,EAAE;AACtB,QAAA,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;KACxD;SAAM;AACH,QAAA,cAAc,EAAE,CAAA;KACnB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs new file mode 100644 index 00000000..3db6ef48 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs @@ -0,0 +1,9 @@ +import { transformProps } from 'motion-dom'; + +const appearStoreId = (elementId, valueName) => { + const key = transformProps.has(valueName) ? "transform" : valueName; + return `${elementId}: ${key}`; +}; + +export { appearStoreId }; +//# sourceMappingURL=store-id.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map new file mode 100644 index 00000000..e360c1d0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store-id.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"store-id.mjs","sources":["../../../../src/animation/optimized-appear/store-id.ts"],"sourcesContent":["import { transformProps } from \"motion-dom\"\n\nexport const appearStoreId = (elementId: string, valueName: string) => {\n const key = transformProps.has(valueName) ? \"transform\" : valueName\n\n return `${elementId}: ${key}`\n}\n"],"names":[],"mappings":";;MAEa,aAAa,GAAG,CAAC,SAAiB,EAAE,SAAiB,KAAI;AAClE,IAAA,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,SAAS,CAAA;AAEnE,IAAA,OAAO,CAAG,EAAA,SAAS,CAAK,EAAA,EAAA,GAAG,EAAE,CAAA;AACjC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs new file mode 100644 index 00000000..a6cfa5ec --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs @@ -0,0 +1,5 @@ +const appearAnimationStore = new Map(); +const appearComplete = new Map(); + +export { appearAnimationStore, appearComplete }; +//# sourceMappingURL=store.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map new file mode 100644 index 00000000..58b27f40 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/optimized-appear/store.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"store.mjs","sources":["../../../../src/animation/optimized-appear/store.ts"],"sourcesContent":["export interface AppearStoreEntry {\n animation: Animation\n startTime: number | null\n}\n\nexport type AppearElementId = string\n\nexport type IsComplete = boolean\n\nexport const appearAnimationStore = new Map()\n\nexport const appearComplete = new Map()\n"],"names":[],"mappings":"AASa,MAAA,oBAAoB,GAAG,IAAI,GAAG,GAAqC;AAEnE,MAAA,cAAc,GAAG,IAAI,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs new file mode 100644 index 00000000..607c2ec2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs @@ -0,0 +1,260 @@ +import { isMotionValue, defaultOffset, isGenerator, createGeneratorEasing, fillOffset } from 'motion-dom'; +import { progress, secondsToMilliseconds, invariant, getEasingForSegment } from 'motion-utils'; +import { resolveSubjects } from '../animate/resolve-subjects.mjs'; +import { calculateRepeatDuration } from './utils/calc-repeat-duration.mjs'; +import { calcNextTime } from './utils/calc-time.mjs'; +import { addKeyframes } from './utils/edit.mjs'; +import { normalizeTimes } from './utils/normalize-times.mjs'; +import { compareByTime } from './utils/sort.mjs'; + +const defaultSegmentEasing = "easeInOut"; +const MAX_REPEAT = 20; +function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = secondsToMilliseconds(duration); + } + const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Handle repeat options + */ + if (repeat) { + invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high"); + duration = calculateRepeatDuration(duration, repeat); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + valueKeyframesAsList.push(...originalKeyframes); + for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + (repeatIndex + 1)); + ease.push(keyframeIndex === 0 + ? "linear" + : getEasingForSegment(originalEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; +} +function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); +} +function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; +} +function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; +} +function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; +} +const isNumber = (keyframe) => typeof keyframe === "number"; +const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + +export { createAnimationsFromSequence, getValueTransition }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map new file mode 100644 index 00000000..49d41201 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../src/animation/sequence/create.ts"],"sourcesContent":["import {\n AnimationScope,\n createGeneratorEasing,\n defaultOffset,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n fillOffset,\n GeneratorFactory,\n isGenerator,\n isMotionValue,\n Transition,\n UnresolvedValueKeyframe,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport {\n Easing,\n getEasingForSegment,\n invariant,\n progress,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n AnimationSequence,\n At,\n ResolvedAnimationDefinitions,\n SequenceMap,\n SequenceOptions,\n ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n sequence: AnimationSequence,\n { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n scope?: AnimationScope,\n generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n const defaultDuration = defaultTransition.duration || 0.3\n const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n const sequences = new Map()\n const elementCache = {}\n const timeLabels = new Map()\n\n let prevTime = 0\n let currentTime = 0\n let totalDuration = 0\n\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i]\n\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime)\n continue\n } else if (!Array.isArray(segment)) {\n timeLabels.set(\n segment.name,\n calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n )\n continue\n }\n\n let [subject, keyframes, transition = {}] = segment\n\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(\n currentTime,\n transition.at,\n prevTime,\n timeLabels\n )\n }\n\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0\n\n const resolveValueSequence = (\n valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n valueTransition: Transition | DynamicAnimationOptions,\n valueSequence: ValueSequence,\n elementIndex = 0,\n numSubjects = 0\n ) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n const {\n delay = 0,\n times = defaultOffset(valueKeyframesAsList),\n type = defaultTransition.type || \"keyframes\",\n repeat,\n repeatType,\n repeatDelay = 0,\n ...remainingTransition\n } = valueTransition\n let { ease = defaultTransition.ease || \"easeOut\", duration } =\n valueTransition\n\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay =\n typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay\n\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"]\n\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100\n if (\n numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)\n ) {\n const delta =\n valueKeyframesAsList[1] - valueKeyframesAsList[0]\n absoluteDelta = Math.abs(delta)\n }\n\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n }\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration)\n }\n\n const springEasing = createGeneratorEasing(\n springTransition,\n absoluteDelta,\n createGenerator\n )\n\n ease = springEasing.ease\n duration = springEasing.duration\n }\n\n duration ??= defaultDuration\n\n const startTime = currentTime + calculatedDelay\n\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1\n }\n\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length\n remainder > 0 && fillOffset(times, remainder)\n\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null)\n\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(\n repeat < MAX_REPEAT,\n \"Repeat count too high, must be less than 20\",\n \"repeat-count-high\"\n )\n\n duration = calculateRepeatDuration(\n duration,\n repeat,\n repeatDelay\n )\n\n const originalKeyframes = [...valueKeyframesAsList]\n const originalTimes = [...times]\n ease = Array.isArray(ease) ? [...ease] : [ease]\n const originalEase = [...ease]\n\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes)\n\n for (\n let keyframeIndex = 0;\n keyframeIndex < originalKeyframes.length;\n keyframeIndex++\n ) {\n times.push(\n originalTimes[keyframeIndex] + (repeatIndex + 1)\n )\n ease.push(\n keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(\n originalEase,\n keyframeIndex - 1\n )\n )\n }\n }\n\n normalizeTimes(times, repeat)\n }\n\n const targetTime = startTime + duration\n\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(\n valueSequence,\n valueKeyframesAsList,\n ease as Easing | Easing[],\n times,\n startTime,\n targetTime\n )\n\n maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n totalDuration = Math.max(targetTime, totalDuration)\n }\n\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences)\n resolveValueSequence(\n keyframes as AnyResolvedKeyframe,\n transition,\n getValueSequence(\"default\", subjectSequence)\n )\n } else {\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope,\n elementCache\n )\n\n const numSubjects = subjects.length\n\n /**\n * For every element in this segment, process the defined values.\n */\n for (\n let subjectIndex = 0;\n subjectIndex < numSubjects;\n subjectIndex++\n ) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes as DOMKeyframesDefinition\n transition = transition as DynamicAnimationOptions\n\n const thisSubject = subjects[subjectIndex]\n const subjectSequence = getSubjectSequence(\n thisSubject,\n sequences\n )\n\n for (const key in keyframes) {\n resolveValueSequence(\n keyframes[\n key as keyof typeof keyframes\n ] as UnresolvedValueKeyframe,\n getValueTransition(transition, key),\n getValueSequence(key, subjectSequence),\n subjectIndex,\n numSubjects\n )\n }\n }\n }\n\n prevTime = currentTime\n currentTime += maxDuration\n }\n\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key]\n\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime)\n\n const keyframes: UnresolvedValueKeyframe[] = []\n const valueOffset: number[] = []\n const valueEasing: Easing[] = []\n\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i]\n keyframes.push(value)\n valueOffset.push(progress(0, totalDuration, at))\n valueEasing.push(easing || \"easeOut\")\n }\n\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0)\n keyframes.unshift(keyframes[0])\n valueEasing.unshift(defaultSegmentEasing)\n }\n\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1)\n keyframes.push(null)\n }\n\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n })\n }\n\n const definition = animationDefinitions.get(element)!\n\n definition.keyframes[key] = keyframes\n\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } =\n defaultTransition\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n }\n }\n })\n\n return animationDefinitions\n}\n\nfunction getSubjectSequence(\n subject: Element | MotionValue | O,\n sequences: Map\n): SequenceMap {\n !sequences.has(subject) && sequences.set(subject, {})\n return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n if (!sequences[name]) sequences[name] = []\n return sequences[name]\n}\n\nfunction keyframesAsList(\n keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n transition: DynamicAnimationOptions & At,\n key: string\n): DynamicAnimationOptions {\n return transition && transition[key as keyof typeof transition]\n ? {\n ...transition,\n ...(transition[key as keyof typeof transition] as Transition),\n }\n : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n"],"names":[],"mappings":";;;;;;;;;AAqCA,MAAM,oBAAoB,GAAG,WAAW,CAAA;AAExC,MAAM,UAAU,GAAG,EAAE,CAAA;SAEL,4BAA4B,CACxC,QAA2B,EAC3B,EAAE,iBAAiB,GAAG,EAAE,EAAE,GAAG,kBAAkB,EAAA,GAAsB,EAAE,EACvE,KAAsB,EACtB,UAAgD,EAAA;AAEhD,IAAA,MAAM,eAAe,GAAG,iBAAiB,CAAC,QAAQ,IAAI,GAAG,CAAA;AACzD,IAAA,MAAM,oBAAoB,GAAiC,IAAI,GAAG,EAAE,CAAA;AACpE,IAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsC,CAAA;IAC/D,MAAM,YAAY,GAAG,EAAE,CAAA;AACvB,IAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAA;IAE5C,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,WAAW,GAAG,CAAC,CAAA;IACnB,IAAI,aAAa,GAAG,CAAC,CAAA;AAErB;;;;AAIG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG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AsD,EAAA;AAEtD,IAAA,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AACrD,IAAA,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAE,CAAA;AAClC,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,SAAsB,EAAA;AAC1D,IAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AAAE,QAAA,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,CAAA;AAC1C,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,eAAe,CACpB,SAA8D,EAAA;AAE9D,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC,SAAS,CAAC,CAAA;AAC7D,CAAC;AAEe,SAAA,kBAAkB,CAC9B,UAAwC,EACxC,GAAW,EAAA;AAEX,IAAA,OAAO,UAAU,IAAI,UAAU,CAAC,GAA8B,CAAC;AAC3D,UAAE;AACI,YAAA,GAAG,UAAU;YACb,GAAI,UAAU,CAAC,GAA8B,CAAgB;AAChE,SAAA;AACH,UAAE,EAAE,GAAG,UAAU,EAAE,CAAA;AAC3B,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,QAAiB,KAAK,OAAO,QAAQ,KAAK,QAAQ,CAAA;AACpE,MAAM,sBAAsB,GAAG,CAC3B,SAAoC,KACZ,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs new file mode 100644 index 00000000..7284600d --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs @@ -0,0 +1,6 @@ +function calculateRepeatDuration(duration, repeat, _repeatDelay) { + return duration * (repeat + 1); +} + +export { calculateRepeatDuration }; +//# sourceMappingURL=calc-repeat-duration.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map new file mode 100644 index 00000000..3d59a868 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-repeat-duration.mjs","sources":["../../../../../src/animation/sequence/utils/calc-repeat-duration.ts"],"sourcesContent":["export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n _repeatDelay: number\n): number {\n return duration * (repeat + 1)\n}\n"],"names":[],"mappings":"SAAgB,uBAAuB,CACnC,QAAgB,EAChB,MAAc,EACd,YAAoB,EAAA;AAEpB,IAAA,OAAO,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAC,CAAA;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs new file mode 100644 index 00000000..7e600c8b --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs @@ -0,0 +1,24 @@ +/** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ +function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } +} + +export { calcNextTime }; +//# sourceMappingURL=calc-time.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map new file mode 100644 index 00000000..2a685402 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-time.mjs","sources":["../../../../../src/animation/sequence/utils/calc-time.ts"],"sourcesContent":["import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n current: number,\n next: SequenceTime,\n prev: number,\n labels: Map\n): number {\n if (typeof next === \"number\") {\n return next\n } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next))\n } else if (next === \"<\") {\n return prev\n } else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)))\n } else {\n return labels.get(next) ?? current\n }\n}\n"],"names":[],"mappings":"AAEA;;;AAGG;AACG,SAAU,YAAY,CACxB,OAAe,EACf,IAAkB,EAClB,IAAY,EACZ,MAA2B,EAAA;AAE3B,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,OAAO,IAAI,CAAA;KACd;AAAM,SAAA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AACrD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAA;KACjD;AAAM,SAAA,IAAI,IAAI,KAAK,GAAG,EAAE;AACrB,QAAA,OAAO,IAAI,CAAA;KACd;AAAM,SAAA,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC7B,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KACvD;SAAM;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAA;KACrC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs new file mode 100644 index 00000000..a140e1b8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs @@ -0,0 +1,31 @@ +import { mixNumber } from 'motion-dom'; +import { getEasingForSegment, removeItem } from 'motion-utils'; + +function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } +} +function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: mixNumber(startTime, endTime, offset[i]), + easing: getEasingForSegment(easing, i), + }); + } +} + +export { addKeyframes, eraseKeyframes }; +//# sourceMappingURL=edit.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map new file mode 100644 index 00000000..949b5e77 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"edit.mjs","sources":["../../../../../src/animation/sequence/utils/edit.ts"],"sourcesContent":["import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n sequence: ValueSequence,\n startTime: number,\n endTime: number\n): void {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i]\n\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe)\n\n // If we remove this item we have to push the pointer back one\n i--\n }\n }\n}\n\nexport function addKeyframes(\n sequence: ValueSequence,\n keyframes: UnresolvedValueKeyframe[],\n easing: Easing | Easing[],\n offset: number[],\n startTime: number,\n endTime: number\n): void {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime)\n\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n })\n }\n}\n"],"names":[],"mappings":";;;SAIgB,cAAc,CAC1B,QAAuB,EACvB,SAAiB,EACjB,OAAe,EAAA;AAEf,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACtC,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAE5B,QAAA,IAAI,QAAQ,CAAC,EAAE,GAAG,SAAS,IAAI,QAAQ,CAAC,EAAE,GAAG,OAAO,EAAE;AAClD,YAAA,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;;AAG9B,YAAA,CAAC,EAAE,CAAA;SACN;KACJ;AACL,CAAC;AAEe,SAAA,YAAY,CACxB,QAAuB,EACvB,SAAoC,EACpC,MAAyB,EACzB,MAAgB,EAChB,SAAiB,EACjB,OAAe,EAAA;AAEf;;;;AAIG;AACH,IAAA,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAE5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,QAAQ,CAAC,IAAI,CAAC;AACV,YAAA,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;YACnB,EAAE,EAAE,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAC5C,YAAA,MAAM,EAAE,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;AACzC,SAAA,CAAC,CAAA;KACL;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs new file mode 100644 index 00000000..8b986a01 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs @@ -0,0 +1,14 @@ +/** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + */ +function normalizeTimes(times, repeat) { + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / (repeat + 1); + } +} + +export { normalizeTimes }; +//# sourceMappingURL=normalize-times.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map new file mode 100644 index 00000000..4ecf4743 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"normalize-times.mjs","sources":["../../../../../src/animation/sequence/utils/normalize-times.ts"],"sourcesContent":["/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times: number[], repeat: number): void {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1)\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AACa,SAAA,cAAc,CAAC,KAAe,EAAE,MAAc,EAAA;AAC1D,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,QAAA,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAA;KACrC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs new file mode 100644 index 00000000..49ae9387 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs @@ -0,0 +1,15 @@ +function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } +} + +export { compareByTime }; +//# sourceMappingURL=sort.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map new file mode 100644 index 00000000..8cd8d62a --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.mjs","sources":["../../../../../src/animation/sequence/utils/sort.ts"],"sourcesContent":["import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n"],"names":[],"mappings":"AAEgB,SAAA,aAAa,CACzB,CAAmB,EACnB,CAAmB,EAAA;IAEnB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE;AACf,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;AAAE,YAAA,OAAO,CAAC,CAAA;AAC9B,QAAA,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,CAAC,CAAC,CAAA;AAC/B,QAAA,OAAO,CAAC,CAAA;KACX;SAAM;AACH,QAAA,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAA;KACrB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs new file mode 100644 index 00000000..d2c7acf5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs @@ -0,0 +1,41 @@ +import { isSVGElement, isSVGSVGElement, SVGVisualElement, HTMLVisualElement, visualElementStore, ObjectVisualElement } from 'motion-dom'; + +function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = isSVGElement(element) && !isSVGSVGElement(element) + ? new SVGVisualElement(options) + : new HTMLVisualElement(options); + node.mount(element); + visualElementStore.set(element, node); +} +function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new ObjectVisualElement(options); + node.mount(subject); + visualElementStore.set(subject, node); +} + +export { createDOMVisualElement, createObjectVisualElement }; +//# sourceMappingURL=create-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map new file mode 100644 index 00000000..8203bd3f --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-visual-element.mjs","sources":["../../../../src/animation/utils/create-visual-element.ts"],"sourcesContent":["import {\n HTMLVisualElement,\n isSVGElement,\n isSVGSVGElement,\n ObjectVisualElement,\n SVGVisualElement,\n visualElementStore,\n} from \"motion-dom\"\n\nexport function createDOMVisualElement(element: HTMLElement | SVGElement) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n }\n const node =\n isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options)\n\n node.mount(element as any)\n\n visualElementStore.set(element, node)\n}\n\nexport function createObjectVisualElement(subject: Object) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n }\n const node = new ObjectVisualElement(options)\n\n node.mount(subject)\n\n visualElementStore.set(subject, node)\n}\n"],"names":[],"mappings":";;AASM,SAAU,sBAAsB,CAAC,OAAiC,EAAA;AACpE,IAAA,MAAM,OAAO,GAAG;AACZ,QAAA,eAAe,EAAE,IAAI;AACrB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE;AACT,YAAA,WAAW,EAAE;AACT,gBAAA,SAAS,EAAE,EAAE;AACb,gBAAA,eAAe,EAAE,EAAE;AACnB,gBAAA,KAAK,EAAE,EAAE;AACT,gBAAA,IAAI,EAAE,EAAE;AACR,gBAAA,KAAK,EAAE,EAAE;AACZ,aAAA;AACD,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA;KACJ,CAAA;IACD,MAAM,IAAI,GACN,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;AAC9C,UAAE,IAAI,gBAAgB,CAAC,OAAO,CAAC;AAC/B,UAAE,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAA;AAExC,IAAA,IAAI,CAAC,KAAK,CAAC,OAAc,CAAC,CAAA;AAE1B,IAAA,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACzC,CAAC;AAEK,SAAU,yBAAyB,CAAC,OAAe,EAAA;AACrD,IAAA,MAAM,OAAO,GAAG;AACZ,QAAA,eAAe,EAAE,IAAI;AACrB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE;AACT,YAAA,WAAW,EAAE;AACT,gBAAA,MAAM,EAAE,EAAE;AACb,aAAA;AACD,YAAA,YAAY,EAAE,EAAE;AACnB,SAAA;KACJ,CAAA;AACD,IAAA,MAAM,IAAI,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAE7C,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AAEnB,IAAA,kBAAkB,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs new file mode 100644 index 00000000..be445079 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs @@ -0,0 +1,6 @@ +function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); +} + +export { isDOMKeyframes }; +//# sourceMappingURL=is-dom-keyframes.mjs.map diff --git a/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map new file mode 100644 index 00000000..ff9ecfc4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-dom-keyframes.mjs","sources":["../../../../src/animation/utils/is-dom-keyframes.ts"],"sourcesContent":["import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n"],"names":[],"mappings":"AAEM,SAAU,cAAc,CAC1B,SAAkB,EAAA;AAElB,IAAA,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/client.mjs b/node_modules/framer-motion/dist/es/client.mjs new file mode 100644 index 00000000..ca763ff6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/client.mjs @@ -0,0 +1,2 @@ +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview } from './render/components/motion/elements.mjs'; +//# sourceMappingURL=client.mjs.map diff --git a/node_modules/framer-motion/dist/es/client.mjs.map b/node_modules/framer-motion/dist/es/client.mjs.map new file mode 100644 index 00000000..5835aec6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/client.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"client.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs new file mode 100644 index 00000000..ea03ab81 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs @@ -0,0 +1,105 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { isHTMLElement } from 'motion-dom'; +import * as React from 'react'; +import { useId, useRef, useContext, useInsertionEffect } from 'react'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { useComposedRefs } from '../../utils/use-composed-ref.mjs'; + +/** + * Measurement functionality has to be within a separate component + * to leverage snapshot lifecycle. + */ +class PopChildMeasure extends React.Component { + getSnapshotBeforeUpdate(prevProps) { + const element = this.props.childRef.current; + if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { + const parent = element.offsetParent; + const parentWidth = isHTMLElement(parent) + ? parent.offsetWidth || 0 + : 0; + const parentHeight = isHTMLElement(parent) + ? parent.offsetHeight || 0 + : 0; + const size = this.props.sizeRef.current; + size.height = element.offsetHeight || 0; + size.width = element.offsetWidth || 0; + size.top = element.offsetTop; + size.left = element.offsetLeft; + size.right = parentWidth - size.width - size.left; + size.bottom = parentHeight - size.height - size.top; + } + return null; + } + /** + * Required with getSnapshotBeforeUpdate to stop React complaining. + */ + componentDidUpdate() { } + render() { + return this.props.children; + } +} +function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { + const id = useId(); + const ref = useRef(null); + const size = useRef({ + width: 0, + height: 0, + top: 0, + left: 0, + right: 0, + bottom: 0, + }); + const { nonce } = useContext(MotionConfigContext); + /** + * In React 19, refs are passed via props.ref instead of element.ref. + * We check props.ref first (React 19) and fall back to element.ref (React 18). + */ + const childRef = children.props?.ref ?? + children?.ref; + const composedRef = useComposedRefs(ref, childRef); + /** + * We create and inject a style block so we can apply this explicit + * sizing in a non-destructive manner by just deleting the style block. + * + * We can't apply size via render as the measurement happens + * in getSnapshotBeforeUpdate (post-render), likewise if we apply the + * styles directly on the DOM node, we might be overwriting + * styles set via the style prop. + */ + useInsertionEffect(() => { + const { width, height, top, left, right, bottom } = size.current; + if (isPresent || pop === false || !ref.current || !width || !height) + return; + const x = anchorX === "left" ? `left: ${left}` : `right: ${right}`; + const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; + ref.current.dataset.motionPopId = id; + const style = document.createElement("style"); + if (nonce) + style.nonce = nonce; + const parent = root ?? document.head; + parent.appendChild(style); + if (style.sheet) { + style.sheet.insertRule(` + [data-motion-pop-id="${id}"] { + position: absolute !important; + width: ${width}px !important; + height: ${height}px !important; + ${x}px !important; + ${y}px !important; + } + `); + } + return () => { + if (parent.contains(style)) { + parent.removeChild(style); + } + }; + }, [isPresent]); + return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false + ? children + : React.cloneElement(children, { ref: composedRef }) })); +} + +export { PopChild }; +//# sourceMappingURL=PopChild.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map new file mode 100644 index 00000000..14f78406 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PopChild.mjs","sources":["../../../../src/components/AnimatePresence/PopChild.tsx"],"sourcesContent":["\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject\n sizeRef: React.RefObject\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const size = this.props.sizeRef.current!\n size.height = element.offsetHeight || 0\n size.width = element.offsetWidth || 0\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef(null)\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n */\n const childRef =\n (children.props as { ref?: React.Ref })?.ref ??\n (children as unknown as { ref?: React.Ref })?.ref\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n \n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAgCA;;;AAGG;AACH;AACI;;;AAGQ;AACA;AACI;;AAEJ;AACI;;;;;AAMJ;AACA;AACA;AACA;;AAGJ;;AAGJ;;AAEG;AACH;;AAGI;;AAEP;AAEe;AACZ;AACA;;AAEI;AACA;AACA;AACA;AACA;AACA;AACH;;AAED;;;AAGG;AACH;;;AAKA;;;;;;;;AAQG;;AAEC;AACA;;AAEA;AACA;;;AAKA;AAAW;AAEX;AACA;AAEA;AACI;;;;;;;;AAQH;;AAGD;AACI;AACI;;AAER;AACJ;;AAKY;AACA;AAGhB;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs new file mode 100644 index 00000000..00b89884 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs @@ -0,0 +1,63 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import * as React from 'react'; +import { useId, useMemo } from 'react'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { PopChild } from './PopChild.mjs'; + +const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { + const presenceChildren = useConstant(newChildrenMap); + const id = useId(); + let isReusedContext = true; + let context = useMemo(() => { + isReusedContext = false; + return { + id, + initial, + isPresent, + custom, + onExitComplete: (childId) => { + presenceChildren.set(childId, true); + for (const isComplete of presenceChildren.values()) { + if (!isComplete) + return; // can stop searching when any is incomplete + } + onExitComplete && onExitComplete(); + }, + register: (childId) => { + presenceChildren.set(childId, false); + return () => presenceChildren.delete(childId); + }, + }; + }, [isPresent, presenceChildren, onExitComplete]); + /** + * If the presence of a child affects the layout of the components around it, + * we want to make a new context value to ensure they get re-rendered + * so they can detect that layout change. + */ + if (presenceAffectsLayout && isReusedContext) { + context = { ...context }; + } + useMemo(() => { + presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); + }, [isPresent]); + /** + * If there's no `motion` components to fire exit animations, we want to remove this + * component immediately. + */ + React.useEffect(() => { + !isPresent && + !presenceChildren.size && + onExitComplete && + onExitComplete(); + }, [isPresent]); + children = (jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); + return (jsx(PresenceContext.Provider, { value: context, children: children })); +}; +function newChildrenMap() { + return new Map(); +} + +export { PresenceChild }; +//# sourceMappingURL=PresenceChild.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map new file mode 100644 index 00000000..1a4ebb6b --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PresenceChild.mjs","sources":["../../../../src/components/AnimatePresence/PresenceChild.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useId, useMemo } from \"react\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { VariantLabels } from \"../../motion/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { PopChild } from \"./PopChild\"\n\ninterface PresenceChildProps {\n children: React.ReactElement\n isPresent: boolean\n onExitComplete?: () => void\n initial?: false | VariantLabels\n custom?: any\n presenceAffectsLayout: boolean\n mode: \"sync\" | \"popLayout\" | \"wait\"\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n}\n\nexport const PresenceChild = ({\n children,\n initial,\n isPresent,\n onExitComplete,\n custom,\n presenceAffectsLayout,\n mode,\n anchorX,\n anchorY,\n root\n}: PresenceChildProps) => {\n const presenceChildren = useConstant(newChildrenMap)\n const id = useId()\n\n let isReusedContext = true\n let context = useMemo((): PresenceContextProps => {\n isReusedContext = false\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId: string) => {\n presenceChildren.set(childId, true)\n\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete) return // can stop searching when any is incomplete\n }\n\n onExitComplete && onExitComplete()\n },\n register: (childId: string) => {\n presenceChildren.set(childId, false)\n return () => presenceChildren.delete(childId)\n },\n }\n }, [isPresent, presenceChildren, onExitComplete])\n\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context }\n }\n\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false))\n }, [isPresent])\n\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete()\n }, [isPresent])\n\n children = (\n \n {children}\n \n )\n\n return (\n \n {children}\n \n )\n}\n\nfunction newChildrenMap(): Map {\n return new Map()\n}\n"],"names":[],"mappings":";;;;;;;;AAyBa;AAYT;AACA;;AAGA;;;;;;;AAOQ;AACI;;AAGI;AAAiB;;;;AAKzB;AACI;;;;;AAMZ;;;;AAIG;AACH;AACI;;;AAIA;AACJ;AAEA;;;AAGG;AACH;AACI;;;AAGI;AACR;AAEA;AAMA;AAKJ;AAEA;;AAEA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs new file mode 100644 index 00000000..73fe42c9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs @@ -0,0 +1,176 @@ +"use client"; +import { jsx, Fragment } from 'react/jsx-runtime'; +import { useMemo, useRef, useState, useContext } from 'react'; +import { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; +import { PresenceChild } from './PresenceChild.mjs'; +import { usePresence } from './use-presence.mjs'; +import { onlyElements, getChildKey } from './utils.mjs'; + +/** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ +const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { + const [isParentPresent, safeToRemove] = usePresence(propagate); + /** + * Filter any children that aren't ReactElements. We can only track components + * between renders with a props.key. + */ + const presentChildren = useMemo(() => onlyElements(children), [children]); + /** + * Track the keys of the currently rendered children. This is used to + * determine which children are exiting. + */ + const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); + /** + * If `initial={false}` we only want to pass this to components in the first render. + */ + const isInitialRender = useRef(true); + /** + * A ref containing the currently present children. When all exit animations + * are complete, we use this to re-render the component with the latest children + * *committed* rather than the latest children *rendered*. + */ + const pendingPresentChildren = useRef(presentChildren); + /** + * Track which exiting children have finished animating out. + */ + const exitComplete = useConstant(() => new Map()); + /** + * Track which components are currently processing exit to prevent duplicate processing. + */ + const exitingComponents = useRef(new Set()); + /** + * Save children to render as React state. To ensure this component is concurrent-safe, + * we check for exiting children via an effect. + */ + const [diffedChildren, setDiffedChildren] = useState(presentChildren); + const [renderedChildren, setRenderedChildren] = useState(presentChildren); + useIsomorphicLayoutEffect(() => { + isInitialRender.current = false; + pendingPresentChildren.current = presentChildren; + /** + * Update complete status of exiting children. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const key = getChildKey(renderedChildren[i]); + if (!presentKeys.includes(key)) { + if (exitComplete.get(key) !== true) { + exitComplete.set(key, false); + } + } + else { + exitComplete.delete(key); + exitingComponents.current.delete(key); + } + } + }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); + const exitingChildren = []; + if (presentChildren !== diffedChildren) { + let nextChildren = [...presentChildren]; + /** + * Loop through all the currently rendered components and decide which + * are exiting. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const child = renderedChildren[i]; + const key = getChildKey(child); + if (!presentKeys.includes(key)) { + nextChildren.splice(i, 0, child); + exitingChildren.push(child); + } + } + /** + * If we're in "wait" mode, and we have exiting children, we want to + * only render these until they've all exited. + */ + if (mode === "wait" && exitingChildren.length) { + nextChildren = exitingChildren; + } + setRenderedChildren(onlyElements(nextChildren)); + setDiffedChildren(presentChildren); + /** + * Early return to ensure once we've set state with the latest diffed + * children, we can immediately re-render. + */ + return null; + } + if (process.env.NODE_ENV !== "production" && + mode === "wait" && + renderedChildren.length > 1) { + console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); + } + /** + * If we've been provided a forceRender function by the LayoutGroupContext, + * we can use it to force a re-render amongst all surrounding components once + * all components have finished animating out. + */ + const { forceRender } = useContext(LayoutGroupContext); + return (jsx(Fragment, { children: renderedChildren.map((child) => { + const key = getChildKey(child); + const isPresent = propagate && !isParentPresent + ? false + : presentChildren === renderedChildren || + presentKeys.includes(key); + const onExit = () => { + if (exitingComponents.current.has(key)) { + return; + } + exitingComponents.current.add(key); + if (exitComplete.has(key)) { + exitComplete.set(key, true); + } + else { + return; + } + let isEveryExitComplete = true; + exitComplete.forEach((isExitComplete) => { + if (!isExitComplete) + isEveryExitComplete = false; + }); + if (isEveryExitComplete) { + forceRender?.(); + setRenderedChildren(pendingPresentChildren.current); + propagate && safeToRemove?.(); + onExitComplete && onExitComplete(); + } + }; + return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial + ? undefined + : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); + }) })); +}; + +export { AnimatePresence }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map new file mode 100644 index 00000000..e0d67f17 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/AnimatePresence/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * \n * {items.map(item => (\n * \n * ))}\n * \n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n exitingComponents.current.add(key)\n\n if (exitComplete.has(key)) {\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n \n {child}\n \n )\n })}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACU;;AAcT;;;AAGG;AACH;AAEA;;;AAGG;AACH;AAGA;;AAEG;AACH;AAEA;;;;AAIG;AACH;AAEA;;AAEG;;AAGH;;AAEG;;AAGH;;;AAGG;;;;AAKC;AACA;AAEA;;AAEG;AACH;;;;AAKY;;;;AAGJ;AACA;;;AAGZ;;AAIA;AACI;AAEA;;;AAGG;AACH;AACI;AACA;;;AAII;;;AAIR;;;AAGG;;;;AAKH;;AAGA;;;AAGG;AACH;;AAGJ;AAEI;AACA;AAEA;;AAKJ;;;;AAIG;;;AAMS;AAEA;AAEQ;;AAEE;;;;;AAMN;AAEA;AACI;;;;;;AAMJ;AACI;;AACJ;;;AAII;AAEA;;;AAIR;AAEA;AAMgB;;;AAiBhC;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs new file mode 100644 index 00000000..8f0f305c --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs @@ -0,0 +1,11 @@ +"use client"; +import { useContext } from 'react'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; + +function usePresenceData() { + const context = useContext(PresenceContext); + return context ? context.custom : undefined; +} + +export { usePresenceData }; +//# sourceMappingURL=use-presence-data.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map new file mode 100644 index 00000000..a94db78a --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence-data.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-presence-data.mjs","sources":["../../../../src/components/AnimatePresence/use-presence-data.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext } from \"react\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\n\nexport function usePresenceData() {\n const context = useContext(PresenceContext)\n return context ? context.custom : undefined\n}\n"],"names":[],"mappings":";;;;;AAMI;;AAEJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs new file mode 100644 index 00000000..462598e9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs @@ -0,0 +1,72 @@ +"use client"; +import { useContext, useId, useEffect, useCallback } from 'react'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; + +/** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return

+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ +function usePresence(subscribe = true) { + const context = useContext(PresenceContext); + if (context === null) + return [true, null]; + const { isPresent, onExitComplete, register } = context; + // It's safe to call the following hooks conditionally (after an early return) because the context will always + // either be null or non-null for the lifespan of the component. + const id = useId(); + useEffect(() => { + if (subscribe) { + return register(id); + } + }, [subscribe]); + const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; +} +/** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ +function useIsPresent() { + return isPresent(useContext(PresenceContext)); +} +function isPresent(context) { + return context === null ? true : context.isPresent; +} + +export { isPresent, useIsPresent, usePresence }; +//# sourceMappingURL=use-presence.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map new file mode 100644 index 00000000..d5220977 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-presence.mjs","sources":["../../../../src/components/AnimatePresence/use-presence.ts"],"sourcesContent":["\"use client\"\n\nimport { useCallback, useContext, useEffect, useId } from \"react\"\nimport {\n PresenceContext,\n PresenceContextProps,\n} from \"../../context/PresenceContext\"\n\nexport type SafeToRemove = () => void\n\ntype AlwaysPresent = [true, null]\n\ntype Present = [true]\n\ntype NotPresent = [false, SafeToRemove]\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(\n subscribe: boolean = true\n): AlwaysPresent | Present | NotPresent {\n const context = useContext(PresenceContext)\n\n if (context === null) return [true, null]\n\n const { isPresent, onExitComplete, register } = context\n\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n\n const id = useId()\n useEffect(() => {\n if (subscribe) {\n return register(id)\n }\n }, [subscribe])\n\n const safeToRemove = useCallback(\n () => subscribe && onExitComplete && onExitComplete(id),\n [id, onExitComplete, subscribe]\n )\n\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true]\n}\n\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext))\n}\n\nexport function isPresent(context: PresenceContextProps | null) {\n return context === null ? true : context.isPresent\n}\n"],"names":[],"mappings":";;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa;AAGZ;;AAEsB;;;;AAOtB;;;AAGQ;;AAER;;AAOA;AACJ;AAEA;;;;;;;;;;;;;;;;;;;AAmBG;;AAEC;AACJ;AAEM;AACF;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs new file mode 100644 index 00000000..31b4bc8b --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs @@ -0,0 +1,15 @@ +import { Children, isValidElement } from 'react'; + +const getChildKey = (child) => child.key || ""; +function onlyElements(children) { + const filtered = []; + // We use forEach here instead of map as map mutates the component key by preprending `.$` + Children.forEach(children, (child) => { + if (isValidElement(child)) + filtered.push(child); + }); + return filtered; +} + +export { getChildKey, onlyElements }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map new file mode 100644 index 00000000..9475b763 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../src/components/AnimatePresence/utils.ts"],"sourcesContent":["import { isValidElement, Children, ReactElement, ReactNode } from \"react\"\n\nexport type ComponentKey = string | number\n\nexport const getChildKey = (child: ReactElement): ComponentKey =>\n child.key || \"\"\n\nexport function onlyElements(children: ReactNode): ReactElement[] {\n const filtered: ReactElement[] = []\n\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child)) filtered.push(child)\n })\n\n return filtered\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW,GAAG,CAAC,KAAwB,KAChD,KAAK,CAAC,GAAG,IAAI,GAAE;AAEb,SAAU,YAAY,CAAC,QAAmB,EAAA;IAC5C,MAAM,QAAQ,GAAwB,EAAE,CAAA;;IAGxC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAI;QACjC,IAAI,cAAc,CAAC,KAAK,CAAC;AAAE,YAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACnD,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,QAAQ,CAAA;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs new file mode 100644 index 00000000..13a4147f --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs @@ -0,0 +1,17 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { invariant } from 'motion-utils'; +import * as React from 'react'; +import { useConstant } from '../utils/use-constant.mjs'; +import { LayoutGroup } from './LayoutGroup/index.mjs'; + +let id = 0; +const AnimateSharedLayout = ({ children }) => { + React.useEffect(() => { + invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); + }, []); + return (jsx(LayoutGroup, { id: useConstant(() => `asl-${id++}`), children: children })); +}; + +export { AnimateSharedLayout }; +//# sourceMappingURL=AnimateSharedLayout.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map new file mode 100644 index 00000000..4fb5031f --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"AnimateSharedLayout.mjs","sources":["../../../src/components/AnimateSharedLayout.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { LayoutGroup } from \"./LayoutGroup\"\n\nlet id = 0\nexport const AnimateSharedLayout: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children }: React.PropsWithChildren<{}>) => {\n React.useEffect(() => {\n invariant(\n false,\n \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\"\n )\n }, [])\n\n return (\n `asl-${id++}`)}>\n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;AAII;AACI;;;AAWR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs new file mode 100644 index 00000000..4d5b36d3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs @@ -0,0 +1,33 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { useContext, useRef, useMemo } from 'react'; +import { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs'; +import { DeprecatedLayoutGroupContext } from '../../context/DeprecatedLayoutGroupContext.mjs'; +import { useForceUpdate } from '../../utils/use-force-update.mjs'; +import { nodeGroup } from 'motion-dom'; + +const shouldInheritGroup = (inherit) => inherit === true; +const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; +const LayoutGroup = ({ children, id, inherit = true }) => { + const layoutGroupContext = useContext(LayoutGroupContext); + const deprecatedLayoutGroupContext = useContext(DeprecatedLayoutGroupContext); + const [forceRender, key] = useForceUpdate(); + const context = useRef(null); + const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id, + group: shouldInheritGroup(inherit) + ? layoutGroupContext.group || nodeGroup() + : nodeGroup(), + }; + } + const memoizedContext = useMemo(() => ({ ...context.current, forceRender }), [key]); + return (jsx(LayoutGroupContext.Provider, { value: memoizedContext, children: children })); +}; + +export { LayoutGroup }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map new file mode 100644 index 00000000..f429a6f8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/LayoutGroup/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { MutableRefObject, useContext, useMemo, useRef } from \"react\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../context/LayoutGroupContext\"\nimport { DeprecatedLayoutGroupContext } from \"../../context/DeprecatedLayoutGroupContext\"\nimport { nodeGroup } from \"../../projection\"\nimport { useForceUpdate } from \"../../utils/use-force-update\"\n\ntype InheritOption = boolean | \"id\"\n\nexport interface Props {\n id?: string\n inherit?: InheritOption\n}\n\nconst shouldInheritGroup = (inherit: InheritOption) => inherit === true\nconst shouldInheritId = (inherit: InheritOption) =>\n shouldInheritGroup(inherit === true) || inherit === \"id\"\n\nexport const LayoutGroup: React.FunctionComponent<\n React.PropsWithChildren\n> = ({ children, id, inherit = true }) => {\n const layoutGroupContext = useContext(LayoutGroupContext)\n const deprecatedLayoutGroupContext = useContext(\n DeprecatedLayoutGroupContext\n )\n const [forceRender, key] = useForceUpdate()\n const context = useRef(\n null\n ) as MutableRefObject\n\n const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext\n if (context.current === null) {\n if (shouldInheritId(inherit) && upstreamId) {\n id = id ? upstreamId + \"-\" + id : upstreamId\n }\n\n context.current = {\n id,\n group: shouldInheritGroup(inherit)\n ? layoutGroupContext.group || nodeGroup()\n : nodeGroup(),\n }\n }\n\n const memoizedContext = useMemo(\n () => ({ ...context.current, forceRender }),\n [key]\n )\n\n return (\n \n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAmBA;AACA;AAGO;AAGH;AACA;;AAIA;AAIA;AACA;AACI;AACI;;;;AAKA;AACI;;;;;AAUZ;AAKJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs new file mode 100644 index 00000000..2b051f1b --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs @@ -0,0 +1,69 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { useState, useRef, useEffect } from 'react'; +import { LazyContext } from '../../context/LazyContext.mjs'; +import { loadFeatures } from '../../motion/features/load-features.mjs'; + +/** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ +function LazyMotion({ children, features, strict = false }) { + const [, setIsLoaded] = useState(!isLazyBundle(features)); + const loadedRenderer = useRef(undefined); + /** + * If this is a synchronous load, load features immediately + */ + if (!isLazyBundle(features)) { + const { renderer, ...loadedFeatures } = features; + loadedRenderer.current = renderer; + loadFeatures(loadedFeatures); + } + useEffect(() => { + if (isLazyBundle(features)) { + features().then(({ renderer, ...loadedFeatures }) => { + loadFeatures(loadedFeatures); + loadedRenderer.current = renderer; + setIsLoaded(true); + }); + } + }, []); + return (jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); +} +function isLazyBundle(features) { + return typeof features === "function"; +} + +export { LazyMotion }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map new file mode 100644 index 00000000..d33ba6c5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/LazyMotion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { loadFeatures } from \"../../motion/features/load-features\"\nimport { FeatureBundle, LazyFeatureBundle } from \"../../motion/features/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { LazyProps } from \"./types\"\n\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }: LazyProps) {\n const [, setIsLoaded] = useState(!isLazyBundle(features))\n const loadedRenderer = useRef(undefined)\n\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features\n loadedRenderer.current = renderer\n loadFeatures(loadedFeatures)\n }\n\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures)\n loadedRenderer.current = renderer\n setIsLoaded(true)\n })\n }\n }, [])\n\n return (\n \n {children}\n \n )\n}\n\nfunction isLazyBundle(\n features: FeatureBundle | LazyFeatureBundle\n): features is LazyFeatureBundle {\n return typeof features === \"function\"\n}\n"],"names":[],"mappings":";;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACG;AACF;AACA;AAEA;;AAEG;AACH;;AAEI;;;;AAKA;AACI;;AAEI;;AAEJ;;;;AAWZ;AAEA;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs new file mode 100644 index 00000000..834f8886 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs @@ -0,0 +1,53 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { useContext, useMemo } from 'react'; +import { resolveTransition } from 'motion-dom'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { loadExternalIsValidProp } from '../../render/dom/utils/filter-props.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; + +/** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ +function MotionConfig({ children, isValidProp, ...config }) { + isValidProp && loadExternalIsValidProp(isValidProp); + /** + * Inherit props from any parent MotionConfig components + */ + const parentConfig = useContext(MotionConfigContext); + config = { ...parentConfig, ...config }; + config.transition = resolveTransition(config.transition, parentConfig.transition); + /** + * Don't allow isStatic to change between renders as it affects how many hooks + * motion components fire. + */ + config.isStatic = useConstant(() => config.isStatic); + /** + * Creating a new config context object will re-render every `motion` component + * every time it renders. So we only want to create a new one sparingly. + */ + const context = useMemo(() => config, [ + JSON.stringify(config.transition), + config.transformPagePoint, + config.reducedMotion, + config.skipAnimations, + ]); + return (jsx(MotionConfigContext.Provider, { value: context, children: children })); +} + +export { MotionConfig }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map new file mode 100644 index 00000000..7429273c --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/components/MotionConfig/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo } from \"react\"\nimport { resolveTransition } from \"motion-dom\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport {\n loadExternalIsValidProp,\n IsValidProp,\n} from \"../../render/dom/utils/filter-props\"\nimport { useConstant } from \"../../utils/use-constant\"\n\nexport interface MotionConfigProps extends Partial {\n children?: React.ReactNode\n isValidProp?: IsValidProp\n}\n\n/**\n * `MotionConfig` is used to set configuration options for all children `motion` components.\n *\n * ```jsx\n * import { motion, MotionConfig } from \"framer-motion\"\n *\n * export function App() {\n * return (\n * \n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function MotionConfig({\n children,\n isValidProp,\n ...config\n}: MotionConfigProps) {\n isValidProp && loadExternalIsValidProp(isValidProp)\n\n /**\n * Inherit props from any parent MotionConfig components\n */\n const parentConfig = useContext(MotionConfigContext)\n config = { ...parentConfig, ...config }\n\n config.transition = resolveTransition(\n config.transition,\n parentConfig.transition\n )\n\n /**\n * Don't allow isStatic to change between renders as it affects how many hooks\n * motion components fire.\n */\n config.isStatic = useConstant(() => config.isStatic)\n\n /**\n * Creating a new config context object will re-render every `motion` component\n * every time it renders. So we only want to create a new one sparingly.\n */\n const context = useMemo(\n () => config,\n [\n JSON.stringify(config.transition),\n config.transformPagePoint,\n config.reducedMotion,\n config.skipAnimations,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAiBA;;;;;;;;;;;;;;;;AAgBG;AACG;AAKF;AAEA;;AAEG;AACH;;AAGA;AAKA;;;AAGG;AACH;AAEA;;;AAGG;;AAIK;AACA;AACA;AACA;AACH;AAGL;AAKJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs new file mode 100644 index 00000000..2fc4033e --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs @@ -0,0 +1,75 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { invariant } from 'motion-utils'; +import { forwardRef, useRef, useEffect } from 'react'; +import { ReorderContext } from '../../context/ReorderContext.mjs'; +import { motion } from '../../render/components/motion/proxy.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { checkReorder } from './utils/check-reorder.mjs'; + +function ReorderGroupComponent({ children, as = "ul", axis = "y", onReorder, values, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const order = []; + const isReordering = useRef(false); + const groupRef = useRef(null); + invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); + const context = { + axis, + groupRef, + registerItem: (value, layout) => { + // If the entry was already added, update it rather than adding it again + const idx = order.findIndex((entry) => value === entry.value); + if (idx !== -1) { + order[idx].layout = layout[axis]; + } + else { + order.push({ value: value, layout: layout[axis] }); + } + order.sort(compareMin); + }, + updateOrder: (item, offset, velocity) => { + if (isReordering.current) + return; + const newOrder = checkReorder(order, item, offset, velocity); + if (order !== newOrder) { + isReordering.current = true; + onReorder(newOrder + .map(getValue) + .filter((value) => values.indexOf(value) !== -1)); + } + }, + }; + useEffect(() => { + isReordering.current = false; + }); + // Combine refs if external ref is provided + const setRef = (element) => { + groupRef.current = element; + if (typeof externalRef === "function") { + externalRef(element); + } + else if (externalRef) { + externalRef.current = element; + } + }; + /** + * Disable browser scroll anchoring on the group container. + * When items reorder, scroll anchoring can cause the browser to adjust + * the scroll position, which interferes with drag position calculations. + */ + const groupStyle = { + overflowAnchor: "none", + ...props.style, + }; + return (jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsx(ReorderContext.Provider, { value: context, children: children }) })); +} +const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent); +function getValue(item) { + return item.value; +} +function compareMin(a, b) { + return a.layout.min - b.layout.min; +} + +export { ReorderGroup, ReorderGroupComponent }; +//# sourceMappingURL=Group.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map new file mode 100644 index 00000000..2b1fb5f7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Group.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Group.mjs","sources":["../../../../src/components/Reorder/Group.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, JSX, useEffect, useRef } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DefaultGroupElement,\n ItemData,\n ReorderContextProps,\n ReorderElementTag,\n} from \"./types\"\nimport { checkReorder } from \"./utils/check-reorder\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"ul\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The axis to reorder along. By default, items will be draggable on this axis.\n * To make draggable on both axes, set ``\n *\n * @public\n */\n axis?: \"x\" | \"y\"\n\n /**\n * A callback to fire with the new value order. For instance, if the values\n * are provided as a state from `useState`, this could be the set state function.\n *\n * @public\n */\n onReorder: (newOrder: V[]) => void\n\n /**\n * The latest values state.\n *\n * ```jsx\n * function Component() {\n * const [items, setItems] = useState([0, 1, 2])\n *\n * return (\n * \n * {items.map((item) => )}\n * \n * )\n * }\n * ```\n *\n * @public\n */\n values: V[]\n}\n\ntype ReorderGroupProps<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n> = Props &\n Omit, \"values\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderGroupComponent<\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n {\n children,\n as = \"ul\" as TagName,\n axis = \"y\",\n onReorder,\n values,\n ...props\n }: ReorderGroupProps,\n externalRef?: React.ForwardedRef\n): JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const order: ItemData[] = []\n const isReordering = useRef(false)\n const groupRef = useRef(null)\n\n invariant(\n Boolean(values),\n \"Reorder.Group must be provided a values prop\",\n \"reorder-values\"\n )\n\n const context: ReorderContextProps = {\n axis,\n groupRef,\n registerItem: (value, layout) => {\n // If the entry was already added, update it rather than adding it again\n const idx = order.findIndex((entry) => value === entry.value)\n if (idx !== -1) {\n order[idx].layout = layout[axis]\n } else {\n order.push({ value: value, layout: layout[axis] })\n }\n order.sort(compareMin)\n },\n updateOrder: (item, offset, velocity) => {\n if (isReordering.current) return\n\n const newOrder = checkReorder(order, item, offset, velocity)\n\n if (order !== newOrder) {\n isReordering.current = true\n onReorder(\n newOrder\n .map(getValue)\n .filter((value) => values.indexOf(value) !== -1)\n )\n }\n },\n }\n\n useEffect(() => {\n isReordering.current = false\n })\n\n // Combine refs if external ref is provided\n const setRef = (element: Element | null) => {\n ;(groupRef as React.MutableRefObject).current = element\n if (typeof externalRef === \"function\") {\n externalRef(element)\n } else if (externalRef) {\n ;(\n externalRef as React.MutableRefObject\n ).current = element\n }\n }\n\n /**\n * Disable browser scroll anchoring on the group container.\n * When items reorder, scroll anchoring can cause the browser to adjust\n * the scroll position, which interferes with drag position calculations.\n */\n const groupStyle = {\n overflowAnchor: \"none\" as const,\n ...props.style,\n }\n\n return (\n \n \n {children}\n \n \n )\n}\n\nexport const ReorderGroup = /*@__PURE__*/ forwardRef(ReorderGroupComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultGroupElement\n>(\n props: ReorderGroupProps & { ref?: React.ForwardedRef }\n) => ReturnType\n\nfunction getValue(item: ItemData) {\n return item.value\n}\n\nfunction compareMin(a: ItemData, b: ItemData) {\n return a.layout.min - b.layout.min\n}\n"],"names":[],"mappings":";;;;;;;;;AAuEM;AAcF;;AAOA;AACA;;AAQA;;;AAGI;;AAEI;AACA;;;;AAGI;;AAEJ;;;;;AAKA;AAEA;AACI;AACA;;AAGS;;;;;AAOjB;AACJ;;AAGA;AACM;AACF;;;;AAIQ;;AAGZ;AAEA;;;;AAIG;AACH;AACI;;;AAIJ;AAOJ;AAEa;AAOb;;AAEA;AAEA;;AAEA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs new file mode 100644 index 00000000..8a1f18b7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs @@ -0,0 +1,43 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { isMotionValue } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { forwardRef, useContext } from 'react'; +import { ReorderContext } from '../../context/ReorderContext.mjs'; +import { motion } from '../../render/components/motion/proxy.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; +import { useMotionValue } from '../../value/use-motion-value.mjs'; +import { useTransform } from '../../value/use-transform.mjs'; +import { autoScrollIfNeeded, resetAutoScrollState } from './utils/auto-scroll.mjs'; + +function useDefaultMotionValue(value, defaultValue = 0) { + return isMotionValue(value) ? value : useMotionValue(defaultValue); +} +function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const context = useContext(ReorderContext); + const point = { + x: useDefaultMotionValue(style.x), + y: useDefaultMotionValue(style.y), + }; + const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); + invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); + const { axis, registerItem, updateOrder, groupRef } = context; + return (jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { + const { velocity, point: pointerPoint } = gesturePoint; + const offset = point[axis].get(); + // Always attempt to update order - checkReorder handles the logic + updateOrder(value, offset, velocity[axis]); + autoScrollIfNeeded(groupRef.current, pointerPoint[axis], axis, velocity[axis]); + onDrag && onDrag(event, gesturePoint); + }, onDragEnd: (event, gesturePoint) => { + resetAutoScrollState(); + onDragEnd && onDragEnd(event, gesturePoint); + }, onLayoutMeasure: (measured) => { + registerItem(value, measured); + }, ref: externalRef, ignoreStrict: true, children: children })); +} +const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent); + +export { ReorderItem, ReorderItemComponent }; +//# sourceMappingURL=Item.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map new file mode 100644 index 00000000..1d63cd9f --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/Item.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Item.mjs","sources":["../../../../src/components/Reorder/Item.tsx"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, useContext } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useMotionValue } from \"../../value/use-motion-value\"\nimport { useTransform } from \"../../value/use-transform\"\n\nimport { DefaultItemElement, ReorderElementTag } from \"./types\"\nimport {\n autoScrollIfNeeded,\n resetAutoScrollState,\n} from \"./utils/auto-scroll\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"li\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The value in the list that this component represents.\n *\n * @public\n */\n value: V\n\n /**\n * A subset of layout options primarily used to disable layout=\"size\"\n *\n * @public\n * @default true\n */\n layout?: true | \"position\"\n}\n\nfunction useDefaultMotionValue(value: any, defaultValue: number = 0) {\n return isMotionValue(value) ? value : useMotionValue(defaultValue)\n}\n\ntype ReorderItemProps<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> = Props &\n Omit, \"value\" | \"layout\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderItemComponent<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n {\n children,\n style = {},\n value,\n as = \"li\" as TagName,\n onDrag,\n onDragEnd,\n layout = true,\n ...props\n }: ReorderItemProps,\n externalRef?: React.ForwardedRef\n): React.JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren & { ref?: React.Ref }>\n >\n\n const context = useContext(ReorderContext)\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y),\n }\n\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) =>\n latestX || latestY ? 1 : \"unset\"\n )\n\n invariant(\n Boolean(context),\n \"Reorder.Item must be a child of Reorder.Group\",\n \"reorder-item-child\"\n )\n\n const { axis, registerItem, updateOrder, groupRef } = context!\n\n return (\n {\n const { velocity, point: pointerPoint } = gesturePoint\n const offset = point[axis].get()\n\n // Always attempt to update order - checkReorder handles the logic\n updateOrder(value, offset, velocity[axis])\n\n autoScrollIfNeeded(\n groupRef.current,\n pointerPoint[axis],\n axis,\n velocity[axis]\n )\n\n onDrag && onDrag(event, gesturePoint)\n }}\n onDragEnd={(event, gesturePoint) => {\n resetAutoScrollState()\n onDragEnd && onDragEnd(event, gesturePoint)\n }}\n onLayoutMeasure={(measured) => {\n registerItem(value, measured)\n }}\n ref={externalRef}\n ignoreStrict\n >\n {children}\n \n )\n}\n\nexport const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n props: ReorderItemProps & { ref?: React.ForwardedRef }\n) => ReturnType\n"],"names":[],"mappings":";;;;;;;;;;;;AA8CA;AACI;AACJ;AASgB;AAgBZ;AAMA;AACA;AACI;AACA;;AAGJ;;;;;;;;AA0BY;AAOA;;AAGA;AACA;AACJ;AAEI;;AAQhB;AAEa;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs new file mode 100644 index 00000000..b8d507ad --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs @@ -0,0 +1,3 @@ +export { ReorderGroup as Group } from './Group.mjs'; +export { ReorderItem as Item } from './Item.mjs'; +//# sourceMappingURL=namespace.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map new file mode 100644 index 00000000..80982f67 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/namespace.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"namespace.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs new file mode 100644 index 00000000..a2e4a8f8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs @@ -0,0 +1,124 @@ +const threshold = 50; +const maxSpeed = 25; +const overflowStyles = new Set(["auto", "scroll"]); +// Track initial scroll limits per scrollable element (Bug 1 fix) +const initialScrollLimits = new WeakMap(); +const activeScrollEdge = new WeakMap(); +// Track which group element is currently dragging to clear state on end +let currentGroupElement = null; +function resetAutoScrollState() { + if (currentGroupElement) { + const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); + if (scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + } + // Also try x axis + const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); + if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestorX); + initialScrollLimits.delete(scrollableAncestorX); + } + currentGroupElement = null; + } +} +function isScrollableElement(element, axis) { + const style = getComputedStyle(element); + const overflow = axis === "x" ? style.overflowX : style.overflowY; + const isDocumentScroll = element === document.body || + element === document.documentElement; + return overflowStyles.has(overflow) || isDocumentScroll; +} +function findScrollableAncestor(element, axis) { + let current = element?.parentElement; + while (current) { + if (isScrollableElement(current, axis)) { + return current; + } + current = current.parentElement; + } + return null; +} +function getScrollAmount(pointerPosition, scrollElement, axis) { + const rect = scrollElement.getBoundingClientRect(); + const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); + const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); + const distanceFromStart = pointerPosition - start; + const distanceFromEnd = end - pointerPosition; + if (distanceFromStart < threshold) { + const intensity = 1 - distanceFromStart / threshold; + return { amount: -maxSpeed * intensity * intensity, edge: "start" }; + } + else if (distanceFromEnd < threshold) { + const intensity = 1 - distanceFromEnd / threshold; + return { amount: maxSpeed * intensity * intensity, edge: "end" }; + } + return { amount: 0, edge: null }; +} +function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { + if (!groupElement) + return; + // Track the group element for cleanup + currentGroupElement = groupElement; + const scrollableAncestor = findScrollableAncestor(groupElement, axis); + if (!scrollableAncestor) + return; + // Convert pointer position from page coordinates to viewport coordinates. + // The gesture system uses pageX/pageY but getBoundingClientRect() returns + // viewport-relative coordinates, so we need to account for page scroll. + const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); + const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); + // If not in any threshold zone, clear all state + if (edge === null) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + return; + } + const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); + const isDocumentScroll = scrollableAncestor === document.body || + scrollableAncestor === document.documentElement; + // If not currently scrolling this edge, check velocity to see if we should start + if (currentActiveEdge !== edge) { + // Only start scrolling if velocity is towards the edge + const shouldStart = (edge === "start" && velocity < 0) || + (edge === "end" && velocity > 0); + if (!shouldStart) + return; + // Activate this edge + activeScrollEdge.set(scrollableAncestor, edge); + // Record initial scroll limit (prevents infinite scroll) + const maxScroll = axis === "x" + ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) + : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); + initialScrollLimits.set(scrollableAncestor, maxScroll); + } + // Cap scrolling at initial limit (prevents infinite scroll) + if (scrollAmount > 0) { + const initialLimit = initialScrollLimits.get(scrollableAncestor); + const currentScroll = axis === "x" + ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) + : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); + if (currentScroll >= initialLimit) + return; + } + // Apply scroll + if (axis === "x") { + if (isDocumentScroll) { + window.scrollBy({ left: scrollAmount }); + } + else { + scrollableAncestor.scrollLeft += scrollAmount; + } + } + else { + if (isDocumentScroll) { + window.scrollBy({ top: scrollAmount }); + } + else { + scrollableAncestor.scrollTop += scrollAmount; + } + } +} + +export { autoScrollIfNeeded, resetAutoScrollState }; +//# sourceMappingURL=auto-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map new file mode 100644 index 00000000..45866f39 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"auto-scroll.mjs","sources":["../../../../../src/components/Reorder/utils/auto-scroll.ts"],"sourcesContent":["const threshold = 50\nconst maxSpeed = 25\n\nconst overflowStyles = new Set([\"auto\", \"scroll\"])\n\n// Track initial scroll limits per scrollable element (Bug 1 fix)\nconst initialScrollLimits = new WeakMap()\n\n// Track auto-scroll active state per edge: \"start\" (top/left) or \"end\" (bottom/right)\ntype ActiveEdge = \"start\" | \"end\" | null\nconst activeScrollEdge = new WeakMap()\n\n// Track which group element is currently dragging to clear state on end\nlet currentGroupElement: Element | null = null\n\nexport function resetAutoScrollState(): void {\n if (currentGroupElement) {\n const scrollableAncestor = findScrollableAncestor(\n currentGroupElement,\n \"y\"\n )\n if (scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n }\n // Also try x axis\n const scrollableAncestorX = findScrollableAncestor(\n currentGroupElement,\n \"x\"\n )\n if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) {\n activeScrollEdge.delete(scrollableAncestorX)\n initialScrollLimits.delete(scrollableAncestorX)\n }\n currentGroupElement = null\n }\n}\n\nfunction isScrollableElement(element: Element, axis: \"x\" | \"y\"): boolean {\n const style = getComputedStyle(element)\n const overflow = axis === \"x\" ? style.overflowX : style.overflowY\n\n const isDocumentScroll =\n element === document.body ||\n element === document.documentElement\n\n return overflowStyles.has(overflow) || isDocumentScroll\n}\n\nfunction findScrollableAncestor(\n element: Element | null,\n axis: \"x\" | \"y\"\n): HTMLElement | null {\n let current = element?.parentElement\n while (current) {\n if (isScrollableElement(current, axis)) {\n return current\n }\n current = current.parentElement\n }\n return null\n}\n\nfunction getScrollAmount(\n pointerPosition: number,\n scrollElement: HTMLElement,\n axis: \"x\" | \"y\"\n): { amount: number; edge: ActiveEdge } {\n const rect = scrollElement.getBoundingClientRect()\n\n const start = axis === \"x\" ? Math.max(0, rect.left) : Math.max(0, rect.top)\n const end = axis === \"x\" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom)\n\n const distanceFromStart = pointerPosition - start\n const distanceFromEnd = end - pointerPosition\n\n if (distanceFromStart < threshold) {\n const intensity = 1 - distanceFromStart / threshold\n return { amount: -maxSpeed * intensity * intensity, edge: \"start\" }\n } else if (distanceFromEnd < threshold) {\n const intensity = 1 - distanceFromEnd / threshold\n return { amount: maxSpeed * intensity * intensity, edge: \"end\" }\n }\n\n return { amount: 0, edge: null }\n}\n\nexport function autoScrollIfNeeded(\n groupElement: Element | null,\n pointerPosition: number,\n axis: \"x\" | \"y\",\n velocity: number\n): void {\n if (!groupElement) return\n\n // Track the group element for cleanup\n currentGroupElement = groupElement\n\n const scrollableAncestor = findScrollableAncestor(groupElement, axis)\n if (!scrollableAncestor) return\n\n // Convert pointer position from page coordinates to viewport coordinates.\n // The gesture system uses pageX/pageY but getBoundingClientRect() returns\n // viewport-relative coordinates, so we need to account for page scroll.\n const viewportPointerPosition =\n pointerPosition - (axis === \"x\" ? window.scrollX : window.scrollY)\n\n const { amount: scrollAmount, edge } = getScrollAmount(\n viewportPointerPosition,\n scrollableAncestor,\n axis\n )\n\n // If not in any threshold zone, clear all state\n if (edge === null) {\n activeScrollEdge.delete(scrollableAncestor)\n initialScrollLimits.delete(scrollableAncestor)\n return\n }\n\n const currentActiveEdge = activeScrollEdge.get(scrollableAncestor)\n\n const isDocumentScroll =\n scrollableAncestor === document.body ||\n scrollableAncestor === document.documentElement\n\n // If not currently scrolling this edge, check velocity to see if we should start\n if (currentActiveEdge !== edge) {\n // Only start scrolling if velocity is towards the edge\n const shouldStart =\n (edge === \"start\" && velocity < 0) ||\n (edge === \"end\" && velocity > 0)\n if (!shouldStart) return\n\n // Activate this edge\n activeScrollEdge.set(scrollableAncestor, edge)\n\n // Record initial scroll limit (prevents infinite scroll)\n const maxScroll =\n axis === \"x\"\n ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth)\n : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight)\n\n initialScrollLimits.set(scrollableAncestor, maxScroll)\n }\n\n // Cap scrolling at initial limit (prevents infinite scroll)\n if (scrollAmount > 0) {\n const initialLimit = initialScrollLimits.get(scrollableAncestor)!\n const currentScroll =\n axis === \"x\"\n ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft)\n : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop)\n if (currentScroll >= initialLimit) return\n }\n\n // Apply scroll\n if (axis === \"x\") {\n if (isDocumentScroll) {\n window.scrollBy({ left: scrollAmount })\n } else {\n scrollableAncestor.scrollLeft += scrollAmount\n }\n } else {\n if (isDocumentScroll) {\n window.scrollBy({ top: scrollAmount })\n } else {\n scrollableAncestor.scrollTop += scrollAmount\n }\n }\n}\n"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAA;AAElD;AACA,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAuB,CAAA;AAI9D,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA2B,CAAA;AAE/D;AACA,IAAI,mBAAmB,GAAmB,IAAI,CAAA;SAE9B,oBAAoB,GAAA;IAChC,IAAI,mBAAmB,EAAE;QACrB,MAAM,kBAAkB,GAAG,sBAAsB,CAC7C,mBAAmB,EACnB,GAAG,CACN,CAAA;QACD,IAAI,kBAAkB,EAAE;AACpB,YAAA,gBAAgB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAC3C,YAAA,mBAAmB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAA;SACjD;;QAED,MAAM,mBAAmB,GAAG,sBAAsB,CAC9C,mBAAmB,EACnB,GAAG,CACN,CAAA;AACD,QAAA,IAAI,mBAAmB,IAAI,mBAAmB,KAAK,kBAAkB,EAAE;AACnE,YAAA,gBAAgB,CAAC,MAAM,CAAC,mBAAmB,CAAC,C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K,GAAG;AACR,eAAG,gBAAgB,GAAG,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC,UAAU;AACpE,eAAG,gBAAgB,GAAG,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAC5E,IAAI,aAAa,IAAI,YAAY;YAAE,OAAM;KAC5C;;AAGD,IAAA,IAAI,IAAI,KAAK,GAAG,EAAE;QACd,IAAI,gBAAgB,EAAE;YAClB,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;SAC1C;aAAM;AACH,YAAA,kBAAkB,CAAC,UAAU,IAAI,YAAY,CAAA;SAChD;KACJ;SAAM;QACH,IAAI,gBAAgB,EAAE;YAClB,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,CAAA;SACzC;aAAM;AACH,YAAA,kBAAkB,CAAC,SAAS,IAAI,YAAY,CAAA;SAC/C;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs new file mode 100644 index 00000000..a62d242c --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs @@ -0,0 +1,25 @@ +import { mixNumber } from 'motion-dom'; +import { moveItem } from 'motion-utils'; + +function checkReorder(order, value, offset, velocity) { + if (!velocity) + return order; + const index = order.findIndex((item) => item.value === value); + if (index === -1) + return order; + const nextOffset = velocity > 0 ? 1 : -1; + const nextItem = order[index + nextOffset]; + if (!nextItem) + return order; + const item = order[index]; + const nextLayout = nextItem.layout; + const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5); + if ((nextOffset === 1 && item.layout.max + offset > nextItemCenter) || + (nextOffset === -1 && item.layout.min + offset < nextItemCenter)) { + return moveItem(order, index, index + nextOffset); + } + return order; +} + +export { checkReorder }; +//# sourceMappingURL=check-reorder.mjs.map diff --git a/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map new file mode 100644 index 00000000..8ab68a05 --- /dev/null +++ b/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"check-reorder.mjs","sources":["../../../../../src/components/Reorder/utils/check-reorder.ts"],"sourcesContent":["import { mixNumber } from \"motion-dom\"\nimport { moveItem } from \"motion-utils\"\nimport { ItemData } from \"../types\"\n\nexport function checkReorder(\n order: ItemData[],\n value: T,\n offset: number,\n velocity: number\n): ItemData[] {\n if (!velocity) return order\n\n const index = order.findIndex((item) => item.value === value)\n\n if (index === -1) return order\n\n const nextOffset = velocity > 0 ? 1 : -1\n const nextItem = order[index + nextOffset]\n\n if (!nextItem) return order\n\n const item = order[index]\n const nextLayout = nextItem.layout\n const nextItemCenter = mixNumber(nextLayout.min, nextLayout.max, 0.5)\n\n if (\n (nextOffset === 1 && item.layout.max + offset > nextItemCenter) ||\n (nextOffset === -1 && item.layout.min + offset < nextItemCenter)\n ) {\n return moveItem(order, index, index + nextOffset)\n }\n\n return order\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,YAAY,CACxB,KAAoB,EACpB,KAAQ,EACR,MAAc,EACd,QAAgB,EAAA;AAEhB,IAAA,IAAI,CAAC,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;AAE3B,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,CAAA;IAE7D,IAAI,KAAK,KAAK,CAAC,CAAC;AAAE,QAAA,OAAO,KAAK,CAAA;AAE9B,IAAA,MAAM,UAAU,GAAG,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,CAAA;AAE1C,IAAA,IAAI,CAAC,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;AAE3B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;AACzB,IAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAA;AAClC,IAAA,MAAM,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAErE,IAAA,IACI,CAAC,UAAU,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,GAAG,cAAc;AAC9D,SAAC,UAAU,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,MAAM,GAAG,cAAc,CAAC,EAClE;QACE,OAAO,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,UAAU,CAAC,CAAA;KACpD;AAED,IAAA,OAAO,KAAK,CAAA;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs new file mode 100644 index 00000000..999cda1e --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs @@ -0,0 +1,12 @@ +"use client"; +import { createContext } from 'react'; + +/** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ +const DeprecatedLayoutGroupContext = createContext(null); + +export { DeprecatedLayoutGroupContext }; +//# sourceMappingURL=DeprecatedLayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map new file mode 100644 index 00000000..5a18fc90 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DeprecatedLayoutGroupContext.mjs","sources":["../../../src/context/DeprecatedLayoutGroupContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\n\n/**\n * Note: Still used by components generated by old versions of Framer\n *\n * @deprecated\n */\nexport const DeprecatedLayoutGroupContext = createContext(null)\n"],"names":[],"mappings":";;;AAIA;;;;AAIG;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs new file mode 100644 index 00000000..cd82e0b5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const LayoutGroupContext = createContext({}); + +export { LayoutGroupContext }; +//# sourceMappingURL=LayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map new file mode 100644 index 00000000..bda87d9a --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LayoutGroupContext.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/LazyContext.mjs b/node_modules/framer-motion/dist/es/context/LazyContext.mjs new file mode 100644 index 00000000..01260609 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LazyContext.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const LazyContext = createContext({ strict: false }); + +export { LazyContext }; +//# sourceMappingURL=LazyContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map b/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map new file mode 100644 index 00000000..57951a8d --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/LazyContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LazyContext.mjs","sources":["../../../src/context/LazyContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport { CreateVisualElement } from \"../render/types\"\n\nexport interface LazyContextProps {\n renderer?: CreateVisualElement\n strict: boolean\n}\n\nexport const LazyContext = createContext({ strict: false })\n"],"names":[],"mappings":";;;AAUO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs new file mode 100644 index 00000000..9847a73c --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs @@ -0,0 +1,14 @@ +"use client"; +import { createContext } from 'react'; + +/** + * @public + */ +const MotionConfigContext = createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never", +}); + +export { MotionConfigContext }; +//# sourceMappingURL=MotionConfigContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map new file mode 100644 index 00000000..ab50b37d --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"MotionConfigContext.mjs","sources":["../../../src/context/MotionConfigContext.tsx"],"sourcesContent":["\"use client\"\n\nimport type { Transition } from \"motion-dom\"\nimport { TransformPoint } from \"motion-utils\"\nimport { createContext } from \"react\"\n\nexport type ReducedMotionConfig = \"always\" | \"never\" | \"user\"\n\n/**\n * @public\n */\nexport interface MotionConfigContext {\n /**\n * Internal, exported only for usage in Framer\n */\n transformPagePoint: TransformPoint\n\n /**\n * Internal. Determines whether this is a static context ie the Framer canvas. If so,\n * it'll disable all dynamic functionality.\n */\n isStatic: boolean\n\n /**\n * Defines a new default transition for the entire tree.\n *\n * @public\n */\n transition?: Transition\n\n /**\n * If true, will respect the device prefersReducedMotion setting by switching\n * transform animations off.\n *\n * @public\n */\n reducedMotion?: ReducedMotionConfig\n\n /**\n * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP).\n * For more details see:\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles\n *\n * @public\n */\n nonce?: string\n\n /**\n * If true, all animations will be skipped and values will be set instantly.\n * Useful for E2E tests and visual regression testing.\n *\n * @public\n */\n skipAnimations?: boolean\n\n}\n\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n})\n"],"names":[],"mappings":";;;AAyDA;;AAEG;AACI;AACH;AACA;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs new file mode 100644 index 00000000..90806eac --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs @@ -0,0 +1,15 @@ +"use client"; +import { useContext, useMemo } from 'react'; +import { MotionContext } from './index.mjs'; +import { getCurrentTreeVariants } from './utils.mjs'; + +function useCreateMotionContext(props) { + const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext)); + return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); +} +function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; +} + +export { useCreateMotionContext }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map new file mode 100644 index 00000000..a172977a --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../src/context/MotionContext/create.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext, useMemo } from \"react\"\nimport { MotionContext, type MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getCurrentTreeVariants } from \"./utils\"\n\nexport function useCreateMotionContext(\n props: MotionProps\n): MotionContextProps {\n const { initial, animate } = getCurrentTreeVariants(\n props,\n useContext(MotionContext)\n )\n\n return useMemo(\n () => ({ initial, animate }),\n [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]\n )\n}\n\nfunction variantLabelsAsDependency(\n prop: undefined | string | string[] | boolean\n) {\n return Array.isArray(prop) ? prop.join(\" \") : prop\n}\n"],"names":[],"mappings":";;;;;AAOM;AAGF;;AASJ;AAEA;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs new file mode 100644 index 00000000..deb883c2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const MotionContext = /* @__PURE__ */ createContext({}); + +export { MotionContext }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map new file mode 100644 index 00000000..e6b4a66e --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/context/MotionContext/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface MotionContextProps {\n visualElement?: VisualElement\n initial?: false | string | string[]\n animate?: string | string[]\n}\n\nexport const MotionContext = /* @__PURE__ */ createContext(\n {}\n)\n"],"names":[],"mappings":";;;AAWa;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs new file mode 100644 index 00000000..5281e891 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs @@ -0,0 +1,17 @@ +import { isControllingVariants, isVariantLabel } from 'motion-dom'; + +function getCurrentTreeVariants(props, context) { + if (isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || isVariantLabel(initial) + ? initial + : undefined, + animate: isVariantLabel(animate) ? animate : undefined, + }; + } + return props.inherit !== false ? context : {}; +} + +export { getCurrentTreeVariants }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map new file mode 100644 index 00000000..9f6ca545 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../src/context/MotionContext/utils.ts"],"sourcesContent":["import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n"],"names":[],"mappings":";;AAIgB,SAAA,sBAAsB,CAClC,KAAkB,EAClB,OAA2B,EAAA;AAE3B,IAAA,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAA,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;QAClC,OAAO;YACH,OAAO,EACH,OAAO,KAAK,KAAK,IAAI,cAAc,CAAC,OAAO,CAAC;AACxC,kBAAG,OAAe;AAClB,kBAAE,SAAS;AACnB,YAAA,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,SAAS;SACzD,CAAA;KACJ;AACD,IAAA,OAAO,KAAK,CAAC,OAAO,KAAK,KAAK,GAAG,OAAO,GAAG,EAAE,CAAA;AACjD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs new file mode 100644 index 00000000..2ad34634 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs @@ -0,0 +1,11 @@ +"use client"; +import { createContext } from 'react'; + +/** + * @public + */ +const PresenceContext = +/* @__PURE__ */ createContext(null); + +export { PresenceContext }; +//# sourceMappingURL=PresenceContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map new file mode 100644 index 00000000..de11202f --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/PresenceContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PresenceContext.mjs","sources":["../../../src/context/PresenceContext.ts"],"sourcesContent":["\"use client\"\n\nimport { createContext } from \"react\"\nimport type { PresenceContextProps } from \"motion-dom\"\n\nexport type { PresenceContextProps }\n\n/**\n * @public\n */\nexport const PresenceContext =\n /* @__PURE__ */ createContext(null)\n"],"names":[],"mappings":";;;AAOA;;AAEG;;AAEC;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs new file mode 100644 index 00000000..17cefb9c --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs @@ -0,0 +1,7 @@ +"use client"; +import { createContext } from 'react'; + +const ReorderContext = createContext(null); + +export { ReorderContext }; +//# sourceMappingURL=ReorderContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map new file mode 100644 index 00000000..a68068f5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/ReorderContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ReorderContext.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs new file mode 100644 index 00000000..08aaa76a --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs @@ -0,0 +1,10 @@ +"use client"; +import { createContext } from 'react'; + +/** + * Internal, exported only for usage in Framer + */ +const SwitchLayoutGroupContext = createContext({}); + +export { SwitchLayoutGroupContext }; +//# sourceMappingURL=SwitchLayoutGroupContext.mjs.map diff --git a/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map new file mode 100644 index 00000000..e25c485f --- /dev/null +++ b/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"SwitchLayoutGroupContext.mjs","sources":["../../../src/context/SwitchLayoutGroupContext.ts"],"sourcesContent":["\"use client\"\n\nimport type { Transition, IProjectionNode } from \"motion-dom\"\nimport { createContext } from \"react\"\n\nexport interface SwitchLayoutGroup {\n register?: (member: IProjectionNode) => void\n deregister?: (member: IProjectionNode) => void\n}\n\nexport type SwitchLayoutGroupContext = SwitchLayoutGroup &\n InitialPromotionConfig\n\nexport type InitialPromotionConfig = {\n /**\n * The initial transition to use when the elements in this group mount (and automatically promoted).\n * Subsequent updates should provide a transition in the promote method.\n */\n transition?: Transition\n /**\n * If the follow tree should preserve its opacity when the lead is promoted on mount\n */\n shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean\n}\n\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext(\n {}\n)\n"],"names":[],"mappings":";;;AAyBA;;AAEG;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/debug.mjs b/node_modules/framer-motion/dist/es/debug.mjs new file mode 100644 index 00000000..170c251f --- /dev/null +++ b/node_modules/framer-motion/dist/es/debug.mjs @@ -0,0 +1,2 @@ +export { recordStats } from 'motion-dom'; +//# sourceMappingURL=debug.mjs.map diff --git a/node_modules/framer-motion/dist/es/debug.mjs.map b/node_modules/framer-motion/dist/es/debug.mjs.map new file mode 100644 index 00000000..b79ebbaf --- /dev/null +++ b/node_modules/framer-motion/dist/es/debug.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"debug.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/dom-mini.mjs b/node_modules/framer-motion/dist/es/dom-mini.mjs new file mode 100644 index 00000000..d8705e72 --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom-mini.mjs @@ -0,0 +1,3 @@ +export { animateSequence } from './animation/animators/waapi/animate-sequence.mjs'; +export { animateMini as animate } from './animation/animators/waapi/animate-style.mjs'; +//# sourceMappingURL=dom-mini.mjs.map diff --git a/node_modules/framer-motion/dist/es/dom-mini.mjs.map b/node_modules/framer-motion/dist/es/dom-mini.mjs.map new file mode 100644 index 00000000..4979ad8b --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom-mini.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"dom-mini.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/dom.mjs b/node_modules/framer-motion/dist/es/dom.mjs new file mode 100644 index 00000000..5df9220d --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom.mjs @@ -0,0 +1,10 @@ +export * from 'motion-dom'; +export { delayInSeconds as delay } from 'motion-dom'; +export * from 'motion-utils'; +export { animate, createScopedAnimate } from './animation/animate/index.mjs'; +export { animateMini } from './animation/animators/waapi/animate-style.mjs'; +export { scroll } from './render/dom/scroll/index.mjs'; +export { scrollInfo } from './render/dom/scroll/track.mjs'; +export { inView } from './render/dom/viewport/index.mjs'; +export { distance, distance2D } from './utils/distance.mjs'; +//# sourceMappingURL=dom.mjs.map diff --git a/node_modules/framer-motion/dist/es/dom.mjs.map b/node_modules/framer-motion/dist/es/dom.mjs.map new file mode 100644 index 00000000..f9925fb5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/dom.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"dom.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs new file mode 100644 index 00000000..e2046649 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs @@ -0,0 +1,9 @@ +import { addDomEvent } from 'motion-dom'; +import { addPointerInfo } from './event-info.mjs'; + +function addPointerEvent(target, eventName, handler, options) { + return addDomEvent(target, eventName, addPointerInfo(handler), options); +} + +export { addPointerEvent }; +//# sourceMappingURL=add-pointer-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map new file mode 100644 index 00000000..60696f31 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/add-pointer-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"add-pointer-event.mjs","sources":["../../../src/events/add-pointer-event.ts"],"sourcesContent":["import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n"],"names":[],"mappings":";;;AAGM,SAAU,eAAe,CAC3B,MAAmB,EACnB,SAAiB,EACjB,OAAmC,EACnC,OAAiC,EAAA;AAEjC,IAAA,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;AAC3E;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/event-info.mjs b/node_modules/framer-motion/dist/es/events/event-info.mjs new file mode 100644 index 00000000..2b342bff --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/event-info.mjs @@ -0,0 +1,16 @@ +import { isPrimaryPointer } from 'motion-dom'; + +function extractEventInfo(event) { + return { + point: { + x: event.pageX, + y: event.pageY, + }, + }; +} +const addPointerInfo = (handler) => { + return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); +}; + +export { addPointerInfo, extractEventInfo }; +//# sourceMappingURL=event-info.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/event-info.mjs.map b/node_modules/framer-motion/dist/es/events/event-info.mjs.map new file mode 100644 index 00000000..67707b26 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/event-info.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"event-info.mjs","sources":["../../../src/events/event-info.ts"],"sourcesContent":["import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo = (\n handler: EventListenerWithPointInfo\n): EventListener => {\n return (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n}\n"],"names":[],"mappings":";;AAOM,SAAU,gBAAgB,CAAC,KAAmB,EAAA;IAChD,OAAO;AACH,QAAA,KAAK,EAAE;YACH,CAAC,EAAE,KAAK,CAAC,KAAK;YACd,CAAC,EAAE,KAAK,CAAC,KAAK;AACjB,SAAA;KACJ,CAAA;AACL,CAAC;AAEY,MAAA,cAAc,GAAG,CAC1B,OAAmC,KACpB;AACf,IAAA,OAAO,CAAC,KAAmB,KACvB,gBAAgB,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAA;AAC1E;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs new file mode 100644 index 00000000..8ea5b54f --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs @@ -0,0 +1,36 @@ +"use client"; +import { useEffect } from 'react'; +import { addDomEvent } from 'motion-dom'; + +/** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return
+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ +function useDomEvent(ref, eventName, handler, options) { + useEffect(() => { + const element = ref.current; + if (handler && element) { + return addDomEvent(element, eventName, handler, options); + } + }, [ref, eventName, handler, options]); +} + +export { useDomEvent }; +//# sourceMappingURL=use-dom-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map new file mode 100644 index 00000000..f24c4bf5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/events/use-dom-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-dom-event.mjs","sources":["../../../src/events/use-dom-event.ts"],"sourcesContent":["\"use client\"\n\nimport { RefObject, useEffect } from \"react\"\nimport { addDomEvent } from \"motion-dom\"\n\n/**\n * Attaches an event listener directly to the provided DOM element.\n *\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\n * event handlers.\n *\n * ```jsx\n * const ref = useRef(null)\n *\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\n *\n * return
\n * ```\n *\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\n * @param eventName - Name of the event you want listen for.\n * @param handler - Function to fire when receiving the event.\n * @param options - Options to pass to `Event.addEventListener`.\n *\n * @public\n */\nexport function useDomEvent(\n ref: RefObject,\n eventName: string,\n handler?: EventListener | undefined,\n options?: AddEventListenerOptions\n) {\n useEffect(() => {\n const element = ref.current\n\n if (handler && element) {\n return addDomEvent(element, eventName, handler, options)\n }\n }, [ref, eventName, handler, options])\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG;;AAOE;AAEA;;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs new file mode 100644 index 00000000..67b6b2fc --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs @@ -0,0 +1,560 @@ +import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, isElementTextInput, addDomEvent, setDragLock, percent, calcLength, resize } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { addPointerEvent } from '../../events/add-pointer-event.mjs'; +import { extractEventInfo } from '../../events/event-info.mjs'; +import { getContextWindow } from '../../utils/get-context-window.mjs'; +import { isRefObject } from '../../utils/is-ref-object.mjs'; +import { PanSession } from '../pan/PanSession.mjs'; +import { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs'; + +const elementDragControls = new WeakMap(); +class VisualElementDragControls { + constructor(visualElement) { + this.openDragLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { x: 0, y: 0 }; + /** + * The permitted boundaries of travel, in pixels. + */ + this.constraints = false; + this.hasMutatedConstraints = false; + /** + * The per-axis resolved elastic values. + */ + this.elastic = createBox(); + /** + * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPointerEvent = null; + /** + * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPanInfo = null; + this.visualElement = visualElement; + } + start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { + /** + * Don't start dragging if this component is exiting + */ + const { presenceContext } = this.visualElement; + if (presenceContext && presenceContext.isPresent === false) + return; + const onSessionStart = (event) => { + if (snapToCursor) { + this.snapToCursor(extractEventInfo(event).point); + } + this.stopAnimation(); + }; + const onStart = (event, info) => { + // Attempt to grab the global drag gesture lock - maybe make this part of PanSession + const { drag, dragPropagation, onDragStart } = this.getProps(); + if (drag && !dragPropagation) { + if (this.openDragLock) + this.openDragLock(); + this.openDragLock = setDragLock(drag); + // If we don 't have the lock, don't start dragging + if (!this.openDragLock) + return; + } + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.isDragging = true; + this.currentDirection = null; + this.resolveConstraints(); + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = true; + this.visualElement.projection.target = undefined; + } + /** + * Record gesture origin and pointer offset + */ + eachAxis((axis) => { + let current = this.getAxisMotionValue(axis).get() || 0; + /** + * If the MotionValue is a percentage value convert to px + */ + if (percent.test(current)) { + const { projection } = this.visualElement; + if (projection && projection.layout) { + const measuredAxis = projection.layout.layoutBox[axis]; + if (measuredAxis) { + const length = calcLength(measuredAxis); + current = length * (parseFloat(current) / 100); + } + } + } + this.originPoint[axis] = current; + }); + // Fire onDragStart event + if (onDragStart) { + frame.update(() => onDragStart(event, info), false, true); + } + addValueToWillChange(this.visualElement, "transform"); + const { animationState } = this.visualElement; + animationState && animationState.setActive("whileDrag", true); + }; + const onMove = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); + // If we didn't successfully receive the gesture lock, early return. + if (!dragPropagation && !this.openDragLock) + return; + const { offset } = info; + // Attempt to detect drag direction if directionLock is true + if (dragDirectionLock && this.currentDirection === null) { + this.currentDirection = getCurrentDirection(offset); + // If we've successfully set a direction, notify listener + if (this.currentDirection !== null) { + onDirectionLock && onDirectionLock(this.currentDirection); + } + return; + } + // Update each point with the latest position + this.updateAxis("x", info.point, offset); + this.updateAxis("y", info.point, offset); + /** + * Ideally we would leave the renderer to fire naturally at the end of + * this frame but if the element is about to change layout as the result + * of a re-render we want to ensure the browser can read the latest + * bounding box to ensure the pointer and element don't fall out of sync. + */ + this.visualElement.render(); + /** + * This must fire after the render call as it might trigger a state + * change which itself might trigger a layout update. + */ + if (onDrag) { + frame.update(() => onDrag(event, info), false, true); + } + }; + const onSessionEnd = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.stop(event, info); + this.latestPointerEvent = null; + this.latestPanInfo = null; + }; + const resumeAnimation = () => { + const { dragSnapToOrigin: snap } = this.getProps(); + if (snap || this.constraints) { + this.startAnimation({ x: 0, y: 0 }); + } + }; + const { dragSnapToOrigin } = this.getProps(); + this.panSession = new PanSession(originEvent, { + onSessionStart, + onStart, + onMove, + onSessionEnd, + resumeAnimation, + }, { + transformPagePoint: this.visualElement.getTransformPagePoint(), + dragSnapToOrigin, + distanceThreshold, + contextWindow: getContextWindow(this.visualElement), + element: this.visualElement.current, + }); + } + /** + * @internal + */ + stop(event, panInfo) { + const finalEvent = event || this.latestPointerEvent; + const finalPanInfo = panInfo || this.latestPanInfo; + const isDragging = this.isDragging; + this.cancel(); + if (!isDragging || !finalPanInfo || !finalEvent) + return; + const { velocity } = finalPanInfo; + this.startAnimation(velocity); + const { onDragEnd } = this.getProps(); + if (onDragEnd) { + frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); + } + } + /** + * @internal + */ + cancel() { + this.isDragging = false; + const { projection, animationState } = this.visualElement; + if (projection) { + projection.isAnimationBlocked = false; + } + this.endPanSession(); + const { dragPropagation } = this.getProps(); + if (!dragPropagation && this.openDragLock) { + this.openDragLock(); + this.openDragLock = null; + } + animationState && animationState.setActive("whileDrag", false); + } + /** + * Clean up the pan session without modifying other drag state. + * This is used during unmount to ensure event listeners are removed + * without affecting projection animations or drag locks. + * @internal + */ + endPanSession() { + this.panSession && this.panSession.end(); + this.panSession = undefined; + } + updateAxis(axis, _point, offset) { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) + return; + const axisValue = this.getAxisMotionValue(axis); + let next = this.originPoint[axis] + offset[axis]; + // Apply constraints + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); + } + axisValue.set(next); + } + resolveConstraints() { + const { dragConstraints, dragElastic } = this.getProps(); + const layout = this.visualElement.projection && + !this.visualElement.projection.layout + ? this.visualElement.projection.measure(false) + : this.visualElement.projection?.layout; + const prevConstraints = this.constraints; + if (dragConstraints && isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } + else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); + } + else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + /** + * If we're outputting to external MotionValues, we want to rebase the measured constraints + * from viewport-relative to component-relative. This only applies to relative (non-ref) + * constraints, as ref-based constraints from calcViewportConstraints are already in the + * correct coordinate space for the motion value transform offset. + */ + if (prevConstraints !== this.constraints && + !isRefObject(dragConstraints) && + layout && + this.constraints && + !this.hasMutatedConstraints) { + eachAxis((axis) => { + if (this.constraints !== false && + this.getAxisMotionValue(axis)) { + this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); + } + }); + } + } + resolveRefConstraints() { + const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); + if (!constraints || !isRefObject(constraints)) + return false; + const constraintsElement = constraints.current; + invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); + const { projection } = this.visualElement; + // TODO + if (!projection || !projection.layout) + return false; + const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); + /** + * If there's an onMeasureDragConstraints listener we call it and + * if different constraints are returned, set constraints to that + */ + if (onMeasureDragConstraints) { + const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + } + startAnimation(velocity) { + const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); + const constraints = this.constraints || {}; + const momentumAnimations = eachAxis((axis) => { + if (!shouldDrag(axis, drag, this.currentDirection)) { + return; + } + let transition = (constraints && constraints[axis]) || {}; + if (dragSnapToOrigin) + transition = { min: 0, max: 0 }; + /** + * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame + * of spring animations so we should look into adding a disable spring option to `inertia`. + * We could do something here where we affect the `bounceStiffness` and `bounceDamping` + * using the value of `dragElastic`. + */ + const bounceStiffness = dragElastic ? 200 : 1000000; + const bounceDamping = dragElastic ? 40 : 10000000; + const inertia = { + type: "inertia", + velocity: dragMomentum ? velocity[axis] : 0, + bounceStiffness, + bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10, + ...dragTransition, + ...transition, + }; + // If we're not animating on an externally-provided `MotionValue` we can use the + // component's animation controls which will handle interactions with whileHover (etc), + // otherwise we just have to animate the `MotionValue` itself. + return this.startAxisValueAnimation(axis, inertia); + }); + // Run all animations and then resolve the new drag constraints. + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + } + startAxisValueAnimation(axis, transition) { + const axisValue = this.getAxisMotionValue(axis); + addValueToWillChange(this.visualElement, axis); + return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); + } + stopAnimation() { + eachAxis((axis) => this.getAxisMotionValue(axis).stop()); + } + /** + * Drag works differently depending on which props are provided. + * + * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. + * - Otherwise, we apply the delta to the x/y motion values. + */ + getAxisMotionValue(axis) { + const dragKey = `_drag${axis.toUpperCase()}`; + const props = this.visualElement.getProps(); + const externalMotionValue = props[dragKey]; + return externalMotionValue + ? externalMotionValue + : this.visualElement.getValue(axis, (props.initial + ? props.initial[axis] + : undefined) || 0); + } + snapToCursor(point) { + eachAxis((axis) => { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!shouldDrag(axis, drag, this.currentDirection)) + return; + const { projection } = this.visualElement; + const axisValue = this.getAxisMotionValue(axis); + if (projection && projection.layout) { + const { min, max } = projection.layout.layoutBox[axis]; + /** + * The layout measurement includes the current transform value, + * so we need to add it back to get the correct snap position. + * This fixes an issue where elements with initial coordinates + * would snap to the wrong position on the first drag. + */ + const current = axisValue.get() || 0; + axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current); + } + }); + } + /** + * When the viewport resizes we want to check if the measured constraints + * have changed and, if so, reposition the element within those new constraints + * relative to where it was before the resize. + */ + scalePositionWithinConstraints() { + if (!this.visualElement.current) + return; + const { drag, dragConstraints } = this.getProps(); + const { projection } = this.visualElement; + if (!isRefObject(dragConstraints) || !projection || !this.constraints) + return; + /** + * Stop current animations as there can be visual glitching if we try to do + * this mid-animation + */ + this.stopAnimation(); + /** + * Record the relative position of the dragged element relative to the + * constraints box and save as a progress value. + */ + const boxProgress = { x: 0, y: 0 }; + eachAxis((axis) => { + const axisValue = this.getAxisMotionValue(axis); + if (axisValue && this.constraints !== false) { + const latest = axisValue.get(); + boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); + } + }); + /** + * Update the layout of this element and resolve the latest drag constraints + */ + const { transformTemplate } = this.visualElement.getProps(); + this.visualElement.current.style.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + /** + * Reset constraints so resolveConstraints() will recalculate them + * with the freshly measured layout rather than returning the cached value. + */ + this.constraints = false; + this.resolveConstraints(); + /** + * For each axis, calculate the current progress of the layout axis + * within the new constraints. + */ + eachAxis((axis) => { + if (!shouldDrag(axis, drag, null)) + return; + /** + * Calculate a new transform based on the previous box progress + */ + const axisValue = this.getAxisMotionValue(axis); + const { min, max } = this.constraints[axis]; + axisValue.set(mixNumber(min, max, boxProgress[axis])); + }); + /** + * Flush the updated transform to the DOM synchronously to prevent + * a visual flash at the element's CSS layout position (0,0) when + * the transform was stripped for measurement. + */ + this.visualElement.render(); + } + addListeners() { + if (!this.visualElement.current) + return; + elementDragControls.set(this.visualElement, this); + const element = this.visualElement.current; + /** + * Attach a pointerdown event listener on this DOM element to initiate drag tracking. + */ + const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { + const { drag, dragListener = true } = this.getProps(); + const target = event.target; + /** + * Only block drag if clicking on a text input child element + * (input, textarea, select, contenteditable) where users might + * want to select text or interact with the control. + * + * Buttons and links don't block drag since they don't have + * click-and-move actions of their own. + */ + const isClickingTextInputChild = target !== element && isElementTextInput(target); + if (drag && dragListener && !isClickingTextInputChild) { + this.start(event); + } + }); + /** + * If using ref-based constraints, observe both the draggable element + * and the constraint container for size changes via ResizeObserver. + * Setup is deferred because dragConstraints.current is null when + * addListeners first runs (React hasn't committed the ref yet). + */ + let stopResizeObservers; + const measureDragConstraints = () => { + const { dragConstraints } = this.getProps(); + if (isRefObject(dragConstraints) && dragConstraints.current) { + this.constraints = this.resolveRefConstraints(); + if (!stopResizeObservers) { + stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); + } + } + }; + const { projection } = this.visualElement; + const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + } + frame.read(measureDragConstraints); + /** + * Attach a window resize listener to scale the draggable target within its defined + * constraints as the window resizes. + */ + const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); + /** + * If the element's layout changes, calculate the delta and apply that to + * the drag gesture's origin point. + */ + const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { + if (this.isDragging && hasLayoutChanged) { + eachAxis((axis) => { + const motionValue = this.getAxisMotionValue(axis); + if (!motionValue) + return; + this.originPoint[axis] += delta[axis].translate; + motionValue.set(motionValue.get() + delta[axis].translate); + }); + this.visualElement.render(); + } + })); + return () => { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + stopLayoutUpdateListener && stopLayoutUpdateListener(); + stopResizeObservers && stopResizeObservers(); + }; + } + getProps() { + const props = this.visualElement.getProps(); + const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; + return { + ...props, + drag, + dragDirectionLock, + dragPropagation, + dragConstraints, + dragElastic, + dragMomentum, + }; + } +} +function skipFirstCall(callback) { + let isFirst = true; + return () => { + if (isFirst) { + isFirst = false; + return; + } + callback(); + }; +} +function startResizeObservers(element, constraintsElement, onResize) { + const stopElement = resize(element, skipFirstCall(onResize)); + const stopContainer = resize(constraintsElement, skipFirstCall(onResize)); + return () => { + stopElement(); + stopContainer(); + }; +} +function shouldDrag(direction, drag, currentDirection) { + return ((drag === true || drag === direction) && + (currentDirection === null || currentDirection === direction)); +} +/** + * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower + * than the provided threshold, return `null`. + * + * @param offset - The x/y offset from origin. + * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. + */ +function getCurrentDirection(offset, lockThreshold = 10) { + let direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } + else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; + } + return direction; +} + +export { VisualElementDragControls, elementDragControls }; +//# sourceMappingURL=VisualElementDragControls.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map new file mode 100644 index 00000000..0a7e5a03 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"VisualElementDragControls.mjs","sources":["../../../../src/gestures/drag/VisualElementDragControls.ts"],"sourcesContent":["import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (dragSnapToOrigin) transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n (props.initial\n ? props.initial[axis as keyof typeof props.initial]\n : undefined) || 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConst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KAAK,IAAI,IAAI,gBAAgB,KAAK,SAAS,CAAC,EAChE;AACL,CAAC;AAED;;;;;;AAMG;AACH,SAAS,mBAAmB,CACxB,MAAa,EACb,aAAa,GAAG,EAAE,EAAA;IAElB,IAAI,SAAS,GAAyB,IAAI,CAAA;IAE1C,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,EAAE;QACpC,SAAS,GAAG,GAAG,CAAA;KAClB;SAAM,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,EAAE;QAC3C,SAAS,GAAG,GAAG,CAAA;KAClB;AAED,IAAA,OAAO,SAAS,CAAA;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs new file mode 100644 index 00000000..6eda9887 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs @@ -0,0 +1,51 @@ +import { Feature } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { VisualElementDragControls } from './VisualElementDragControls.mjs'; + +class DragGesture extends Feature { + constructor(node) { + super(node); + this.removeGroupControls = noop; + this.removeListeners = noop; + this.controls = new VisualElementDragControls(node); + } + mount() { + // If we've been provided a DragControls for manual control over the drag gesture, + // subscribe this component to it on mount. + const { dragControls } = this.node.getProps(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + this.removeListeners = this.controls.addListeners() || noop; + } + update() { + const { dragControls } = this.node.getProps(); + const { dragControls: prevDragControls } = this.node.prevProps || {}; + if (dragControls !== prevDragControls) { + this.removeGroupControls(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + } + } + unmount() { + this.removeGroupControls(); + this.removeListeners(); + /** + * In React 19, during list reorder reconciliation, components may + * briefly unmount and remount while the drag is still active. If we're + * actively dragging, we should NOT end the pan session - it will + * continue tracking pointer events via its window-level listeners. + * + * The pan session will be properly cleaned up when: + * 1. The drag ends naturally (pointerup/pointercancel) + * 2. The component is truly removed from the DOM + */ + if (!this.controls.isDragging) { + this.controls.endPanSession(); + } + } +} + +export { DragGesture }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map new file mode 100644 index 00000000..b317949f --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/drag/index.ts"],"sourcesContent":["import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n"],"names":[],"mappings":";;;;AAIM,MAAO,WAAY,SAAQ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No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs new file mode 100644 index 00000000..ebd79b9f --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs @@ -0,0 +1,117 @@ +import { useConstant } from '../../utils/use-constant.mjs'; + +/** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +class DragControls { + constructor() { + this.componentControls = new Set(); + } + /** + * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. + * + * @internal + */ + subscribe(controls) { + this.componentControls.add(controls); + return () => this.componentControls.delete(controls); + } + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event, options) { + this.componentControls.forEach((controls) => { + controls.start(event.nativeEvent || event, options); + }); + } + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel() { + this.componentControls.forEach((controls) => { + controls.cancel(); + }); + } + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop() { + this.componentControls.forEach((controls) => { + controls.stop(); + }); + } +} +const createDragControls = () => new DragControls(); +/** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +function useDragControls() { + return useConstant(createDragControls); +} + +export { DragControls, useDragControls }; +//# sourceMappingURL=use-drag-controls.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map new file mode 100644 index 00000000..61b807d3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-drag-controls.mjs","sources":["../../../../src/gestures/drag/use-drag-controls.ts"],"sourcesContent":["import * as React from \"react\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport {\n DragControlOptions,\n VisualElementDragControls,\n} from \"./VisualElementDragControls\"\n\n/**\n * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport class DragControls {\n private componentControls = new Set()\n\n /**\n * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.\n *\n * @internal\n */\n subscribe(controls: VisualElementDragControls): () => void {\n this.componentControls.add(controls)\n\n return () => this.componentControls.delete(controls)\n }\n\n /**\n * Start a drag gesture on every `motion` component that has this set of drag controls\n * passed into it via the `dragControls` prop.\n *\n * ```jsx\n * dragControls.start(e, {\n * snapToCursor: true\n * })\n * ```\n *\n * @param event - PointerEvent\n * @param options - Options\n *\n * @public\n */\n start(\n event: React.PointerEvent | PointerEvent,\n options?: DragControlOptions\n ) {\n this.componentControls.forEach((controls) => {\n controls.start(\n (event as React.PointerEvent).nativeEvent || event,\n options\n )\n })\n }\n\n /**\n * Cancels a drag gesture.\n *\n * ```jsx\n * dragControls.cancel()\n * ```\n *\n * @public\n */\n cancel() {\n this.componentControls.forEach((controls) => {\n controls.cancel()\n })\n }\n\n /**\n * Stops a drag gesture.\n *\n * ```jsx\n * dragControls.stop()\n * ```\n *\n * @public\n */\n stop() {\n this.componentControls.forEach((controls) => {\n controls.stop()\n })\n }\n}\n\nconst createDragControls = () => new DragControls()\n\n/**\n * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop\n * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we\n * might want to initiate that dragging from a different component than the draggable one.\n *\n * By creating a `dragControls` using the `useDragControls` hook, we can pass this into\n * the draggable component's `dragControls` prop. It exposes a `start` method\n * that can start dragging from pointer events on other components.\n *\n * ```jsx\n * const dragControls = useDragControls()\n *\n * function startDrag(event) {\n * dragControls.start(event, { snapToCursor: true })\n * }\n *\n * return (\n * <>\n *
\n * \n * \n * )\n * ```\n *\n * @public\n */\nexport function useDragControls() {\n return useConstant(createDragControls)\n}\n"],"names":[],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;AAmBG;MACU,YAAY,CAAA;AAAzB,IAAA,WAAA,GAAA;AACY,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,GAAG,EAA6B,CAAA;KAqEnE;AAnEG;;;;AAIG;AACH,IAAA,SAAS,CAAC,QAAmC,EAAA;AACzC,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAEpC,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;KACvD;AAED;;;;;;;;;;;;;;AAcG;IACH,KAAK,CACD,KAAwC,EACxC,OAA4B,EAAA;QAE5B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,KAAK,CACT,KAA4B,CAAC,WAAW,IAAI,KAAK,EAClD,OAAO,CACV,CAAA;AACL,SAAC,CAAC,CAAA;KACL;AAED;;;;;;;;AAQG;IACH,MAAM,GAAA;QACF,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,MAAM,EAAE,CAAA;AACrB,SAAC,CAAC,CAAA;KACL;AAED;;;;;;;;AAQG;IACH,IAAI,GAAA;QACA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YACxC,QAAQ,CAAC,IAAI,EAAE,CAAA;AACnB,SAAC,CAAC,CAAA;KACL;AACJ,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,IAAI,YAAY,EAAE,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;SACa,eAAe,GAAA;AAC3B,IAAA,OAAO,WAAW,CAAC,kBAAkB,CAAC,CAAA;AAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs new file mode 100644 index 00000000..98c6754c --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs @@ -0,0 +1,128 @@ +import { mixNumber, calcLength } from 'motion-dom'; +import { progress, clamp } from 'motion-utils'; + +/** + * Apply constraints to a point. These constraints are both physical along an + * axis, and an elastic factor that determines how much to constrain the point + * by if it does lie outside the defined parameters. + */ +function applyConstraints(point, { min, max }, elastic) { + if (min !== undefined && point < min) { + // If we have a min point defined, and this is outside of that, constrain + point = elastic + ? mixNumber(min, point, elastic.min) + : Math.max(point, min); + } + else if (max !== undefined && point > max) { + // If we have a max point defined, and this is outside of that, constrain + point = elastic + ? mixNumber(max, point, elastic.max) + : Math.min(point, max); + } + return point; +} +/** + * Calculate constraints in terms of the viewport when defined relatively to the + * measured axis. This is measured from the nearest edge, so a max constraint of 200 + * on an axis with a max value of 300 would return a constraint of 500 - axis length + */ +function calcRelativeAxisConstraints(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined + ? axis.max + max - (axis.max - axis.min) + : undefined, + }; +} +/** + * Calculate constraints in terms of the viewport when + * defined relatively to the measured bounding box. + */ +function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), + }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative axis + */ +function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { + let min = constraintsAxis.min - layoutAxis.min; + let max = constraintsAxis.max - layoutAxis.max; + // If the constraints axis is actually smaller than the layout axis then we can + // flip the constraints + if (constraintsAxis.max - constraintsAxis.min < + layoutAxis.max - layoutAxis.min) { + [min, max] = [max, min]; + } + return { min, max }; +} +/** + * Calculate viewport constraints when defined as another viewport-relative box + */ +function calcViewportConstraints(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), + }; +} +/** + * Calculate a transform origin relative to the source axis, between 0-1, that results + * in an asthetically pleasing scale/transform needed to project from source to target. + */ +function calcOrigin(source, target) { + let origin = 0.5; + const sourceLength = calcLength(source); + const targetLength = calcLength(target); + if (targetLength > sourceLength) { + origin = progress(target.min, target.max - sourceLength, source.min); + } + else if (sourceLength > targetLength) { + origin = progress(source.min, source.max - targetLength, target.min); + } + return clamp(0, 1, origin); +} +/** + * Rebase the calculated viewport constraints relative to the layout.min point. + */ +function rebaseAxisConstraints(layout, constraints) { + const relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; + } + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; + } + return relativeConstraints; +} +const defaultElastic = 0.35; +/** + * Accepts a dragElastic prop and returns resolved elastic values for each axis. + */ +function resolveDragElastic(dragElastic = defaultElastic) { + if (dragElastic === false) { + dragElastic = 0; + } + else if (dragElastic === true) { + dragElastic = defaultElastic; + } + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom"), + }; +} +function resolveAxisElastic(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel), + }; +} +function resolvePointElastic(dragElastic, label) { + return typeof dragElastic === "number" + ? dragElastic + : dragElastic[label] || 0; +} + +export { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic }; +//# sourceMappingURL=constraints.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map new file mode 100644 index 00000000..7b7533d9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"constraints.mjs","sources":["../../../../../src/gestures/drag/utils/constraints.ts"],"sourcesContent":["import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial\n): Partial {\n const relativeConstraints: Partial = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n"],"names":["calcProgress"],"mappings":";;;AAUA;;;;AAIG;AACG,SAAU,gBAAgB,CAC5B,KAAa,EACb,EAAE,GAAG,EAAE,GAAG,EAAiB,EAC3B,OAAc,EAAA;IAEd,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,GAAG,EAAE;;AAElC,QAAA,KAAK,GAAG,OAAO;cACT,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC;cAClC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;KAC7B;SAAM,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,GAAG,GAAG,EAAE;;AAEzC,QAAA,KAAK,GAAG,OAAO;cACT,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC;cAClC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;KAC7B;AAED,IAAA,OAAO,KAAK,CAAA;AAChB,CAAC;AAuBD;;;;AAIG;SACa,2BAA2B,CACvC,IAAU,EACV,GAAY,EACZ,GAAY,EAAA;IAEZ,OAAO;AACH,QAAA,GAAG,EAAE,GAAG,KAAK,SAAS,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,SAAS;QACnD,GAAG,EACC,GAAG,KAAK,SAAS;AACb,cAAE,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;AACxC,cAAE,SAAS;KACtB,CAAA;AACL,CAAC;AAED;;;AAGG;AACa,SAAA,uBAAuB,CACnC,SAAc,EACd,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAwB,EAAA;IAElD,OAAO;QACH,CAAC,EAAE,2BAA2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gB,EAAA;IAEhB,OAAO;AACH,QAAA,GAAG,EAAE,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC;AAC/C,QAAA,GAAG,EAAE,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC;KAClD,CAAA;AACL,CAAC;AAEe,SAAA,mBAAmB,CAC/B,WAAwB,EACxB,KAAa,EAAA;IAEb,OAAO,OAAO,WAAW,KAAK,QAAQ;AAClC,UAAE,WAAW;AACb,UAAE,WAAW,CAAC,KAAiC,CAAC,IAAI,CAAC,CAAA;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/focus.mjs b/node_modules/framer-motion/dist/es/gestures/focus.mjs new file mode 100644 index 00000000..dcd3282f --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/focus.mjs @@ -0,0 +1,41 @@ +import { Feature, addDomEvent } from 'motion-dom'; +import { pipe } from 'motion-utils'; + +class FocusGesture extends Feature { + constructor() { + super(...arguments); + this.isActive = false; + } + onFocus() { + let isFocusVisible = false; + /** + * If this element doesn't match focus-visible then don't + * apply whileHover. But, if matches throws that focus-visible + * is not a valid selector then in that browser outline styles will be applied + * to the element by default and we want to match that behaviour with whileFocus. + */ + try { + isFocusVisible = this.node.current.matches(":focus-visible"); + } + catch (e) { + isFocusVisible = true; + } + if (!isFocusVisible || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", true); + this.isActive = true; + } + onBlur() { + if (!this.isActive || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", false); + this.isActive = false; + } + mount() { + this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); + } + unmount() { } +} + +export { FocusGesture }; +//# sourceMappingURL=focus.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/focus.mjs.map b/node_modules/framer-motion/dist/es/gestures/focus.mjs.map new file mode 100644 index 00000000..a5ade200 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/focus.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"focus.mjs","sources":["../../../src/gestures/focus.ts"],"sourcesContent":["import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGM,MAAO,YAAa,SAAQ,OAAgB,CAAA;AAAlD,IAAA,WAAA,GAAA;;QACY,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAA;KAqC3B;IAnCG,OAAO,GAAA;QACH,IAAI,cAAc,GAAG,KAAK,CAAA;AAE1B;;;;;AAKG;AACH,QAAA,IAAI;YACA,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,OAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAChE;QAAC,OAAO,CAAC,EAAE;YACR,cAAc,GAAG,IAAI,CAAA;SACxB;QAED,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE,OAAM;QAExD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AACtD,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;KACvB;IAED,MAAM,GAAA;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc;YAAE,OAAM;QACvD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;AACvD,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;KACxB;IAED,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CACf,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,EAC9D,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,OAAQ,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,CAC/C,CAAA;KACpB;AAED,IAAA,OAAO,MAAK;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/hover.mjs b/node_modules/framer-motion/dist/es/gestures/hover.mjs new file mode 100644 index 00000000..6ab462ff --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/hover.mjs @@ -0,0 +1,29 @@ +import { Feature, hover, frame } from 'motion-dom'; +import { extractEventInfo } from '../events/event-info.mjs'; + +function handleHoverEvent(node, event, lifecycle) { + const { props } = node; + if (node.animationState && props.whileHover) { + node.animationState.setActive("whileHover", lifecycle === "Start"); + } + const eventName = ("onHover" + lifecycle); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class HoverGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + this.unmount = hover(current, (_element, startEvent) => { + handleHoverEvent(this.node, startEvent, "Start"); + return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); + }); + } + unmount() { } +} + +export { HoverGesture }; +//# sourceMappingURL=hover.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/hover.mjs.map b/node_modules/framer-motion/dist/es/gestures/hover.mjs.map new file mode 100644 index 00000000..566543e3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/hover.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGA,SAAS,gBAAgB,CACrB,IAA4B,EAC5B,KAAmB,EACnB,SAA0B,EAAA;AAE1B,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;IAEtB,IAAI,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,UAAU,EAAE;QACzC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,KAAK,OAAO,CAAC,CAAA;KACrE;AAED,IAAA,MAAM,SAAS,IAAI,SAAS,GAAG,SAAS,CAAkC,CAAA;AAC1E,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;IACjC,IAAI,QAAQ,EAAE;AACV,QAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KACnE;AACL,CAAC;AAEK,MAAO,YAAa,SAAQ,OAAgB,CAAA;IAC9C,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAA;AAC7B,QAAA,IAAI,CAAC,OAAO;YAAE,OAAM;AAEpB,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAI;YACnD,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AAEhD,YAAA,OAAO,CAAC,QAAQ,KAAK,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;AACrE,SAAC,CAAC,CAAA;KACL;AAED,IAAA,OAAO,MAAK;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs new file mode 100644 index 00000000..fd6e2c62 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs @@ -0,0 +1,270 @@ +import { frame, isPrimaryPointer, cancelFrame, frameData } from 'motion-dom'; +import { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils'; +import { addPointerEvent } from '../../events/add-pointer-event.mjs'; +import { extractEventInfo } from '../../events/event-info.mjs'; +import { distance2D } from '../../utils/distance.mjs'; + +const overflowStyles = /*#__PURE__*/ new Set(["auto", "scroll"]); +/** + * @internal + */ +class PanSession { + constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { + /** + * @internal + */ + this.startEvent = null; + /** + * @internal + */ + this.lastMoveEvent = null; + /** + * @internal + */ + this.lastMoveEventInfo = null; + /** + * @internal + */ + this.handlers = {}; + /** + * @internal + */ + this.contextWindow = window; + /** + * Scroll positions of scrollable ancestors and window. + * @internal + */ + this.scrollPositions = new Map(); + /** + * Cleanup function for scroll listeners. + * @internal + */ + this.removeScrollListeners = null; + this.onElementScroll = (event) => { + this.handleScroll(event.target); + }; + this.onWindowScroll = () => { + this.handleScroll(window); + }; + this.updatePoint = () => { + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const info = getPanInfo(this.lastMoveEventInfo, this.history); + const isPanStarted = this.startEvent !== null; + // Only start panning if the offset is larger than 3 pixels. If we make it + // any larger than this we'll want to reset the pointer history + // on the first update to avoid visual snapping to the cursor. + const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; + if (!isPanStarted && !isDistancePastThreshold) + return; + const { point } = info; + const { timestamp } = frameData; + this.history.push({ ...point, timestamp }); + const { onStart, onMove } = this.handlers; + if (!isPanStarted) { + onStart && onStart(this.lastMoveEvent, info); + this.startEvent = this.lastMoveEvent; + } + onMove && onMove(this.lastMoveEvent, info); + }; + this.handlePointerMove = (event, info) => { + this.lastMoveEvent = event; + this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); + // Throttle mouse move event to once per frame + frame.update(this.updatePoint, true); + }; + this.handlePointerUp = (event, info) => { + this.end(); + const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; + // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) + // This ensures constraint animations continue when interrupted by a click + if (this.dragSnapToOrigin || !this.startEvent) { + resumeAnimation && resumeAnimation(); + } + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const panInfo = getPanInfo(event.type === "pointercancel" + ? this.lastMoveEventInfo + : transformPoint(info, this.transformPagePoint), this.history); + if (this.startEvent && onEnd) { + onEnd(event, panInfo); + } + onSessionEnd && onSessionEnd(event, panInfo); + }; + // If we have more than one touch, don't start detecting this gesture + if (!isPrimaryPointer(event)) + return; + this.dragSnapToOrigin = dragSnapToOrigin; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + this.distanceThreshold = distanceThreshold; + this.contextWindow = contextWindow || window; + const info = extractEventInfo(event); + const initialInfo = transformPoint(info, this.transformPagePoint); + const { point } = initialInfo; + const { timestamp } = frameData; + this.history = [{ ...point, timestamp }]; + const { onSessionStart } = handlers; + onSessionStart && + onSessionStart(event, getPanInfo(initialInfo, this.history)); + this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp)); + // Start scroll tracking if element provided + if (element) { + this.startScrollTracking(element); + } + } + /** + * Start tracking scroll on ancestors and window. + */ + startScrollTracking(element) { + // Store initial scroll positions for scrollable ancestors + let current = element.parentElement; + while (current) { + const style = getComputedStyle(current); + if (overflowStyles.has(style.overflowX) || + overflowStyles.has(style.overflowY)) { + this.scrollPositions.set(current, { + x: current.scrollLeft, + y: current.scrollTop, + }); + } + current = current.parentElement; + } + // Track window scroll + this.scrollPositions.set(window, { + x: window.scrollX, + y: window.scrollY, + }); + // Capture listener catches element scroll events as they bubble + window.addEventListener("scroll", this.onElementScroll, { + capture: true, + passive: true, + }); + // Direct window scroll listener (window scroll doesn't bubble) + window.addEventListener("scroll", this.onWindowScroll, { + passive: true, + }); + this.removeScrollListeners = () => { + window.removeEventListener("scroll", this.onElementScroll, { + capture: true, + }); + window.removeEventListener("scroll", this.onWindowScroll); + }; + } + /** + * Handle scroll compensation during drag. + * + * For element scroll: adjusts history origin since pageX/pageY doesn't change. + * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. + */ + handleScroll(target) { + const initial = this.scrollPositions.get(target); + if (!initial) + return; + const isWindow = target === window; + const current = isWindow + ? { x: window.scrollX, y: window.scrollY } + : { + x: target.scrollLeft, + y: target.scrollTop, + }; + const delta = { x: current.x - initial.x, y: current.y - initial.y }; + if (delta.x === 0 && delta.y === 0) + return; + if (isWindow) { + // Window scroll: pageX/pageY changes, so update lastMoveEventInfo + if (this.lastMoveEventInfo) { + this.lastMoveEventInfo.point.x += delta.x; + this.lastMoveEventInfo.point.y += delta.y; + } + } + else { + // Element scroll: pageX/pageY unchanged, so adjust history origin + if (this.history.length > 0) { + this.history[0].x -= delta.x; + this.history[0].y -= delta.y; + } + } + this.scrollPositions.set(target, current); + frame.update(this.updatePoint, true); + } + updateHandlers(handlers) { + this.handlers = handlers; + } + end() { + this.removeListeners && this.removeListeners(); + this.removeScrollListeners && this.removeScrollListeners(); + this.scrollPositions.clear(); + cancelFrame(this.updatePoint); + } +} +function transformPoint(info, transformPagePoint) { + return transformPagePoint ? { point: transformPagePoint(info.point) } : info; +} +function subtractPoint(a, b) { + return { x: a.x - b.x, y: a.y - b.y }; +} +function getPanInfo({ point }, history) { + return { + point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity(history, 0.1), + }; +} +function startDevicePoint(history) { + return history[0]; +} +function lastDevicePoint(history) { + return history[history.length - 1]; +} +function getVelocity(history, timeDelta) { + if (history.length < 2) { + return { x: 0, y: 0 }; + } + let i = history.length - 1; + let timestampedPoint = null; + const lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta)) { + break; + } + i--; + } + if (!timestampedPoint) { + return { x: 0, y: 0 }; + } + /** + * If the selected point is the pointer-down origin (history[0]), + * there are better movement points available, and the time gap + * is suspiciously large (>2x timeDelta), use the next point instead. + * This prevents stale pointer-down points from diluting velocity + * in hold-then-flick gestures. + */ + if (timestampedPoint === history[0] && + history.length > 2 && + lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta) * 2) { + timestampedPoint = history[1]; + } + const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); + if (time === 0) { + return { x: 0, y: 0 }; + } + const currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time, + y: (lastPoint.y - timestampedPoint.y) / time, + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; + } + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; + } + return currentVelocity; +} + +export { PanSession }; +//# sourceMappingURL=PanSession.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map new file mode 100644 index 00000000..f7042a8a --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"PanSession.mjs","sources":["../../../../src/gestures/pan/PanSession.ts"],"sourcesContent":["import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n passive: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll, {\n passive: true,\n })\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n"],"names":[],"mappings":";;;;;;AAuCA,MAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAA;AAEhE;;AAEG;MACU,UAAU,CAAA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C;YACE,MAAK;SACR;AACD,QAAA,CAAC,EAAE,CAAA;KACN;IAED,IAAI,CAAC,gBAAgB,EAAE;QACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;KACxB;AAED;;;;;;AAMG;AACH,IAAA,IACI,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC;QAC/B,OAAO,CAAC,MAAM,GAAG,CAAC;AAClB,QAAA,SAAS,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS;AAC5C,YAAA,qBAAqB,CAAC,SAAS,CAAC,GAAG,CAAC,EAC1C;AACE,QAAA,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;KAChC;AAED,IAAA,MAAM,IAAI,GAAG,qBAAqB,CAC9B,SAAS,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS,CACnD,CAAA;AACD,IAAA,IAAI,IAAI,KAAK,CAAC,EAAE;QACZ,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;KACxB;AAED,IAAA,MAAM,eAAe,GAAG;QACpB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;QAC5C,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;KAC/C,CAAA;AAED,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC,CAAA;KACxB;AACD,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC,CAAA;KACxB;AAED,IAAA,OAAO,eAAe,CAAA;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs new file mode 100644 index 00000000..e0b1c17d --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs @@ -0,0 +1,50 @@ +import { Feature, frame } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { addPointerEvent } from '../../events/add-pointer-event.mjs'; +import { getContextWindow } from '../../utils/get-context-window.mjs'; +import { PanSession } from './PanSession.mjs'; + +const asyncHandler = (handler) => (event, info) => { + if (handler) { + frame.update(() => handler(event, info), false, true); + } +}; +class PanGesture extends Feature { + constructor() { + super(...arguments); + this.removePointerDownListener = noop; + } + onPointerDown(pointerDownEvent) { + this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { + transformPagePoint: this.node.getTransformPagePoint(), + contextWindow: getContextWindow(this.node), + }); + } + createPanHandlers() { + const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); + return { + onSessionStart: asyncHandler(onPanSessionStart), + onStart: asyncHandler(onPanStart), + onMove: asyncHandler(onPan), + onEnd: (event, info) => { + delete this.session; + if (onPanEnd) { + frame.postRender(() => onPanEnd(event, info)); + } + }, + }; + } + mount() { + this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); + } + update() { + this.session && this.session.updateHandlers(this.createPanHandlers()); + } + unmount() { + this.removePointerDownListener(); + this.session && this.session.end(); + } +} + +export { PanGesture }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map new file mode 100644 index 00000000..5dbdad70 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/pan/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/pan/index.ts"],"sourcesContent":["import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true)\n }\n }\n\nexport class PanGesture extends Feature {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,YAAY,GACd,CAAC,OAAyB,KAAK,CAAC,KAAmB,EAAE,IAAa,KAAI;IAClE,IAAI,OAAO,EAAE;AACT,QAAA,KAAK,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;KACxD;AACL,CAAC,CAAA;AAEC,MAAO,UAAW,SAAQ,OAAgB,CAAA;AAAhD,IAAA,WAAA,GAAA;;QAGY,IAAyB,CAAA,yBAAA,GAAa,IAAI,CAAA;KA8CrD;AA5CG,IAAA,aAAa,CAAC,gBAA8B,EAAA;AACxC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CACzB,gBAAg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motion/dist/es/gestures/press.mjs b/node_modules/framer-motion/dist/es/gestures/press.mjs new file mode 100644 index 00000000..45b99a2e --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/press.mjs @@ -0,0 +1,36 @@ +import { Feature, press, frame } from 'motion-dom'; +import { extractEventInfo } from '../events/event-info.mjs'; + +function handlePressEvent(node, event, lifecycle) { + const { props } = node; + if (node.current instanceof HTMLButtonElement && node.current.disabled) { + return; + } + if (node.animationState && props.whileTap) { + node.animationState.setActive("whileTap", lifecycle === "Start"); + } + const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } +} +class PressGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + const { globalTapTarget, propagate } = this.node.props; + this.unmount = press(current, (_element, startEvent) => { + handlePressEvent(this.node, startEvent, "Start"); + return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); + }, { + useGlobalTarget: globalTapTarget, + stopPropagation: propagate?.tap === false, + }); + } + unmount() { } +} + +export { PressGesture }; +//# sourceMappingURL=press.mjs.map diff --git a/node_modules/framer-motion/dist/es/gestures/press.mjs.map b/node_modules/framer-motion/dist/es/gestures/press.mjs.map new file mode 100644 index 00000000..9ffc7339 --- /dev/null +++ b/node_modules/framer-motion/dist/es/gestures/press.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"press.mjs","sources":["../../../src/gestures/press.ts"],"sourcesContent":["import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node\n if (!current) return\n\n const { globalTapTarget, propagate } = this.node.props\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n }\n )\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;;AAGA,SAAS,gBAAgB,CACrB,IAA4B,EAC5B,KAAmB,EACnB,SAAqC,EAAA;AAErC,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;AAEtB,IAAA,IAAI,IAAI,CAAC,OAAO,YAAY,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QACpE,OAAM;KACT;IAED,IAAI,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,QAAQ,EAAE;QACvC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,KAAK,OAAO,CAAC,CAAA;KACnE;AAED,IAAA,MAAM,SAAS,IAAI,OAAO,IAAI,SAAS,KAAK,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC,CAGhD,CAAA;AAEnB,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;IACjC,IAAI,QAAQ,EAAE;AACV,QAAA,KAAK,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KACnE;AACL,CAAC;AAEK,MAAO,YAAa,SAAQ,OAAgB,CAAA;IAC9C,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAA;AAC7B,QAAA,IAAI,CAAC,OAAO;YAAE,OAAM;QAEpB,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAA;AAEtD,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAChB,OAAO,EACP,CAAC,QAAQ,EAAE,UAAU,KAAI;YACrB,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;YAEhD,OAAO,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,KACzB,gBAAgB,CACZ,IAAI,CAAC,IAAI,EACT,QAAQ,EACR,OAAO,GAAG,KAAK,GAAG,QAAQ,CAC7B,CAAA;AACT,SAAC,EACD;AACI,YAAA,eAAe,EAAE,eAAe;AAChC,YAAA,eAAe,EAAE,SAAS,EAAE,GAAG,KAAK,KAAK;AAC5C,SAAA,CACJ,CAAA;KACJ;AAED,IAAA,OAAO,MAAK;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/index.mjs b/node_modules/framer-motion/dist/es/index.mjs new file mode 100644 index 00000000..6626bcd2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/index.mjs @@ -0,0 +1,78 @@ +export { AnimatePresence } from './components/AnimatePresence/index.mjs'; +export { PopChild } from './components/AnimatePresence/PopChild.mjs'; +export { PresenceChild } from './components/AnimatePresence/PresenceChild.mjs'; +export { LayoutGroup } from './components/LayoutGroup/index.mjs'; +export { LazyMotion } from './components/LazyMotion/index.mjs'; +export { MotionConfig } from './components/MotionConfig/index.mjs'; +export { m } from './render/components/m/proxy.mjs'; +export { motion } from './render/components/motion/proxy.mjs'; +export { addPointerEvent } from './events/add-pointer-event.mjs'; +export { addPointerInfo } from './events/event-info.mjs'; +export { animations } from './motion/features/animations.mjs'; +export { makeUseVisualState } from './motion/utils/use-visual-state.mjs'; +export * from 'motion-dom'; +export { VisualElement, addScaleCorrector, animateVisualElement, buildTransform, calcLength, createBox, delay, optimizedAppearDataAttribute, resolveMotionValue, visualElementStore } from 'motion-dom'; +export { filterProps } from './render/dom/utils/filter-props.mjs'; +export { isBrowser } from './utils/is-browser.mjs'; +export { useComposedRefs } from './utils/use-composed-ref.mjs'; +export { useForceUpdate } from './utils/use-force-update.mjs'; +export { useIsomorphicLayoutEffect } from './utils/use-isomorphic-effect.mjs'; +export { useUnmountEffect } from './utils/use-unmount-effect.mjs'; +export { domAnimation } from './render/dom/features-animation.mjs'; +export { domMax } from './render/dom/features-max.mjs'; +export { domMin } from './render/dom/features-min.mjs'; +export { useMotionValueEvent } from './utils/use-motion-value-event.mjs'; +export { useElementScroll } from './value/scroll/use-element-scroll.mjs'; +export { useViewportScroll } from './value/scroll/use-viewport-scroll.mjs'; +export { useMotionTemplate } from './value/use-motion-template.mjs'; +export { useMotionValue } from './value/use-motion-value.mjs'; +export { useScroll } from './value/use-scroll.mjs'; +export { useFollowValue } from './value/use-follow-value.mjs'; +export { useSpring } from './value/use-spring.mjs'; +export { useTime } from './value/use-time.mjs'; +export { useTransform } from './value/use-transform.mjs'; +export { useVelocity } from './value/use-velocity.mjs'; +export { useWillChange } from './value/use-will-change/index.mjs'; +export { WillChangeMotionValue } from './value/use-will-change/WillChangeMotionValue.mjs'; +export { useReducedMotion } from './utils/reduced-motion/use-reduced-motion.mjs'; +export { useReducedMotionConfig } from './utils/reduced-motion/use-reduced-motion-config.mjs'; +export * from 'motion-utils'; +export { MotionGlobalConfig } from 'motion-utils'; +export { animationControls } from './animation/hooks/animation-controls.mjs'; +export { useAnimate } from './animation/hooks/use-animate.mjs'; +export { useAnimateMini } from './animation/hooks/use-animate-style.mjs'; +export { useAnimation, useAnimationControls } from './animation/hooks/use-animation.mjs'; +export { useIsPresent, usePresence } from './components/AnimatePresence/use-presence.mjs'; +export { usePresenceData } from './components/AnimatePresence/use-presence-data.mjs'; +export { useDomEvent } from './events/use-dom-event.mjs'; +export { DragControls, useDragControls } from './gestures/drag/use-drag-controls.mjs'; +export { isMotionComponent } from './motion/utils/is-motion-component.mjs'; +export { unwrapMotionComponent } from './motion/utils/unwrap-motion-component.mjs'; +export { isValidMotionProp } from './motion/utils/valid-prop.mjs'; +export { useInstantLayoutTransition } from './projection/use-instant-layout-transition.mjs'; +export { useResetProjection } from './projection/use-reset-projection.mjs'; +export { useAnimationFrame } from './utils/use-animation-frame.mjs'; +export { useCycle } from './utils/use-cycle.mjs'; +export { useInView } from './utils/use-in-view.mjs'; +export { disableInstantTransitions, useInstantTransition } from './utils/use-instant-transition.mjs'; +export { usePageInView } from './utils/use-page-in-view.mjs'; +export { transformViewBoxPoint } from './utils/transform-viewbox-point.mjs'; +export { startOptimizedAppearAnimation } from './animation/optimized-appear/start.mjs'; +export { LayoutGroupContext } from './context/LayoutGroupContext.mjs'; +export { MotionConfigContext } from './context/MotionConfigContext.mjs'; +export { MotionContext } from './context/MotionContext/index.mjs'; +export { PresenceContext } from './context/PresenceContext.mjs'; +export { SwitchLayoutGroupContext } from './context/SwitchLayoutGroupContext.mjs'; +export { useAnimatedState as useDeprecatedAnimatedState } from './animation/hooks/use-animated-state.mjs'; +export { AnimateSharedLayout } from './components/AnimateSharedLayout.mjs'; +export { DeprecatedLayoutGroupContext } from './context/DeprecatedLayoutGroupContext.mjs'; +export { useInvertedScale as useDeprecatedInvertedScale } from './value/use-inverted-scale.mjs'; +import * as namespace from './components/Reorder/namespace.mjs'; +export { namespace as Reorder }; +export { animate, createScopedAnimate } from './animation/animate/index.mjs'; +export { animateMini } from './animation/animators/waapi/animate-style.mjs'; +export { scroll } from './render/dom/scroll/index.mjs'; +export { scrollInfo } from './render/dom/scroll/track.mjs'; +export { inView } from './render/dom/viewport/index.mjs'; +export { distance, distance2D } from './utils/distance.mjs'; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/index.mjs.map b/node_modules/framer-motion/dist/es/index.mjs.map new file mode 100644 index 00000000..26795396 --- /dev/null +++ b/node_modules/framer-motion/dist/es/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/m.mjs b/node_modules/framer-motion/dist/es/m.mjs new file mode 100644 index 00000000..5a2badd2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/m.mjs @@ -0,0 +1,3 @@ +export { createMinimalMotionComponent as create } from './render/components/m/create.mjs'; +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview } from './render/components/m/elements.mjs'; +//# sourceMappingURL=m.mjs.map diff --git a/node_modules/framer-motion/dist/es/m.mjs.map b/node_modules/framer-motion/dist/es/m.mjs.map new file mode 100644 index 00000000..af0ce5df --- /dev/null +++ b/node_modules/framer-motion/dist/es/m.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"m.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/mini.mjs b/node_modules/framer-motion/dist/es/mini.mjs new file mode 100644 index 00000000..b620a1fc --- /dev/null +++ b/node_modules/framer-motion/dist/es/mini.mjs @@ -0,0 +1,2 @@ +export { useAnimateMini as useAnimate } from './animation/hooks/use-animate-style.mjs'; +//# sourceMappingURL=mini.mjs.map diff --git a/node_modules/framer-motion/dist/es/mini.mjs.map b/node_modules/framer-motion/dist/es/mini.mjs.map new file mode 100644 index 00000000..d146aa01 --- /dev/null +++ b/node_modules/framer-motion/dist/es/mini.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mini.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs new file mode 100644 index 00000000..fe250675 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs @@ -0,0 +1,37 @@ +import { Feature } from 'motion-dom'; + +let id = 0; +class ExitAnimationFeature extends Feature { + constructor() { + super(...arguments); + this.id = id++; + } + update() { + if (!this.node.presenceContext) + return; + const { isPresent, onExitComplete } = this.node.presenceContext; + const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; + if (!this.node.animationState || isPresent === prevIsPresent) { + return; + } + const exitAnimation = this.node.animationState.setActive("exit", !isPresent); + if (onExitComplete && !isPresent) { + exitAnimation.then(() => { + onExitComplete(this.id); + }); + } + } + mount() { + const { register, onExitComplete } = this.node.presenceContext || {}; + if (onExitComplete) { + onExitComplete(this.id); + } + if (register) { + this.unmount = register(this.id); + } + } + unmount() { } +} + +export { ExitAnimationFeature }; +//# sourceMappingURL=exit.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map new file mode 100644 index 00000000..566306c8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"exit.mjs","sources":["../../../../../src/motion/features/animation/exit.ts"],"sourcesContent":["import { Feature } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature {\n private id: number = id++\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;AAEA,IAAI,EAAE,GAAG,CAAC,CAAA;AAEJ,MAAO,oBAAqB,SAAQ,OAAgB,CAAA;AAA1D,IAAA,WAAA,GAAA;;QACY,IAAE,CAAA,EAAA,GAAW,EAAE,EAAE,CAAA;KAqC5B;IAnCG,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAM;QAEtC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAA;AAC/D,QAAA,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE,CAAA;QAExE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS,KAAK,aAAa,EAAE;YAC1D,OAAM;SACT;AAED,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CACpD,MAAM,EACN,CAAC,SAAS,CACb,CAAA;AAED,QAAA,IAAI,cAAc,IAAI,CAAC,SAAS,EAAE;AAC9B,YAAA,aAAa,CAAC,IAAI,CAAC,MAAK;AACpB,gBAAA,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAC3B,aAAC,CAAC,CAAA;SACL;KACJ;IAED,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,CAAA;QAEpE,IAAI,cAAc,EAAE;AAChB,YAAA,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SAC1B;QAED,IAAI,QAAQ,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SACnC;KACJ;AAED,IAAA,OAAO,MAAK;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs new file mode 100644 index 00000000..be9a9ec0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs @@ -0,0 +1,39 @@ +import { Feature, createAnimationState, isAnimationControls } from 'motion-dom'; + +class AnimationFeature extends Feature { + /** + * We dynamically generate the AnimationState manager as it contains a reference + * to the underlying animation library. We only want to load that if we load this, + * so people can optionally code split it out using the `m` component. + */ + constructor(node) { + super(node); + node.animationState || (node.animationState = createAnimationState(node)); + } + updateAnimationControlsSubscription() { + const { animate } = this.node.getProps(); + if (isAnimationControls(animate)) { + this.unmountControls = animate.subscribe(this.node); + } + } + /** + * Subscribe any provided AnimationControls to the component's VisualElement + */ + mount() { + this.updateAnimationControlsSubscription(); + } + update() { + const { animate } = this.node.getProps(); + const { animate: prevAnimate } = this.node.prevProps || {}; + if (animate !== prevAnimate) { + this.updateAnimationControlsSubscription(); + } + } + unmount() { + this.node.animationState.reset(); + this.unmountControls?.(); + } +} + +export { AnimationFeature }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map new file mode 100644 index 00000000..ad776b7a --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animation/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/motion/features/animation/index.ts"],"sourcesContent":["import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n"],"names":[],"mappings":";;AAOM,MAAO,gBAAiB,SAAQ,OAAgB,CAAA;AAGlD;;;;AAIG;AACH,IAAA,WAAA,CAAY,IAAmB,EAAA;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,cAAc,KAAnB,IAAI,CAAC,cAAc,GAAK,oBAAoB,CAAC,IAAI,CAAC,CAAA,CAAA;KACrD;IAED,mCAAmC,GAAA;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;AACxC,QAAA,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE;YAC9B,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SACtD;KACJ;AAED;;AAEG;IACH,KAAK,GAAA;QACD,IAAI,CAAC,mCAAmC,EAAE,CAAA;KAC7C;IAED,MAAM,GAAA;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;AACxC,QAAA,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAA;AAC1D,QAAA,IAAI,OAAO,KAAK,WAAW,EAAE;YACzB,IAAI,CAAC,mCAAmC,EAAE,CAAA;SAC7C;KACJ;IAED,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,cAAe,CAAC,KAAK,EAAE,CAAA;AACjC,QAAA,IAAI,CAAC,eAAe,IAAI,CAAA;KAC3B;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/animations.mjs b/node_modules/framer-motion/dist/es/motion/features/animations.mjs new file mode 100644 index 00000000..0746a484 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animations.mjs @@ -0,0 +1,14 @@ +import { AnimationFeature } from './animation/index.mjs'; +import { ExitAnimationFeature } from './animation/exit.mjs'; + +const animations = { + animation: { + Feature: AnimationFeature, + }, + exit: { + Feature: ExitAnimationFeature, + }, +}; + +export { animations }; +//# sourceMappingURL=animations.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map b/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map new file mode 100644 index 00000000..f24b292b --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/animations.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animations.mjs","sources":["../../../../src/motion/features/animations.ts"],"sourcesContent":["import { AnimationFeature } from \"./animation\"\nimport { ExitAnimationFeature } from \"./animation/exit\"\nimport { FeaturePackages } from \"./types\"\n\nexport const animations: FeaturePackages = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,UAAU,GAAoB;AACvC,IAAA,SAAS,EAAE;AACP,QAAA,OAAO,EAAE,gBAAgB;AAC5B,KAAA;AACD,IAAA,IAAI,EAAE;AACF,QAAA,OAAO,EAAE,oBAAoB;AAChC,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs new file mode 100644 index 00000000..e3293b6b --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs @@ -0,0 +1,49 @@ +import { getFeatureDefinitions, setFeatureDefinitions } from 'motion-dom'; + +const featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag", + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"], +}; +let isInitialized = false; +/** + * Initialize feature definitions with isEnabled checks. + * This must be called before any motion components are rendered. + */ +function initFeatureDefinitions() { + if (isInitialized) + return; + const initialFeatureDefinitions = {}; + for (const key in featureProps) { + initialFeatureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]), + }; + } + setFeatureDefinitions(initialFeatureDefinitions); + isInitialized = true; +} +/** + * Get the current feature definitions, initializing if needed. + */ +function getInitializedFeatureDefinitions() { + initFeatureDefinitions(); + return getFeatureDefinitions(); +} + +export { getInitializedFeatureDefinitions, initFeatureDefinitions }; +//# sourceMappingURL=definitions.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map new file mode 100644 index 00000000..f1c70d78 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/definitions.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"definitions.mjs","sources":["../../../../src/motion/features/definitions.ts"],"sourcesContent":["import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n"],"names":[],"mappings":";;AAIA,MAAM,YAAY,GAAG;AACjB,IAAA,SAAS,EAAE;QACP,SAAS;QACT,UAAU;QACV,YAAY;QACZ,UAAU;QACV,MAAM;QACN,aAAa;QACb,YAAY;QACZ,WAAW;AACd,KAAA;IACD,IAAI,EAAE,CAAC,MAAM,CAAC;AACd,IAAA,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;IAC9B,KAAK,EAAE,CAAC,YAAY,CAAC;AACrB,IAAA,KAAK,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC;IACnD,GAAG,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC;IACvD,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,CAAC;AAC7D,IAAA,MAAM,EAAE,CAAC,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;AAC7D,IAAA,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;CACjC,CAAA;AAED,IAAI,aAAa,GAAG,KAAK,CAAA;AAEzB;;;AAGG;SACa,sBAAsB,GAAA;AAClC,IAAA,IAAI,aAAa;QAAE,OAAM;IAEzB,MAAM,yBAAyB,GAAgC,EAAE,CAAA;AAEjE,IAAA,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;QAC5B,yBAAyB,CACrB,GAA6C,CAChD,GAAG;YACA,SAAS,EAAE,CAAC,KAAkB,KAC1B,YAAY,CAAC,GAAgC,CAAC,CAAC,IAAI,CAC/C,CAAC,IAAY,KAAK,CAAC,CAAC,KAAK,CAAC,IAA0B,CAAC,CACxD;SACR,CAAA;KACJ;IAED,qBAAqB,CAAC,yBAAyB,CAAC,CAAA;IAChD,aAAa,GAAG,IAAI,CAAA;AACxB,CAAC;AAED;;AAEG;SACa,gCAAgC,GAAA;AAC5C,IAAA,sBAAsB,EAAE,CAAA;IACxB,OAAO,qBAAqB,EAAE,CAAA;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/drag.mjs b/node_modules/framer-motion/dist/es/motion/features/drag.mjs new file mode 100644 index 00000000..78524527 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/drag.mjs @@ -0,0 +1,18 @@ +import { DragGesture } from '../../gestures/drag/index.mjs'; +import { PanGesture } from '../../gestures/pan/index.mjs'; +import { MeasureLayout } from './layout/MeasureLayout.mjs'; +import { HTMLProjectionNode } from 'motion-dom'; + +const drag = { + pan: { + Feature: PanGesture, + }, + drag: { + Feature: DragGesture, + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, +}; + +export { drag }; +//# sourceMappingURL=drag.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map b/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map new file mode 100644 index 00000000..9e575a25 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/drag.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"drag.mjs","sources":["../../../../src/motion/features/drag.ts"],"sourcesContent":["import { DragGesture } from \"../../gestures/drag\"\nimport { PanGesture } from \"../../gestures/pan\"\nimport { HTMLProjectionNode } from \"../../projection\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const drag: FeaturePackages = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n"],"names":[],"mappings":";;;;;AAMa,MAAA,IAAI,GAAoB;AACjC,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,UAAU;AACtB,KAAA;AACD,IAAA,IAAI,EAAE;AACF,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,cAAc,EAAE,kBAAkB;QAClC,aAAa;AAChB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs new file mode 100644 index 00000000..e7708ccd --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs @@ -0,0 +1,22 @@ +import { HoverGesture } from '../../gestures/hover.mjs'; +import { FocusGesture } from '../../gestures/focus.mjs'; +import { PressGesture } from '../../gestures/press.mjs'; +import { InViewFeature } from './viewport/index.mjs'; + +const gestureAnimations = { + inView: { + Feature: InViewFeature, + }, + tap: { + Feature: PressGesture, + }, + focus: { + Feature: FocusGesture, + }, + hover: { + Feature: HoverGesture, + }, +}; + +export { gestureAnimations }; +//# sourceMappingURL=gestures.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map new file mode 100644 index 00000000..0bbdf889 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/gestures.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gestures.mjs","sources":["../../../../src/motion/features/gestures.ts"],"sourcesContent":["import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n"],"names":[],"mappings":";;;;;AAMa,MAAA,iBAAiB,GAAoB;AAC9C,IAAA,MAAM,EAAE;AACJ,QAAA,OAAO,EAAE,aAAa;AACzB,KAAA;AACD,IAAA,GAAG,EAAE;AACD,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;AACD,IAAA,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,YAAY;AACxB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/layout.mjs b/node_modules/framer-motion/dist/es/motion/features/layout.mjs new file mode 100644 index 00000000..6ba67db7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout.mjs @@ -0,0 +1,12 @@ +import { HTMLProjectionNode } from 'motion-dom'; +import { MeasureLayout } from './layout/MeasureLayout.mjs'; + +const layout = { + layout: { + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, +}; + +export { layout }; +//# sourceMappingURL=layout.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map b/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map new file mode 100644 index 00000000..a74d3e22 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"layout.mjs","sources":["../../../../src/motion/features/layout.ts"],"sourcesContent":["import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,MAAM,GAAoB;AACnC,IAAA,MAAM,EAAE;AACJ,QAAA,cAAc,EAAE,kBAAkB;QAClC,aAAa;AAChB,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs new file mode 100644 index 00000000..72e7e021 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs @@ -0,0 +1,134 @@ +"use client"; +import { jsx } from 'react/jsx-runtime'; +import { globalProjectionState, frame, microtask } from 'motion-dom'; +import { useContext, Component } from 'react'; +import { usePresence } from '../../../components/AnimatePresence/use-presence.mjs'; +import { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs'; +import { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs'; + +/** + * Track whether we've taken any snapshots yet. If not, + * we can safely skip notification of didUpdate. + * + * Difficult to capture in a test but to prevent flickering + * we must set this to true either on update or unmount. + * Running `next-env/layout-id` in Safari will show this behaviour if broken. + */ +let hasTakenAnySnapshot = false; +class MeasureLayoutWithContext extends Component { + /** + * This only mounts projection nodes for components that + * need measuring, we might want to do it for all components + * in order to incorporate transforms + */ + componentDidMount() { + const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; + const { projection } = visualElement; + if (projection) { + if (layoutGroup.group) + layoutGroup.group.add(projection); + if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { + switchLayoutGroup.register(projection); + } + if (hasTakenAnySnapshot) { + projection.root.didUpdate(); + } + projection.addEventListener("animationComplete", () => { + this.safeToRemove(); + }); + projection.setOptions({ + ...projection.options, + layoutDependency: this.props.layoutDependency, + onExitComplete: () => this.safeToRemove(), + }); + } + globalProjectionState.hasEverUpdated = true; + } + getSnapshotBeforeUpdate(prevProps) { + const { layoutDependency, visualElement, drag, isPresent } = this.props; + const { projection } = visualElement; + if (!projection) + return null; + /** + * TODO: We use this data in relegate to determine whether to + * promote a previous element. There's no guarantee its presence data + * will have updated by this point - if a bug like this arises it will + * have to be that we markForRelegation and then find a new lead some other way, + * perhaps in didUpdate + */ + projection.isPresent = isPresent; + if (prevProps.layoutDependency !== layoutDependency) { + projection.setOptions({ + ...projection.options, + layoutDependency, + }); + } + hasTakenAnySnapshot = true; + if (drag || + prevProps.layoutDependency !== layoutDependency || + layoutDependency === undefined || + prevProps.isPresent !== isPresent) { + projection.willUpdate(); + } + else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } + else if (!projection.relegate()) { + /** + * If there's another stack member taking over from this one, + * it's in charge of the exit animation and therefore should + * be in charge of the safe to remove. Otherwise we call it here. + */ + frame.postRender(() => { + const stack = projection.getStack(); + if (!stack || !stack.members.length) { + this.safeToRemove(); + } + }); + } + } + return null; + } + componentDidUpdate() { + const { projection } = this.props.visualElement; + if (projection) { + projection.root.didUpdate(); + microtask.postRender(() => { + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + }); + } + } + componentWillUnmount() { + const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; + const { projection } = visualElement; + hasTakenAnySnapshot = true; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup && layoutGroup.group) + layoutGroup.group.remove(projection); + if (promoteContext && promoteContext.deregister) + promoteContext.deregister(projection); + } + } + safeToRemove() { + const { safeToRemove } = this.props; + safeToRemove && safeToRemove(); + } + render() { + return null; + } +} +function MeasureLayout(props) { + const [isPresent, safeToRemove] = usePresence(); + const layoutGroup = useContext(LayoutGroupContext); + return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); +} + +export { MeasureLayout }; +//# sourceMappingURL=MeasureLayout.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map new file mode 100644 index 00000000..a9e08d8a --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"MeasureLayout.mjs","sources":["../../../../../src/motion/features/layout/MeasureLayout.tsx"],"sourcesContent":["\"use client\"\n\nimport { frame, microtask, globalProjectionState, type VisualElement } from \"motion-dom\"\nimport { Component, useContext } from \"react\"\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\"\nimport {\n LayoutGroupContext,\n LayoutGroupContextProps,\n} from \"../../../context/LayoutGroupContext\"\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../types\"\n\ninterface MeasureContextProps {\n layoutGroup: LayoutGroupContextProps\n switchLayoutGroup?: SwitchLayoutGroupContext\n isPresent: boolean\n safeToRemove?: VoidFunction | null\n}\n\ntype MeasureProps = MotionProps &\n MeasureContextProps & { visualElement: VisualElement }\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false\n\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } =\n this.props\n const { projection } = visualElement\n\n if (projection) {\n if (layoutGroup.group) layoutGroup.group.add(projection)\n\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection)\n }\n\n if (hasTakenAnySnapshot) {\n projection.root!.didUpdate()\n }\n\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove()\n })\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n })\n }\n\n globalProjectionState.hasEverUpdated = true\n }\n\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props\n const { projection } = visualElement\n\n if (!projection) return null\n\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent\n\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n })\n }\n\n hasTakenAnySnapshot = true\n\n if (\n drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent\n ) {\n projection.willUpdate()\n } else {\n this.safeToRemove()\n }\n\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote()\n } else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack()\n if (!stack || !stack.members.length) {\n this.safeToRemove()\n }\n })\n }\n }\n\n return null\n }\n\n componentDidUpdate() {\n const { projection } = this.props.visualElement\n if (projection) {\n projection.root!.didUpdate()\n\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove()\n }\n })\n }\n }\n\n componentWillUnmount() {\n const {\n visualElement,\n layoutGroup,\n switchLayoutGroup: promoteContext,\n } = this.props\n const { projection } = visualElement\n\n hasTakenAnySnapshot = true\n\n if (projection) {\n projection.scheduleCheckAfterUnmount()\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection)\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection)\n }\n }\n\n safeToRemove() {\n const { safeToRemove } = this.props\n safeToRemove && safeToRemove()\n }\n\n render() {\n return null\n }\n}\n\nexport function MeasureLayout(\n props: MotionProps & { visualElement: VisualElement }\n) {\n const [isPresent, safeToRemove] = usePresence()\n const layoutGroup = useContext(LayoutGroupContext)\n\n return (\n \n )\n}\n"],"names":[],"mappings":";;;;;;;;AAsBA;;;;;;;AAOG;AACH;AAEA;AACI;;;;AAIG;;AAEC;AAEA;;;AAG2B;;AAGnB;;;AAIA;;AAGJ;;AAEA;;;AAGI;AACA;AACH;;AAGL;;AAGJ;AACI;AACA;AAEA;AAAiB;AAEjB;;;;;;AAMG;AACH;AAEA;;;;AAIK;;;AAKL;;AAGI;AACA;;;;;;AAOJ;;;;AAGW;AACH;;;;AAIG;AACH;AACI;;;;AAIJ;;;AAIR;;;;;AAMI;AAEA;;;;AAIA;;;;AAKJ;AAKA;;;;AAMI;AACI;AACJ;AACI;;;;AAKR;;;;AAKA;;AAEP;AAEK;;AAIF;;AAWJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs new file mode 100644 index 00000000..dc52536e --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs @@ -0,0 +1,16 @@ +import { setFeatureDefinitions } from 'motion-dom'; +import { getInitializedFeatureDefinitions } from './definitions.mjs'; + +function loadFeatures(features) { + const featureDefinitions = getInitializedFeatureDefinitions(); + for (const key in features) { + featureDefinitions[key] = { + ...featureDefinitions[key], + ...features[key], + }; + } + setFeatureDefinitions(featureDefinitions); +} + +export { loadFeatures }; +//# sourceMappingURL=load-features.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map new file mode 100644 index 00000000..9a1bc6cb --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/load-features.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"load-features.mjs","sources":["../../../../src/motion/features/load-features.ts"],"sourcesContent":["import { setFeatureDefinitions } from \"motion-dom\"\nimport { getInitializedFeatureDefinitions } from \"./definitions\"\nimport { FeaturePackages } from \"./types\"\n\nexport function loadFeatures(features: FeaturePackages) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n\n for (const key in features) {\n featureDefinitions[key as keyof typeof featureDefinitions] = {\n ...featureDefinitions[key as keyof typeof featureDefinitions],\n ...features[key as keyof typeof features],\n } as any\n }\n\n setFeatureDefinitions(featureDefinitions)\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,YAAY,CAAC,QAAyB,EAAA;AAClD,IAAA,MAAM,kBAAkB,GAAG,gCAAgC,EAAE,CAAA;AAE7D,IAAA,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;QACxB,kBAAkB,CAAC,GAAsC,CAAC,GAAG;YACzD,GAAG,kBAAkB,CAAC,GAAsC,CAAC;YAC7D,GAAG,QAAQ,CAAC,GAA4B,CAAC;SACrC,CAAA;KACX;IAED,qBAAqB,CAAC,kBAAkB,CAAC,CAAA;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs new file mode 100644 index 00000000..d8708d95 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs @@ -0,0 +1,73 @@ +import { Feature } from 'motion-dom'; +import { observeIntersection } from './observers.mjs'; + +const thresholdNames = { + some: 0, + all: 1, +}; +class InViewFeature extends Feature { + constructor() { + super(...arguments); + this.hasEnteredView = false; + this.isInView = false; + } + startObserver() { + this.unmount(); + const { viewport = {} } = this.node.getProps(); + const { root, margin: rootMargin, amount = "some", once } = viewport; + const options = { + root: root ? root.current : undefined, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount], + }; + const onIntersectionUpdate = (entry) => { + const { isIntersecting } = entry; + /** + * If there's been no change in the viewport state, early return. + */ + if (this.isInView === isIntersecting) + return; + this.isInView = isIntersecting; + /** + * Handle hasEnteredView. If this is only meant to run once, and + * element isn't visible, early return. Otherwise set hasEnteredView to true. + */ + if (once && !isIntersecting && this.hasEnteredView) { + return; + } + else if (isIntersecting) { + this.hasEnteredView = true; + } + if (this.node.animationState) { + this.node.animationState.setActive("whileInView", isIntersecting); + } + /** + * Use the latest committed props rather than the ones in scope + * when this observer is created + */ + const { onViewportEnter, onViewportLeave } = this.node.getProps(); + const callback = isIntersecting ? onViewportEnter : onViewportLeave; + callback && callback(entry); + }; + return observeIntersection(this.node.current, options, onIntersectionUpdate); + } + mount() { + this.startObserver(); + } + update() { + if (typeof IntersectionObserver === "undefined") + return; + const { props, prevProps } = this.node; + const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); + if (hasOptionsChanged) { + this.startObserver(); + } + } + unmount() { } +} +function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { + return (name) => viewport[name] !== prevViewport[name]; +} + +export { InViewFeature }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map new file mode 100644 index 00000000..873baae0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/motion/features/viewport/index.ts"],"sourcesContent":["import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature {\n private hasEnteredView = false\n\n private isInView = false\n\n private startObserver() {\n this.unmount()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n return observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {}\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,cAAc,GAAG;AACnB,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,GAAG,EAAE,CAAC;CACT,CAAA;AAEK,MAAO,aAAc,SAAQ,OAAgB,CAAA;AAAnD,IAAA,WAAA,GAAA;;QACY,IAAc,CAAA,cAAA,GAAG,KAAK,CAAA;QAEtB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAA;KA4E3B;IA1EW,aAAa,GAAA;QACjB,IAAI,CAAC,OAAO,EAAE,CAAA;AAEd,QAAA,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;AAC9C,QAAA,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAA;AAEpE,QAAA,MAAM,OAAO,GAAG;YACZ,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,OAAO,GAAG,SAAS;YACrC,UAAU;AACV,YAAA,SAAS,EACL,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;SACnE,CAAA;AAED,QAAA,MAAM,oBAAoB,GAAG,CAAC,KAAgC,KAAI;AAC9D,YAAA,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAA;AAEhC;;AAEG;AACH,YAAA,IAAI,IAAI,CAA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B,CAC7B,EAAE,QAAQ,GAAG,EAAE,EAAe,EAC9B,EAAE,QAAQ,EAAE,YAAY,GAAG,EAAE,KAAkB,EAAE,EAAA;AAEjD,IAAA,OAAO,CAAC,IAA2B,KAC/B,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAA;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs new file mode 100644 index 00000000..7c67d854 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs @@ -0,0 +1,50 @@ +/** + * Map an IntersectionHandler callback to an element. We only ever make one handler for one + * element, so even though these handlers might all be triggered by different + * observers, we can keep them in the same map. + */ +const observerCallbacks = new WeakMap(); +/** + * Multiple observers can be created for multiple element/document roots. Each with + * different settings. So here we store dictionaries of observers to each root, + * using serialised settings (threshold/margin) as lookup keys. + */ +const observers = new WeakMap(); +const fireObserverCallback = (entry) => { + const callback = observerCallbacks.get(entry.target); + callback && callback(entry); +}; +const fireAllObserverCallbacks = (entries) => { + entries.forEach(fireObserverCallback); +}; +function initIntersectionObserver({ root, ...options }) { + const lookupRoot = root || document; + /** + * If we don't have an observer lookup map for this root, create one. + */ + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + const rootObservers = observers.get(lookupRoot); + const key = JSON.stringify(options); + /** + * If we don't have an observer for this combination of root and settings, + * create one. + */ + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); + } + return rootObservers[key]; +} +function observeIntersection(element, options, callback) { + const rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return () => { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; +} + +export { observeIntersection }; +//# sourceMappingURL=observers.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map new file mode 100644 index 00000000..d085e940 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"observers.mjs","sources":["../../../../../src/motion/features/viewport/observers.ts"],"sourcesContent":["type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)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AG,wBAAwB,CAAC,OAAO,CAAC,CAAA;AAEnE,IAAA,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACxC,IAAA,yBAAyB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AAE1C,IAAA,OAAO,MAAK;AACR,QAAA,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACjC,QAAA,yBAAyB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;AAChD,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/index.mjs b/node_modules/framer-motion/dist/es/motion/index.mjs new file mode 100644 index 00000000..d7211d1f --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/index.mjs @@ -0,0 +1,114 @@ +"use client"; +import { jsxs, jsx } from 'react/jsx-runtime'; +import { warning, invariant } from 'motion-utils'; +import { forwardRef, useContext } from 'react'; +import { LayoutGroupContext } from '../context/LayoutGroupContext.mjs'; +import { LazyContext } from '../context/LazyContext.mjs'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; +import { MotionContext } from '../context/MotionContext/index.mjs'; +import { useCreateMotionContext } from '../context/MotionContext/create.mjs'; +import { useRender } from '../render/dom/use-render.mjs'; +import { isSVGComponent } from '../render/dom/utils/is-svg-component.mjs'; +import { useHTMLVisualState } from '../render/html/use-html-visual-state.mjs'; +import { useSVGVisualState } from '../render/svg/use-svg-visual-state.mjs'; +import { isBrowser } from '../utils/is-browser.mjs'; +import { getInitializedFeatureDefinitions } from './features/definitions.mjs'; +import { loadFeatures } from './features/load-features.mjs'; +import { motionComponentSymbol } from './utils/symbol.mjs'; +import { useMotionRef } from './utils/use-motion-ref.mjs'; +import { useVisualElement } from './utils/use-visual-element.mjs'; + +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { + preloadedFeatures && loadFeatures(preloadedFeatures); + /** + * Determine whether to use SVG or HTML rendering based on: + * 1. Explicit `type` option (highest priority) + * 2. Auto-detection via `isSVGComponent` + */ + const isSVG = type ? type === "svg" : isSVGComponent(Component); + const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; + function MotionDOMComponent(props, externalRef) { + /** + * If we need to measure the element we load this functionality in a + * separate class component in order to gain access to getSnapshotBeforeUpdate. + */ + let MeasureLayout; + const configAndProps = { + ...useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props), + }; + const { isStatic } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && isBrowser) { + useStrictMode(configAndProps, preloadedFeatures); + const layoutProjection = getProjectionFunctionality(configAndProps); + MeasureLayout = layoutProjection.MeasureLayout; + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] })); + } + MotionDOMComponent.displayName = `motion.${typeof Component === "string" + ? Component + : `create(${Component.displayName ?? Component.name ?? ""})`}`; + const ForwardRefMotionComponent = forwardRef(MotionDOMComponent); + ForwardRefMotionComponent[motionComponentSymbol] = Component; + return ForwardRefMotionComponent; +} +function useLayoutId({ layoutId }) { + const layoutGroupId = useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined + ? layoutGroupId + "-" + layoutId + : layoutId; +} +function useStrictMode(configAndProps, preloadedFeatures) { + const isStrict = useContext(LazyContext).strict; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (process.env.NODE_ENV !== "production" && + preloadedFeatures && + isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + configAndProps.ignoreStrict + ? warning(false, strictMessage, "lazy-strict-mode") + : invariant(false, strictMessage, "lazy-strict-mode"); + } +} +function getProjectionFunctionality(props) { + const featureDefinitions = getInitializedFeatureDefinitions(); + const { drag, layout } = featureDefinitions; + if (!drag && !layout) + return {}; + const combined = { ...drag, ...layout }; + return { + MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) + ? combined.MeasureLayout + : undefined, + ProjectionNode: combined.ProjectionNode, + }; +} + +export { createMotionComponent }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/index.mjs.map b/node_modules/framer-motion/dist/es/motion/index.mjs.map new file mode 100644 index 00000000..d6e3ad0c --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/motion/index.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { isBrowser } from \"../utils/is-browser\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps = {\n [K in Exclude]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps

[\"children\"]\n : MotionComponentProps

[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps,\n externalRef?: React.Ref\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic } = configAndProps\n\n const context = useCreateMotionContext(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n \n {MeasureLayout && context.visualElement ? (\n \n ) : null}\n {useRender(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG\n )}\n \n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA8DA;;;;;;;;AAQG;;AAUC;AAEA;;;;AAIG;AACH;;AAGA;AAII;;;AAGG;AACH;AAEA;;AAEI;AACA;;AAGJ;AAEA;;AAIA;AACI;AAEA;AACA;AAEA;;;;;AAKG;AACH;;AAUJ;;;AAGG;AACH;;AAwBJ;AAEQ;AACA;AAGR;AACE;AAEF;AACJ;AAEA;;AAEI;AACI;;AAER;AAEA;;AAMI;;;AAGG;AACH;;AAGI;;AAIA;;;;AAIR;AAEA;AACI;AACA;AAEA;AAAsB;;;AAKlB;;AAGQ;;;AAGhB;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs new file mode 100644 index 00000000..3d738094 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs @@ -0,0 +1,13 @@ +import { motionComponentSymbol } from './symbol.mjs'; + +/** + * Checks if a component is a `motion` component. + */ +function isMotionComponent(component) { + return (component !== null && + typeof component === "object" && + motionComponentSymbol in component); +} + +export { isMotionComponent }; +//# sourceMappingURL=is-motion-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map new file mode 100644 index 00000000..3d6e15c7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/is-motion-component.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-motion-component.mjs","sources":["../../../../src/motion/utils/is-motion-component.ts"],"sourcesContent":["import { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Checks if a component is a `motion` component.\n */\nexport function isMotionComponent(component: React.ComponentType | string) {\n return (\n component !== null &&\n typeof component === \"object\" &&\n motionComponentSymbol in component\n )\n}\n"],"names":[],"mappings":";;AAEA;;AAEG;AACG,SAAU,iBAAiB,CAAC,SAAuC,EAAA;IACrE,QACI,SAAS,KAAK,IAAI;QAClB,OAAO,SAAS,KAAK,QAAQ;QAC7B,qBAAqB,IAAI,SAAS,EACrC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs new file mode 100644 index 00000000..afeb9bbe --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs @@ -0,0 +1,4 @@ +const motionComponentSymbol = Symbol.for("motionComponentSymbol"); + +export { motionComponentSymbol }; +//# sourceMappingURL=symbol.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map new file mode 100644 index 00000000..87b1e2b0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/symbol.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"symbol.mjs","sources":["../../../../src/motion/utils/symbol.ts"],"sourcesContent":["export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n"],"names":[],"mappings":"AAAa,MAAA,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs new file mode 100644 index 00000000..b76a6681 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs @@ -0,0 +1,18 @@ +import { isMotionComponent } from './is-motion-component.mjs'; +import { motionComponentSymbol } from './symbol.mjs'; + +/** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ +function unwrapMotionComponent(component) { + if (isMotionComponent(component)) { + return component[motionComponentSymbol]; + } + return undefined; +} + +export { unwrapMotionComponent }; +//# sourceMappingURL=unwrap-motion-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map new file mode 100644 index 00000000..607242fb --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/unwrap-motion-component.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"unwrap-motion-component.mjs","sources":["../../../../src/motion/utils/unwrap-motion-component.ts"],"sourcesContent":["import { isMotionComponent } from \"./is-motion-component\"\nimport { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Unwraps a `motion` component and returns either a string for `motion.div` or\n * the React component for `motion(Component)`.\n *\n * If the component is not a `motion` component it returns undefined.\n */\nexport function unwrapMotionComponent(\n component: React.ComponentType | string\n): React.ComponentType | string | undefined {\n if (isMotionComponent(component)) {\n return component[motionComponentSymbol as keyof typeof component]\n }\n\n return undefined\n}\n"],"names":[],"mappings":";;;AAGA;;;;;AAKG;AACG,SAAU,qBAAqB,CACjC,SAAuC,EAAA;AAEvC,IAAA,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE;AAC9B,QAAA,OAAO,SAAS,CAAC,qBAA+C,CAAC,CAAA;KACpE;AAED,IAAA,OAAO,SAAS,CAAA;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs new file mode 100644 index 00000000..595f0117 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs @@ -0,0 +1,52 @@ +"use client"; +import { useRef, useInsertionEffect, useCallback } from 'react'; + +/** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ +function useMotionRef(visualState, visualElement, externalRef) { + /** + * Store externalRef in a ref to avoid including it in the useCallback + * dependency array. Including externalRef in dependencies causes issues + * with libraries like Radix UI that create new callback refs on each render + * when using asChild - this would cause the callback to be recreated, + * triggering element remounts and breaking AnimatePresence exit animations. + */ + const externalRefContainer = useRef(externalRef); + useInsertionEffect(() => { + externalRefContainer.current = externalRef; + }); + // Store cleanup function returned by callback refs (React 19 feature) + const refCleanup = useRef(null); + return useCallback((instance) => { + if (instance) { + visualState.onMount?.(instance); + } + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + const ref = externalRefContainer.current; + if (typeof ref === "function") { + if (instance) { + const cleanup = ref(instance); + if (typeof cleanup === "function") { + refCleanup.current = cleanup; + } + } + else if (refCleanup.current) { + refCleanup.current(); + refCleanup.current = null; + } + else { + ref(instance); + } + } + else if (ref) { + ref.current = instance; + } + }, [visualElement]); +} + +export { useMotionRef }; +//# sourceMappingURL=use-motion-ref.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map new file mode 100644 index 00000000..029a6024 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-ref.mjs","sources":["../../../../src/motion/utils/use-motion-ref.ts"],"sourcesContent":["\"use client\"\n\nimport type { VisualElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useCallback, useInsertionEffect, useRef } from \"react\"\nimport { VisualState } from \"./use-visual-state\"\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(\n visualState: VisualState,\n visualElement?: VisualElement | null,\n externalRef?: React.Ref\n): React.Ref {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef)\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef\n })\n\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef<(() => void) | null>(null)\n\n return useCallback(\n (instance: Instance) => {\n if (instance) {\n visualState.onMount?.(instance)\n }\n\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount()\n }\n\n const ref = externalRefContainer.current\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance)\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup\n }\n } else if (refCleanup.current) {\n refCleanup.current()\n refCleanup.current = null\n } else {\n ref(instance)\n }\n } else if (ref) {\n ;(ref as React.MutableRefObject).current = instance\n }\n },\n [visualElement]\n )\n}\n"],"names":[],"mappings":";;;AAOA;;;AAGG;;AAMC;;;;;;AAMG;AACH;;AAEI;AACJ;;AAGA;AAEA;;AAGY;;;AAIA;;AAGJ;AACA;;AAEQ;AACA;AACI;;;AAED;;AAEH;;;;;;;AAKF;;AAEV;AAGR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs new file mode 100644 index 00000000..0cee12d4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs @@ -0,0 +1,164 @@ +"use client"; +import { optimizedAppearDataAttribute } from 'motion-dom'; +import { useContext, useRef, useInsertionEffect, useEffect } from 'react'; +import { LazyContext } from '../../context/LazyContext.mjs'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { MotionContext } from '../../context/MotionContext/index.mjs'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; +import { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs'; +import { isRefObject } from '../../utils/is-ref-object.mjs'; +import { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs'; + +function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { + const { visualElement: parent } = useContext(MotionContext); + const lazyContext = useContext(LazyContext); + const presenceContext = useContext(PresenceContext); + const motionConfig = useContext(MotionConfigContext); + const reducedMotionConfig = motionConfig.reducedMotion; + const skipAnimations = motionConfig.skipAnimations; + const visualElementRef = useRef(null); + /** + * Track whether the component has been through React's commit phase. + * Used to detect when LazyMotion features load after the component has mounted. + */ + const hasMountedOnce = useRef(false); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + createVisualElement = + createVisualElement || + lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext + ? presenceContext.initial === false + : false, + reducedMotionConfig, + skipAnimations, + isSVG, + }); + /** + * If the component has already mounted before features loaded (e.g. via + * LazyMotion with async feature loading), we need to force the initial + * animation to run. Otherwise state changes that occurred before features + * loaded will be lost and the element will snap to its final state. + */ + if (hasMountedOnce.current && visualElementRef.current) { + visualElementRef.current.manuallyAnimateOnMount = true; + } + } + const visualElement = visualElementRef.current; + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext); + if (visualElement && + !visualElement.projection && + ProjectionNodeConstructor && + (visualElement.type === "html" || visualElement.type === "svg")) { + createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); + } + const isMounted = useRef(false); + useInsertionEffect(() => { + /** + * Check the component has already mounted before calling + * `update` unnecessarily. This ensures we skip the initial update. + */ + if (visualElement && isMounted.current) { + visualElement.update(props, presenceContext); + } + }); + /** + * Cache this value as we want to know whether HandoffAppearAnimations + * was present on initial render - it will be deleted after this. + */ + const optimisedAppearId = props[optimizedAppearDataAttribute]; + const wantsHandoff = useRef(Boolean(optimisedAppearId) && + !window.MotionHandoffIsComplete?.(optimisedAppearId) && + window.MotionHasOptimisedAnimation?.(optimisedAppearId)); + useIsomorphicLayoutEffect(() => { + /** + * Track that this component has mounted. This is used to detect when + * LazyMotion features load after the component has already committed. + */ + hasMountedOnce.current = true; + if (!visualElement) + return; + isMounted.current = true; + window.MotionIsMounted = true; + visualElement.updateFeatures(); + visualElement.scheduleRenderMicrotask(); + /** + * Ideally this function would always run in a useEffect. + * + * However, if we have optimised appear animations to handoff from, + * it needs to happen synchronously to ensure there's no flash of + * incorrect styles in the event of a hydration error. + * + * So if we detect a situtation where optimised appear animations + * are running, we use useLayoutEffect to trigger animations. + */ + if (wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + useEffect(() => { + if (!visualElement) + return; + if (!wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + if (wantsHandoff.current) { + // This ensures all future calls to animateChanges() in this component will run in useEffect + queueMicrotask(() => { + window.MotionHandoffMarkAsComplete?.(optimisedAppearId); + }); + wantsHandoff.current = false; + } + /** + * Now we've finished triggering animations for this element we + * can wipe the enteringChildren set for the next render. + */ + visualElement.enteringChildren = undefined; + }); + return visualElement; +} +function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { + const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props; + visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] + ? undefined + : getClosestProjectingNode(visualElement.parent)); + visualElement.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), + visualElement, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig, + crossfade: layoutCrossfade, + layoutScroll, + layoutRoot, + }); +} +function getClosestProjectingNode(visualElement) { + if (!visualElement) + return undefined; + return visualElement.options.allowProjection !== false + ? visualElement.projection + : getClosestProjectingNode(visualElement.parent); +} + +export { useVisualElement }; +//# sourceMappingURL=use-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map new file mode 100644 index 00000000..f832cc39 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-visual-element.mjs","sources":["../../../../src/motion/utils/use-visual-element.ts"],"sourcesContent":["\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType,\n visualState:\n | VisualState\n | VisualState,\n props: MotionProps & Partial,\n createVisualElement?: CreateVisualElement,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId)\n )\n\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true\n\n if (!visualElement) return\n\n isMounted.current = true\n window.MotionIsMounted = true\n\n visualElement.updateFeatures()\n visualElement.scheduleRenderMicrotask()\n\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n })\n\n useEffect(() => {\n if (!visualElement) return\n\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges()\n }\n\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId)\n })\n\n wantsHandoff.current = false\n }\n\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined\n })\n\n return visualElement!\n}\n\nfunction createProjectionNode(\n visualElement: VisualElement,\n props: MotionProps,\n ProjectionNodeConstructor: any,\n initialPromotionConfig?: InitialPromotionConfig\n) {\n const {\n layoutId,\n layout,\n drag,\n dragConstraints,\n layoutScroll,\n layoutRoot,\n layoutCrossfade,\n } = props\n\n visualElement.projection = new ProjectionNodeConstructor(\n visualElement.latestValues,\n props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent)\n ) as IProjectionNode\n\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout:\n Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n })\n}\n\nfunction getClosestProjectingNode(\n visualElement?: VisualElement<\n unknown,\n unknown,\n { allowProjection?: boolean }\n >\n): IProjectionNode | undefined {\n if (!visualElement) return undefined\n\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent)\n}\n"],"names":[],"mappings":";;;;;;;;;;;AA0BgB;;AAcZ;AACA;AACA;AACA;AACA;AAEA;AAIA;;;AAGG;AACH;AAEA;;AAEG;;;;AAKH;AACI;;;;;AAKI;AACI;AACA;;;;AAIP;AAED;;;;;AAKG;;AAEC;;;AAIR;AAEA;;;AAGG;AACH;AAEA;;;AAII;;;AAUJ;;AAEI;;;AAGG;AACH;AACI;;AAER;AAEA;;;AAGG;AACH;AAEA;AAEQ;AACA;;AAIJ;;;AAGG;AACH;AAEA;;AAEA;AACA;;;AAKA;;;;;;;;;AASG;;AAEC;;AAER;;AAGI;;;AAGI;;AAGJ;;;AAGQ;AACJ;AAEA;;AAGJ;;;AAGG;AACH;AACJ;AAEA;AACJ;AAEA;AAMI;AAUA;AAGQ;;AAIR;;;AAGI;;AAGA;;;;;;AAMG;AACH;;AAEA;;;AAGH;AACL;AAEA;AAOI;AAAoB;AAEpB;;AAEI;AACR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs new file mode 100644 index 00000000..433af584 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs @@ -0,0 +1,78 @@ +"use client"; +import { resolveMotionValue, isControllingVariants, isVariantNode, isAnimationControls, resolveVariantFromProps } from 'motion-dom'; +import { useContext } from 'react'; +import { MotionContext } from '../../context/MotionContext/index.mjs'; +import { PresenceContext } from '../../context/PresenceContext.mjs'; +import { useConstant } from '../../utils/use-constant.mjs'; + +function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState(), + }; + return state; +} +function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants$1 = isControllingVariants(props); + const isVariantNode$1 = isVariantNode(props); + if (context && + isVariantNode$1 && + !isControllingVariants$1 && + props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext + ? presenceContext.initial === false + : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && + typeof variantToSet !== "boolean" && + !isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + for (let i = 0; i < list.length; i++) { + const resolved = resolveVariantFromProps(props, list[i]); + if (resolved) { + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + const index = isInitialAnimationBlocked + ? valueTarget.length - 1 + : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) { + values[key] = transitionEnd[key]; + } + } + } + } + return values; +} +const makeUseVisualState = (config) => (props, isStatic) => { + const context = useContext(MotionContext); + const presenceContext = useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); +}; + +export { makeUseVisualState }; +//# sourceMappingURL=use-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map new file mode 100644 index 00000000..bca2c6db --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-visual-state.mjs","sources":["../../../../src/motion/utils/use-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n isAnimationControls,\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n ResolvedValues,\n resolveVariantFromProps,\n} from \"motion-dom\"\nimport { useContext } from \"react\"\nimport { MotionContext, MotionContextProps } from \"../../context/MotionContext\"\nimport {\n PresenceContext,\n type PresenceContextProps,\n} from \"../../context/PresenceContext\"\nimport { ScrapeMotionValuesFromProps } from \"../../render/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { resolveMotionValue } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\n\nexport interface VisualState {\n renderState: RenderState\n latestValues: ResolvedValues\n onMount?: (instance: Instance) => void\n}\n\nexport type UseVisualState = (\n props: MotionProps,\n isStatic: boolean\n) => VisualState\n\nexport interface UseVisualStateConfig {\n scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps\n createRenderState: () => RenderState\n}\n\nfunction makeState(\n {\n scrapeMotionValuesFromProps,\n createRenderState,\n }: UseVisualStateConfig,\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null\n) {\n const state: VisualState = {\n latestValues: makeLatestValues(\n props,\n context,\n presenceContext,\n scrapeMotionValuesFromProps\n ),\n renderState: createRenderState(),\n }\n\n return state\n}\n\nfunction makeLatestValues(\n props: MotionProps,\n context: MotionContextProps,\n presenceContext: PresenceContextProps | null,\n scrapeMotionValues: ScrapeMotionValuesFromProps\n) {\n const values: ResolvedValues = {}\n\n const motionValues = scrapeMotionValues(props, {})\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key])\n }\n\n let { initial, animate } = props\n const isControllingVariants = checkIsControllingVariants(props)\n const isVariantNode = checkIsVariantNode(props)\n\n if (\n context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false\n ) {\n if (initial === undefined) initial = context.initial\n if (animate === undefined) animate = context.animate\n }\n\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false\n\n const variantToSet = isInitialAnimationBlocked ? animate : initial\n\n if (\n variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)\n ) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i] as any)\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved\n for (const key in target) {\n let valueTarget = target[key as keyof typeof target]\n\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0\n valueTarget = valueTarget[index] as any\n }\n\n if (valueTarget !== null) {\n values[key] = valueTarget as AnyResolvedKeyframe\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[\n key as keyof typeof transitionEnd\n ] as AnyResolvedKeyframe\n }\n }\n }\n }\n\n return values\n}\n\nexport const makeUseVisualState =\n (config: UseVisualStateConfig): UseVisualState =>\n (props: MotionProps, isStatic: boolean): VisualState => {\n const context = useContext(MotionContext)\n const presenceContext = useContext(PresenceContext)\n const make = () => makeState(config, props, context, presenceContext)\n\n return isStatic ? make() : useConstant(make)\n }\n"],"names":[],"mappings":";;;;;;;AAqCA;AASI;;;;AAUA;AACJ;AAEA;;;AASI;;;AAIA;AACA;AACA;AAEA;;AAGI;AACA;;AAE2B;;AACA;;;AAI3B;;AAEJ;;AAIA;;AAGI;AAEA;AACA;;;;AAIQ;AACI;AAEA;AACI;;;AAGG;;AAEC;;AAEJ;;AAGJ;AACI;;;AAGR;;;;;;AASZ;AACJ;AAEO;AAGC;AACA;AACA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs new file mode 100644 index 00000000..e4c52d63 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs @@ -0,0 +1,59 @@ +/** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ +const validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "custom", + "inherit", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "globalTapTarget", + "propagate", + "ignoreStrict", + "viewport", +]); +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +function isValidMotionProp(key) { + return (key.startsWith("while") || + (key.startsWith("drag") && key !== "draggable") || + key.startsWith("layout") || + key.startsWith("onTap") || + key.startsWith("onPan") || + key.startsWith("onLayout") || + validMotionProps.has(key)); +} + +export { isValidMotionProp }; +//# sourceMappingURL=valid-prop.mjs.map diff --git a/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map new file mode 100644 index 00000000..8cbe8615 --- /dev/null +++ b/node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"valid-prop.mjs","sources":["../../../../src/motion/utils/valid-prop.ts"],"sourcesContent":["import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n"],"names":[],"mappings":"AAEA;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAoB;IAChD,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,OAAO;IACP,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,mBAAmB;IACnB,QAAQ;IACR,SAAS;IACT,uBAAuB;IACvB,kBAAkB;IAClB,qBAAqB;IACrB,UAAU;IACV,aAAa;IACb,QAAQ;IACR,WAAW;IACX,0BAA0B;IAC1B,iBAAiB;IACjB,qBAAqB;IACrB,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,WAAW;IACX,cAAc;IACd,UAAU;AACb,CAAA,CAAC,CAAA;AAEF;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,GAAW,EAAA;AACzC,IAAA,QACI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;SACtB,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,WAAW,CAAC;AAC/C,QAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;AACxB,QAAA,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC;AAC1B,QAAA,gBAAgB,CAAC,GAAG,CAAC,GAAwB,CAAC,EACjD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection.mjs b/node_modules/framer-motion/dist/es/projection.mjs new file mode 100644 index 00000000..902c523b --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection.mjs @@ -0,0 +1,2 @@ +export { HTMLProjectionNode, HTMLVisualElement, addScaleCorrector, buildTransform, calcBoxDelta, correctBorderRadius, correctBoxShadow, frame, frameData, mix, nodeGroup, recordStats, statsBuffer } from 'motion-dom'; +//# sourceMappingURL=projection.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection.mjs.map b/node_modules/framer-motion/dist/es/projection.mjs.map new file mode 100644 index 00000000..2f608b0f --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"projection.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs new file mode 100644 index 00000000..914d498e --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs @@ -0,0 +1,15 @@ +import { rootProjectionNode } from 'motion-dom'; + +function useInstantLayoutTransition() { + return startTransition; +} +function startTransition(callback) { + if (!rootProjectionNode.current) + return; + rootProjectionNode.current.isUpdating = false; + rootProjectionNode.current.blockUpdate(); + callback && callback(); +} + +export { useInstantLayoutTransition }; +//# sourceMappingURL=use-instant-layout-transition.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map new file mode 100644 index 00000000..2503a234 --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-instant-layout-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-instant-layout-transition.mjs","sources":["../../../src/projection/use-instant-layout-transition.ts"],"sourcesContent":["import { rootProjectionNode } from \"motion-dom\"\n\nexport function useInstantLayoutTransition(): (\n cb?: (() => void) | undefined\n) => void {\n return startTransition\n}\n\nfunction startTransition(callback?: () => void) {\n if (!rootProjectionNode.current) return\n rootProjectionNode.current.isUpdating = false\n rootProjectionNode.current.blockUpdate()\n callback && callback()\n}\n"],"names":[],"mappings":";;SAEgB,0BAA0B,GAAA;AAGtC,IAAA,OAAO,eAAe,CAAA;AAC1B,CAAC;AAED,SAAS,eAAe,CAAC,QAAqB,EAAA;IAC1C,IAAI,CAAC,kBAAkB,CAAC,OAAO;QAAE,OAAM;AACvC,IAAA,kBAAkB,CAAC,OAAO,CAAC,UAAU,GAAG,KAAK,CAAA;AAC7C,IAAA,kBAAkB,CAAC,OAAO,CAAC,WAAW,EAAE,CAAA;IACxC,QAAQ,IAAI,QAAQ,EAAE,CAAA;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs new file mode 100644 index 00000000..4ef3e87b --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs @@ -0,0 +1,15 @@ +import { useCallback } from 'react'; +import { rootProjectionNode } from 'motion-dom'; + +function useResetProjection() { + const reset = useCallback(() => { + const root = rootProjectionNode.current; + if (!root) + return; + root.resetTree(); + }, []); + return reset; +} + +export { useResetProjection }; +//# sourceMappingURL=use-reset-projection.mjs.map diff --git a/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map new file mode 100644 index 00000000..64326baf --- /dev/null +++ b/node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-reset-projection.mjs","sources":["../../../src/projection/use-reset-projection.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { rootProjectionNode } from \"motion-dom\"\n\nexport function useResetProjection() {\n const reset = useCallback(() => {\n const root = rootProjectionNode.current\n if (!root) return\n root.resetTree()\n }, [])\n\n return reset\n}\n"],"names":[],"mappings":";;;SAGgB,kBAAkB,GAAA;AAC9B,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,MAAK;AAC3B,QAAA,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAA;AACvC,QAAA,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,IAAI,CAAC,SAAS,EAAE,CAAA;KACnB,EAAE,EAAE,CAAC,CAAA;AAEN,IAAA,OAAO,KAAK,CAAA;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs new file mode 100644 index 00000000..5252bc2c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs @@ -0,0 +1,46 @@ +import { warnOnce } from 'motion-utils'; +import { createMotionComponent } from '../../motion/index.mjs'; + +function createMotionProxy(preloadedFeatures, createVisualElement) { + if (typeof Proxy === "undefined") { + return createMotionComponent; + } + /** + * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. + * Rather than generating them anew every render. + */ + const componentCache = new Map(); + const factory = (Component, options) => { + return createMotionComponent(Component, options, preloadedFeatures, createVisualElement); + }; + /** + * Support for deprecated`motion(Component)` pattern + */ + const deprecatedFactoryFunction = (Component, options) => { + if (process.env.NODE_ENV !== "production") { + warnOnce(false, "motion() is deprecated. Use motion.create() instead."); + } + return factory(Component, options); + }; + return new Proxy(deprecatedFactoryFunction, { + /** + * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. + * The prop name is passed through as `key` and we can use that to generate a `motion` + * DOM component with that name. + */ + get: (_target, key) => { + if (key === "create") + return factory; + /** + * If this element doesn't exist in the component cache, create it and cache. + */ + if (!componentCache.has(key)) { + componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); + } + return componentCache.get(key); + }, + }); +} + +export { createMotionProxy }; +//# sourceMappingURL=create-proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map new file mode 100644 index 00000000..091afa5c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-proxy.mjs","sources":["../../../../src/render/components/create-proxy.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps = React.PropsWithoutRef &\n React.RefAttributes\nexport type CustomDomComponent = React.ComponentType<\n ComponentProps\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n"],"names":[],"mappings":";;;AAqBgB,SAAA,iBAAiB,CAC7B,iBAAmC,EACnC,mBAAmD,EAAA;AAEnD,IAAA,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;AAC9B,QAAA,OAAO,qBAAoC,CAAA;KAC9C;AAED;;;AAGG;AACH,IAAA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAe,CAAA;AAE7C,IAAA,MAAM,OAAO,GAAG,CAAC,SAAiB,EAAE,OAAgC,KAAI;QACpE,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,mBAAmB,CACtB,CAAA;AACL,KAAC,CAAA;AAED;;AAEG;AACH,IAAA,MAAM,yBAAyB,GAAG,CAC9B,SAAiB,EACjB,OAAgC,KAChC;QACA,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,YAAA,QAAQ,CACJ,KAAK,EACL,sDAAsD,CACzD,CAAA;SACJ;AACD,QAAA,OAAO,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AACtC,KAAC,CAAA;AAED,IAAA,OAAO,IAAI,KAAK,CAAC,yBAAyB,EAAE;AACxC;;;;AAIG;AACH,QAAA,GAAG,EAAE,CAAC,OAAO,EAAE,GAAW,KAAI;YAC1B,IAAI,GAAG,KAAK,QAAQ;AAAE,gBAAA,OAAO,OAAO,CAAA;AAEpC;;AAEG;YACH,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AAC1B,gBAAA,cAAc,CAAC,GAAG,CACd,GAAG,EACH,qBAAqB,CACjB,GAAG,EACH,SAAS,EACT,iBAAiB,EACjB,mBAAmB,CACtB,CACJ,CAAA;aACJ;AAED,YAAA,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAE,CAAA;SAClC;AACJ,KAAA,CAAgB,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/create.mjs b/node_modules/framer-motion/dist/es/render/components/m/create.mjs new file mode 100644 index 00000000..48a923c9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/create.mjs @@ -0,0 +1,8 @@ +import { createMotionComponent } from '../../../motion/index.mjs'; + +function createMinimalMotionComponent(Component, options) { + return createMotionComponent(Component, options); +} + +export { createMinimalMotionComponent }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map new file mode 100644 index 00000000..aa627124 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/m/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { DOMMotionComponents } from \"../../dom/types\"\n\nexport function createMinimalMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(Component, options)\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,4BAA4B,CAIxC,SAAwD,EACxD,OAAgC,EAAA;AAEhC,IAAA,OAAO,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs new file mode 100644 index 00000000..7f37fed4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs @@ -0,0 +1,228 @@ +"use client"; +import { createMinimalMotionComponent } from './create.mjs'; + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMinimalMotionComponent("a"); +const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent("abbr"); +const MotionAddress = +/*@__PURE__*/ createMinimalMotionComponent("address"); +const MotionArea = /*@__PURE__*/ createMinimalMotionComponent("area"); +const MotionArticle = +/*@__PURE__*/ createMinimalMotionComponent("article"); +const MotionAside = /*@__PURE__*/ createMinimalMotionComponent("aside"); +const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent("audio"); +const MotionB = /*@__PURE__*/ createMinimalMotionComponent("b"); +const MotionBase = /*@__PURE__*/ createMinimalMotionComponent("base"); +const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent("bdi"); +const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent("bdo"); +const MotionBig = /*@__PURE__*/ createMinimalMotionComponent("big"); +const MotionBlockquote = +/*@__PURE__*/ createMinimalMotionComponent("blockquote"); +const MotionBody = /*@__PURE__*/ createMinimalMotionComponent("body"); +const MotionButton = /*@__PURE__*/ createMinimalMotionComponent("button"); +const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent("canvas"); +const MotionCaption = +/*@__PURE__*/ createMinimalMotionComponent("caption"); +const MotionCite = /*@__PURE__*/ createMinimalMotionComponent("cite"); +const MotionCode = /*@__PURE__*/ createMinimalMotionComponent("code"); +const MotionCol = /*@__PURE__*/ createMinimalMotionComponent("col"); +const MotionColgroup = +/*@__PURE__*/ createMinimalMotionComponent("colgroup"); +const MotionData = /*@__PURE__*/ createMinimalMotionComponent("data"); +const MotionDatalist = +/*@__PURE__*/ createMinimalMotionComponent("datalist"); +const MotionDd = /*@__PURE__*/ createMinimalMotionComponent("dd"); +const MotionDel = /*@__PURE__*/ createMinimalMotionComponent("del"); +const MotionDetails = +/*@__PURE__*/ createMinimalMotionComponent("details"); +const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent("dfn"); +const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent("dialog"); +const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent("div"); +const MotionDl = /*@__PURE__*/ createMinimalMotionComponent("dl"); +const MotionDt = /*@__PURE__*/ createMinimalMotionComponent("dt"); +const MotionEm = /*@__PURE__*/ createMinimalMotionComponent("em"); +const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent("embed"); +const MotionFieldset = +/*@__PURE__*/ createMinimalMotionComponent("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMinimalMotionComponent("figcaption"); +const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent("figure"); +const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent("footer"); +const MotionForm = /*@__PURE__*/ createMinimalMotionComponent("form"); +const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent("h1"); +const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent("h2"); +const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent("h3"); +const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent("h4"); +const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent("h5"); +const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent("h6"); +const MotionHead = /*@__PURE__*/ createMinimalMotionComponent("head"); +const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent("header"); +const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent("hgroup"); +const MotionHr = /*@__PURE__*/ createMinimalMotionComponent("hr"); +const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent("html"); +const MotionI = /*@__PURE__*/ createMinimalMotionComponent("i"); +const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent("iframe"); +const MotionImg = /*@__PURE__*/ createMinimalMotionComponent("img"); +const MotionInput = /*@__PURE__*/ createMinimalMotionComponent("input"); +const MotionIns = /*@__PURE__*/ createMinimalMotionComponent("ins"); +const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent("kbd"); +const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent("keygen"); +const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent("label"); +const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent("legend"); +const MotionLi = /*@__PURE__*/ createMinimalMotionComponent("li"); +const MotionLink = /*@__PURE__*/ createMinimalMotionComponent("link"); +const MotionMain = /*@__PURE__*/ createMinimalMotionComponent("main"); +const MotionMap = /*@__PURE__*/ createMinimalMotionComponent("map"); +const MotionMark = /*@__PURE__*/ createMinimalMotionComponent("mark"); +const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent("menu"); +const MotionMenuitem = +/*@__PURE__*/ createMinimalMotionComponent("menuitem"); +const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent("meter"); +const MotionNav = /*@__PURE__*/ createMinimalMotionComponent("nav"); +const MotionObject = /*@__PURE__*/ createMinimalMotionComponent("object"); +const MotionOl = /*@__PURE__*/ createMinimalMotionComponent("ol"); +const MotionOptgroup = +/*@__PURE__*/ createMinimalMotionComponent("optgroup"); +const MotionOption = /*@__PURE__*/ createMinimalMotionComponent("option"); +const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent("output"); +const MotionP = /*@__PURE__*/ createMinimalMotionComponent("p"); +const MotionParam = /*@__PURE__*/ createMinimalMotionComponent("param"); +const MotionPicture = +/*@__PURE__*/ createMinimalMotionComponent("picture"); +const MotionPre = /*@__PURE__*/ createMinimalMotionComponent("pre"); +const MotionProgress = +/*@__PURE__*/ createMinimalMotionComponent("progress"); +const MotionQ = /*@__PURE__*/ createMinimalMotionComponent("q"); +const MotionRp = /*@__PURE__*/ createMinimalMotionComponent("rp"); +const MotionRt = /*@__PURE__*/ createMinimalMotionComponent("rt"); +const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent("ruby"); +const MotionS = /*@__PURE__*/ createMinimalMotionComponent("s"); +const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent("samp"); +const MotionScript = /*@__PURE__*/ createMinimalMotionComponent("script"); +const MotionSection = +/*@__PURE__*/ createMinimalMotionComponent("section"); +const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent("select"); +const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent("small"); +const MotionSource = /*@__PURE__*/ createMinimalMotionComponent("source"); +const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent("span"); +const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent("strong"); +const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent("style"); +const MotionSub = /*@__PURE__*/ createMinimalMotionComponent("sub"); +const MotionSummary = +/*@__PURE__*/ createMinimalMotionComponent("summary"); +const MotionSup = /*@__PURE__*/ createMinimalMotionComponent("sup"); +const MotionTable = /*@__PURE__*/ createMinimalMotionComponent("table"); +const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent("tbody"); +const MotionTd = /*@__PURE__*/ createMinimalMotionComponent("td"); +const MotionTextarea = +/*@__PURE__*/ createMinimalMotionComponent("textarea"); +const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent("tfoot"); +const MotionTh = /*@__PURE__*/ createMinimalMotionComponent("th"); +const MotionThead = /*@__PURE__*/ createMinimalMotionComponent("thead"); +const MotionTime = /*@__PURE__*/ createMinimalMotionComponent("time"); +const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent("title"); +const MotionTr = /*@__PURE__*/ createMinimalMotionComponent("tr"); +const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent("track"); +const MotionU = /*@__PURE__*/ createMinimalMotionComponent("u"); +const MotionUl = /*@__PURE__*/ createMinimalMotionComponent("ul"); +const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent("video"); +const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent("wbr"); +const MotionWebview = +/*@__PURE__*/ createMinimalMotionComponent("webview"); +/** + * SVG components + */ +const MotionAnimate = +/*@__PURE__*/ createMinimalMotionComponent("animate"); +const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent("circle"); +const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent("defs"); +const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent("desc"); +const MotionEllipse = +/*@__PURE__*/ createMinimalMotionComponent("ellipse"); +const MotionG = /*@__PURE__*/ createMinimalMotionComponent("g"); +const MotionImage = /*@__PURE__*/ createMinimalMotionComponent("image"); +const MotionLine = /*@__PURE__*/ createMinimalMotionComponent("line"); +const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent("filter"); +const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent("marker"); +const MotionMask = /*@__PURE__*/ createMinimalMotionComponent("mask"); +const MotionMetadata = +/*@__PURE__*/ createMinimalMotionComponent("metadata"); +const MotionPath = /*@__PURE__*/ createMinimalMotionComponent("path"); +const MotionPattern = +/*@__PURE__*/ createMinimalMotionComponent("pattern"); +const MotionPolygon = +/*@__PURE__*/ createMinimalMotionComponent("polygon"); +const MotionPolyline = +/*@__PURE__*/ createMinimalMotionComponent("polyline"); +const MotionRect = /*@__PURE__*/ createMinimalMotionComponent("rect"); +const MotionStop = /*@__PURE__*/ createMinimalMotionComponent("stop"); +const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent("svg"); +const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent("symbol"); +const MotionText = /*@__PURE__*/ createMinimalMotionComponent("text"); +const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent("tspan"); +const MotionUse = /*@__PURE__*/ createMinimalMotionComponent("use"); +const MotionView = /*@__PURE__*/ createMinimalMotionComponent("view"); +const MotionClipPath = +/*@__PURE__*/ createMinimalMotionComponent("clipPath"); +const MotionFeBlend = +/*@__PURE__*/ createMinimalMotionComponent("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feColorMatrix"); +const MotionFeComponentTransfer = +/*@__PURE__*/ createMinimalMotionComponent("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMinimalMotionComponent("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMinimalMotionComponent("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMinimalMotionComponent("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMinimalMotionComponent("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMinimalMotionComponent("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMinimalMotionComponent("feDropShadow"); +const MotionFeFlood = +/*@__PURE__*/ createMinimalMotionComponent("feFlood"); +const MotionFeFuncA = +/*@__PURE__*/ createMinimalMotionComponent("feFuncA"); +const MotionFeFuncB = +/*@__PURE__*/ createMinimalMotionComponent("feFuncB"); +const MotionFeFuncG = +/*@__PURE__*/ createMinimalMotionComponent("feFuncG"); +const MotionFeFuncR = +/*@__PURE__*/ createMinimalMotionComponent("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMinimalMotionComponent("feGaussianBlur"); +const MotionFeImage = +/*@__PURE__*/ createMinimalMotionComponent("feImage"); +const MotionFeMerge = +/*@__PURE__*/ createMinimalMotionComponent("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMinimalMotionComponent("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMinimalMotionComponent("feMorphology"); +const MotionFeOffset = +/*@__PURE__*/ createMinimalMotionComponent("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMinimalMotionComponent("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMinimalMotionComponent("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMinimalMotionComponent("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMinimalMotionComponent("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMinimalMotionComponent("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMinimalMotionComponent("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMinimalMotionComponent("radialGradient"); +const MotionTextPath = +/*@__PURE__*/ createMinimalMotionComponent("textPath"); + +export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview }; +//# sourceMappingURL=elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map new file mode 100644 index 00000000..14581d6e --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/m/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMinimalMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\")\nexport const MotionAddress =\n /*@__PURE__*/ createMinimalMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\")\nexport const MotionArticle =\n /*@__PURE__*/ createMinimalMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMinimalMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\")\nexport const MotionCaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\")\nexport const MotionColgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\")\nexport const MotionDatalist =\n /*@__PURE__*/ createMinimalMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\")\nexport const MotionDetails =\n /*@__PURE__*/ createMinimalMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\")\nexport const MotionFieldset =\n /*@__PURE__*/ createMinimalMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMinimalMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\")\nexport const MotionMenuitem =\n /*@__PURE__*/ createMinimalMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\")\nexport const MotionOptgroup =\n /*@__PURE__*/ createMinimalMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\")\nexport const MotionPicture =\n /*@__PURE__*/ createMinimalMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\")\nexport const MotionProgress =\n /*@__PURE__*/ createMinimalMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\")\nexport const MotionSection =\n /*@__PURE__*/ createMinimalMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\")\nexport const MotionSummary =\n /*@__PURE__*/ createMinimalMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\")\nexport const MotionTextarea =\n /*@__PURE__*/ createMinimalMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\")\nexport const MotionWebview =\n /*@__PURE__*/ createMinimalMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate =\n /*@__PURE__*/ createMinimalMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\")\nexport const MotionEllipse =\n /*@__PURE__*/ createMinimalMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\")\nexport const MotionMetadata =\n /*@__PURE__*/ createMinimalMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\")\nexport const MotionPattern =\n /*@__PURE__*/ createMinimalMotionComponent(\"pattern\")\nexport const MotionPolygon =\n /*@__PURE__*/ createMinimalMotionComponent(\"polygon\")\nexport const MotionPolyline =\n /*@__PURE__*/ createMinimalMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\")\nexport const MotionClipPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"clipPath\")\nexport const MotionFeBlend =\n /*@__PURE__*/ createMinimalMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\")\nexport const MotionFeComposite =\n /*@__PURE__*/ createMinimalMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFlood\")\nexport const MotionFeFuncA =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR =\n /*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage =\n /*@__PURE__*/ createMinimalMotionComponent(\"feImage\")\nexport const MotionFeMerge =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\")\nexport const MotionFeOffset =\n /*@__PURE__*/ createMinimalMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\")\nexport const MotionTextPath =\n /*@__PURE__*/ createMinimalMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACU;AACA;;AAET;AACS;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;;AAET;AACS;AACA;AACA;;AAET;AACS;;AAET;AACS;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;;AAEA;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;;AAET;AACS;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AAEJ;;AAEG;;AAEC;AACS;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;;AAET;;AAEA;;AAEA;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACS;;AAET;;AAEA;;AAEA;;AAEA;;AAEA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs new file mode 100644 index 00000000..2de139e9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs @@ -0,0 +1,6 @@ +import { createMotionProxy } from '../create-proxy.mjs'; + +const m = /*@__PURE__*/ createMotionProxy(); + +export { m }; +//# sourceMappingURL=proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map new file mode 100644 index 00000000..ce751052 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/m/proxy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/m/proxy.ts"],"sourcesContent":["import { createMotionProxy } from \"../create-proxy\"\n\nexport const m = /*@__PURE__*/ createMotionProxy()\n"],"names":[],"mappings":";;MAEa,CAAC,iBAAiB,iBAAiB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs new file mode 100644 index 00000000..b74f806a --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs @@ -0,0 +1,10 @@ +import { createMotionComponent } from '../../../motion/index.mjs'; +import { createDomVisualElement } from '../../dom/create-visual-element.mjs'; +import { featureBundle } from './feature-bundle.mjs'; + +function createMotionComponentWithFeatures(Component, options) { + return createMotionComponent(Component, options, featureBundle, createDomVisualElement); +} + +export { createMotionComponentWithFeatures }; +//# sourceMappingURL=create.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map new file mode 100644 index 00000000..293826d5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/create.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create.mjs","sources":["../../../../../src/render/components/motion/create.ts"],"sourcesContent":["import { createMotionComponent, MotionComponentOptions } from \"../../../motion\"\nimport { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { DOMMotionComponents } from \"../../dom/types\"\nimport { CreateVisualElement } from \"../../types\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport function createMotionComponentWithFeatures<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n options?: MotionComponentOptions\n) {\n return createMotionComponent(\n Component,\n options,\n featureBundle,\n createDomVisualElement as CreateVisualElement\n )\n}\n"],"names":[],"mappings":";;;;AAMgB,SAAA,iCAAiC,CAI7C,SAAwD,EACxD,OAAgC,EAAA;IAEhC,OAAO,qBAAqB,CACxB,SAAS,EACT,OAAO,EACP,aAAa,EACb,sBAA6D,CAChE,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs new file mode 100644 index 00000000..04dc7620 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs @@ -0,0 +1,195 @@ +"use client"; +import { createMotionComponentWithFeatures } from './create.mjs'; + +/** + * HTML components + */ +const MotionA = /*@__PURE__*/ createMotionComponentWithFeatures("a"); +const MotionAbbr = /*@__PURE__*/ createMotionComponentWithFeatures("abbr"); +const MotionAddress = /*@__PURE__*/ createMotionComponentWithFeatures("address"); +const MotionArea = /*@__PURE__*/ createMotionComponentWithFeatures("area"); +const MotionArticle = /*@__PURE__*/ createMotionComponentWithFeatures("article"); +const MotionAside = /*@__PURE__*/ createMotionComponentWithFeatures("aside"); +const MotionAudio = /*@__PURE__*/ createMotionComponentWithFeatures("audio"); +const MotionB = /*@__PURE__*/ createMotionComponentWithFeatures("b"); +const MotionBase = /*@__PURE__*/ createMotionComponentWithFeatures("base"); +const MotionBdi = /*@__PURE__*/ createMotionComponentWithFeatures("bdi"); +const MotionBdo = /*@__PURE__*/ createMotionComponentWithFeatures("bdo"); +const MotionBig = /*@__PURE__*/ createMotionComponentWithFeatures("big"); +const MotionBlockquote = +/*@__PURE__*/ createMotionComponentWithFeatures("blockquote"); +const MotionBody = /*@__PURE__*/ createMotionComponentWithFeatures("body"); +const MotionButton = /*@__PURE__*/ createMotionComponentWithFeatures("button"); +const MotionCanvas = /*@__PURE__*/ createMotionComponentWithFeatures("canvas"); +const MotionCaption = /*@__PURE__*/ createMotionComponentWithFeatures("caption"); +const MotionCite = /*@__PURE__*/ createMotionComponentWithFeatures("cite"); +const MotionCode = /*@__PURE__*/ createMotionComponentWithFeatures("code"); +const MotionCol = /*@__PURE__*/ createMotionComponentWithFeatures("col"); +const MotionColgroup = /*@__PURE__*/ createMotionComponentWithFeatures("colgroup"); +const MotionData = /*@__PURE__*/ createMotionComponentWithFeatures("data"); +const MotionDatalist = /*@__PURE__*/ createMotionComponentWithFeatures("datalist"); +const MotionDd = /*@__PURE__*/ createMotionComponentWithFeatures("dd"); +const MotionDel = /*@__PURE__*/ createMotionComponentWithFeatures("del"); +const MotionDetails = /*@__PURE__*/ createMotionComponentWithFeatures("details"); +const MotionDfn = /*@__PURE__*/ createMotionComponentWithFeatures("dfn"); +const MotionDialog = /*@__PURE__*/ createMotionComponentWithFeatures("dialog"); +const MotionDiv = /*@__PURE__*/ createMotionComponentWithFeatures("div"); +const MotionDl = /*@__PURE__*/ createMotionComponentWithFeatures("dl"); +const MotionDt = /*@__PURE__*/ createMotionComponentWithFeatures("dt"); +const MotionEm = /*@__PURE__*/ createMotionComponentWithFeatures("em"); +const MotionEmbed = /*@__PURE__*/ createMotionComponentWithFeatures("embed"); +const MotionFieldset = /*@__PURE__*/ createMotionComponentWithFeatures("fieldset"); +const MotionFigcaption = +/*@__PURE__*/ createMotionComponentWithFeatures("figcaption"); +const MotionFigure = /*@__PURE__*/ createMotionComponentWithFeatures("figure"); +const MotionFooter = /*@__PURE__*/ createMotionComponentWithFeatures("footer"); +const MotionForm = /*@__PURE__*/ createMotionComponentWithFeatures("form"); +const MotionH1 = /*@__PURE__*/ createMotionComponentWithFeatures("h1"); +const MotionH2 = /*@__PURE__*/ createMotionComponentWithFeatures("h2"); +const MotionH3 = /*@__PURE__*/ createMotionComponentWithFeatures("h3"); +const MotionH4 = /*@__PURE__*/ createMotionComponentWithFeatures("h4"); +const MotionH5 = /*@__PURE__*/ createMotionComponentWithFeatures("h5"); +const MotionH6 = /*@__PURE__*/ createMotionComponentWithFeatures("h6"); +const MotionHead = /*@__PURE__*/ createMotionComponentWithFeatures("head"); +const MotionHeader = /*@__PURE__*/ createMotionComponentWithFeatures("header"); +const MotionHgroup = /*@__PURE__*/ createMotionComponentWithFeatures("hgroup"); +const MotionHr = /*@__PURE__*/ createMotionComponentWithFeatures("hr"); +const MotionHtml = /*@__PURE__*/ createMotionComponentWithFeatures("html"); +const MotionI = /*@__PURE__*/ createMotionComponentWithFeatures("i"); +const MotionIframe = /*@__PURE__*/ createMotionComponentWithFeatures("iframe"); +const MotionImg = /*@__PURE__*/ createMotionComponentWithFeatures("img"); +const MotionInput = /*@__PURE__*/ createMotionComponentWithFeatures("input"); +const MotionIns = /*@__PURE__*/ createMotionComponentWithFeatures("ins"); +const MotionKbd = /*@__PURE__*/ createMotionComponentWithFeatures("kbd"); +const MotionKeygen = /*@__PURE__*/ createMotionComponentWithFeatures("keygen"); +const MotionLabel = /*@__PURE__*/ createMotionComponentWithFeatures("label"); +const MotionLegend = /*@__PURE__*/ createMotionComponentWithFeatures("legend"); +const MotionLi = /*@__PURE__*/ createMotionComponentWithFeatures("li"); +const MotionLink = /*@__PURE__*/ createMotionComponentWithFeatures("link"); +const MotionMain = /*@__PURE__*/ createMotionComponentWithFeatures("main"); +const MotionMap = /*@__PURE__*/ createMotionComponentWithFeatures("map"); +const MotionMark = /*@__PURE__*/ createMotionComponentWithFeatures("mark"); +const MotionMenu = /*@__PURE__*/ createMotionComponentWithFeatures("menu"); +const MotionMenuitem = /*@__PURE__*/ createMotionComponentWithFeatures("menuitem"); +const MotionMeter = /*@__PURE__*/ createMotionComponentWithFeatures("meter"); +const MotionNav = /*@__PURE__*/ createMotionComponentWithFeatures("nav"); +const MotionObject = /*@__PURE__*/ createMotionComponentWithFeatures("object"); +const MotionOl = /*@__PURE__*/ createMotionComponentWithFeatures("ol"); +const MotionOptgroup = /*@__PURE__*/ createMotionComponentWithFeatures("optgroup"); +const MotionOption = /*@__PURE__*/ createMotionComponentWithFeatures("option"); +const MotionOutput = /*@__PURE__*/ createMotionComponentWithFeatures("output"); +const MotionP = /*@__PURE__*/ createMotionComponentWithFeatures("p"); +const MotionParam = /*@__PURE__*/ createMotionComponentWithFeatures("param"); +const MotionPicture = /*@__PURE__*/ createMotionComponentWithFeatures("picture"); +const MotionPre = /*@__PURE__*/ createMotionComponentWithFeatures("pre"); +const MotionProgress = /*@__PURE__*/ createMotionComponentWithFeatures("progress"); +const MotionQ = /*@__PURE__*/ createMotionComponentWithFeatures("q"); +const MotionRp = /*@__PURE__*/ createMotionComponentWithFeatures("rp"); +const MotionRt = /*@__PURE__*/ createMotionComponentWithFeatures("rt"); +const MotionRuby = /*@__PURE__*/ createMotionComponentWithFeatures("ruby"); +const MotionS = /*@__PURE__*/ createMotionComponentWithFeatures("s"); +const MotionSamp = /*@__PURE__*/ createMotionComponentWithFeatures("samp"); +const MotionScript = /*@__PURE__*/ createMotionComponentWithFeatures("script"); +const MotionSection = /*@__PURE__*/ createMotionComponentWithFeatures("section"); +const MotionSelect = /*@__PURE__*/ createMotionComponentWithFeatures("select"); +const MotionSmall = /*@__PURE__*/ createMotionComponentWithFeatures("small"); +const MotionSource = /*@__PURE__*/ createMotionComponentWithFeatures("source"); +const MotionSpan = /*@__PURE__*/ createMotionComponentWithFeatures("span"); +const MotionStrong = /*@__PURE__*/ createMotionComponentWithFeatures("strong"); +const MotionStyle = /*@__PURE__*/ createMotionComponentWithFeatures("style"); +const MotionSub = /*@__PURE__*/ createMotionComponentWithFeatures("sub"); +const MotionSummary = /*@__PURE__*/ createMotionComponentWithFeatures("summary"); +const MotionSup = /*@__PURE__*/ createMotionComponentWithFeatures("sup"); +const MotionTable = /*@__PURE__*/ createMotionComponentWithFeatures("table"); +const MotionTbody = /*@__PURE__*/ createMotionComponentWithFeatures("tbody"); +const MotionTd = /*@__PURE__*/ createMotionComponentWithFeatures("td"); +const MotionTextarea = /*@__PURE__*/ createMotionComponentWithFeatures("textarea"); +const MotionTfoot = /*@__PURE__*/ createMotionComponentWithFeatures("tfoot"); +const MotionTh = /*@__PURE__*/ createMotionComponentWithFeatures("th"); +const MotionThead = /*@__PURE__*/ createMotionComponentWithFeatures("thead"); +const MotionTime = /*@__PURE__*/ createMotionComponentWithFeatures("time"); +const MotionTitle = /*@__PURE__*/ createMotionComponentWithFeatures("title"); +const MotionTr = /*@__PURE__*/ createMotionComponentWithFeatures("tr"); +const MotionTrack = /*@__PURE__*/ createMotionComponentWithFeatures("track"); +const MotionU = /*@__PURE__*/ createMotionComponentWithFeatures("u"); +const MotionUl = /*@__PURE__*/ createMotionComponentWithFeatures("ul"); +const MotionVideo = /*@__PURE__*/ createMotionComponentWithFeatures("video"); +const MotionWbr = /*@__PURE__*/ createMotionComponentWithFeatures("wbr"); +const MotionWebview = /*@__PURE__*/ createMotionComponentWithFeatures("webview"); +/** + * SVG components + */ +const MotionAnimate = /*@__PURE__*/ createMotionComponentWithFeatures("animate"); +const MotionCircle = /*@__PURE__*/ createMotionComponentWithFeatures("circle"); +const MotionDefs = /*@__PURE__*/ createMotionComponentWithFeatures("defs"); +const MotionDesc = /*@__PURE__*/ createMotionComponentWithFeatures("desc"); +const MotionEllipse = /*@__PURE__*/ createMotionComponentWithFeatures("ellipse"); +const MotionG = /*@__PURE__*/ createMotionComponentWithFeatures("g"); +const MotionImage = /*@__PURE__*/ createMotionComponentWithFeatures("image"); +const MotionLine = /*@__PURE__*/ createMotionComponentWithFeatures("line"); +const MotionFilter = /*@__PURE__*/ createMotionComponentWithFeatures("filter"); +const MotionMarker = /*@__PURE__*/ createMotionComponentWithFeatures("marker"); +const MotionMask = /*@__PURE__*/ createMotionComponentWithFeatures("mask"); +const MotionMetadata = /*@__PURE__*/ createMotionComponentWithFeatures("metadata"); +const MotionPath = /*@__PURE__*/ createMotionComponentWithFeatures("path"); +const MotionPattern = /*@__PURE__*/ createMotionComponentWithFeatures("pattern"); +const MotionPolygon = /*@__PURE__*/ createMotionComponentWithFeatures("polygon"); +const MotionPolyline = /*@__PURE__*/ createMotionComponentWithFeatures("polyline"); +const MotionRect = /*@__PURE__*/ createMotionComponentWithFeatures("rect"); +const MotionStop = /*@__PURE__*/ createMotionComponentWithFeatures("stop"); +const MotionSvg = /*@__PURE__*/ createMotionComponentWithFeatures("svg"); +const MotionSymbol = /*@__PURE__*/ createMotionComponentWithFeatures("symbol"); +const MotionText = /*@__PURE__*/ createMotionComponentWithFeatures("text"); +const MotionTspan = /*@__PURE__*/ createMotionComponentWithFeatures("tspan"); +const MotionUse = /*@__PURE__*/ createMotionComponentWithFeatures("use"); +const MotionView = /*@__PURE__*/ createMotionComponentWithFeatures("view"); +const MotionClipPath = /*@__PURE__*/ createMotionComponentWithFeatures("clipPath"); +const MotionFeBlend = /*@__PURE__*/ createMotionComponentWithFeatures("feBlend"); +const MotionFeColorMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feColorMatrix"); +const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponentWithFeatures("feComponentTransfer"); +const MotionFeComposite = +/*@__PURE__*/ createMotionComponentWithFeatures("feComposite"); +const MotionFeConvolveMatrix = +/*@__PURE__*/ createMotionComponentWithFeatures("feConvolveMatrix"); +const MotionFeDiffuseLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feDiffuseLighting"); +const MotionFeDisplacementMap = +/*@__PURE__*/ createMotionComponentWithFeatures("feDisplacementMap"); +const MotionFeDistantLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feDistantLight"); +const MotionFeDropShadow = +/*@__PURE__*/ createMotionComponentWithFeatures("feDropShadow"); +const MotionFeFlood = /*@__PURE__*/ createMotionComponentWithFeatures("feFlood"); +const MotionFeFuncA = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncA"); +const MotionFeFuncB = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncB"); +const MotionFeFuncG = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncG"); +const MotionFeFuncR = /*@__PURE__*/ createMotionComponentWithFeatures("feFuncR"); +const MotionFeGaussianBlur = +/*@__PURE__*/ createMotionComponentWithFeatures("feGaussianBlur"); +const MotionFeImage = /*@__PURE__*/ createMotionComponentWithFeatures("feImage"); +const MotionFeMerge = /*@__PURE__*/ createMotionComponentWithFeatures("feMerge"); +const MotionFeMergeNode = +/*@__PURE__*/ createMotionComponentWithFeatures("feMergeNode"); +const MotionFeMorphology = +/*@__PURE__*/ createMotionComponentWithFeatures("feMorphology"); +const MotionFeOffset = /*@__PURE__*/ createMotionComponentWithFeatures("feOffset"); +const MotionFePointLight = +/*@__PURE__*/ createMotionComponentWithFeatures("fePointLight"); +const MotionFeSpecularLighting = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpecularLighting"); +const MotionFeSpotLight = +/*@__PURE__*/ createMotionComponentWithFeatures("feSpotLight"); +const MotionFeTile = /*@__PURE__*/ createMotionComponentWithFeatures("feTile"); +const MotionFeTurbulence = +/*@__PURE__*/ createMotionComponentWithFeatures("feTurbulence"); +const MotionForeignObject = +/*@__PURE__*/ createMotionComponentWithFeatures("foreignObject"); +const MotionLinearGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("linearGradient"); +const MotionRadialGradient = +/*@__PURE__*/ createMotionComponentWithFeatures("radialGradient"); +const MotionTextPath = /*@__PURE__*/ createMotionComponentWithFeatures("textPath"); + +export { MotionA, MotionAbbr, MotionAddress, MotionAnimate, MotionArea, MotionArticle, MotionAside, MotionAudio, MotionB, MotionBase, MotionBdi, MotionBdo, MotionBig, MotionBlockquote, MotionBody, MotionButton, MotionCanvas, MotionCaption, MotionCircle, MotionCite, MotionClipPath, MotionCode, MotionCol, MotionColgroup, MotionData, MotionDatalist, MotionDd, MotionDefs, MotionDel, MotionDesc, MotionDetails, MotionDfn, MotionDialog, MotionDiv, MotionDl, MotionDt, MotionEllipse, MotionEm, MotionEmbed, MotionFeBlend, MotionFeColorMatrix, MotionFeComponentTransfer, MotionFeComposite, MotionFeConvolveMatrix, MotionFeDiffuseLighting, MotionFeDisplacementMap, MotionFeDistantLight, MotionFeDropShadow, MotionFeFlood, MotionFeFuncA, MotionFeFuncB, MotionFeFuncG, MotionFeFuncR, MotionFeGaussianBlur, MotionFeImage, MotionFeMerge, MotionFeMergeNode, MotionFeMorphology, MotionFeOffset, MotionFePointLight, MotionFeSpecularLighting, MotionFeSpotLight, MotionFeTile, MotionFeTurbulence, MotionFieldset, MotionFigcaption, MotionFigure, MotionFilter, MotionFooter, MotionForeignObject, MotionForm, MotionG, MotionH1, MotionH2, MotionH3, MotionH4, MotionH5, MotionH6, MotionHead, MotionHeader, MotionHgroup, MotionHr, MotionHtml, MotionI, MotionIframe, MotionImage, MotionImg, MotionInput, MotionIns, MotionKbd, MotionKeygen, MotionLabel, MotionLegend, MotionLi, MotionLine, MotionLinearGradient, MotionLink, MotionMain, MotionMap, MotionMark, MotionMarker, MotionMask, MotionMenu, MotionMenuitem, MotionMetadata, MotionMeter, MotionNav, MotionObject, MotionOl, MotionOptgroup, MotionOption, MotionOutput, MotionP, MotionParam, MotionPath, MotionPattern, MotionPicture, MotionPolygon, MotionPolyline, MotionPre, MotionProgress, MotionQ, MotionRadialGradient, MotionRect, MotionRp, MotionRt, MotionRuby, MotionS, MotionSamp, MotionScript, MotionSection, MotionSelect, MotionSmall, MotionSource, MotionSpan, MotionStop, MotionStrong, MotionStyle, MotionSub, MotionSummary, MotionSup, MotionSvg, MotionSymbol, MotionTable, MotionTbody, MotionTd, MotionText, MotionTextPath, MotionTextarea, MotionTfoot, MotionTh, MotionThead, MotionTime, MotionTitle, MotionTr, MotionTrack, MotionTspan, MotionU, MotionUl, MotionUse, MotionVideo, MotionView, MotionWbr, MotionWebview }; +//# sourceMappingURL=elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map new file mode 100644 index 00000000..dfdd3201 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"elements.mjs","sources":["../../../../../src/render/components/motion/elements.ts"],"sourcesContent":["\"use client\"\n\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\"\n\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\")\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\")\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\")\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\")\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\")\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\")\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\")\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\")\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\")\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\")\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\")\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\")\nexport const MotionBlockquote =\n /*@__PURE__*/ createMotionComponent(\"blockquote\")\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\")\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\")\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\")\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\")\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\")\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\")\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\")\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\")\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\")\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\")\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\")\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\")\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\")\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\")\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\")\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\")\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\")\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\")\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\")\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\")\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\")\nexport const MotionFigcaption =\n /*@__PURE__*/ createMotionComponent(\"figcaption\")\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\")\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\")\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\")\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\")\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\")\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\")\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\")\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\")\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\")\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\")\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\")\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\")\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\")\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\")\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\")\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\")\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\")\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\")\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\")\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\")\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\")\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\")\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\")\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\")\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\")\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\")\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\")\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\")\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\")\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\")\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\")\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\")\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\")\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\")\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\")\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\")\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\")\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\")\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\")\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\")\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\")\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\")\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\")\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\")\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\")\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\")\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\")\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\")\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\")\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\")\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\")\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\")\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\")\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\")\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\")\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\")\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\")\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\")\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\")\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\")\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\")\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\")\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\")\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\")\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\")\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\")\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\")\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\")\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\")\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\")\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\")\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\")\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\")\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\")\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\")\n\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\")\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\")\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\")\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\")\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\")\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\")\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\")\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\")\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\")\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\")\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\")\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\")\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\")\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\")\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\")\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\")\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\")\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\")\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\")\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\")\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\")\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\")\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\")\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\")\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\")\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\")\nexport const MotionFeColorMatrix =\n /*@__PURE__*/ createMotionComponent(\"feColorMatrix\")\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\n \"feComponentTransfer\"\n)\nexport const MotionFeComposite =\n /*@__PURE__*/ createMotionComponent(\"feComposite\")\nexport const MotionFeConvolveMatrix =\n /*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\")\nexport const MotionFeDiffuseLighting =\n /*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\")\nexport const MotionFeDisplacementMap =\n /*@__PURE__*/ createMotionComponent(\"feDisplacementMap\")\nexport const MotionFeDistantLight =\n /*@__PURE__*/ createMotionComponent(\"feDistantLight\")\nexport const MotionFeDropShadow =\n /*@__PURE__*/ createMotionComponent(\"feDropShadow\")\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\")\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\")\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\")\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\")\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\")\nexport const MotionFeGaussianBlur =\n /*@__PURE__*/ createMotionComponent(\"feGaussianBlur\")\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\")\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\")\nexport const MotionFeMergeNode =\n /*@__PURE__*/ createMotionComponent(\"feMergeNode\")\nexport const MotionFeMorphology =\n /*@__PURE__*/ createMotionComponent(\"feMorphology\")\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\")\nexport const MotionFePointLight =\n /*@__PURE__*/ createMotionComponent(\"fePointLight\")\nexport const MotionFeSpecularLighting =\n /*@__PURE__*/ createMotionComponent(\"feSpecularLighting\")\nexport const MotionFeSpotLight =\n /*@__PURE__*/ createMotionComponent(\"feSpotLight\")\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\")\nexport const MotionFeTurbulence =\n /*@__PURE__*/ createMotionComponent(\"feTurbulence\")\nexport const MotionForeignObject =\n /*@__PURE__*/ createMotionComponent(\"foreignObject\")\nexport const MotionLinearGradient =\n /*@__PURE__*/ createMotionComponent(\"linearGradient\")\nexport const MotionRadialGradient =\n /*@__PURE__*/ createMotionComponent(\"radialGradient\")\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\")\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACU;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEb;;AAEG;AACU;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAET;AACS;;AAIT;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACS;AACA;AACA;AACA;AACA;;AAET;AACS;AACA;;AAET;;AAEA;AACS;;AAET;;AAEA;;AAEA;AACS;;AAET;;AAEA;;AAEA;;AAEA;AACS;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs new file mode 100644 index 00000000..06da6bd9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs @@ -0,0 +1,14 @@ +import { animations } from '../../../motion/features/animations.mjs'; +import { drag } from '../../../motion/features/drag.mjs'; +import { gestureAnimations } from '../../../motion/features/gestures.mjs'; +import { layout } from '../../../motion/features/layout.mjs'; + +const featureBundle = { + ...animations, + ...gestureAnimations, + ...drag, + ...layout, +}; + +export { featureBundle }; +//# sourceMappingURL=feature-bundle.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map new file mode 100644 index 00000000..f7de5227 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"feature-bundle.mjs","sources":["../../../../../src/render/components/motion/feature-bundle.ts"],"sourcesContent":["import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAKa,MAAA,aAAa,GAAG;AACzB,IAAA,GAAG,UAAU;AACb,IAAA,GAAG,iBAAiB;AACpB,IAAA,GAAG,IAAI;AACP,IAAA,GAAG,MAAM;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs new file mode 100644 index 00000000..66755cac --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs @@ -0,0 +1,8 @@ +import { createDomVisualElement } from '../../dom/create-visual-element.mjs'; +import { createMotionProxy } from '../create-proxy.mjs'; +import { featureBundle } from './feature-bundle.mjs'; + +const motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement); + +export { motion }; +//# sourceMappingURL=proxy.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map new file mode 100644 index 00000000..78668806 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy.mjs","sources":["../../../../../src/render/components/motion/proxy.ts"],"sourcesContent":["import { createDomVisualElement } from \"../../dom/create-visual-element\"\nimport { createMotionProxy } from \"../create-proxy\"\nimport { featureBundle } from \"./feature-bundle\"\n\nexport const motion = /*@__PURE__*/ createMotionProxy(\n featureBundle,\n createDomVisualElement\n)\n"],"names":[],"mappings":";;;;AAIO,MAAM,MAAM,iBAAiB,iBAAiB,CACjD,aAAa,EACb,sBAAsB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs new file mode 100644 index 00000000..95a233fd --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs @@ -0,0 +1,18 @@ +import { SVGVisualElement, HTMLVisualElement } from 'motion-dom'; +import { Fragment } from 'react'; +import { isSVGComponent } from './utils/is-svg-component.mjs'; + +const createDomVisualElement = (Component, options) => { + /** + * Use explicit isSVG override if provided, otherwise auto-detect + */ + const isSVG = options.isSVG ?? isSVGComponent(Component); + return isSVG + ? new SVGVisualElement(options) + : new HTMLVisualElement(options, { + allowProjection: Component !== Fragment, + }); +}; + +export { createDomVisualElement }; +//# sourceMappingURL=create-visual-element.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map new file mode 100644 index 00000000..c43e3176 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-visual-element.mjs","sources":["../../../../src/render/dom/create-visual-element.ts"],"sourcesContent":["import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\"\nimport { ComponentType, Fragment } from \"react\"\nimport { CreateVisualElement, VisualElementOptions } from \"../types\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport const createDomVisualElement: CreateVisualElement = (\n Component: string | ComponentType>,\n options: VisualElementOptions\n) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component)\n\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n })\n}\n"],"names":[],"mappings":";;;;MAKa,sBAAsB,GAAwB,CACvD,SAAmE,EACnE,OAAuD,KACvD;AACA;;AAEG;IACH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,cAAc,CAAC,SAAS,CAAC,CAAA;AAExD,IAAA,OAAO,KAAK;AACR,UAAE,IAAI,gBAAgB,CAAC,OAAO,CAAC;AAC/B,UAAE,IAAI,iBAAiB,CAAC,OAAO,EAAE;YAC3B,eAAe,EAAE,SAAS,KAAK,QAAQ;AAC1C,SAAA,CAAC,CAAA;AACZ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs new file mode 100644 index 00000000..4f15e67d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs @@ -0,0 +1,16 @@ +"use client"; +import { animations } from '../../motion/features/animations.mjs'; +import { gestureAnimations } from '../../motion/features/gestures.mjs'; +import { createDomVisualElement } from './create-visual-element.mjs'; + +/** + * @public + */ +const domAnimation = { + renderer: createDomVisualElement, + ...animations, + ...gestureAnimations, +}; + +export { domAnimation }; +//# sourceMappingURL=features-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map new file mode 100644 index 00000000..fecb3d6f --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"features-animation.mjs","sources":["../../../../src/render/dom/features-animation.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { gestureAnimations } from \"../../motion/features/gestures\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domAnimation: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACU;AACT;AACA;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs new file mode 100644 index 00000000..54deaf2f --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs @@ -0,0 +1,16 @@ +"use client"; +import { drag } from '../../motion/features/drag.mjs'; +import { layout } from '../../motion/features/layout.mjs'; +import { domAnimation } from './features-animation.mjs'; + +/** + * @public + */ +const domMax = { + ...domAnimation, + ...drag, + ...layout, +}; + +export { domMax }; +//# sourceMappingURL=features-max.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map new file mode 100644 index 00000000..87cf93a1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-max.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"features-max.mjs","sources":["../../../../src/render/dom/features-max.ts"],"sourcesContent":["\"use client\"\n\nimport { drag } from \"../../motion/features/drag\"\nimport { layout } from \"../../motion/features/layout\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { domAnimation } from \"./features-animation\"\n\n/**\n * @public\n */\nexport const domMax: FeatureBundle = {\n ...domAnimation,\n ...drag,\n ...layout,\n}\n"],"names":[],"mappings":";;;;;AAOA;;AAEG;AACU;AACT;AACA;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs new file mode 100644 index 00000000..72a4fa0c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs @@ -0,0 +1,14 @@ +"use client"; +import { animations } from '../../motion/features/animations.mjs'; +import { createDomVisualElement } from './create-visual-element.mjs'; + +/** + * @public + */ +const domMin = { + renderer: createDomVisualElement, + ...animations, +}; + +export { domMin }; +//# sourceMappingURL=features-min.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map new file mode 100644 index 00000000..a2d7edc6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/features-min.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"features-min.mjs","sources":["../../../../src/render/dom/features-min.ts"],"sourcesContent":["\"use client\"\n\nimport { animations } from \"../../motion/features/animations\"\nimport { FeatureBundle } from \"../../motion/features/types\"\nimport { createDomVisualElement } from \"./create-visual-element\"\n\n/**\n * @public\n */\nexport const domMin: FeatureBundle = {\n renderer: createDomVisualElement,\n ...animations,\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACU;AACT;AACA;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs new file mode 100644 index 00000000..b1580731 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs @@ -0,0 +1,19 @@ +import { observeTimeline } from 'motion-dom'; +import { getTimeline } from './utils/get-timeline.mjs'; + +function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + return animation.attachTimeline({ + timeline: options.target ? undefined : timeline, + observe: (valueAnimation) => { + valueAnimation.pause(); + return observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); +} + +export { attachToAnimation }; +//# sourceMappingURL=attach-animation.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map new file mode 100644 index 00000000..4aff3c9e --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"attach-animation.mjs","sources":["../../../../../src/render/dom/scroll/attach-animation.ts"],"sourcesContent":["import { AnimationPlaybackControls, observeTimeline } from \"motion-dom\"\nimport { ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\nexport function attachToAnimation(\n animation: AnimationPlaybackControls,\n options: ScrollOptionsWithDefaults\n) {\n const timeline = getTimeline(options)\n\n return animation.attachTimeline({\n timeline: options.target ? undefined : timeline,\n observe: (valueAnimation) => {\n valueAnimation.pause()\n\n return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress\n }, timeline)\n },\n })\n}\n"],"names":[],"mappings":";;;AAIgB,SAAA,iBAAiB,CAC7B,SAAoC,EACpC,OAAkC,EAAA;AAElC,IAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAErC,OAAO,SAAS,CAAC,cAAc,CAAC;QAC5B,QAAQ,EAAE,OAAO,CAAC,MAAM,GAAG,SAAS,GAAG,QAAQ;AAC/C,QAAA,OAAO,EAAE,CAAC,cAAc,KAAI;YACxB,cAAc,CAAC,KAAK,EAAE,CAAA;AAEtB,YAAA,OAAO,eAAe,CAAC,CAAC,QAAQ,KAAI;AAChC,gBAAA,cAAc,CAAC,IAAI;AACf,oBAAA,cAAc,CAAC,iBAAiB,GAAG,QAAQ,CAAA;aAClD,EAAE,QAAQ,CAAC,CAAA;SACf;AACJ,KAAA,CAAC,CAAA;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs new file mode 100644 index 00000000..507d3471 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs @@ -0,0 +1,24 @@ +import { observeTimeline } from 'motion-dom'; +import { scrollInfo } from './track.mjs'; +import { getTimeline } from './utils/get-timeline.mjs'; + +/** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ +function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; +} +function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return observeTimeline(onScroll, getTimeline(options)); + } +} + +export { attachToFunction }; +//# sourceMappingURL=attach-function.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map new file mode 100644 index 00000000..47ac9eab --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/attach-function.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"attach-function.mjs","sources":["../../../../../src/render/dom/scroll/attach-function.ts"],"sourcesContent":["import { observeTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"./track\"\nimport { OnScroll, OnScrollWithInfo, ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\n\n/**\n * If the onScroll function has two arguments, it's expecting\n * more specific information about the scroll from scrollInfo.\n */\nfunction isOnScrollWithInfo(onScroll: OnScroll): onScroll is OnScrollWithInfo {\n return onScroll.length === 2\n}\n\nexport function attachToFunction(\n onScroll: OnScroll,\n options: ScrollOptionsWithDefaults\n) {\n if (isOnScrollWithInfo(onScroll)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis!].progress, info)\n }, options)\n } else {\n return observeTimeline(onScroll, getTimeline(options))\n }\n}\n"],"names":[],"mappings":";;;;AAKA;;;AAGG;AACH,SAAS,kBAAkB,CAAC,QAAkB,EAAA;AAC1C,IAAA,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAA;AAChC,CAAC;AAEe,SAAA,gBAAgB,CAC5B,QAAkB,EAClB,OAAkC,EAAA;AAElC,IAAA,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE;AAC9B,QAAA,OAAO,UAAU,CAAC,CAAC,IAAI,KAAI;AACvB,YAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;SAC/C,EAAE,OAAO,CAAC,CAAA;KACd;SAAM;QACH,OAAO,eAAe,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;KACzD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs new file mode 100644 index 00000000..2c4016a8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs @@ -0,0 +1,15 @@ +import { noop } from 'motion-utils'; +import { attachToAnimation } from './attach-animation.mjs'; +import { attachToFunction } from './attach-function.mjs'; + +function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return noop; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); +} + +export { scroll }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map new file mode 100644 index 00000000..410ea397 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/scroll/index.ts"],"sourcesContent":["import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { attachToFunction } from \"./attach-function\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n onScroll: OnScroll | AnimationPlaybackControls,\n {\n axis = \"y\",\n container = document.scrollingElement as Element,\n ...options\n }: ScrollOptions = {}\n): VoidFunction {\n if (!container) return noop as VoidFunction\n\n const optionsWithDefaults = { axis, container, ...options }\n\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults)\n}\n"],"names":[],"mappings":";;;;SAMgB,MAAM,CAClB,QAA8C,EAC9C,EACI,IAAI,GAAG,GAAG,EACV,SAAS,GAAG,QAAQ,CAAC,gBAA2B,EAChD,GAAG,OAAO,KACK,EAAE,EAAA;AAErB,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAoB,CAAA;IAE3C,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAA;IAE3D,OAAO,OAAO,QAAQ,KAAK,UAAU;AACjC,UAAE,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC;AACjD,UAAE,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAA;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs new file mode 100644 index 00000000..e2ee21d3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs @@ -0,0 +1,56 @@ +import { progress, velocityPerSecond } from 'motion-utils'; + +/** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ +const maxElapsed = 50; +const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, +}); +const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), +}); +const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, +}; +function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = element[`scroll${position}`]; + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : velocityPerSecond(axis.current - prev, elapsed); +} +function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; +} + +export { createScrollInfo, updateScrollInfo }; +//# sourceMappingURL=info.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map new file mode 100644 index 00000000..ca7654aa --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/info.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"info.mjs","sources":["../../../../../src/render/dom/scroll/info.ts"],"sourcesContent":["import { progress, velocityPerSecond } from \"motion-utils\"\nimport { AxisScrollInfo, ScrollInfo } from \"./types\"\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50\n\nconst createAxisInfo = (): AxisScrollInfo => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n})\n\nexport const createScrollInfo = (): ScrollInfo => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n})\n\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n} as const\n\nfunction updateAxisInfo(\n element: Element,\n axisName: \"x\" | \"y\",\n info: ScrollInfo,\n time: number\n) {\n const axis = info[axisName]\n const { length, position } = keys[axisName]\n\n const prev = axis.current\n const prevTime = info.time\n\n axis.current = element[`scroll${position}`]\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]\n\n axis.offset.length = 0\n axis.offset[0] = 0\n axis.offset[1] = axis.scrollLength\n axis.progress = progress(0, axis.scrollLength, axis.current)\n\n const elapsed = time - prevTime\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed)\n}\n\nexport function updateScrollInfo(\n element: Element,\n info: ScrollInfo,\n time: number\n) {\n updateAxisInfo(element, \"x\", info, time)\n updateAxisInfo(element, \"y\", info, time)\n info.time = time\n}\n"],"names":[],"mappings":";;AAGA;;AAEG;AACH,MAAM,UAAU,GAAG,EAAE,CAAA;AAErB,MAAM,cAAc,GAAG,OAAuB;AAC1C,IAAA,OAAO,EAAE,CAAC;AACV,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,QAAQ,EAAE,CAAC;AACX,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,eAAe,EAAE,CAAC;AAClB,IAAA,QAAQ,EAAE,CAAC;AACd,CAAA,CAAC,CAAA;AAEW,MAAA,gBAAgB,GAAG,OAAmB;AAC/C,IAAA,IAAI,EAAE,CAAC;IACP,CAAC,EAAE,cAAc,EAAE;IACnB,CAAC,EAAE,cAAc,EAAE;AACtB,CAAA,EAAC;AAEF,MAAM,IAAI,GAAG;AACT,IAAA,CAAC,EAAE;AACC,QAAA,MAAM,EAAE,OAAO;AACf,QAAA,QAAQ,EAAE,MAAM;AACnB,KAAA;AACD,IAAA,CAAC,EAAE;AACC,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,QAAQ,EAAE,KAAK;AAClB,KAAA;CACK,CAAA;AAEV,SAAS,cAAc,CACnB,OAAgB,EAChB,QAAmB,EACnB,IAAgB,EAChB,IAAY,EAAA;AAEZ,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC3B,MAAM,EAAE,MAAM,E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/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs new file mode 100644 index 00000000..58cb4c10 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs @@ -0,0 +1,46 @@ +const namedEdges = { + start: 0, + center: 0.5, + end: 1, +}; +function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; +} + +export { namedEdges, resolveEdge }; +//# sourceMappingURL=edge.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map new file mode 100644 index 00000000..433d1093 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/edge.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"edge.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/edge.ts"],"sourcesContent":["import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record = {\n start: 0,\n center: 0.5,\n end: 1,\n}\n\nexport function resolveEdge(edge: Edge, length: number, inset = 0) {\n let delta = 0\n\n /**\n * If we have this edge defined as a preset, replace the definition\n * with the numerical value.\n */\n if (edge in namedEdges) {\n edge = namedEdges[edge as NamedEdges]\n }\n\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge)\n\n if (edge.endsWith(\"px\")) {\n delta = asNumber\n } else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100\n } else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth\n } else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight\n } else {\n edge = asNumber\n }\n }\n\n /**\n * If the edge is defined as a number, handle as a progress value.\n */\n if (typeof edge === \"number\") {\n delta = length * edge\n }\n\n return inset + delta\n}\n"],"names":[],"mappings":"AAEa,MAAA,UAAU,GAA+B;AAClD,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,GAAG;AACX,IAAA,GAAG,EAAE,CAAC;EACT;AAEK,SAAU,WAAW,CAAC,IAAU,EAAE,MAAc,EAAE,KAAK,GAAG,CAAC,EAAA;IAC7D,IAAI,KAAK,GAAG,CAAC,CAAA;AAEb;;;AAGG;AACH,IAAA,IAAI,IAAI,IAAI,UAAU,EAAE;AACpB,QAAA,IAAI,GAAG,UAAU,CAAC,IAAkB,CAAC,CAAA;KACxC;AAED;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;AAEjC,QAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACrB,KAAK,GAAG,QAAQ,CAAA;SACnB;AAAM,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC3B,YAAA,IAAI,GAAG,QAAQ,GAAG,GAAG,CAAA;SACxB;AAAM,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAA;SAClE;AAAM,aAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC5B,YAAA,KAAK,GAAG,CAAC,QAAQ,GAAG,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAA;SACnE;aAAM;YACH,IAAI,GAAG,QAAQ,CAAA;SAClB;KACJ;AAED;;AAEG;AACH,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC1B,QAAA,KAAK,GAAG,MAAM,GAAG,IAAI,CAAA;KACxB;IAED,OAAO,KAAK,GAAG,KAAK,CAAA;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs new file mode 100644 index 00000000..32cdd155 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs @@ -0,0 +1,60 @@ +import { interpolate, defaultOffset } from 'motion-dom'; +import { clamp } from 'motion-utils'; +import { calcInset } from './inset.mjs'; +import { resolveOffset } from './offset.mjs'; +import { ScrollOffset } from './presets.mjs'; + +const point = { x: 0, y: 0 }; +function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; +} +function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); +} + +export { resolveOffsets }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map new file mode 100644 index 00000000..a780387a --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/index.ts"],"sourcesContent":["import { defaultOffset, interpolate } from \"motion-dom\"\nimport { clamp } from \"motion-utils\"\nimport { ScrollInfo, ScrollInfoOptions } from \"../types\"\nimport { calcInset } from \"./inset\"\nimport { resolveOffset } from \"./offset\"\nimport { ScrollOffset } from \"./presets\"\n\nconst point = { x: 0, y: 0 }\n\nfunction getTargetSize(target: Element) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? (target as SVGGraphicsElement).getBBox()\n : { width: target.clientWidth, height: target.clientHeight }\n}\n\nexport function resolveOffsets(\n container: Element,\n info: ScrollInfo,\n options: ScrollInfoOptions\n) {\n const { offset: offsetDefinition = ScrollOffset.All } = options\n const { target = container, axis = \"y\" } = options\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\"\n\n const inset = target !== container ? calcInset(target, container) : point\n\n /**\n * Measure the target and container. If they're the same thing then we\n * use the container's scrollWidth/Height as the target, from there\n * all other calculations can remain the same.\n */\n const targetSize =\n target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target)\n\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\n }\n\n /**\n * Reset the length of the resolved offset array rather than creating a new one.\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\n */\n info[axis].offset.length = 0\n\n /**\n * Populate the offset array by resolving the user's offset definition into\n * a list of pixel scroll offets.\n */\n let hasChanged = !info[axis].interpolate\n\n const numOffsets = offsetDefinition.length\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(\n offsetDefinition[i],\n containerSize[lengthLabel],\n targetSize[lengthLabel],\n inset[axis]\n )\n\n if (!hasChanged && offset !== info[axis].interpolatorOffsets![i]) {\n hasChanged = true\n }\n\n info[axis].offset[i] = offset\n }\n\n /**\n * If the pixel scroll offsets have changed, create a new interpolator function\n * to map scroll value into a progress.\n */\n if (hasChanged) {\n info[axis].interpolate = interpolate(\n info[axis].offset,\n defaultOffset(offsetDefinition),\n { clamp: false }\n )\n\n info[axis].interpolatorOffsets = [...info[axis].offset]\n }\n\n info[axis].progress = clamp(\n 0,\n 1,\n info[axis].interpolate!(info[axis].current)\n )\n}\n"],"names":[],"mappings":";;;;;;AAOA,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;AAE5B,SAAS,aAAa,CAAC,MAAe,EAAA;IAClC,OAAO,SAAS,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,KAAK,KAAK;AAClD,UAAG,MAA6B,CAAC,OAAO,EAAE;AAC1C,UAAE,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,CAAA;AACpE,CAAC;SAEe,cAAc,CAC1B,SAAkB,EAClB,IAAgB,EAChB,OAA0B,EAAA;IAE1B,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,OAAO,CAAA;I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IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAA;KAChC;AAED;;;AAGG;IACH,IAAI,UAAU,EAAE;QACZ,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,WAAW,CAChC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EACjB,aAAa,CAAC,gBAAgB,CAAC,EAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,CACnB,CAAA;AAED,QAAA,IAAI,CAAC,IAAI,CAAC,CAAC,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAA;KAC1D;IAED,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,KAAK,CACvB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,IAAI,CAAC,CAAC,WAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAC9C,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs new file mode 100644 index 00000000..82d4652a --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs @@ -0,0 +1,48 @@ +import { isHTMLElement } from 'motion-dom'; + +function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; +} + +export { calcInset }; +//# sourceMappingURL=inset.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map new file mode 100644 index 00000000..2e61831c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/inset.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"inset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/inset.ts"],"sourcesContent":["import { isHTMLElement } from \"motion-dom\"\n\nexport function calcInset(element: Element, container: Element) {\n const inset = { x: 0, y: 0 }\n\n let current: Element | null = element\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft\n inset.y += current.offsetTop\n current = current.offsetParent\n } else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect()\n current = current.parentElement!\n const parentBoundingBox = current.getBoundingClientRect()\n inset.x += svgBoundingBox.left - parentBoundingBox.left\n inset.y += svgBoundingBox.top - parentBoundingBox.top\n } else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox()\n inset.x += x\n inset.y += y\n\n let svg: SVGElement | null = null\n let parent: SVGElement = current.parentNode as SVGElement\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent\n }\n parent = current.parentNode as SVGElement\n }\n current = svg\n } else {\n break\n }\n }\n\n return inset\n}\n"],"names":[],"mappings":";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MAAM,CAAC,OAAO,KAAK,KAAK,EAAE;oBAC1B,GAAG,GAAG,MAAM,CAAA;iBACf;AACD,gBAAA,MAAM,GAAG,OAAO,CAAC,UAAwB,CAAA;aAC5C;YACD,OAAO,GAAG,GAAG,CAAA;SAChB;aAAM;YACH,MAAK;SACR;KACJ;AAED,IAAA,OAAO,KAAK,CAAA;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs new file mode 100644 index 00000000..fd25b46d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs @@ -0,0 +1,36 @@ +import { resolveEdge, namedEdges } from './edge.mjs'; + +const defaultOffset = [0, 0]; +function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; +} + +export { resolveOffset }; +//# sourceMappingURL=offset.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map new file mode 100644 index 00000000..acca4811 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/offset.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"offset.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/offset.ts"],"sourcesContent":["import { Edge, EdgeString, Intersection, ProgressIntersection } from \"../types\"\nimport { namedEdges, resolveEdge } from \"./edge\"\n\nconst defaultOffset: ProgressIntersection = [0, 0]\n\nexport function resolveOffset(\n offset: Edge | Intersection | ProgressIntersection,\n containerLength: number,\n targetLength: number,\n targetInset: number\n) {\n let offsetDefinition: ProgressIntersection | [EdgeString, EdgeString] =\n Array.isArray(offset) ? offset : defaultOffset\n\n let targetPoint = 0\n let containerPoint = 0\n\n if (typeof offset === \"number\") {\n /**\n * If we're provided offset: [0, 0.5, 1] then each number x should become\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n * and container etc.\n */\n offsetDefinition = [offset, offset]\n } else if (typeof offset === \"string\") {\n offset = offset.trim() as EdgeString\n\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \") as [EdgeString, EdgeString]\n } else {\n /**\n * If we're provided a definition like \"100px\" then we want to apply\n * that only to the top of the target point, leaving the container at 0.\n * Whereas a named offset like \"end\" should be applied to both.\n */\n offsetDefinition = [offset, namedEdges[offset as keyof typeof namedEdges] ? offset : `0`]\n }\n }\n\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset)\n containerPoint = resolveEdge(offsetDefinition[1], containerLength)\n\n return targetPoint - containerPoint\n}\n"],"names":[],"mappings":";;AAGA,MAAM,aAAa,GAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAE5C,SAAU,aAAa,CACzB,MAAkD,EAClD,eAAuB,EACvB,YAAoB,EACpB,WAAmB,EAAA;AAEnB,IAAA,IAAI,gBAAgB,GAChB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,aAAa,CAAA;IAElD,IAAI,WAAW,GAAG,CAAC,CAAA;IACnB,IAAI,cAAc,GAAG,CAAC,CAAA;AAEtB,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B;;;;AAIG;AACH,QAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACtC;AAAM,SAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACnC,QAAA,MAAM,GAAG,MAAM,CAAC,IAAI,EAAgB,CAAA;AAEpC,QAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,YAAA,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAA6B,CAAA;SACnE;aAAM;AACH;;;;AAIG;AACH,YAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,MAAiC,CAAC,GAAG,MAAM,GAAG,CAAA,CAAA,CAAG,CAAC,CAAA;SAC5F;KACJ;AAED,IAAA,WAAW,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;IACzE,cAAc,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAA;IAElE,OAAO,WAAW,GAAG,cAAc,CAAA;AACvC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs new file mode 100644 index 00000000..46e42cf9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs @@ -0,0 +1,21 @@ +const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], +}; + +export { ScrollOffset }; +//# sourceMappingURL=presets.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map new file mode 100644 index 00000000..370048a8 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/offsets/presets.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"presets.mjs","sources":["../../../../../../src/render/dom/scroll/offsets/presets.ts"],"sourcesContent":["import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record = {\n Enter: [\n [0, 1],\n [1, 1],\n ],\n Exit: [\n [0, 0],\n [1, 0],\n ],\n Any: [\n [1, 0],\n [0, 1],\n ],\n All: [\n [0, 0],\n [1, 1],\n ],\n}\n"],"names":[],"mappings":"AAEa,MAAA,YAAY,GAA2C;AAClE,IAAA,KAAK,EAAE;QACL,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,IAAI,EAAE;QACJ,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;AACD,IAAA,GAAG,EAAE;QACH,CAAC,CAAC,EAAE,CAAC,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,CAAC;AACP,KAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs new file mode 100644 index 00000000..f419f2ad --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs @@ -0,0 +1,49 @@ +import { warnOnce } from 'motion-utils'; +import { updateScrollInfo } from './info.mjs'; +import { resolveOffsets } from './offsets/index.mjs'; + +function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. + */ + if (process.env.NODE_ENV !== "production") { + if (container && target && target !== container) { + warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } +} +function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; +} + +export { createOnScrollHandler }; +//# sourceMappingURL=on-scroll-handler.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map new file mode 100644 index 00000000..65ac0450 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/on-scroll-handler.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"on-scroll-handler.mjs","sources":["../../../../../src/render/dom/scroll/on-scroll-handler.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { updateScrollInfo } from \"./info\"\nimport { resolveOffsets } from \"./offsets/index\"\nimport {\n OnScrollHandler,\n OnScrollInfo,\n ScrollInfo,\n ScrollInfoOptions,\n} from \"./types\"\n\nfunction measure(\n container: Element,\n target: Element = container,\n info: ScrollInfo\n) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0\n info.y.targetOffset = 0\n if (target !== container) {\n let node = target as HTMLElement\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft\n info.y.targetOffset += node.offsetTop\n node = node.offsetParent as HTMLElement\n }\n }\n\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight\n info.x.containerLength = container.clientWidth\n info.y.containerLength = container.clientHeight\n\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(\n getComputedStyle(container).position !== \"static\",\n \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\"\n )\n }\n }\n}\n\nexport function createOnScrollHandler(\n element: Element,\n onScroll: OnScrollInfo,\n info: ScrollInfo,\n options: ScrollInfoOptions = {}\n): OnScrollHandler {\n return {\n measure: (time) => {\n measure(element, options.target, info)\n updateScrollInfo(element, info, time)\n\n if (options.offset || options.target) {\n resolveOffsets(element, info, options)\n }\n },\n notify: () => onScroll(info),\n }\n}\n"],"names":[],"mappings":";;;;AAUA,SAAS,OAAO,CACZ,SAAkB,EAClB,MAAkB,GAAA,SAAS,EAC3B,IAAgB,EAAA;AAEhB;;AAEG;AACH,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAA;AACvB,IAAA,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAA;AACvB,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,IAAI,IAAI,GAAG,MAAqB,CAAA;AAChC,QAAA,OAAO,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;YAC/B,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,UAAU,CAAA;YACtC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,SAAS,CAAA;AACrC,YAAA,IAAI,GAAG,IAAI,CAAC,YAA2B,CAAA;SAC1C;KACJ;IAED,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;IAClE,IAAI,CAAC,CAAC,CAAC,YAAY;AACf,QAAA,MAAM,KAAK,SAAS,GAAG,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAA;IACpE,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,WAAW,CAAA;IAC9C,IAAI,CAAC,CAAC,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAA;AAE/C;;;AAGG;IACH,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;QACvC,IAAI,SAAS,IAAI,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE;AAC7C,YAAA,QAAQ,CACJ,gBAAgB,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,QAAQ,EACjD,sJAAsJ,CACzJ,CAAA;SACJ;KACJ;AACL,CAAC;AAEK,SAAU,qBAAqB,CACjC,OAAgB,EAChB,QAAsB,EACtB,IAAgB,EAChB,OAAA,GAA6B,EAAE,EAAA;IAE/B,OAAO;AACH,QAAA,OAAO,EAAE,CAAC,IAAI,KAAI;YACd,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AACtC,YAAA,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;YAErC,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE;AAClC,gBAAA,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;aACzC;SACJ;AACD,QAAA,MAAM,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC;KAC/B,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs new file mode 100644 index 00000000..0a91dba4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs @@ -0,0 +1,115 @@ +import { resize, frame, cancelFrame, frameData } from 'motion-dom'; +import { noop } from 'motion-utils'; +import { createScrollInfo } from './info.mjs'; +import { createOnScrollHandler } from './on-scroll-handler.mjs'; + +const scrollListeners = new WeakMap(); +const resizeListeners = new WeakMap(); +const onScrollHandlers = new WeakMap(); +const scrollSize = new WeakMap(); +const dimensionCheckProcesses = new WeakMap(); +const getEventTarget = (element) => element === document.scrollingElement ? window : element; +function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return noop; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(frameData.timestamp); + } + frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener, { passive: true }); + if (container !== document.documentElement) { + resizeListeners.set(container, resize(container, listener)); + } + target.addEventListener("scroll", listener, { passive: true }); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + frame.read(listener, false, true); + return () => { + cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; +} + +export { scrollInfo }; +//# sourceMappingURL=track.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map new file mode 100644 index 00000000..75e1461e --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/track.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"track.mjs","sources":["../../../../../src/render/dom/scroll/track.ts"],"sourcesContent":["import { cancelFrame, frame, frameData, resize, Process } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { createScrollInfo } from \"./info\"\nimport { createOnScrollHandler } from \"./on-scroll-handler\"\nimport { OnScrollHandler, OnScrollInfo, ScrollInfoOptions } from \"./types\"\n\nconst scrollListeners = new WeakMap()\nconst resizeListeners = new WeakMap()\nconst onScrollHandlers = new WeakMap>()\nconst scrollSize = new WeakMap()\nconst dimensionCheckProcesses = new WeakMap()\n\nexport type ScrollTargets = Array\n\nconst getEventTarget = (element: Element) =>\n element === document.scrollingElement ? window : element\n\nexport function scrollInfo(\n onScroll: OnScrollInfo,\n {\n container = document.scrollingElement as Element,\n trackContentSize = false,\n ...options\n }: ScrollInfoOptions = {}\n) {\n if (!container) return noop as VoidFunction\n\n let containerHandlers = onScrollHandlers.get(container)\n\n /**\n * Get the onScroll handlers for this container.\n * If one isn't found, create a new one.\n */\n if (!containerHandlers) {\n containerHandlers = new Set()\n onScrollHandlers.set(container, containerHandlers)\n }\n\n /**\n * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo()\n const containerHandler = createOnScrollHandler(\n container,\n onScroll,\n info,\n options\n )\n containerHandlers.add(containerHandler)\n\n /**\n * Check if there's a scroll event listener for this container.\n * If not, create one.\n */\n if (!scrollListeners.has(container)) {\n const measureAll = () => {\n for (const handler of containerHandlers) {\n handler.measure(frameData.timestamp)\n }\n\n frame.preUpdate(notifyAll)\n }\n\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify()\n }\n }\n\n const listener = () => frame.read(measureAll)\n\n scrollListeners.set(container, listener)\n\n const target = getEventTarget(container)\n window.addEventListener(\"resize\", listener, { passive: true })\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener))\n }\n\n target.addEventListener(\"scroll\", listener, { passive: true })\n\n listener()\n }\n\n /**\n * Enable content size tracking if requested and not already enabled.\n */\n if (trackContentSize && !dimensionCheckProcesses.has(container)) {\n const listener = scrollListeners.get(container)!\n\n // Store initial scroll dimensions (object is reused to avoid allocation)\n const size = {\n width: container.scrollWidth,\n height: container.scrollHeight,\n }\n scrollSize.set(container, size)\n\n // Add frame-based scroll dimension checking to detect content changes\n const checkScrollDimensions: Process = () => {\n const newWidth = container.scrollWidth\n const newHeight = container.scrollHeight\n\n if (size.width !== newWidth || size.height !== newHeight) {\n listener()\n size.width = newWidth\n size.height = newHeight\n }\n }\n\n // Schedule with keepAlive=true to run every frame\n const dimensionCheckProcess = frame.read(checkScrollDimensions, true)\n dimensionCheckProcesses.set(container, dimensionCheckProcess)\n }\n\n const listener = scrollListeners.get(container)!\n frame.read(listener, false, true)\n\n return () => {\n cancelFrame(listener)\n\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container)\n if (!currentHandlers) return\n\n currentHandlers.delete(containerHandler)\n\n if (currentHandlers.size) return\n\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container)\n scrollListeners.delete(container)\n\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\n \"scroll\",\n scrollListener\n )\n resizeListeners.get(container)?.()\n window.removeEventListener(\"resize\", scrollListener)\n }\n\n // Clean up scroll dimension checking\n const dimensionCheckProcess = dimensionCheckProcesses.get(container)\n if (dimensionCheckProcess) {\n cancelFrame(dimensionCheckProcess)\n dimensionCheckProcesses.delete(container)\n }\n scrollSize.delete(container)\n }\n}\n"],"names":[],"mappings":";;;;;AAMA,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB,CAAA;AAC5D,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB,CAAA;AAC5D,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAiC,CAAA;AACrE,MAAM,UAAU,GAAG,IAAI,OAAO,EAA8C,CAAA;AAC5E,MAAM,uBAAuB,GAAG,IAAI,OAAO,EAAoB,CAAA;AAI/D,MAAM,cAAc,GAAG,CAAC,OAAgB,KACpC,OAAO,KAAK,QAAQ,CAAC,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAA;SAE5C,UAAU,CACtB,QAAsB,EACtB,EACI,SAAS,GAAG,QAAQ,CAAC,gBAA2B,EAChD,gBAAgB,GAAG,KAAK,EACxB,GAAG,OAAO,KACS,EAAE,EAAA;AAEzB,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,IAAoB,CAAA;IAE3C,IAAI,iBAAiB,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAEvD;;;AAGG;IACH,IAAI,CAAC,iBAAiB,EAAE;AACpB,QAAA,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,QAAA,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAA;KACrD;AAED;;AAEG;AACH,IAAA,MAAM,IA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AAA,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;QAExC,IAAI,eAAe,CAAC,IAAI;YAAE,OAAM;AAEhC;;AAEG;QACH,MAAM,cAAc,GAAG,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AACrD,QAAA,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAEjC,IAAI,cAAc,EAAE;YAChB,cAAc,CAAC,SAAS,CAAC,CAAC,mBAAmB,CACzC,QAAQ,EACR,cAAc,CACjB,CAAA;AACD,YAAA,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAA;AAClC,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;SACvD;;QAGD,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACpE,IAAI,qBAAqB,EAAE;YACvB,WAAW,CAAC,qBAAqB,CAAC,CAAA;AAClC,YAAA,uBAAuB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;SAC5C;AACD,QAAA,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AAChC,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs new file mode 100644 index 00000000..1ac756bf --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs @@ -0,0 +1,8 @@ +import { supportsScrollTimeline } from 'motion-dom'; + +function canUseNativeTimeline(target) { + return (typeof window !== "undefined" && !target && supportsScrollTimeline()); +} + +export { canUseNativeTimeline }; +//# sourceMappingURL=can-use-native-timeline.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map new file mode 100644 index 00000000..215950c3 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/can-use-native-timeline.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"can-use-native-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/can-use-native-timeline.ts"],"sourcesContent":["import { supportsScrollTimeline } from \"motion-dom\"\n\nexport function canUseNativeTimeline(target?: Element) {\n return (\n typeof window !== \"undefined\" && !target && supportsScrollTimeline()\n )\n}\n"],"names":[],"mappings":";;AAEM,SAAU,oBAAoB,CAAC,MAAgB,EAAA;AACjD,IAAA,QACI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,IAAI,sBAAsB,EAAE,EACvE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs new file mode 100644 index 00000000..f0afc134 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs @@ -0,0 +1,31 @@ +import { scrollInfo } from '../track.mjs'; +import { canUseNativeTimeline } from './can-use-native-timeline.mjs'; + +const timelineCache = new Map(); +function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; +} +function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + const containerCache = timelineCache.get(container) ?? new Map(); + timelineCache.set(container, containerCache); + const targetKey = options.target ?? "self"; + const targetCache = containerCache.get(targetKey) ?? {}; + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + targetCache[axisKey] = + canUseNativeTimeline(options.target) + ? new ScrollTimeline({ source: container, axis }) + : scrollTimelineFallback({ container, ...options }); + } + return targetCache[axisKey]; +} + +export { getTimeline }; +//# sourceMappingURL=get-timeline.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map new file mode 100644 index 00000000..2d43b09d --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/scroll/utils/get-timeline.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-timeline.mjs","sources":["../../../../../../src/render/dom/scroll/utils/get-timeline.ts"],"sourcesContent":["import { ProgressTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"../track\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n Element,\n Map\n>()\n\nfunction scrollTimelineFallback(options: ScrollOptionsWithDefaults) {\n const currentTime = { value: 0 }\n\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis!].progress * 100\n }, options)\n\n return { currentTime, cancel }\n}\n\nexport function getTimeline({\n source,\n container,\n ...options\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n const { axis } = options\n\n if (source) container = source\n\n const containerCache = timelineCache.get(container) ?? new Map()\n timelineCache.set(container, containerCache)\n\n const targetKey = options.target ?? \"self\"\n const targetCache = containerCache.get(targetKey) ?? {}\n\n const axisKey = axis + (options.offset ?? []).join(\",\")\n\n if (!targetCache[axisKey]) {\n targetCache[axisKey] =\n canUseNativeTimeline(options.target)\n ? new ScrollTimeline({ source: container, axis } as any)\n : scrollTimelineFallback({ container, ...options })\n }\n\n return targetCache[axisKey]!\n}\n"],"names":[],"mappings":";;;AAmBA,MAAM,aAAa,GAAG,IAAI,GAAG,EAG1B,CAAA;AAEH,SAAS,sBAAsB,CAAC,OAAkC,EAAA;AAC9D,IAAA,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AAEhC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modules/framer-motion/dist/es/render/dom/use-render.mjs b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs new file mode 100644 index 00000000..15b5179c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs @@ -0,0 +1,28 @@ +"use client"; +import { isMotionValue } from 'motion-dom'; +import { Fragment, useMemo, createElement } from 'react'; +import { useHTMLProps } from '../html/use-props.mjs'; +import { useSVGProps } from '../svg/use-props.mjs'; +import { filterProps } from './utils/filter-props.mjs'; +import { isSVGComponent } from './utils/is-svg-component.mjs'; + +function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) { + const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); + const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}; + /** + * If component has been handed a motion value as its child, + * memoise its initial value and render that. Subsequent updates + * will be handled by the onChange handler + */ + const { children } = props; + const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]); + return createElement(Component, { + ...elementProps, + children: renderedChildren, + }); +} + +export { useRender }; +//# sourceMappingURL=use-render.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map new file mode 100644 index 00000000..7e09e53f --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-render.mjs","sources":["../../../../src/render/dom/use-render.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType,\n props: MotionProps,\n ref: React.Ref,\n {\n latestValues,\n }: VisualState,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n"],"names":[],"mappings":";;;;;;;;;AA4BI;AAGA;AAMA;;AAQA;;;;AAIG;AACH;AACA;;AAMI;AACA;AACH;AACL;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs new file mode 100644 index 00000000..96d9e761 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs @@ -0,0 +1,60 @@ +import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs'; + +let shouldForward = (key) => !isValidMotionProp(key); +function loadExternalIsValidProp(isValidProp) { + if (typeof isValidProp !== "function") + return; + // Explicitly filter our events + shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); +} +/** + * Emotion and Styled Components both allow users to pass through arbitrary props to their components + * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which + * of these should be passed to the underlying DOM node. + * + * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props + * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props + * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of + * `@emotion/is-prop-valid`, however to fix this problem we need to use it. + * + * By making it an optionalDependency we can offer this functionality only in the situations where it's + * actually required. + */ +try { + /** + * We attempt to import this package but require won't be defined in esm environments, in that case + * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed + * in favour of explicit injection. + */ + loadExternalIsValidProp(require("@emotion/is-prop-valid").default); +} +catch { + // We don't need to actually do anything here - the fallback is the existing `isPropValid`. +} +function filterProps(props, isDom, forwardMotionProps) { + const filteredProps = {}; + for (const key in props) { + /** + * values is considered a valid prop by Emotion, so if it's present + * this will be rendered out to the DOM unless explicitly filtered. + * + * We check the type as it could be used with the `feColorMatrix` + * element, which we support. + */ + if (key === "values" && typeof props.values === "object") + continue; + if (shouldForward(key) || + (forwardMotionProps === true && isValidMotionProp(key)) || + (!isDom && !isValidMotionProp(key)) || + // If trying to use native HTML drag events, forward drag listeners + (props["draggable"] && + key.startsWith("onDrag"))) { + filteredProps[key] = + props[key]; + } + } + return filteredProps; +} + +export { filterProps, loadExternalIsValidProp }; +//# sourceMappingURL=filter-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map new file mode 100644 index 00000000..4df004c0 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"filter-props.mjs","sources":["../../../../../src/render/dom/utils/filter-props.ts"],"sourcesContent":["import type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n"],"names":[],"mappings":";;AAGA,IAAI,aAAa,GAAG,CAAC,GAAW,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;AAItD,SAAU,uBAAuB,CAAC,WAAyB,EAAA;IAC7D,IAAI,OAAO,WAAW,KAAK,UAAU;QAAE,OAAM;;IAG7C,aAAa,GAAG,CAAC,GAAW,KACxB,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;AAYG;AACH,IAAI;AACA;;;;AAIG;IACH,uBAAuB,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,CAAA;AACtE,CAAC;AAAC,MAAM;;AAER,CAAC;SAEe,WAAW,CACvB,KAAkB,EAClB,KAAc,EACd,kBAA2B,EAAA;IAE3B,MAAM,aAAa,GAAgB,EAAE,CAAA;AAErC,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB;;;;;;AAMG;QACH,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE,SAAQ;QAElE,IACI,aAAa,CAAC,GAAG,CAAC;aACjB,kBAAkB,KAAK,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;aACtD,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;;aAElC,KAAK,CAAC,WAAgC,CAAC;AACpC,gBAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAC/B;YACE,aAAa,CAAC,GAAwB,CAAC;gBACnC,KAAK,CAAC,GAAwB,CAAC,CAAA;SACtC;KACJ;AAED,IAAA,OAAO,aAAa,CAAA;AACxB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs new file mode 100644 index 00000000..e300fc16 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs @@ -0,0 +1,31 @@ +import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs'; + +function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } + else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/u.test(Component)) { + return true; + } + return false; +} + +export { isSVGComponent }; +//# sourceMappingURL=is-svg-component.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map new file mode 100644 index 00000000..9c4be889 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-component.mjs","sources":["../../../../../src/render/dom/utils/is-svg-component.ts"],"sourcesContent":["import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGM,SAAU,cAAc,CAAC,SAA4C,EAAA;AACvE,IAAA;AACI;;;AAGG;IACH,OAAO,SAAS,KAAK,QAAQ;AAC7B;;AAEG;AACH,QAAA,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EACzB;AACE,QAAA,OAAO,KAAK,CAAA;KACf;AAAM,SAAA;AACH;;AAEG;AACH,IAAA,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC5C;;AAEG;AACH,QAAA,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAC1B;AACE,QAAA,OAAO,IAAI,CAAA;KACd;AAED,IAAA,OAAO,KAAK,CAAA;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs new file mode 100644 index 00000000..93c0f8d5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs @@ -0,0 +1,44 @@ +import { resolveElements } from 'motion-dom'; + +const thresholds = { + some: 0, + all: 1, +}; +function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); +} + +export { inView }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map new file mode 100644 index 00000000..d5f7608b --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/render/dom/viewport/index.ts"],"sourcesContent":["import { ElementOrSelector, resolveElements } from \"motion-dom\"\n\nexport type ViewChangeHandler = (entry: IntersectionObserverEntry) => void\n\ntype MarginValue = `${number}${\"px\" | \"%\"}`\ntype MarginType =\n | MarginValue\n | `${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue}`\n | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`\n\nexport interface InViewOptions {\n root?: Element | Document\n margin?: MarginType\n amount?: \"some\" | \"all\" | number\n}\n\nconst thresholds = {\n some: 0,\n all: 1,\n}\n\nexport function inView(\n elementOrSelector: ElementOrSelector,\n onStart: (\n element: Element,\n entry: IntersectionObserverEntry\n ) => void | ViewChangeHandler,\n { root, margin: rootMargin, amount = \"some\" }: InViewOptions = {}\n): VoidFunction {\n const elements = resolveElements(elementOrSelector)\n\n const activeIntersections = new WeakMap()\n\n const onIntersectionChange: IntersectionObserverCallback = (entries) => {\n entries.forEach((entry) => {\n const onEnd = activeIntersections.get(entry.target)\n\n /**\n * If there's no change to the intersection, we don't need to\n * do anything here.\n */\n if (entry.isIntersecting === Boolean(onEnd)) return\n\n if (entry.isIntersecting) {\n const newOnEnd = onStart(entry.target, entry)\n if (typeof newOnEnd === \"function\") {\n activeIntersections.set(entry.target, newOnEnd)\n } else {\n observer.unobserve(entry.target)\n }\n } else if (typeof onEnd === \"function\") {\n onEnd(entry)\n activeIntersections.delete(entry.target)\n }\n })\n }\n\n const observer = new IntersectionObserver(onIntersectionChange, {\n root,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n })\n\n elements.forEach((element) => observer.observe(element))\n\n return () => observer.disconnect()\n}\n"],"names":[],"mappings":";;AAiBA,MAAM,UAAU,GAAG;AACf,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,GAAG,EAAE,CAAC;CACT,CAAA;SAEe,MAAM,CAClB,iBAAoC,EACpC,OAG6B,EAC7B,EAAE,IAAI,EAAE,MAAM,EAAE,U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,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;AAExD,IAAA,OAAO,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAA;AACtC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs new file mode 100644 index 00000000..3b31d713 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs @@ -0,0 +1,12 @@ +"use client"; +import { scrapeHTMLMotionValuesFromProps } from 'motion-dom'; +import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; +import { createHtmlRenderState } from './utils/create-render-state.mjs'; + +const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps, + createRenderState: createHtmlRenderState, +}); + +export { useHTMLVisualState }; +//# sourceMappingURL=use-html-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map new file mode 100644 index 00000000..e029ae6c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-html-visual-state.mjs","sources":["../../../../src/render/html/use-html-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n})\n"],"names":[],"mappings":";;;;;AAMa;AACT;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/use-props.mjs b/node_modules/framer-motion/dist/es/render/html/use-props.mjs new file mode 100644 index 00000000..62e55562 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-props.mjs @@ -0,0 +1,57 @@ +"use client"; +import { isMotionValue, isForcedMotionValue, buildHTMLStyles } from 'motion-dom'; +import { useMemo } from 'react'; +import { createHtmlRenderState } from './utils/create-render-state.mjs'; + +function copyRawValuesOnly(target, source, props) { + for (const key in source) { + if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } +} +function useInitialMotionValues({ transformTemplate }, visualState) { + return useMemo(() => { + const state = createHtmlRenderState(); + buildHTMLStyles(state, visualState, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); +} +function useStyle(props, visualState) { + const styleProp = props.style || {}; + const style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState)); + return style; +} +function useHTMLProps(props, visualState) { + // The `any` isn't ideal but it is the type of createElement props argument + const htmlProps = {}; + const style = useStyle(props, visualState); + if (props.drag && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = + style.WebkitUserSelect = + style.WebkitTouchCallout = + "none"; + // Disable scrolling on the draggable direction + style.touchAction = + props.drag === true + ? "none" + : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && + (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; +} + +export { copyRawValuesOnly, useHTMLProps }; +//# sourceMappingURL=use-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map b/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map new file mode 100644 index 00000000..30e50da1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/use-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-props.mjs","sources":["../../../../src/render/html/use-props.ts"],"sourcesContent":["\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n"],"names":[],"mappings":";;;;;;AAaI;AACI;;;;AAIR;AAEA;;AAKQ;AAEA;AAEA;AACJ;AACJ;AAEA;AAII;;AAGA;;AAEG;AACH;AAEA;AAEA;AACJ;AAEgB;;;;;;AAUR;;AAGA;AACI;AACA;AACI;;AAGR;;AAEQ;AACA;;AAGZ;AAEI;AAEA;;AAGJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs new file mode 100644 index 00000000..e3872015 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs @@ -0,0 +1,9 @@ +const createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {}, +}); + +export { createHtmlRenderState }; +//# sourceMappingURL=create-render-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map new file mode 100644 index 00000000..56aa4187 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-render-state.mjs","sources":["../../../../../src/render/html/utils/create-render-state.ts"],"sourcesContent":["import { HTMLRenderState } from \"../types\"\n\nexport const createHtmlRenderState = (): HTMLRenderState => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n})\n"],"names":[],"mappings":"AAEa,MAAA,qBAAqB,GAAG,OAAwB;AACzD,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,IAAI,EAAE,EAAE;AACX,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs new file mode 100644 index 00000000..0177ce0c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs @@ -0,0 +1,34 @@ +/** + * We keep these listed separately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ +const lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view", +]; + +export { lowercaseSVGElements }; +//# sourceMappingURL=lowercase-elements.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map new file mode 100644 index 00000000..95ff5aec --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"lowercase-elements.mjs","sources":["../../../../src/render/svg/lowercase-elements.ts"],"sourcesContent":["/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n]\n"],"names":[],"mappings":"AAAA;;;AAGG;AACU,MAAA,oBAAoB,GAAG;IAChC,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;IACT,GAAG;IACH,OAAO;IACP,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,SAAS;IACT,SAAS;IACT,UAAU;IACV,MAAM;IACN,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs new file mode 100644 index 00000000..c992b5fa --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs @@ -0,0 +1,25 @@ +"use client"; +import { buildSVGAttrs, isSVGTag } from 'motion-dom'; +import { useMemo } from 'react'; +import { copyRawValuesOnly } from '../html/use-props.mjs'; +import { createSvgRenderState } from './utils/create-render-state.mjs'; + +function useSVGProps(props, visualState, _isStatic, Component) { + const visualProps = useMemo(() => { + const state = createSvgRenderState(); + buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style); + return { + ...state.attrs, + style: { ...state.style }, + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; +} + +export { useSVGProps }; +//# sourceMappingURL=use-props.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map new file mode 100644 index 00000000..6d16ff9c --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-props.mjs","sources":["../../../../src/render/svg/use-props.ts"],"sourcesContent":["\"use client\"\n\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\"\nimport { useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { copyRawValuesOnly } from \"../html/use-props\"\nimport { ResolvedValues } from \"../types\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport function useSVGProps(\n props: MotionProps,\n visualState: ResolvedValues,\n _isStatic: boolean,\n Component: string | React.ComponentType>\n) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState()\n\n buildSVGAttrs(\n state,\n visualState,\n isSVGTag(Component),\n props.transformTemplate,\n props.style\n )\n\n return {\n ...state.attrs,\n style: { ...state.style },\n }\n }, [visualState])\n\n if (props.style) {\n const rawStyles = {}\n copyRawValuesOnly(rawStyles, props.style as any, props)\n visualProps.style = { ...rawStyles, ...visualProps.style }\n }\n\n return visualProps\n}\n"],"names":[],"mappings":";;;;;;AASM;AAMF;AACI;AAEA;;;AAUI;;AAER;AAEA;;;AAGI;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs new file mode 100644 index 00000000..a987d88b --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs @@ -0,0 +1,12 @@ +"use client"; +import { scrapeSVGMotionValuesFromProps } from 'motion-dom'; +import { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs'; +import { createSvgRenderState } from './utils/create-render-state.mjs'; + +const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps, + createRenderState: createSvgRenderState, +}); + +export { useSVGVisualState }; +//# sourceMappingURL=use-svg-visual-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map new file mode 100644 index 00000000..e0407a01 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-svg-visual-state.mjs","sources":["../../../../src/render/svg/use-svg-visual-state.ts"],"sourcesContent":["\"use client\"\n\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\"\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\"\nimport { createSvgRenderState } from \"./utils/create-render-state\"\n\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n})\n"],"names":[],"mappings":";;;;;AAMa;AACT;AACA;AACH;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs new file mode 100644 index 00000000..884270f2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs @@ -0,0 +1,9 @@ +import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs'; + +const createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {}, +}); + +export { createSvgRenderState }; +//# sourceMappingURL=create-render-state.mjs.map diff --git a/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map new file mode 100644 index 00000000..8f2bf387 --- /dev/null +++ b/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-render-state.mjs","sources":["../../../../../src/render/svg/utils/create-render-state.ts"],"sourcesContent":["import { createHtmlRenderState } from \"../../html/utils/create-render-state\"\nimport { SVGRenderState } from \"../types\"\n\nexport const createSvgRenderState = (): SVGRenderState => ({\n ...createHtmlRenderState(),\n attrs: {},\n})\n"],"names":[],"mappings":";;AAGa,MAAA,oBAAoB,GAAG,OAAuB;AACvD,IAAA,GAAG,qBAAqB,EAAE;AAC1B,IAAA,KAAK,EAAE,EAAE;AACZ,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/distance.mjs b/node_modules/framer-motion/dist/es/utils/distance.mjs new file mode 100644 index 00000000..c7ff075c --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/distance.mjs @@ -0,0 +1,10 @@ +const distance = (a, b) => Math.abs(a - b); +function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); +} + +export { distance, distance2D }; +//# sourceMappingURL=distance.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/distance.mjs.map b/node_modules/framer-motion/dist/es/utils/distance.mjs.map new file mode 100644 index 00000000..5cc80208 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/distance.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"distance.mjs","sources":["../../../src/utils/distance.ts"],"sourcesContent":["import { Point } from \"motion-utils\"\n\nexport const distance = (a: number, b: number) => Math.abs(a - b)\n\nexport function distance2D(a: Point, b: Point): number {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x)\n const yDelta = distance(a.y, b.y)\n return Math.sqrt(xDelta ** 2 + yDelta ** 2)\n}\n"],"names":[],"mappings":"AAEa,MAAA,QAAQ,GAAG,CAAC,CAAS,EAAE,CAAS,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAC;AAEjD,SAAA,UAAU,CAAC,CAAQ,EAAE,CAAQ,EAAA;;AAEzC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,IAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,IAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAA;AAC/C;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs new file mode 100644 index 00000000..02fa901d --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs @@ -0,0 +1,7 @@ +// Fixes https://github.com/motiondivision/motion/issues/2270 +const getContextWindow = ({ current }) => { + return current ? current.ownerDocument.defaultView : null; +}; + +export { getContextWindow }; +//# sourceMappingURL=get-context-window.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map new file mode 100644 index 00000000..df9e9982 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-context-window.mjs","sources":["../../../src/utils/get-context-window.ts"],"sourcesContent":["import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement) => {\n return current ? current.ownerDocument.defaultView : null\n}\n"],"names":[],"mappings":"AAEA;MACa,gBAAgB,GAAG,CAAC,EAAE,OAAO,EAA0B,KAAI;AACpE,IAAA,OAAO,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAA;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/is-browser.mjs b/node_modules/framer-motion/dist/es/utils/is-browser.mjs new file mode 100644 index 00000000..870cec2c --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-browser.mjs @@ -0,0 +1,4 @@ +const isBrowser = typeof window !== "undefined"; + +export { isBrowser }; +//# sourceMappingURL=is-browser.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map b/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map new file mode 100644 index 00000000..5cf8d860 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-browser.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-browser.mjs","sources":["../../../src/utils/is-browser.ts"],"sourcesContent":["export const isBrowser = typeof window !== \"undefined\"\n"],"names":[],"mappings":"MAAa,SAAS,GAAG,OAAO,MAAM,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs new file mode 100644 index 00000000..7c2f9bbd --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs @@ -0,0 +1,8 @@ +function isRefObject(ref) { + return (ref && + typeof ref === "object" && + Object.prototype.hasOwnProperty.call(ref, "current")); +} + +export { isRefObject }; +//# sourceMappingURL=is-ref-object.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map new file mode 100644 index 00000000..15c1a342 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/is-ref-object.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-ref-object.mjs","sources":["../../../src/utils/is-ref-object.ts"],"sourcesContent":["import { MutableRefObject } from \"./safe-react-types\"\n\nexport function isRefObject(ref: any): ref is MutableRefObject {\n return (\n ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\")\n )\n}\n"],"names":[],"mappings":"AAEM,SAAU,WAAW,CAAU,GAAQ,EAAA;AACzC,IAAA,QACI,GAAG;QACH,OAAO,GAAG,KAAK,QAAQ;AACvB,QAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,EACvD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs new file mode 100644 index 00000000..f4a36b0c --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs @@ -0,0 +1,21 @@ +"use client"; +import { useContext } from 'react'; +import { MotionConfigContext } from '../../context/MotionConfigContext.mjs'; +import { useReducedMotion } from './use-reduced-motion.mjs'; + +function useReducedMotionConfig() { + const reducedMotionPreference = useReducedMotion(); + const { reducedMotion } = useContext(MotionConfigContext); + if (reducedMotion === "never") { + return false; + } + else if (reducedMotion === "always") { + return true; + } + else { + return reducedMotionPreference; + } +} + +export { useReducedMotionConfig }; +//# sourceMappingURL=use-reduced-motion-config.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map new file mode 100644 index 00000000..27f54f2b --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-reduced-motion-config.mjs","sources":["../../../../src/utils/reduced-motion/use-reduced-motion-config.ts"],"sourcesContent":["\"use client\"\n\nimport { useContext } from \"react\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useReducedMotion } from \"./use-reduced-motion\"\n\nexport function useReducedMotionConfig() {\n const reducedMotionPreference = useReducedMotion()\n const { reducedMotion } = useContext(MotionConfigContext)\n\n if (reducedMotion === \"never\") {\n return false\n } else if (reducedMotion === \"always\") {\n return true\n } else {\n return reducedMotionPreference\n }\n}\n"],"names":[],"mappings":";;;;;;AAOI;;AAGA;AACI;;AACG;AACH;;;AAEA;;AAER;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs new file mode 100644 index 00000000..f78cfe84 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs @@ -0,0 +1,48 @@ +"use client"; +import { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion } from 'motion-dom'; +import { warnOnce } from 'motion-utils'; +import { useState } from 'react'; + +/** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ +function useReducedMotion() { + /** + * Lazy initialisation of prefersReducedMotion + */ + !hasReducedMotionListener.current && initPrefersReducedMotion(); + const [shouldReduceMotion] = useState(prefersReducedMotion.current); + if (process.env.NODE_ENV !== "production") { + warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * TODO See if people miss automatically updating shouldReduceMotion setting + */ + return shouldReduceMotion; +} + +export { useReducedMotion }; +//# sourceMappingURL=use-reduced-motion.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map new file mode 100644 index 00000000..c5f09d1c --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-reduced-motion.mjs","sources":["../../../../src/utils/reduced-motion/use-reduced-motion.ts"],"sourcesContent":["\"use client\"\n\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"motion-dom\"\nimport { warnOnce } from \"motion-utils\"\nimport { useState } from \"react\"\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nexport function useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion()\n\n const [shouldReduceMotion] = useState(prefersReducedMotion.current)\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n\n return shouldReduceMotion\n}\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;;AAEC;;AAEG;AACH;;;;;AAYA;;AAEG;AAEH;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs new file mode 100644 index 00000000..378b008c --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs @@ -0,0 +1,63 @@ +/** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +function transformViewBoxPoint(svgRef) { + return (point) => { + const svg = svgRef.current; + if (!svg) { + return point; + } + // Get the viewBox attribute + const viewBox = svg.viewBox?.baseVal; + if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { + // No viewBox or empty viewBox - no transformation needed + return point; + } + // Get the rendered dimensions of the SVG + const bbox = svg.getBoundingClientRect(); + if (bbox.width === 0 || bbox.height === 0) { + return point; + } + // Calculate scale factors + const scaleX = viewBox.width / bbox.width; + const scaleY = viewBox.height / bbox.height; + // Get the SVG's position on the page + const svgX = bbox.left + window.scrollX; + const svgY = bbox.top + window.scrollY; + // Transform the point: + // 1. Calculate position relative to SVG + // 2. Scale by viewBox/viewport ratio + // 3. Add back the SVG position (but in SVG coordinates) + return { + x: (point.x - svgX) * scaleX + svgX, + y: (point.y - svgY) * scaleY + svgY, + }; + }; +} + +export { transformViewBoxPoint }; +//# sourceMappingURL=transform-viewbox-point.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map new file mode 100644 index 00000000..7fbae3cc --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/transform-viewbox-point.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform-viewbox-point.mjs","sources":["../../../src/utils/transform-viewbox-point.ts"],"sourcesContent":["import type { Point, TransformPoint } from \"motion-utils\"\nimport type { RefObject } from \"react\"\n\n/**\n * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling.\n *\n * When dragging SVG elements inside an SVG with a viewBox that differs from\n * the rendered dimensions (e.g., `viewBox=\"0 0 100 100\"` but rendered at 500x500 pixels),\n * pointer coordinates need to be transformed to match the SVG's coordinate system.\n *\n * @example\n * ```jsx\n * function App() {\n * const svgRef = useRef(null)\n *\n * return (\n * \n * \n * \n * \n * \n * )\n * }\n * ```\n *\n * @param svgRef - A React ref to the SVG element\n * @returns A transformPagePoint function for use with MotionConfig\n *\n * @public\n */\nexport function transformViewBoxPoint(\n svgRef: RefObject\n): TransformPoint {\n return (point: Point): Point => {\n const svg = svgRef.current\n if (!svg) {\n return point\n }\n\n // Get the viewBox attribute\n const viewBox = svg.viewBox?.baseVal\n if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) {\n // No viewBox or empty viewBox - no transformation needed\n return point\n }\n\n // Get the rendered dimensions of the SVG\n const bbox = svg.getBoundingClientRect()\n if (bbox.width === 0 || bbox.height === 0) {\n return point\n }\n\n // Calculate scale factors\n const scaleX = viewBox.width / bbox.width\n const scaleY = viewBox.height / bbox.height\n\n // Get the SVG's position on the page\n const svgX = bbox.left + window.scrollX\n const svgY = bbox.top + window.scrollY\n\n // Transform the point:\n // 1. Calculate position relative to SVG\n // 2. Scale by viewBox/viewport ratio\n // 3. Add back the SVG position (but in SVG coordinates)\n return {\n x: (point.x - svgX) * scaleX + svgX,\n y: (point.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utils/use-animation-frame.mjs b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs new file mode 100644 index 00000000..529b1cef --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs @@ -0,0 +1,23 @@ +"use client"; +import { frame, cancelFrame } from 'motion-dom'; +import { useRef, useContext, useEffect } from 'react'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; + +function useAnimationFrame(callback) { + const initialTimestamp = useRef(0); + const { isStatic } = useContext(MotionConfigContext); + useEffect(() => { + if (isStatic) + return; + const provideTimeSinceStart = ({ timestamp, delta }) => { + if (!initialTimestamp.current) + initialTimestamp.current = timestamp; + callback(timestamp - initialTimestamp.current, delta); + }; + frame.update(provideTimeSinceStart, true); + return () => cancelFrame(provideTimeSinceStart); + }, [callback]); +} + +export { useAnimationFrame }; +//# sourceMappingURL=use-animation-frame.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map new file mode 100644 index 00000000..22b0de00 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-animation-frame.mjs","sources":["../../../src/utils/use-animation-frame.ts"],"sourcesContent":["\"use client\"\n\nimport { cancelFrame, frame, FrameData } from \"motion-dom\"\nimport { useContext, useEffect, useRef } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\n\nexport type FrameCallback = (timestamp: number, delta: number) => void\n\nexport function useAnimationFrame(callback: FrameCallback) {\n const initialTimestamp = useRef(0)\n const { isStatic } = useContext(MotionConfigContext)\n\n useEffect(() => {\n if (isStatic) return\n\n const provideTimeSinceStart = ({ timestamp, delta }: FrameData) => {\n if (!initialTimestamp.current) initialTimestamp.current = timestamp\n\n callback(timestamp - initialTimestamp.current, delta)\n }\n\n frame.update(provideTimeSinceStart, true)\n return () => cancelFrame(provideTimeSinceStart)\n }, [callback])\n}\n"],"names":[],"mappings":";;;;;AAQM;AACF;;;AAII;;;;AAGmC;;AAGnC;AAEA;AACA;AACJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs new file mode 100644 index 00000000..efa3d327 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs @@ -0,0 +1,61 @@ +import * as React from 'react'; + +/** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ +/** + * Set a given ref to a given value + * This utility takes care of different types of refs: callback refs and RefObject(s) + */ +function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } + else if (ref !== null && ref !== undefined) { + ref.current = value; + } +} +/** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ +function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup === "function") { + hasCleanup = true; + } + return cleanup; + }); + // React <19 will log an error to the console if a callback ref returns a + // value. We don't use ref cleanups internally so this will only happen if a + // user's ref callback returns a value, which we only expect if they are + // using the cleanup functionality added in React 19. + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup === "function") { + cleanup(); + } + else { + setRef(refs[i], null); + } + } + }; + } + }; +} +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +function useComposedRefs(...refs) { + // eslint-disable-next-line react-hooks/exhaustive-deps + return React.useCallback(composeRefs(...refs), refs); +} + +export { useComposedRefs }; +//# sourceMappingURL=use-composed-ref.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map new file mode 100644 index 00000000..a56836cd --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-composed-ref.mjs","sources":["../../../src/utils/use-composed-ref.ts"],"sourcesContent":["/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\nimport * as React from \"react\"\n\ntype PossibleRef = React.Ref | undefined\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref: PossibleRef, value: T): void | (() => void) {\n if (typeof ref === \"function\") {\n return ref(value)\n } else if (ref !== null && ref !== undefined) {\n ;(ref as React.MutableRefObject).current = value\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs: PossibleRef[]): React.RefCallback {\n return (node) => {\n let hasCleanup = false\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node)\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true\n }\n return cleanup\n })\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i]\n if (typeof cleanup === \"function\") {\n cleanup()\n } else {\n setRef(refs[i], null)\n }\n }\n }\n }\n }\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs: PossibleRef[]): React.RefCallback {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs)\n}\n\nexport { useComposedRefs }\n"],"names":[],"mappings":";;AAAA;;AAEG;AAKH;;;AAGG;AACH,SAAS,MAAM,CAAI,GAAmB,EAAE,KAAQ,EAAA;AAC5C,IAAA,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AAC3B,QAAA,OAAO,GAAG,CAAC,KAAK,CAAC,CAAA;KACpB;SAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;AACxC,QAAA,GAAiC,CAAC,OAAO,GAAG,KAAK,CAAA;KACtD;AACL,CAAC;AAED;;;AAGG;AACH,SAAS,WAAW,CAAI,GAAG,IAAsB,EAAA;IAC7C,OAAO,CAAC,IAAI,KAAI;QACZ,IAAI,UAAU,GAAG,KAAK,CAAA;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAI;YAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;YACjC,IAAI,CAAC,UAAU,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;gBAC9C,UAAU,GAAG,IAAI,CAAA;aACpB;AACD,YAAA,OAAO,OAAO,CAAA;AAClB,SAAC,CAAC,CAAA;;;;;QAKF,IAAI,UAAU,EAAE;AACZ,YAAA,OAAO,MAAK;AACR,gBAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACtC,oBAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC3B,oBAAA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAC/B,wBAAA,OAAO,EAAE,CAAA;qBACZ;yBAAM;wBACH,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;qBACxB;iBACJ;AACL,aAAC,CAAA;SACJ;AACL,KAAC,CAAA;AACL,CAAC;AAED;;;AAGG;AACH,SAAS,eAAe,CAAI,GAAG,IAAsB,EAAA;;AAEjD,IAAA,OAAO,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;AACxD;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-constant.mjs b/node_modules/framer-motion/dist/es/utils/use-constant.mjs new file mode 100644 index 00000000..50a3e1db --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-constant.mjs @@ -0,0 +1,20 @@ +"use client"; +import { useRef } from 'react'; + +/** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ +function useConstant(init) { + const ref = useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; +} + +export { useConstant }; +//# sourceMappingURL=use-constant.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map b/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map new file mode 100644 index 00000000..4a9d7be2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-constant.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-constant.mjs","sources":["../../../src/utils/use-constant.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\n\ntype Init = () => T\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init: Init) {\n const ref = useRef(null)\n\n if (ref.current === null) {\n ref.current = init()\n }\n\n return ref.current\n}\n"],"names":[],"mappings":";;;AAMA;;;;;;AAMG;AACG;AACF;AAEA;AACI;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs new file mode 100644 index 00000000..a5a61ff2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs @@ -0,0 +1,49 @@ +"use client"; +import { wrap } from 'motion-utils'; +import { useRef, useState, useCallback } from 'react'; + +/** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ +function useCycle(...items) { + const index = useRef(0); + const [item, setItem] = useState(items[index.current]); + const runCycle = useCallback((next) => { + index.current = + typeof next !== "number" + ? wrap(0, items.length, index.current + 1) + : next; + setItem(items[index.current]); + }, + // The array will change on each call, but by putting items.length at + // the front of this array, we guarantee the dependency comparison will match up + // eslint-disable-next-line react-hooks/exhaustive-deps + [items.length, ...items]); + return [item, runCycle]; +} + +export { useCycle }; +//# sourceMappingURL=use-cycle.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map new file mode 100644 index 00000000..cffe6406 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-cycle.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-cycle.mjs","sources":["../../../src/utils/use-cycle.ts"],"sourcesContent":["\"use client\"\n\nimport { wrap } from \"motion-utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\nexport type Cycle = (i?: number) => void\n\nexport type CycleState = [T, Cycle]\n\n/**\n * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments.\n *\n * An index value can be passed to the returned `cycle` function to cycle to a specific index.\n *\n * ```jsx\n * import * as React from \"react\"\n * import { motion, useCycle } from \"framer-motion\"\n *\n * export const MyComponent = () => {\n * const [x, cycleX] = useCycle(0, 50, 100)\n *\n * return (\n * cycleX()}\n * />\n * )\n * }\n * ```\n *\n * @param items - items to cycle through\n * @returns [currentState, cycleState]\n *\n * @public\n */\nexport function useCycle(...items: T[]): CycleState {\n const index = useRef(0)\n const [item, setItem] = useState(items[index.current])\n\n const runCycle = useCallback(\n (next?: number) => {\n index.current =\n typeof next !== \"number\"\n ? wrap(0, items.length, index.current + 1)\n : next\n\n setItem(items[index.current])\n },\n // The array will change on each call, but by putting items.length at\n // the front of this array, we guarantee the dependency comparison will match up\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [items.length, ...items]\n )\n return [item, runCycle]\n}\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACa;AACZ;AACA;AAEA;AAEQ;;AAEQ;;;;;;;;AAUhB;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs new file mode 100644 index 00000000..729a98b7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs @@ -0,0 +1,21 @@ +"use client"; +import { frame } from 'motion-dom'; +import { useState, useCallback } from 'react'; +import { useIsMounted } from './use-is-mounted.mjs'; + +function useForceUpdate() { + const isMounted = useIsMounted(); + const [forcedRenderCount, setForcedRenderCount] = useState(0); + const forceRender = useCallback(() => { + isMounted.current && setForcedRenderCount(forcedRenderCount + 1); + }, [forcedRenderCount]); + /** + * Defer this to the end of the next animation frame in case there are multiple + * synchronous calls. + */ + const deferredForceRender = useCallback(() => frame.postRender(forceRender), [forceRender]); + return [deferredForceRender, forcedRenderCount]; +} + +export { useForceUpdate }; +//# sourceMappingURL=use-force-update.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map new file mode 100644 index 00000000..a000fb86 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-force-update.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-force-update.mjs","sources":["../../../src/utils/use-force-update.ts"],"sourcesContent":["\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { useCallback, useState } from \"react\"\nimport { useIsMounted } from \"./use-is-mounted\"\n\nexport function useForceUpdate(): [VoidFunction, number] {\n const isMounted = useIsMounted()\n const [forcedRenderCount, setForcedRenderCount] = useState(0)\n\n const forceRender = useCallback(() => {\n isMounted.current && setForcedRenderCount(forcedRenderCount + 1)\n }, [forcedRenderCount])\n\n /**\n * Defer this to the end of the next animation frame in case there are multiple\n * synchronous calls.\n */\n const deferredForceRender = useCallback(\n () => frame.postRender(forceRender),\n [forceRender]\n )\n\n return [deferredForceRender, forcedRenderCount]\n}\n"],"names":[],"mappings":";;;;;;AAOI;;AAGA;;AAEA;AAEA;;;AAGG;AACH;AAKA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs new file mode 100644 index 00000000..59d5aebf --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs @@ -0,0 +1,25 @@ +"use client"; +import { useState, useEffect } from 'react'; +import { inView } from '../render/dom/viewport/index.mjs'; + +function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { + const [isInView, setInView] = useState(initial); + useEffect(() => { + if (!ref.current || (once && isInView)) + return; + const onEnter = () => { + setInView(true); + return once ? undefined : () => setInView(false); + }; + const options = { + root: (root && root.current) || undefined, + margin, + amount, + }; + return inView(ref.current, onEnter, options); + }, [root, ref, margin, once, amount]); + return isInView; +} + +export { useInView }; +//# sourceMappingURL=use-in-view.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map new file mode 100644 index 00000000..29d21d87 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-in-view.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-in-view.mjs","sources":["../../../src/utils/use-in-view.ts"],"sourcesContent":["\"use client\"\n\nimport { RefObject, useEffect, useState } from \"react\"\nimport { inView, InViewOptions } from \"../render/dom/viewport\"\n\nexport interface UseInViewOptions\n extends Omit {\n root?: RefObject\n once?: boolean\n amount?: \"some\" | \"all\" | number\n initial?: boolean\n}\n\nexport function useInView(\n ref: RefObject,\n {\n root,\n margin,\n amount,\n once = false,\n initial = false,\n }: UseInViewOptions = {}\n) {\n const [isInView, setInView] = useState(initial)\n\n useEffect(() => {\n if (!ref.current || (once && isInView)) return\n\n const onEnter = () => {\n setInView(true)\n\n return once ? undefined : () => setInView(false)\n }\n\n const options: InViewOptions = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n }\n\n return inView(ref.current, onEnter, options)\n }, [root, ref, margin, once, amount])\n\n return isInView\n}\n"],"names":[],"mappings":";;;;AAaM;;;;;;;AAkBM;AACJ;AAEA;;;;;;AAOJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs new file mode 100644 index 00000000..8a84ebfb --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs @@ -0,0 +1,43 @@ +"use client"; +import { frame } from 'motion-dom'; +import { MotionGlobalConfig } from 'motion-utils'; +import { useRef, useEffect } from 'react'; +import { useInstantLayoutTransition } from '../projection/use-instant-layout-transition.mjs'; +import { useForceUpdate } from './use-force-update.mjs'; + +function useInstantTransition() { + const [forceUpdate, forcedRenderCount] = useForceUpdate(); + const startInstantLayoutTransition = useInstantLayoutTransition(); + const unlockOnFrameRef = useRef(-1); + useEffect(() => { + /** + * Unblock after two animation frames, otherwise this will unblock too soon. + */ + frame.postRender(() => frame.postRender(() => { + /** + * If the callback has been called again after the effect + * triggered this 2 frame delay, don't unblock animations. This + * prevents the previous effect from unblocking the current + * instant transition too soon. This becomes more likely when + * used in conjunction with React.startTransition(). + */ + if (forcedRenderCount !== unlockOnFrameRef.current) + return; + MotionGlobalConfig.instantAnimations = false; + })); + }, [forcedRenderCount]); + return (callback) => { + startInstantLayoutTransition(() => { + MotionGlobalConfig.instantAnimations = true; + forceUpdate(); + callback(); + unlockOnFrameRef.current = forcedRenderCount + 1; + }); + }; +} +function disableInstantTransitions() { + MotionGlobalConfig.instantAnimations = false; +} + +export { disableInstantTransitions, useInstantTransition }; +//# sourceMappingURL=use-instant-transition.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map new file mode 100644 index 00000000..8c6bdaaa --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-instant-transition.mjs","sources":["../../../src/utils/use-instant-transition.ts"],"sourcesContent":["\"use client\"\n\nimport { frame } from \"motion-dom\"\nimport { MotionGlobalConfig } from \"motion-utils\"\nimport { useEffect, useRef } from \"react\"\nimport { useInstantLayoutTransition } from \"../projection/use-instant-layout-transition\"\nimport { useForceUpdate } from \"./use-force-update\"\n\nexport function useInstantTransition() {\n const [forceUpdate, forcedRenderCount] = useForceUpdate()\n const startInstantLayoutTransition = useInstantLayoutTransition()\n const unlockOnFrameRef = useRef(-1)\n\n useEffect(() => {\n /**\n * Unblock after two animation frames, otherwise this will unblock too soon.\n */\n frame.postRender(() =>\n frame.postRender(() => {\n /**\n * If the callback has been called again after the effect\n * triggered this 2 frame delay, don't unblock animations. This\n * prevents the previous effect from unblocking the current\n * instant transition too soon. This becomes more likely when\n * used in conjunction with React.startTransition().\n */\n if (forcedRenderCount !== unlockOnFrameRef.current) return\n MotionGlobalConfig.instantAnimations = false\n })\n )\n }, [forcedRenderCount])\n\n return (callback: () => void) => {\n startInstantLayoutTransition(() => {\n MotionGlobalConfig.instantAnimations = true\n forceUpdate()\n callback()\n unlockOnFrameRef.current = forcedRenderCount + 1\n })\n }\n}\n\nexport function disableInstantTransitions() {\n MotionGlobalConfig.instantAnimations = false\n}\n"],"names":[],"mappings":";;;;;;;;;AAUI;AACA;;AAGI;;AAEG;;AAGK;;;;;;AAMG;AACH;;AACA;;AAGZ;;;AAIQ;AACA;AACA;AACA;AACJ;AACJ;AACJ;;AAGI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs new file mode 100644 index 00000000..1ebefbe2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs @@ -0,0 +1,17 @@ +"use client"; +import { useRef } from 'react'; +import { useIsomorphicLayoutEffect } from './use-isomorphic-effect.mjs'; + +function useIsMounted() { + const isMounted = useRef(false); + useIsomorphicLayoutEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + return isMounted; +} + +export { useIsMounted }; +//# sourceMappingURL=use-is-mounted.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map new file mode 100644 index 00000000..72e622c5 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-is-mounted.mjs","sources":["../../../src/utils/use-is-mounted.ts"],"sourcesContent":["\"use client\"\n\nimport { useRef } from \"react\"\nimport { useIsomorphicLayoutEffect } from \"./use-isomorphic-effect\"\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n"],"names":[],"mappings":";;;;;AAMI;;AAEI;AAEA;AACI;AACJ;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs new file mode 100644 index 00000000..704d9f68 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs @@ -0,0 +1,8 @@ +"use client"; +import { useLayoutEffect, useEffect } from 'react'; +import { isBrowser } from './is-browser.mjs'; + +const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect; + +export { useIsomorphicLayoutEffect }; +//# sourceMappingURL=use-isomorphic-effect.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map new file mode 100644 index 00000000..66035e5b --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-isomorphic-effect.mjs","sources":["../../../src/utils/use-isomorphic-effect.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useLayoutEffect } from \"react\"\nimport { isBrowser } from \"./is-browser\"\n\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect\n"],"names":[],"mappings":";;;;AAKO;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs new file mode 100644 index 00000000..5b19c981 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs @@ -0,0 +1,15 @@ +"use client"; +import { useInsertionEffect } from 'react'; + +function useMotionValueEvent(value, event, callback) { + /** + * useInsertionEffect will create subscriptions before any other + * effects will run. Effects run upwards through the tree so it + * can be that binding a useLayoutEffect higher up the tree can + * miss changes from lower down the tree. + */ + useInsertionEffect(() => value.on(event, callback), [value, event, callback]); +} + +export { useMotionValueEvent }; +//# sourceMappingURL=use-motion-value-event.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map new file mode 100644 index 00000000..07df7e41 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-value-event.mjs","sources":["../../../src/utils/use-motion-value-event.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue, MotionValueEventCallbacks } from \"motion-dom\"\nimport { useInsertionEffect } from \"react\"\n\nexport function useMotionValueEvent<\n V,\n EventName extends keyof MotionValueEventCallbacks\n>(\n value: MotionValue,\n event: EventName,\n callback: MotionValueEventCallbacks[EventName]\n) {\n /**\n * useInsertionEffect will create subscriptions before any other\n * effects will run. Effects run upwards through the tree so it\n * can be that binding a useLayoutEffect higher up the tree can\n * miss changes from lower down the tree.\n */\n useInsertionEffect(\n () => value.on(event, callback),\n [value, event, callback]\n )\n}\n"],"names":[],"mappings":";;;;AAaI;;;;;AAKG;;AAKP;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs new file mode 100644 index 00000000..a4c10547 --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs @@ -0,0 +1,20 @@ +"use client"; +import { useState, useEffect } from 'react'; + +function usePageInView() { + const [isInView, setIsInView] = useState(true); + useEffect(() => { + const handleVisibilityChange = () => setIsInView(!document.hidden); + if (document.hidden) { + handleVisibilityChange(); + } + document.addEventListener("visibilitychange", handleVisibilityChange); + return () => { + document.removeEventListener("visibilitychange", handleVisibilityChange); + }; + }, []); + return isInView; +} + +export { usePageInView }; +//# sourceMappingURL=use-page-in-view.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map new file mode 100644 index 00000000..9a0dd0db --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-page-in-view.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-page-in-view.mjs","sources":["../../../src/utils/use-page-in-view.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nexport function usePageInView() {\n const [isInView, setIsInView] = useState(true)\n\n useEffect(() => {\n const handleVisibilityChange = () => setIsInView(!document.hidden)\n\n if (document.hidden) {\n handleVisibilityChange()\n }\n\n document.addEventListener(\"visibilitychange\", handleVisibilityChange)\n\n return () => {\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n )\n }\n }, [])\n\n return isInView\n}\n"],"names":[],"mappings":";;;;;;AAQQ;AAEA;AACI;;AAGJ;AAEA;AACI;AAIJ;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs new file mode 100644 index 00000000..a4bd165f --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs @@ -0,0 +1,9 @@ +"use client"; +import { useEffect } from 'react'; + +function useUnmountEffect(callback) { + return useEffect(() => () => callback(), []); +} + +export { useUnmountEffect }; +//# sourceMappingURL=use-unmount-effect.mjs.map diff --git a/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map new file mode 100644 index 00000000..eb242e9e --- /dev/null +++ b/node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-unmount-effect.mjs","sources":["../../../src/utils/use-unmount-effect.ts"],"sourcesContent":["\"use client\"\n\nimport { useEffect } from \"react\"\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n"],"names":[],"mappings":";;;AAIM;AACF;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs new file mode 100644 index 00000000..f108d60e --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs @@ -0,0 +1,15 @@ +import { warnOnce } from 'motion-utils'; +import { useScroll } from '../use-scroll.mjs'; + +/** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ +function useElementScroll(ref) { + if (process.env.NODE_ENV === "development") { + warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); + } + return useScroll({ container: ref }); +} + +export { useElementScroll }; +//# sourceMappingURL=use-element-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map new file mode 100644 index 00000000..85fc5d01 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-element-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-element-scroll.mjs","sources":["../../../../src/value/scroll/use-element-scroll.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { RefObject } from \"react\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })\n */\nexport function useElementScroll(ref: RefObject) {\n if (process.env.NODE_ENV === \"development\") {\n warnOnce(\n false,\n \"useElementScroll is deprecated. Convert to useScroll({ container: ref }).\"\n )\n }\n\n return useScroll({ container: ref })\n}\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACG,SAAU,gBAAgB,CAAC,GAAkC,EAAA;IAC/D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;AACxC,QAAA,QAAQ,CACJ,KAAK,EACL,2EAA2E,CAC9E,CAAA;KACJ;IAED,OAAO,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAA;AACxC;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs new file mode 100644 index 00000000..0c9dcbe9 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs @@ -0,0 +1,15 @@ +import { warnOnce } from 'motion-utils'; +import { useScroll } from '../use-scroll.mjs'; + +/** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ +function useViewportScroll() { + if (process.env.NODE_ENV !== "production") { + warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); + } + return useScroll(); +} + +export { useViewportScroll }; +//# sourceMappingURL=use-viewport-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map new file mode 100644 index 00000000..49767bbd --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/scroll/use-viewport-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-viewport-scroll.mjs","sources":["../../../../src/value/scroll/use-viewport-scroll.ts"],"sourcesContent":["import { warnOnce } from \"motion-utils\"\nimport { useScroll } from \"../use-scroll\"\n\n/**\n * @deprecated useViewportScroll is deprecated. Convert to useScroll()\n */\nexport function useViewportScroll() {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"useViewportScroll is deprecated. Convert to useScroll().\"\n )\n }\n return useScroll()\n}\n"],"names":[],"mappings":";;;AAGA;;AAEG;SACa,iBAAiB,GAAA;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AACvC,QAAA,QAAQ,CACJ,KAAK,EACL,0DAA0D,CAC7D,CAAA;KACJ;IACD,OAAO,SAAS,EAAE,CAAA;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs new file mode 100644 index 00000000..fc34d544 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs @@ -0,0 +1,39 @@ +"use client"; +import { cancelFrame, frame } from 'motion-dom'; +import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; + +function useCombineMotionValues(values, combineValues) { + /** + * Initialise the returned motion value. This remains the same between renders. + */ + const value = useMotionValue(combineValues()); + /** + * Create a function that will update the template motion value with the latest values. + * This is pre-bound so whenever a motion value updates it can schedule its + * execution in Framesync. If it's already been scheduled it won't be fired twice + * in a single frame. + */ + const updateValue = () => value.set(combineValues()); + /** + * Synchronously update the motion value with the latest values during the render. + * This ensures that within a React render, the styles applied to the DOM are up-to-date. + */ + updateValue(); + /** + * Subscribe to all motion values found within the template. Whenever any of them change, + * schedule an update. + */ + useIsomorphicLayoutEffect(() => { + const scheduleUpdate = () => frame.preRender(updateValue, false, true); + const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); + return () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(updateValue); + }; + }); + return value; +} + +export { useCombineMotionValues }; +//# sourceMappingURL=use-combine-values.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map new file mode 100644 index 00000000..59e6e6a7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-combine-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-combine-values.mjs","sources":["../../../src/value/use-combine-values.ts"],"sourcesContent":["\"use client\"\n\nimport { cancelFrame, frame, MotionValue } from \"motion-dom\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useCombineMotionValues(\n values: MotionValue[],\n combineValues: () => R\n) {\n /**\n * Initialise the returned motion value. This remains the same between renders.\n */\n const value = useMotionValue(combineValues())\n\n /**\n * Create a function that will update the template motion value with the latest values.\n * This is pre-bound so whenever a motion value updates it can schedule its\n * execution in Framesync. If it's already been scheduled it won't be fired twice\n * in a single frame.\n */\n const updateValue = () => value.set(combineValues())\n\n /**\n * Synchronously update the motion value with the latest values during the render.\n * This ensures that within a React render, the styles applied to the DOM are up-to-date.\n */\n updateValue()\n\n /**\n * Subscribe to all motion values found within the template. Whenever any of them change,\n * schedule an update.\n */\n useIsomorphicLayoutEffect(() => {\n const scheduleUpdate = () => frame.preRender(updateValue, false, true)\n const subscriptions = values.map((v) => v.on(\"change\", scheduleUpdate))\n\n return () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(updateValue)\n }\n })\n\n return value\n}\n"],"names":[],"mappings":";;;;;AAMgB;AAIZ;;AAEG;AACH;AAEA;;;;;AAKG;AACH;AAEA;;;AAGG;AACH;AAEA;;;AAGG;;AAEC;;AAGA;;;AAGA;AACJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-computed.mjs b/node_modules/framer-motion/dist/es/value/use-computed.mjs new file mode 100644 index 00000000..1e85b4ee --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-computed.mjs @@ -0,0 +1,21 @@ +"use client"; +import { collectMotionValues } from 'motion-dom'; +import { useCombineMotionValues } from './use-combine-values.mjs'; + +function useComputed(compute) { + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * will be saved into this array. + */ + collectMotionValues.current = []; + compute(); + const value = useCombineMotionValues(collectMotionValues.current, compute); + /** + * Synchronously close session of collectMotionValues. + */ + collectMotionValues.current = undefined; + return value; +} + +export { useComputed }; +//# sourceMappingURL=use-computed.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-computed.mjs.map b/node_modules/framer-motion/dist/es/value/use-computed.mjs.map new file mode 100644 index 00000000..f8ada626 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-computed.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-computed.mjs","sources":["../../../src/value/use-computed.ts"],"sourcesContent":["\"use client\"\n\nimport { collectMotionValues, type MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\nexport function useComputed(compute: () => O): MotionValue {\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * will be saved into this array.\n */\n collectMotionValues.current = []\n\n compute()\n\n const value = useCombineMotionValues(collectMotionValues.current, compute)\n\n /**\n * Synchronously close session of collectMotionValues.\n */\n collectMotionValues.current = undefined\n\n return value\n}\n"],"names":[],"mappings":";;;;AAKM;AACF;;;AAGG;AACH;AAEA;;AAIA;;AAEG;AACH;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs new file mode 100644 index 00000000..29cb0d24 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs @@ -0,0 +1,23 @@ +"use client"; +import { attachFollow, isMotionValue } from 'motion-dom'; +import { useContext, useInsertionEffect } from 'react'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; +import { useTransform } from './use-transform.mjs'; + +function useFollowValue(source, options = {}) { + const { isStatic } = useContext(MotionConfigContext); + const getFromSource = () => (isMotionValue(source) ? source.get() : source); + // isStatic will never change, allowing early hooks return + if (isStatic) { + return useTransform(getFromSource); + } + const value = useMotionValue(getFromSource()); + useInsertionEffect(() => { + return attachFollow(value, source, options); + }, [value, JSON.stringify(options)]); + return value; +} + +export { useFollowValue }; +//# sourceMappingURL=use-follow-value.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map new file mode 100644 index 00000000..bb1ef6cc --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-follow-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-follow-value.mjs","sources":["../../../src/value/use-follow-value.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n attachFollow,\n FollowValueOptions,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { useContext, useInsertionEffect } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state.\n *\n * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition\n * including spring, tween, inertia, and keyframes.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * // Spring animation (default)\n * const x = useFollowValue(0, { stiffness: 300 })\n *\n * // Tween animation\n * const y = useFollowValue(0, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n *\n * // Track another MotionValue with spring\n * const source = useMotionValue(0)\n * const z = useFollowValue(source, { type: \"spring\", damping: 10 })\n *\n * // Inertia animation\n * const w = useFollowValue(0, { type: \"inertia\", velocity: 100 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition.\n * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: string,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: number,\n options?: FollowValueOptions\n): MotionValue\nexport function useFollowValue(\n source: MotionValue | MotionValue | AnyResolvedKeyframe,\n options: FollowValueOptions = {}\n) {\n const { isStatic } = useContext(MotionConfigContext)\n const getFromSource = () => (isMotionValue(source) ? source.get() : source)\n\n // isStatic will never change, allowing early hooks return\n if (isStatic) {\n return useTransform(getFromSource)\n }\n\n const value = useMotionValue(getFromSource())\n\n useInsertionEffect(() => {\n return attachFollow(value, source, options)\n }, [value, JSON.stringify(options)])\n\n return value\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAuEQ;;AAGJ;;;AAIA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs new file mode 100644 index 00000000..347d4199 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs @@ -0,0 +1,54 @@ +"use client"; +import { invariant, warning } from 'motion-utils'; +import { useContext } from 'react'; +import { MotionContext } from '../context/MotionContext/index.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; +import { useTransform } from './use-transform.mjs'; + +// Keep things reasonable and avoid scale: Infinity. In practise we might need +// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] +// to simply hide content at unreasonable scales. +const maxScale = 100000; +const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; +let hasWarned = false; +/** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ +function useInvertedScale(scale) { + let parentScaleX = useMotionValue(1); + let parentScaleY = useMotionValue(1); + const { visualElement } = useContext(MotionContext); + invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); + warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); + hasWarned = true; + if (scale) { + parentScaleX = scale.scaleX || parentScaleX; + parentScaleY = scale.scaleY || parentScaleY; + } + else if (visualElement) { + parentScaleX = visualElement.getValue("scaleX", 1); + parentScaleY = visualElement.getValue("scaleY", 1); + } + const scaleX = useTransform(parentScaleX, invertScale); + const scaleY = useTransform(parentScaleY, invertScale); + return { scaleX, scaleY }; +} + +export { invertScale, useInvertedScale }; +//# sourceMappingURL=use-inverted-scale.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map new file mode 100644 index 00000000..b9ef57be --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-inverted-scale.mjs","sources":["../../../src/value/use-inverted-scale.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue } from \"motion-dom\"\nimport { invariant, warning } from \"motion-utils\"\nimport { useContext } from \"react\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\ninterface ScaleMotionValues {\n scaleX: MotionValue\n scaleY: MotionValue\n}\n\n// Keep things reasonable and avoid scale: Infinity. In practise we might need\n// to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1]\n// to simply hide content at unreasonable scales.\nconst maxScale = 100000\nexport const invertScale = (scale: number) =>\n scale > 0.001 ? 1 / scale : maxScale\n\nlet hasWarned = false\n\n/**\n * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse\n * of their respective parent scales.\n *\n * This is useful for undoing the distortion of content when scaling a parent component.\n *\n * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent.\n * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output\n * of those instead.\n *\n * ```jsx\n * const MyComponent = () => {\n * const { scaleX, scaleY } = useInvertedScale()\n * return \n * }\n * ```\n *\n * @deprecated\n */\nexport function useInvertedScale(\n scale?: Partial\n): ScaleMotionValues {\n let parentScaleX = useMotionValue(1)\n let parentScaleY = useMotionValue(1)\n const { visualElement } = useContext(MotionContext)\n\n invariant(\n !!(scale || visualElement),\n \"If no scale values are provided, useInvertedScale must be used within a child of another motion component.\"\n )\n\n warning(\n hasWarned,\n \"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead.\"\n )\n\n hasWarned = true\n\n if (scale) {\n parentScaleX = scale.scaleX || parentScaleX\n parentScaleY = scale.scaleY || parentScaleY\n } else if (visualElement) {\n parentScaleX = visualElement.getValue(\"scaleX\", 1)\n parentScaleY = visualElement.getValue(\"scaleY\", 1)\n }\n\n const scaleX = useTransform(parentScaleX, invertScale)\n const scaleY = useTransform(parentScaleY, invertScale)\n\n return { scaleX, scaleY }\n}\n"],"names":[],"mappings":";;;;;;;AAcA;AACA;AACA;AACA;;AAIA;AAEA;;;;;;;;;;;;;;;;;;AAkBG;AACG;AAGF;AACA;;;AAQA;;;AAQI;AACA;;;;;;;;AASJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs new file mode 100644 index 00000000..9654b0d2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs @@ -0,0 +1,47 @@ +"use client"; +import { isMotionValue } from 'motion-dom'; +import { useCombineMotionValues } from './use-combine-values.mjs'; + +/** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ +function useMotionTemplate(fragments, ...values) { + /** + * Create a function that will build a string from the latest motion values. + */ + const numFragments = fragments.length; + function buildValue() { + let output = ``; + for (let i = 0; i < numFragments; i++) { + output += fragments[i]; + const value = values[i]; + if (value) { + output += isMotionValue(value) ? value.get() : value; + } + } + return output; + } + return useCombineMotionValues(values.filter(isMotionValue), buildValue); +} + +export { useMotionTemplate }; +//# sourceMappingURL=use-motion-template.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map new file mode 100644 index 00000000..ebd693d6 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-template.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-template.mjs","sources":["../../../src/value/use-motion-template.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue, MotionValue } from \"motion-dom\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\n\n/**\n * Combine multiple motion values into a new one using a string template literal.\n *\n * ```jsx\n * import {\n * motion,\n * useSpring,\n * useMotionValue,\n * useMotionTemplate\n * } from \"framer-motion\"\n *\n * function Component() {\n * const shadowX = useSpring(0)\n * const shadowY = useMotionValue(0)\n * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport function useMotionTemplate(\n fragments: TemplateStringsArray,\n ...values: Array\n) {\n /**\n * Create a function that will build a string from the latest motion values.\n */\n const numFragments = fragments.length\n\n function buildValue() {\n let output = ``\n\n for (let i = 0; i < numFragments; i++) {\n output += fragments[i]\n const value = values[i]\n if (value) {\n output += isMotionValue(value) ? value.get() : value\n }\n }\n\n return output\n }\n\n return useCombineMotionValues(values.filter(isMotionValue), buildValue)\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;;AAqBG;;AAKC;;AAEG;AACH;AAEA;;AAGI;AACI;AACA;;AAEI;;;AAIR;;;AAIR;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs new file mode 100644 index 00000000..119b29e7 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs @@ -0,0 +1,40 @@ +"use client"; +import { motionValue } from 'motion-dom'; +import { useContext, useState, useEffect } from 'react'; +import { MotionConfigContext } from '../context/MotionConfigContext.mjs'; +import { useConstant } from '../utils/use-constant.mjs'; + +/** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ +function useMotionValue(initial) { + const value = useConstant(() => motionValue(initial)); + /** + * If this motion value is being used in static mode, like on + * the Framer canvas, force components to rerender when the motion + * value is updated. + */ + const { isStatic } = useContext(MotionConfigContext); + if (isStatic) { + const [, setLatest] = useState(initial); + useEffect(() => value.on("change", setLatest), []); + } + return value; +} + +export { useMotionValue }; +//# sourceMappingURL=use-motion-value.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map new file mode 100644 index 00000000..8dcf9a5f --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-motion-value.mjs","sources":["../../../src/value/use-motion-value.ts"],"sourcesContent":["\"use client\"\n\nimport { motionValue, MotionValue } from \"motion-dom\"\nimport { useContext, useEffect, useState } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useConstant } from \"../utils/use-constant\"\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return \n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nexport function useMotionValue(initial: T): MotionValue {\n const value = useConstant(() => motionValue(initial))\n\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext)\n if (isStatic) {\n const [, setLatest] = useState(initial)\n useEffect(() => value.on(\"change\", setLatest), [])\n }\n\n return value\n}\n"],"names":[],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;AAgBG;AACG;AACF;AAEA;;;;AAIG;;;;AAIC;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-scroll.mjs b/node_modules/framer-motion/dist/es/value/use-scroll.mjs new file mode 100644 index 00000000..2b4f30db --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-scroll.mjs @@ -0,0 +1,78 @@ +"use client"; +import { motionValue } from 'motion-dom'; +import { invariant } from 'motion-utils'; +import { useRef, useCallback, useEffect } from 'react'; +import { scroll } from '../render/dom/scroll/index.mjs'; +import { canUseNativeTimeline } from '../render/dom/scroll/utils/can-use-native-timeline.mjs'; +import { useConstant } from '../utils/use-constant.mjs'; +import { useIsomorphicLayoutEffect } from '../utils/use-isomorphic-effect.mjs'; + +const createScrollMotionValues = () => ({ + scrollX: motionValue(0), + scrollY: motionValue(0), + scrollXProgress: motionValue(0), + scrollYProgress: motionValue(0), +}); +const isRefPending = (ref) => { + if (!ref) + return false; + return !ref.current; +}; +function makeAccelerateConfig(axis, options, container) { + return { + factory: (animation) => scroll(animation, { ...options, axis, container }), + times: [0, 1], + keyframes: [0, 1], + ease: (v) => v, + duration: 1, + }; +} +function useScroll({ container, target, ...options } = {}) { + const values = useConstant(createScrollMotionValues); + if (!target && canUseNativeTimeline()) { + const resolvedContainer = container?.current || undefined; + values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, resolvedContainer); + values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, resolvedContainer); + } + const scrollAnimation = useRef(null); + const needsStart = useRef(false); + const start = useCallback(() => { + scrollAnimation.current = scroll((_progress, { x, y, }) => { + values.scrollX.set(x.current); + values.scrollXProgress.set(x.progress); + values.scrollY.set(y.current); + values.scrollYProgress.set(y.progress); + }, { + ...options, + container: container?.current || undefined, + target: target?.current || undefined, + }); + return () => { + scrollAnimation.current?.(); + }; + }, [container, target, JSON.stringify(options.offset)]); + useIsomorphicLayoutEffect(() => { + needsStart.current = false; + if (isRefPending(container) || isRefPending(target)) { + needsStart.current = true; + return; + } + else { + return start(); + } + }, [start]); + useEffect(() => { + if (needsStart.current) { + invariant(!isRefPending(container), "Container ref is defined but not hydrated", "use-scroll-ref"); + invariant(!isRefPending(target), "Target ref is defined but not hydrated", "use-scroll-ref"); + return start(); + } + else { + return; + } + }, [start]); + return values; +} + +export { useScroll }; +//# sourceMappingURL=use-scroll.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map b/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map new file mode 100644 index 00000000..292df011 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-scroll.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-scroll.mjs","sources":["../../../src/value/use-scroll.ts"],"sourcesContent":["\"use client\"\n\nimport { AnimationPlaybackControls, motionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { RefObject, useCallback, useEffect, useRef } from \"react\"\nimport { scroll } from \"../render/dom/scroll\"\nimport { ScrollInfoOptions } from \"../render/dom/scroll/types\"\nimport { canUseNativeTimeline } from \"../render/dom/scroll/utils/can-use-native-timeline\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../utils/use-isomorphic-effect\"\n\nexport interface UseScrollOptions\n extends Omit {\n container?: RefObject\n target?: RefObject\n}\n\nconst createScrollMotionValues = () => ({\n scrollX: motionValue(0),\n scrollY: motionValue(0),\n scrollXProgress: motionValue(0),\n scrollYProgress: motionValue(0),\n})\n\nconst isRefPending = (ref?: RefObject) => {\n if (!ref) return false\n return !ref.current\n}\n\nfunction makeAccelerateConfig(\n axis: \"x\" | \"y\",\n options: Omit,\n container?: Element\n) {\n return {\n factory: (animation: AnimationPlaybackControls) =>\n scroll(animation, { ...options, axis, container }),\n times: [0, 1],\n keyframes: [0, 1],\n ease: (v: number) => v,\n duration: 1,\n }\n}\n\nexport function useScroll({\n container,\n target,\n ...options\n}: UseScrollOptions = {}) {\n const values = useConstant(createScrollMotionValues)\n\n if (!target && canUseNativeTimeline()) {\n const resolvedContainer = container?.current || undefined\n values.scrollXProgress.accelerate = makeAccelerateConfig(\n \"x\",\n options,\n resolvedContainer\n )\n values.scrollYProgress.accelerate = makeAccelerateConfig(\n \"y\",\n options,\n resolvedContainer\n )\n }\n\n const scrollAnimation = useRef(null)\n const needsStart = useRef(false)\n\n const start = useCallback(() => {\n scrollAnimation.current = scroll(\n (\n _progress: number,\n {\n x,\n y,\n }: {\n x: { current: number; progress: number }\n y: { current: number; progress: number }\n }\n ) => {\n values.scrollX.set(x.current)\n values.scrollXProgress.set(x.progress)\n values.scrollY.set(y.current)\n values.scrollYProgress.set(y.progress)\n },\n {\n ...options,\n container: container?.current || undefined,\n target: target?.current || undefined,\n }\n )\n\n return () => {\n scrollAnimation.current?.()\n }\n }, [container, target, JSON.stringify(options.offset)])\n\n useIsomorphicLayoutEffect(() => {\n needsStart.current = false\n\n if (isRefPending(container) || isRefPending(target)) {\n needsStart.current = true\n return\n } else {\n return start()\n }\n }, [start])\n\n useEffect(() => {\n if (needsStart.current) {\n invariant(\n !isRefPending(container),\n \"Container ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n invariant(\n !isRefPending(target),\n \"Target ref is defined but not hydrated\",\n \"use-scroll-ref\"\n )\n return start()\n } else {\n return\n }\n }, [start])\n\n return values\n}\n"],"names":[],"mappings":";;;;;;;;;AAiBA;AACI;AACA;AACA;AACA;AACH;AAED;AACI;AAAU;AACV;AACJ;AAEA;;AAMQ;AAEA;AACA;AACA;AACA;;AAER;AAEM;AAKF;AAEA;AACI;AACA;AAKA;;AAOJ;AACA;AAEA;AACI;;;;;AAeI;AAEI;AACA;AACA;AACH;AAGL;AACI;AACJ;AACJ;;AAGI;;AAGI;;;;;;AAKR;;AAGI;;;;;;;;AAeJ;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-spring.mjs b/node_modules/framer-motion/dist/es/value/use-spring.mjs new file mode 100644 index 00000000..225081a1 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-spring.mjs @@ -0,0 +1,9 @@ +"use client"; +import { useFollowValue } from './use-follow-value.mjs'; + +function useSpring(source, options = {}) { + return useFollowValue(source, { type: "spring", ...options }); +} + +export { useSpring }; +//# sourceMappingURL=use-spring.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-spring.mjs.map b/node_modules/framer-motion/dist/es/value/use-spring.mjs.map new file mode 100644 index 00000000..4be7cea4 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-spring.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-spring.mjs","sources":["../../../src/value/use-spring.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: string,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: number,\n options?: SpringOptions\n): MotionValue\nexport function useSpring(\n source: MotionValue | MotionValue | string | number,\n options: SpringOptions = {}\n): MotionValue | MotionValue {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;;;AA4CI;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-time.mjs b/node_modules/framer-motion/dist/es/value/use-time.mjs new file mode 100644 index 00000000..74ec85a2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-time.mjs @@ -0,0 +1,12 @@ +"use client"; +import { useAnimationFrame } from '../utils/use-animation-frame.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; + +function useTime() { + const time = useMotionValue(0); + useAnimationFrame((t) => time.set(t)); + return time; +} + +export { useTime }; +//# sourceMappingURL=use-time.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-time.mjs.map b/node_modules/framer-motion/dist/es/value/use-time.mjs.map new file mode 100644 index 00000000..c733bbaa --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-time.mjs","sources":["../../../src/value/use-time.ts"],"sourcesContent":["\"use client\"\n\nimport { useAnimationFrame } from \"../utils/use-animation-frame\"\nimport { useMotionValue } from \"./use-motion-value\"\n\nexport function useTime() {\n const time = useMotionValue(0)\n useAnimationFrame((t) => time.set(t))\n return time\n}\n"],"names":[],"mappings":";;;;;AAMI;AACA;AACA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-transform.mjs b/node_modules/framer-motion/dist/es/value/use-transform.mjs new file mode 100644 index 00000000..156168eb --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-transform.mjs @@ -0,0 +1,70 @@ +"use client"; +import { transform } from 'motion-dom'; +import { useConstant } from '../utils/use-constant.mjs'; +import { useCombineMotionValues } from './use-combine-values.mjs'; +import { useComputed } from './use-computed.mjs'; + +function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { + if (typeof input === "function") { + return useComputed(input); + } + /** + * Detect if outputRangeOrMap is an output map (object with keys) + * rather than an output range (array). + */ + const isOutputMap = outputRangeOrMap !== undefined && + !Array.isArray(outputRangeOrMap) && + typeof inputRangeOrTransformer !== "function"; + if (isOutputMap) { + return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); + } + const outputRange = outputRangeOrMap; + const transformer = typeof inputRangeOrTransformer === "function" + ? inputRangeOrTransformer + : transform(inputRangeOrTransformer, outputRange, options); + const result = Array.isArray(input) + ? useListTransform(input, transformer) + : useListTransform([input], ([latest]) => transformer(latest)); + const inputAccelerate = !Array.isArray(input) + ? input.accelerate + : undefined; + if (inputAccelerate && + !inputAccelerate.isTransformed && + typeof inputRangeOrTransformer !== "function" && + Array.isArray(outputRangeOrMap) && + options?.clamp !== false) { + result.accelerate = { + ...inputAccelerate, + times: inputRangeOrTransformer, + keyframes: outputRangeOrMap, + isTransformed: true, + ...(options?.ease ? { ease: options.ease } : {}), + }; + } + return result; +} +function useListTransform(values, transformer) { + const latest = useConstant(() => []); + return useCombineMotionValues(values, () => { + latest.length = 0; + const numValues = values.length; + for (let i = 0; i < numValues; i++) { + latest[i] = values[i].get(); + } + return transformer(latest); + }); +} +function useMapTransform(inputValue, inputRange, outputMap, options) { + /** + * Capture keys once to ensure hooks are called in consistent order. + */ + const keys = useConstant(() => Object.keys(outputMap)); + const output = useConstant(() => ({})); + for (const key of keys) { + output[key] = useTransform(inputValue, inputRange, outputMap[key], options); + } + return output; +} + +export { useTransform }; +//# sourceMappingURL=use-transform.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-transform.mjs.map b/node_modules/framer-motion/dist/es/value/use-transform.mjs.map new file mode 100644 index 00000000..bec93641 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-transform.mjs","sources":["../../../src/value/use-transform.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n MotionValue,\n transform,\n TransformOptions,\n} from \"motion-dom\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { useCombineMotionValues } from \"./use-combine-values\"\nimport { useComputed } from \"./use-computed\"\n\nexport type InputRange = number[]\ntype SingleTransformer = (input: I) => O\ntype MultiTransformer = (input: I[]) => O\ntype Transformer =\n | SingleTransformer\n /**\n * Ideally, this would be typed in all instances, but to type this\n * more accurately requires the tuple support in TypeScript 4:\n * https://gist.github.com/InventingWithMonster/c4d23752a0fae7888596c4ff6d92733a\n */\n | MultiTransformer\n\ninterface OutputMap {\n [key: string]: O[]\n}\n\n/**\n * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges.\n *\n * @remarks\n *\n * This is useful when you want to derive multiple values from a single input value.\n * The keys of the output map must remain constant across renders.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const { opacity, scale } = useTransform(x, [0, 100], {\n * opacity: [0, 1],\n * scale: [0.5, 1]\n * })\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`.\n * @param options - Transform options applied to all outputs\n *\n * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue`\n *\n * @public\n */\nexport function useTransform>(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: T,\n options?: TransformOptions\n): { [K in keyof T]: MotionValue }\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = useTransform(x, xRange, opacityRange)\n *\n * return (\n * \n * )\n * }\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n value: MotionValue,\n inputRange: InputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue\n\n/**\n * Create a `MotionValue` that transforms the output of another `MotionValue` through a function.\n * In this example, `y` will always be double `x`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(10)\n * const y = useTransform(x, value => value * 2)\n *\n * return \n * }\n * ```\n *\n * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest value from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input: MotionValue,\n transformer: SingleTransformer\n): MotionValue\n\n/**\n * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY)\n *\n * return \n * }\n * ```\n *\n * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`.\n * @param transform - A function that accepts the latest values from `input` and returns a new value.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useTransform(\n input:\n | MotionValue[]\n | MotionValue[]\n | MotionValue[],\n transformer: MultiTransformer\n): MotionValue\nexport function useTransform(transformer: () => O): MotionValue\n\nexport function useTransform(\n input:\n | MotionValue\n | MotionValue[]\n | MotionValue[]\n | MotionValue[]\n | (() => O),\n inputRangeOrTransformer?: InputRange | Transformer,\n outputRangeOrMap?: O[] | OutputMap,\n options?: TransformOptions\n): MotionValue | { [key in K]: MotionValue } {\n if (typeof input === \"function\") {\n return useComputed(input)\n }\n\n /**\n * Detect if outputRangeOrMap is an output map (object with keys)\n * rather than an output range (array).\n */\n const isOutputMap =\n outputRangeOrMap !== undefined &&\n !Array.isArray(outputRangeOrMap) &&\n typeof inputRangeOrTransformer !== \"function\"\n\n if (isOutputMap) {\n return useMapTransform(\n input as MotionValue,\n inputRangeOrTransformer as InputRange,\n outputRangeOrMap as OutputMap,\n options\n ) as { [key in K]: MotionValue }\n }\n\n const outputRange = outputRangeOrMap as O[] | undefined\n const transformer =\n typeof inputRangeOrTransformer === \"function\"\n ? inputRangeOrTransformer\n : transform(inputRangeOrTransformer!, outputRange!, options)\n\n const result = Array.isArray(input)\n ? useListTransform(\n input,\n transformer as MultiTransformer\n )\n : useListTransform([input], ([latest]) =>\n (transformer as SingleTransformer)(latest)\n )\n\n const inputAccelerate = !Array.isArray(input)\n ? (input as MotionValue).accelerate\n : undefined\n\n if (\n inputAccelerate &&\n !inputAccelerate.isTransformed &&\n typeof inputRangeOrTransformer !== \"function\" &&\n Array.isArray(outputRangeOrMap) &&\n options?.clamp !== false\n ) {\n result.accelerate = {\n ...inputAccelerate,\n times: inputRangeOrTransformer as number[],\n keyframes: outputRangeOrMap,\n isTransformed: true,\n ...(options?.ease ? { ease: options.ease } : {}),\n }\n }\n\n return result\n}\n\nfunction useListTransform(\n values: MotionValue[],\n transformer: MultiTransformer\n): MotionValue {\n const latest = useConstant(() => [])\n\n return useCombineMotionValues(values, () => {\n latest.length = 0\n const numValues = values.length\n for (let i = 0; i < numValues; i++) {\n latest[i] = values[i].get()\n }\n\n return transformer(latest)\n })\n}\n\nfunction useMapTransform(\n inputValue: MotionValue,\n inputRange: InputRange,\n outputMap: OutputMap,\n options?: TransformOptions\n): { [key: string]: MotionValue } {\n /**\n * Capture keys once to ensure hooks are called in consistent order.\n */\n const keys = useConstant(() => Object.keys(outputMap))\n const output = useConstant<{ [key: string]: MotionValue }>(() => ({}))\n\n for (const key of keys) {\n output[key] = useTransform(inputValue, inputRange, outputMap[key], options)\n }\n\n return output\n}\n"],"names":[],"mappings":";;;;;;AA2KM;AAWF;AACI;;AAGJ;;;AAGG;AACH;AAEI;;;;;;AAaJ;AAEQ;;AAGR;AACI;AAIA;;;;AAQJ;;;AAII;AACA;;AAGI;AACA;AACA;AACA;AACA;;;AAIR;AACJ;AAEA;;AAMI;AACI;AACA;AACA;;;AAIA;AACJ;AACJ;AAEA;AAMI;;AAEG;AACH;;AAGA;AACI;;AAGJ;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-velocity.mjs b/node_modules/framer-motion/dist/es/value/use-velocity.mjs new file mode 100644 index 00000000..70a9d193 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-velocity.mjs @@ -0,0 +1,37 @@ +"use client"; +import { frame } from 'motion-dom'; +import { useMotionValueEvent } from '../utils/use-motion-value-event.mjs'; +import { useMotionValue } from './use-motion-value.mjs'; + +/** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ +function useVelocity(value) { + const velocity = useMotionValue(value.getVelocity()); + const updateVelocity = () => { + const latest = value.getVelocity(); + velocity.set(latest); + /** + * If we still have velocity, schedule an update for the next frame + * to keep checking until it is zero. + */ + if (latest) + frame.update(updateVelocity); + }; + useMotionValueEvent(value, "change", () => { + // Schedule an update to this value at the end of the current frame. + frame.update(updateVelocity, false, true); + }); + return velocity; +} + +export { useVelocity }; +//# sourceMappingURL=use-velocity.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map b/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map new file mode 100644 index 00000000..df80afed --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-velocity.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"use-velocity.mjs","sources":["../../../src/value/use-velocity.ts"],"sourcesContent":["\"use client\"\n\nimport { frame, MotionValue } from \"motion-dom\"\nimport { useMotionValueEvent } from \"../utils/use-motion-value-event\"\nimport { useMotionValue } from \"./use-motion-value\"\n/**\n * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes.\n *\n * ```javascript\n * const x = useMotionValue(0)\n * const xVelocity = useVelocity(x)\n * const xAcceleration = useVelocity(xVelocity)\n * ```\n *\n * @public\n */\nexport function useVelocity(value: MotionValue): MotionValue {\n const velocity = useMotionValue(value.getVelocity())\n\n const updateVelocity = () => {\n const latest = value.getVelocity()\n velocity.set(latest)\n\n /**\n * If we still have velocity, schedule an update for the next frame\n * to keep checking until it is zero.\n */\n if (latest) frame.update(updateVelocity)\n }\n\n useMotionValueEvent(value, \"change\", () => {\n // Schedule an update to this value at the end of the current frame.\n frame.update(updateVelocity, false, true)\n })\n\n return velocity\n}\n"],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;AAUG;AACG;;;AAIE;AACA;AAEA;;;AAGG;AACH;AAAY;AAChB;AAEA;;;AAGA;AAEA;AACJ;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs new file mode 100644 index 00000000..b5ba18bf --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs @@ -0,0 +1,20 @@ +import { MotionValue, transformProps, acceleratedValues } from 'motion-dom'; + +class WillChangeMotionValue extends MotionValue { + constructor() { + super(...arguments); + this.isEnabled = false; + } + add(name) { + if (transformProps.has(name) || acceleratedValues.has(name)) { + this.isEnabled = true; + this.update(); + } + } + update() { + this.set(this.isEnabled ? "transform" : "auto"); + } +} + +export { WillChangeMotionValue }; +//# sourceMappingURL=WillChangeMotionValue.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map new file mode 100644 index 00000000..5f7978fd --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/WillChangeMotionValue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"WillChangeMotionValue.mjs","sources":["../../../../src/value/use-will-change/WillChangeMotionValue.ts"],"sourcesContent":["import {\n acceleratedValues,\n MotionValue,\n transformProps,\n type WillChange,\n} from \"motion-dom\"\n\nexport class WillChangeMotionValue\n extends MotionValue\n implements WillChange\n{\n private isEnabled = false\n\n add(name: string) {\n if (transformProps.has(name) || acceleratedValues.has(name)) {\n this.isEnabled = true\n this.update()\n }\n }\n\n private update() {\n this.set(this.isEnabled ? \"transform\" : \"auto\")\n }\n}\n"],"names":[],"mappings":";;AAOM,MAAO,qBACT,SAAQ,WAAmB,CAAA;AAD/B,IAAA,WAAA,GAAA;;QAIY,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;KAY5B;AAVG,IAAA,GAAG,CAAC,IAAY,EAAA;AACZ,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzD,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;YACrB,IAAI,CAAC,MAAM,EAAE,CAAA;SAChB;KACJ;IAEO,MAAM,GAAA;AACV,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC,CAAA;KAClD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs new file mode 100644 index 00000000..f06ed5e2 --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs @@ -0,0 +1,10 @@ +"use client"; +import { useConstant } from '../../utils/use-constant.mjs'; +import { WillChangeMotionValue } from './WillChangeMotionValue.mjs'; + +function useWillChange() { + return useConstant(() => new WillChangeMotionValue("auto")); +} + +export { useWillChange }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map new file mode 100644 index 00000000..0944a7ce --- /dev/null +++ b/node_modules/framer-motion/dist/es/value/use-will-change/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/value/use-will-change/index.ts"],"sourcesContent":["\"use client\"\n\nimport type { WillChange } from \"motion-dom\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { WillChangeMotionValue } from \"./WillChangeMotionValue\"\n\nexport function useWillChange(): WillChange {\n return useConstant(() => new WillChangeMotionValue(\"auto\"))\n}\n"],"names":[],"mappings":";;;;;;AAQA;;"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/framer-motion.dev.js b/node_modules/framer-motion/dist/framer-motion.dev.js new file mode 100644 index 00000000..01b215bb --- /dev/null +++ b/node_modules/framer-motion/dist/framer-motion.dev.js @@ -0,0 +1,15809 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : + typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Motion = {}, global.React)); +})(this, (function (exports, React$1) { 'use strict'; + + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + } + n.default = e; + return Object.freeze(n); + } + + var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$1); + + // source: react/cjs/react-jsx-runtime.production.min.js + /** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + var f = React, + k = Symbol.for("react.element"), + l = Symbol.for("react.fragment"), + m$1 = Object.prototype.hasOwnProperty, + n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, + p = { key: !0, ref: !0, __self: !0, __source: !0 }; + function q(c, a, g) { + var b, + d = {}, + e = null, + h = null; + void 0 !== g && (e = "" + g); + void 0 !== a.key && (e = "" + a.key); + void 0 !== a.ref && (h = a.ref); + for (b in a) m$1.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]); + if (c && c.defaultProps) + for (b in ((a = c.defaultProps), a)) void 0 === d[b] && (d[b] = a[b]); + return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current } + } + const Fragment = l; + const jsx = q; + const jsxs = q; + + const LayoutGroupContext = React$1.createContext({}); + + /** + * Creates a constant value over the lifecycle of a component. + * + * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer + * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` + * you can ensure that initialisers don't execute twice or more. + */ + function useConstant(init) { + const ref = React$1.useRef(null); + if (ref.current === null) { + ref.current = init(); + } + return ref.current; + } + + const isBrowser$1 = typeof window !== "undefined"; + + const useIsomorphicLayoutEffect = isBrowser$1 ? React$1.useLayoutEffect : React$1.useEffect; + + /** + * @public + */ + const PresenceContext = + /* @__PURE__ */ React$1.createContext(null); + + function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); + } + function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); + } + // Adapted from array-move + function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; + } + + const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; + }; + + function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; + } + + exports.warning = () => { }; + exports.invariant = () => { }; + if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + exports.warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + exports.invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; + } + + const MotionGlobalConfig = {}; + + /** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ + const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + + function isObject(value) { + return typeof value === "object" && value !== null; + } + + /** + * Check if the value is a zero value string like "0px" or "0%" + */ + const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + + /*#__NO_SIDE_EFFECTS__*/ + function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const noop$1 = (any) => any; + + /** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ + const combineFunctions = (a, b) => (v) => b(a(v)); + const pipe = (...transformers) => transformers.reduce(combineFunctions); + + /* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. + + @param [number]: Lower limit + @param [number]: Upper limit + @param [number]: Value to find progress within given range + @return [number]: Progress of value within range as expressed 0-1 + */ + /*#__NO_SIDE_EFFECTS__*/ + const progress = (from, to, value) => { + const toFromDifference = to - from; + return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; + }; + + class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } + } + + /** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ + /*#__NO_SIDE_EFFECTS__*/ + const secondsToMilliseconds = (seconds) => seconds * 1000; + /*#__NO_SIDE_EFFECTS__*/ + const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + + /* + Convert velocity into velocity per second + + @param [number]: Unit per frame + @param [number]: Frame duration in ms + */ + function velocityPerSecond(velocity, frameDuration) { + return frameDuration ? velocity * (1000 / frameDuration) : 0; + } + + const warned = new Set(); + function hasWarned$1(message) { + return warned.has(message); + } + function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); + } + + const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; + }; + + /* + Bezier function generator + This has been modified from GaĆ«tan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... + */ + // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. + const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; + const subdivisionPrecision = 0.0000001; + const subdivisionMaxIterations = 12; + function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; + } + function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop$1; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); + } + + // Accepts an easing function and returns a new one that outputs mirrored values for + // the second half of the animation. Turns easeIn into easeInOut. + const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + + // Accepts an easing function and returns a new one that outputs reversed values. + // Turns easeIn into easeOut. + const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + + const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); + const backIn = /*@__PURE__*/ reverseEasing(backOut); + const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + + const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + + const circIn = (p) => 1 - Math.sin(Math.acos(p)); + const circOut = reverseEasing(circIn); + const circInOut = mirrorEasing(circIn); + + const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); + const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); + const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + + function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; + } + + const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; + }; + + function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; + } + + const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + + const easingLookup = { + linear: noop$1, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, + }; + const isValidEasing = (easing) => { + return typeof easing === "string"; + }; + const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; + }; + + const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute + ]; + + const statsBuffer = { + value: null, + addProjectionMetrics: null, + }; + + function createRenderStep(runNextFrame, stepName) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + let numCalls = 0; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + numCalls++; + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + if (!queue.has(callback)) + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + [thisFrame, nextFrame] = [nextFrame, thisFrame]; + // Execute this frame + thisFrame.forEach(triggerCallback); + /** + * If we're recording stats then + */ + if (stepName && statsBuffer.value) { + statsBuffer.value.frameloop[stepName].push(numCalls); + } + numCalls = 0; + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; + } + + const maxElapsed$1 = 40; + function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const timestamp = MotionGlobalConfig.useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!MotionGlobalConfig.useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed$1), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; + } + + const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop$1, true); + + let now; + function clearTime() { + now = undefined; + } + /** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ + const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, + }; + + const activeAnimations = { + layout: 0, + mainThread: 0, + waapi: 0, + }; + + const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); + const isCSSVariableName = + /*@__PURE__*/ checkStringStartsWith("--"); + const startsAsVariableToken = + /*@__PURE__*/ checkStringStartsWith("var(--"); + const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); + }; + const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; + /** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ + function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); + } + + const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, + }; + const alpha = { + ...number, + transform: (v) => clamp(0, 1, v), + }; + const scale = { + ...number, + default: 1, + }; + + // If this number is a decimal, make it just five decimal places + // to avoid exponents + const sanitize = (v) => Math.round(v * 100000) / 100000; + + const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + + function isNullish(v) { + return v == null; + } + + const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + + /** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ + const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); + }; + const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; + }; + + const clampRgbUnit = (v) => clamp(0, 255, v); + const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), + }; + const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", + }; + + function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; + } + const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, + }; + + /*#__NO_SIDE_EFFECTS__*/ + const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, + }); + const degrees = /*@__PURE__*/ createUnitType("deg"); + const percent = /*@__PURE__*/ createUnitType("%"); + const px = /*@__PURE__*/ createUnitType("px"); + const vh = /*@__PURE__*/ createUnitType("vh"); + const vw = /*@__PURE__*/ createUnitType("vw"); + const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), + }))(); + + const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, + }; + + const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, + }; + + const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + + function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); + } + const NUMBER_TOKEN = "number"; + const COLOR_TOKEN = "color"; + const VAR_TOKEN = "var"; + const VAR_FUNCTION_TOKEN = "var("; + const SPLIT_TOKEN = "${}"; + // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` + const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; + function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; + } + function parseComplexValue(v) { + return analyseComplexValue(v).values; + } + function createTransformer(source) { + const { split, types } = analyseComplexValue(source); + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; + } + const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; + function getAnimatableNone$1(v) { + const parsed = parseComplexValue(v); + const transformer = createTransformer(v); + return transformer(parsed.map(convertNumbersToZero)); + } + const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone: getAnimatableNone$1, + }; + + // Adapted from https://gist.github.com/mjackson/5311256 + function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; + } + + function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); + } + + /* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) + */ + const mixNumber$1 = (from, to, progress) => { + return from + (to - from) * progress; + }; + + // Linear color space blending + // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw + // Demonstrated http://codepen.io/osublake/pen/xGVVaN + const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); + }; + const colorTypes = [hex, rgba, hsla]; + const getColorType = (v) => colorTypes.find((type) => type.test(v)); + function asRGBA(color) { + const type = getColorType(color); + exports.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; + } + const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; + }; + + const invisibleValues = new Set(["none", "hidden"]); + /** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ + function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } + } + + function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); + } + function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; + } + function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; + } + function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; + } + function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; + } + const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + exports.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } + }; + + function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber$1(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); + } + + const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; + }; + + const generateLinearEasing = (easing, duration, // as milliseconds + resolution = 10 // as milliseconds + ) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; + }; + + /** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ + const maxGeneratorDuration = 20000; + function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; + } + + /** + * Create a progress => progress easing function from a generator. + */ + function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: millisecondsToSeconds(duration), + }; + } + + const velocitySampleDuration = 5; // ms + function calcGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return velocityPerSecond(current - resolveValue(prevT), t - prevT); + } + + const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, + }; + + const safeMin = 0.001; + function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + exports.warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } + } + const rootIterations = 12; + function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; + } + function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); + } + + const durationKeys = ["duration", "bounce"]; + const physicsKeys = ["stiffness", "damping", "mass"]; + function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); + } + function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring(options); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; + } + function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + if (dampingRatio < 1) { + const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq) * + Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + next: (t) => { + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + let currentVelocity = t === 0 ? initialVelocity : 0.0; + /** + * We only need to calculate velocity for under-damped springs + * as over- and critically-damped springs can't overshoot, so + * checking only for displacement is enough. + */ + if (dampingRatio < 1) { + currentVelocity = + t === 0 + ? secondsToMilliseconds(initialVelocity) + : calcGeneratorVelocity(resolveSpring, t, current); + } + const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; + const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; + state.done = + isBelowVelocityThreshold && isBelowDisplacementThreshold; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; + } + spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; + }; + + function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; + } + + function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || noop$1 : ease; + mixer = pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; + } + /** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ + function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + exports.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) + : interpolator; + } + + function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = progress(0, remaining, i); + offset.push(mixNumber$1(min, 1, offsetProgress)); + } + } + + function defaultOffset$1(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; + } + + function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); + } + + function defaultEasing(values, easing) { + return values.map(() => easing || easeInOut).splice(0, values.length - 1); + } + function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = isEasingArray(ease) + ? ease.map(easingDefinitionToFunction) + : easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset$1(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; + } + + const isNotNull$1 = (value) => value !== null; + function getFinalKeyframe$1(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull$1); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; + } + + const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, + }; + function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } + } + + class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } + } + + const percentToProgress = (percent) => percent / 100; + class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + activeAnimations.mainThread++; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (generatorFactory !== keyframes) { + exports.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + const state = isInDelayPhase + ? { done: false, value: keyframes[0] } + : frameGenerator.next(elapsed); + if (mixKeyframes) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe$1(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + this.driver?.start(false); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + this.updateTime(time.now()); + const hasChanged = this.playbackSpeed !== newSpeed; + this.playbackSpeed = newSpeed; + if (hasChanged) { + this.time = millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + activeAnimations.mainThread--; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } + } + // Legacy function support + function animateValue(options) { + return new JSAnimation(options); + } + + function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } + } + + const radToDeg = (rad) => (rad * 180) / Math.PI; + const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); + }; + const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, + }; + const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; + }; + const rotateZ = rotate; + const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); + const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); + const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, + }; + function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; + } + function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; + } + const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); + }; + function convertTransformToNumber(value) { + return parseFloat(value.trim()); + } + + /** + * Generate a list of every possible transform key. + */ + const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", + ]; + /** + * A quick lookup for transform props. + */ + const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))(); + + const isNumOrPxType = (v) => v === number || v === px; + const transformKeys = new Set(["x", "y", "z"]); + const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); + function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; + } + const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight), + height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom), + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), + }; + // Alias translate longform names + positionalValues.translateX = positionalValues.x; + positionalValues.translateY = positionalValues.y; + + const toResolve = new Set(); + let isScheduled = false; + let anyNeedsMeasurement = false; + let isForced = false; + function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); + } + function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); + } + function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; + } + class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } + } + + const isCSSVar = (name) => name.startsWith("--"); + + function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); + } + + /** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ + const supportsFlags = {}; + + function memoSupports(callback, supportsFlag) { + const memoized = memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); + } + + const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); + + const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; + }, "linearEasing"); + + const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + + const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), + }; + + function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } + } + + function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + if (statsBuffer.value) { + activeAnimations.waapi++; + } + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + const animation = element.animate(keyframeOptions, options); + if (statsBuffer.value) { + animation.finished.finally(() => { + activeAnimations.waapi--; + }); + } + return animation; + } + + function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; + } + + function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; + } + + /** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ + class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + exports.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe$1(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + else { + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + */ + setStyle(element, name, keyframe); + } + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = secondsToMilliseconds(newTime); + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, observe }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + return noop$1; + } + else { + return observe(this); + } + } + } + + const unsupportedEasingFunctions = { + anticipate, + backInOut, + circInOut, + }; + function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; + } + function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } + } + + /** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ + const sampleDelta = 10; //ms + class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + if (options.startTime !== undefined) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta); + sampleAnimation.stop(); + } + } + + /** + * Check if a value is animatable. Examples: + * + * āœ…: 100, "100px", "#fff" + * āŒ: "block", "url(2.jpg)" + * @param value + * + * @internal + */ + const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; + }; + + function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } + } + function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + exports.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); + } + + function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; + } + + /** + * A list of values that can be hardware-accelerated. + */ + const acceleratedValues$1 = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Could be re-enabled now we have support for linear() easing + // "background-color" + ]); + const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); + function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type } = options; + const subject = motionValue?.owner?.current; + /** + * We use this check instead of isHTMLElement() because we explicitly + * **don't** want elements in different timing contexts (i.e. popups) + * to be accelerated, as it's not possible to sync these animations + * properly with those driven from the main window frameloop. + */ + if (!(subject instanceof HTMLElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + acceleratedValues$1.has(name) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); + } + + /** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ + const MAX_RESOLVE_DELAY = 40; + class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + if (!canAnimate(keyframes, name, type, velocity)) { + if (MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe$1(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + */ + const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + const animation = useWaapi + ? new NativeAnimationExtended({ + ...resolvedOptions, + element, + }) + : new JSAnimation(resolvedOptions); + animation.finished.then(() => { + this.notifyFinished(); + }).catch(noop$1); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } + } + + class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } + } + function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; + } + + class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + } + + class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } + } + + const animationMaps = new WeakMap(); + const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; + function getAnimationMap(element) { + const map = animationMaps.get(element) || new Map(); + animationMaps.set(element, map); + return map; + } + + function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; + } + + /** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ + const splitCSSVariableRegex = + // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words + /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; + function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; + } + const maxDepth = 4; + function getVariableValue(current, element, depth = 1) { + exports.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; + } + + const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, + }; + const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, + }); + const keyframesTransition = { + type: "keyframes", + duration: 0.8, + }; + /** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ + const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, + }; + const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; + }; + + const isNotNull = (value) => value !== null; + function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const index = repeat && repeatType !== "loop" && repeat % 2 === 1 + ? 0 + : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; + } + + /** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ + function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; + } + + function getValueTransition$1(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; + } + + /** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ + function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) { + return !!Object.keys(transition).length; + } + + const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition$1(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (MotionGlobalConfig.instantAnimations || + MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); + }; + + function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; + } + function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; + } + + function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); + } + + const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, + ]); + + /** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ + const MAX_VELOCITY_DELTA = 30; + const isFloat = (value) => { + return !isNaN(parseFloat(value)); + }; + const collectMotionValues = { + current: undefined, + }; + /** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ + class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + { + warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } + } + function motionValue(init, options) { + return new MotionValue(init, options); + } + + const isKeyframesTarget = (v) => { + return Array.isArray(v); + }; + + /** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ + function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } + } + function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; + } + function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } + } + + const isMotionValue = (value) => Boolean(value && value.getVelocity); + + function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); + } + + function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && MotionGlobalConfig.WillChange) { + const newWillChange = new MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } + } + + function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); + } + + const optimizedAppearDataId = "framerAppearId"; + const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + + function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; + } + + /** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ + function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; + } + function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition$1(transition || {}, key), + }; + /** + * If the value is already at the defined target, skip the animation. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; + } + + function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } + } + function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); + } + + function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); + } + + /** + * ValueType for "auto" + */ + const auto = { + test: (v) => v === "auto", + parse: (v) => v, + }; + + /** + * Tests a provided value against a ValueType + */ + const testValueType = (v) => (type) => type.test(v); + + /** + * A list of value types commonly used for dimensions + */ + const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; + /** + * Tests a dimensional value against the list of dimension ValueTypes + */ + const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + + function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || isZeroValueString(value); + } + else { + return true; + } + } + + /** + * Properties that should default to 1 or 100% + */ + const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); + function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; + } + const functionRegex = /\b([a-z-]*)\(.*?\)/gu; + const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, + }; + + const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, + }; + + const int = { + ...number, + transform: Math.round, + }; + + const transformValueTypes = { + rotate: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, + }; + + const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, + }; + + /** + * A map of default value types for common values + */ + const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, + }; + /** + * Gets the default ValueType for the provided value key + */ + const getDefaultValueType = (key) => defaultValueTypes[key]; + + const customTypes = /*@__PURE__*/ new Set([filter, mask]); + function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; + } + + /** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ + const invalidTemplates = new Set(["auto", "none", "0"]); + function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } + } + + class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } + } + + const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", + ]); + + function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } + } + + function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); + } + + const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; + }); + + /** + * A list of values that can be hardware-accelerated. + */ + const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved + // or until we implement support for linear() easing. + // "background-color" + ]); + + function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); + } + + function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; + } + + /** + * Provided a value and a ValueType, returns the value as that value type. + */ + const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; + }; + + class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } + destroy() { + for (const value of this.values.values()) { + value.onRemove(); + } + } + } + + function createEffect(addValue) { + const stateCache = new WeakMap(); + const subscriptions = []; + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; + } + + function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; + } + const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); + }; + const attrEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addAttrValue)); + + const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); + }); + + /** + * Checks if an element is an HTML element in a way + * that works across iframes + */ + function isHTMLElement(element) { + return isObject(element) && "offsetHeight" in element; + } + + const translateAlias$1 = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + function buildTransform$1(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias$1[key] || key; + const valueToRender = state.latest[key]; + transform += `${transformName}(${valueToRender}) `; + } + } + return transformIsDefault ? "none" : transform.trim(); + } + + const originProps = new Set(["originX", "originY", "originZ"]); + const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform$1(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); + }; + const styleEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addStyleValue)); + + function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } + } + const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); + }; + const svgEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addSVGValue)); + function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); + } + + const { schedule: microtask, cancel: cancelMicrotask } = + /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + + const isDragging = { + x: false, + y: false, + }; + function isDragActive() { + return isDragging.x || isDragging.y; + } + + function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } + } + + function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; + } + + function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); + } + /** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ + function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; + } + + /** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ + const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } + }; + + const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } + }; + + const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", + ]); + /** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ + function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); + } + const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); + /** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ + function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); + } + + const isPressing = new WeakSet(); + + /** + * Filter out events that are not "Enter" keys. + */ + function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; + } + function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); + } + const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); + }; + + /** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ + function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); + } + const claimedPointerDownEvents = new WeakSet(); + /** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ + function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerCancel); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerCancel, eventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; + } + + function getComputedStyle$2(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; + } + + /** + * Checks if an element is an SVG element in a way + * that works across iframes + */ + function isSVGElement(element) { + return isObject(element) && "ownerSVGElement" in element; + } + + const resizeHandlers = new WeakMap(); + let observer; + const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } + }; + const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); + const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); + function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); + } + function notifyAll(entries) { + entries.forEach(notifyTarget); + } + function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); + } + function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; + } + + const windowCallbacks = new Set(); + let windowResizeHandler; + function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); + } + function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; + } + + function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); + } + + function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); + } + + function record() { + const { value } = statsBuffer; + if (value === null) { + cancelFrame(record); + return; + } + value.frameloop.rate.push(frameData.delta); + value.animations.mainThread.push(activeAnimations.mainThread); + value.animations.waapi.push(activeAnimations.waapi); + value.animations.layout.push(activeAnimations.layout); + } + function mean(values) { + return values.reduce((acc, value) => acc + value, 0) / values.length; + } + function summarise(values, calcAverage = mean) { + if (values.length === 0) { + return { + min: 0, + max: 0, + avg: 0, + }; + } + return { + min: Math.min(...values), + max: Math.max(...values), + avg: calcAverage(values), + }; + } + const msToFps = (ms) => Math.round(1000 / ms); + function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; + } + function reportStats() { + const { value } = statsBuffer; + if (!value) { + throw new Error("Stats are not being measured"); + } + clearStatsBuffer(); + cancelFrame(record); + const summary = { + frameloop: { + setup: summarise(value.frameloop.setup), + rate: summarise(value.frameloop.rate), + read: summarise(value.frameloop.read), + resolveKeyframes: summarise(value.frameloop.resolveKeyframes), + preUpdate: summarise(value.frameloop.preUpdate), + update: summarise(value.frameloop.update), + preRender: summarise(value.frameloop.preRender), + render: summarise(value.frameloop.render), + postRender: summarise(value.frameloop.postRender), + }, + animations: { + mainThread: summarise(value.animations.mainThread), + waapi: summarise(value.animations.waapi), + layout: summarise(value.animations.layout), + }, + layoutProjection: { + nodes: summarise(value.layoutProjection.nodes), + calculatedTargetDeltas: summarise(value.layoutProjection.calculatedTargetDeltas), + calculatedProjections: summarise(value.layoutProjection.calculatedProjections), + }, + }; + /** + * Convert the rate to FPS + */ + const { rate } = summary.frameloop; + rate.min = msToFps(rate.min); + rate.max = msToFps(rate.max); + rate.avg = msToFps(rate.avg); + [rate.min, rate.max] = [rate.max, rate.min]; + return summary; + } + function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const newStatsBuffer = statsBuffer; + newStatsBuffer.value = { + frameloop: { + setup: [], + rate: [], + read: [], + resolveKeyframes: [], + preUpdate: [], + update: [], + preRender: [], + render: [], + postRender: [], + }, + animations: { + mainThread: [], + waapi: [], + layout: [], + }, + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + newStatsBuffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = newStatsBuffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; + frame.postRender(record, true); + return reportStats; + } + + /** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ + function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; + } + + function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } + } + function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; + } + + function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; + } + + /** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ + function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; + } + /** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ + function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + }; + const startAnimation = () => { + stopAnimation(); + const currentValue = asNumber$1(value.get()); + const targetValue = asNumber$1(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + return; + } + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity: value.getVelocity(), + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(() => { + startAnimation(); + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value["events"].animationComplete?.notify(); + }); + }); + }, stopAnimation); + if (isMotionValue(source)) { + const removeSourceOnChange = source.on("change", (v) => value.set(parseValue(v, unit))); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; + } + function parseValue(v, unit) { + return unit ? v + unit : v; + } + function asNumber$1(v) { + return typeof v === "number" ? v : parseFloat(v); + } + + function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); + } + + /** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ + function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; + } + + /** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ + function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); + } + + /** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ + function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); + } + /** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ + function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); + } + + /** + * A list of all ValueTypes + */ + const valueTypes = [...dimensionValueTypes, color, complex]; + /** + * Tests a value against the list of ValueTypes + */ + const findValueType = (v) => valueTypes.find(testValueType(v)); + + function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + if (valueName === "exit" || valueName === "old") + return "old"; + return "group"; + } + + let pendingRules = {}; + let style = null; + const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, + }; + + function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; + } + + function filterViewAnimations(animation) { + const { effect } = animation; + if (!effect) + return false; + return (effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); + } + function getViewAnimations() { + return document.getAnimations().filter(filterViewAnimations); + } + + function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; + } + + const definitionNames = ["layout", "enter", "exit", "new", "old"]; + function startViewAnimation(builder) { + const { update, targets, options: defaultOptions } = builder; + if (!document.startViewTransition) { + return new Promise(async (resolve) => { + await update(); + resolve(new GroupAnimation([])); + }); + } + // TODO: Go over existing targets and ensure they all have ids + /** + * If we don't have any animations defined for the root target, + * remove it from being captured. + */ + if (!hasTarget("root", targets)) { + css.set(":root", { + "view-transition-name": "none", + }); + } + /** + * Set the timing curve to linear for all view transition layers. + * This gets baked into the keyframes, which can't be changed + * without breaking the generated animation. + * + * This allows us to set easing via updateTiming - which can be changed. + */ + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + css.commit(); // Write + const transition = document.startViewTransition(async () => { + await update(); + // TODO: Go over new targets and ensure they all have ids + }); + transition.finished.finally(() => { + css.remove(); // Write + }); + return new Promise((resolve) => { + transition.ready.then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + */ + targets.forEach((definition, target) => { + // TODO: If target is not "root", resolve elements + // and iterate over each + for (const key of definitionNames) { + if (!definition[key]) + continue; + const { keyframes, options } = definition[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + if (!valueKeyframes) + continue; + const valueOptions = { + ...getValueTransition$1(defaultOptions, valueName), + ...getValueTransition$1(options, valueName), + }; + const type = chooseLayerType(key); + /** + * If this is an opacity animation, and keyframes are not an array, + * we need to convert them into an array and set an initial value. + */ + if (valueName === "opacity" && + !Array.isArray(valueKeyframes)) { + const initialValue = type === "new" ? 0 : 1; + valueKeyframes = [initialValue, valueKeyframes]; + } + /** + * Resolve stagger function if provided. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(0, 1); + } + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + const animation = new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${target})`, + keyframes: valueKeyframes, + }); + animations.push(animation); + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = targets.get(name.layer); + if (!targetDefinition) { + /** + * If transition name is group then update the timing of the animation + * whereas if it's old or new then we could possibly replace it using + * the above method. + */ + const transitionName = name.type === "group" ? "layout" : ""; + let animationTransition = { + ...getValueTransition$1(defaultOptions, transitionName), + }; + animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration); + effect.updateTiming({ + delay: secondsToMilliseconds(animationTransition.delay ?? 0), + duration: animationTransition.duration, + easing, + }); + animations.push(new NativeAnimationWrapper(animation)); + } + else if (hasOpacity(targetDefinition, "enter") && + hasOpacity(targetDefinition, "exit") && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + } + resolve(new GroupAnimation(animations)); + }); + }); + } + function hasOpacity(target, key) { + return target?.[key]?.keyframes.opacity; + } + + let builders = []; + let current = null; + function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); + } + function start(builder) { + removeItem(builders, builder); + current = builder; + startViewAnimation(builder).then((animation) => { + builder.notifyReady(animation); + animation.finished.finally(next); + }); + } + function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } + } + function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); + } + + class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + this.notifyReady = noop$1; + this.readyPromise = new Promise((resolve) => { + this.notifyReady = resolve; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + addToQueue(this); + } + get(subject) { + this.currentSubject = subject; + return this; + } + layout(keyframes, options) { + this.updateTarget("layout", keyframes, options); + return this; + } + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + crossfade(options) { + this.updateTarget("enter", { opacity: 1 }, options); + this.updateTarget("exit", { opacity: 0 }, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + } + function animateView(update, defaultOptions = {}) { + return new ViewTransitionBuilder(update, defaultOptions); + } + + const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, + }); + const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), + }); + const createAxis = () => ({ min: 0, max: 0 }); + const createBox = () => ({ + x: createAxis(), + y: createAxis(), + }); + + const visualElementStore = new WeakMap(); + + function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); + } + + /** + * Decides if the supplied variable is variant label + */ + function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); + } + + const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", + ]; + const variantProps = ["initial", ...variantPriorityOrder]; + + function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); + } + function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); + } + + /** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ + function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; + } + + // Does this device prefer reduced motion? Returns `null` server-side. + const prefersReducedMotion = { current: null }; + const hasReducedMotionListener = { current: false }; + + const isBrowser = typeof window !== "undefined"; + function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } + } + + const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", + ]; + /** + * Static feature definitions - can be injected by framework layer + */ + let featureDefinitions = {}; + /** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ + function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; + } + /** + * Get the current feature definitions + */ + function getFeatureDefinitions() { + return featureDefinitions; + } + /** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ + class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + { + warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + if (value.owner) + value.stop(); + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (isNumericalString(value) || isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } + } + + class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } + } + + /** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ + class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } + } + + /** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ + function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; + } + function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; + } + /** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ + function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; + } + + function isIdentityScale(scale) { + return scale === undefined || scale === 1; + } + function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); + } + function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); + } + function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); + } + function is2DTranslate(value) { + return value && value !== "0%"; + } + + /** + * Scales a point based on a factor and an originPoint + */ + function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; + } + /** + * Applies a translate/scale delta to a point + */ + function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; + } + /** + * Applies a translate/scale delta to an axis + */ + function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Applies a translate/scale delta to a box + */ + function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); + } + const TREE_SCALE_SNAP_MIN = 0.999999999999; + const TREE_SCALE_SNAP_MAX = 1.0000000000001; + /** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ + function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(box, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } + } + function translateAxis(axis, distance) { + axis.min = axis.min + distance; + axis.max = axis.max + distance; + } + /** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ + function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); + } + /** + * Apply a transform to a box from the latest resolved motion values. + */ + function transformBox(box, transform) { + transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY); + } + + function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); + } + function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; + } + + const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + const numTransforms = transformPropOrder.length; + /** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ + function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; + } + + function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } + } + + function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } + } + + function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; + } + /** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ + const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, + }; + + const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber$1(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, + }; + + const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomLeftRadius", + "borderBottomRightRadius", + ], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, + }; + function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } + } + + function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); + } + + function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; + } + + function getComputedStyle$1(element) { + return window.getComputedStyle(element); + } + class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle$1(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + } + } + + function isObjectKey(key, object) { + return key in object; + } + class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } + } + + const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", + }; + const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", + }; + /** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ + function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; + } + + /** + * CSS Motion Path properties that should remain as CSS styles on SVG elements. + */ + const cssMotionPathProperties = [ + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", + ]; + /** + * Build SVG visual attributes, like cx and style.transform + */ + function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, + // This is object creation, which we try to avoid per-frame. + ...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + /** + * However, we apply transforms as CSS transforms. + * So if we detect a transform, transformOrigin we take it from attrs and copy it into style. + */ + if (attrs.transform) { + style.transform = attrs.transform; + delete attrs.transform; + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + for (const key of cssMotionPathProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } + } + + /** + * A set of attribute names that are always read/written as camel case. + */ + const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", + ]); + + const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + + function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } + } + + function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; + } + + class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } + } + + const numVariantProps = variantProps.length; + /** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ + function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; + } + + function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; + } + + const reversePriorityOrder = [...variantPriorityOrder].reverse(); + const numAnimationTypes = variantPriorityOrder.length; + function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; + } + function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + isInitialRender && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = !shallowCompare(next, prev); + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if (isInitialRender && visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + isInitialRender && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + /** + * Temporarily disabling resetting this flag as it prevents components + * with initial={false} from animating after being remounted, for instance + * as the child of an Activity component. + */ + // isInitialRender = true + }, + }; + } + function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; + } + function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; + } + function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; + } + + /** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; + } + /** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ + function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); + } + /** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; + } + + const SCALE_PRECISION = 0.0001; + const SCALE_MIN = 1 - SCALE_PRECISION; + const SCALE_MAX = 1 + SCALE_PRECISION; + const TRANSLATE_PRECISION = 0.01; + const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; + const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; + function calcLength(axis) { + return axis.max - axis.min; + } + function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; + } + function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } + } + function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); + } + function calcRelativeAxis(target, relative, parent) { + target.min = parent.min + relative.min; + target.max = target.min + calcLength(relative); + } + function calcRelativeBox(target, relative, parent) { + calcRelativeAxis(target.x, relative.x, parent.x); + calcRelativeAxis(target.y, relative.y, parent.y); + } + function calcRelativeAxisPosition(target, layout, parent) { + target.min = layout.min - parent.min; + target.max = target.min + calcLength(layout); + } + function calcRelativePosition(target, layout, parent) { + calcRelativeAxisPosition(target.x, layout.x, parent.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y); + } + + /** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ + function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; + } + /** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ + function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); + } + /** + * The names of the motion values we want to apply as translation, scale and origin. + */ + const xKeys = ["x", "scaleX", "originX"]; + const yKeys = ["y", "scaleY", "originY"]; + /** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); + } + + function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; + } + function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); + } + function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; + } + function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); + } + function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); + } + function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); + } + function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); + } + function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); + } + + function eachAxis(callback) { + return [callback("x"), callback("y")]; + } + + function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; + } + + const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; + const numBorders = borders.length; + const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; + const isPx = (value) => typeof value === "number" || px.test(value); + function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = `border${borders[i]}Radius`; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); + } + } + function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; + } + const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); + const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop$1); + function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(progress(min, max, p)); + }; + } + + function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; + } + + function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler); + } + + const compareByDepth = (a, b) => a.depth - b.depth; + + class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } + } + + /** + * Timeout defined in ms + */ + function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); + } + function delayInSeconds(callback, timeout) { + return delay(callback, secondsToMilliseconds(timeout)); + } + + /** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ + function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; + } + + class NodeStack { + constructor() { + this.members = []; + } + add(node) { + addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const m = this.members[i]; + if (m === node || m === this.lead || m === this.prevLead) + continue; + const inst = m.instance; + if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) { + removeItem(this.members, m); + } + } + node.scheduleRender(); + } + remove(node) { + removeItem(this.members, node); + if (node === this.prevLead) { + this.prevLead = undefined; + } + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) { + this.promote(prevLead); + } + } + } + relegate(node) { + const indexOfNode = this.members.findIndex((member) => node === member); + if (indexOfNode === 0) + return false; + /** + * Find the next projection node that is present + */ + let prevLead; + for (let i = indexOfNode; i >= 0; i--) { + const member = this.members[i]; + const inst = member.instance; + if (member.isPresent !== false && (!inst || inst.isConnected !== false)) { + prevLead = member; + break; + } + } + if (prevLead) { + this.promote(prevLead); + return true; + } + else { + return false; + } + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.instance && prevLead.scheduleRender(); + node.scheduleRender(); + /** + * If both the new and previous lead have the same defined layoutDependency, + * skip the shared layout animation. This allows components with layoutId + * to opt-out of animations when their layoutDependency hasn't changed, + * even when the component unmounts and remounts in a different location. + */ + const prevDep = prevLead.options.layoutDependency; + const nextDep = node.options.layoutDependency; + const dependencyMatches = prevDep !== undefined && + nextDep !== undefined && + prevDep === nextDep; + if (!dependencyMatches) { + const prevInstance = prevLead.instance; + const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot; + if (!isStale) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) { + node.resumeFrom.preserveOpacity = true; + } + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root && node.root.isUpdating) { + node.isLayoutDirty = true; + } + } + } + const { crossfade } = node.options; + if (crossfade === false) { + prevLead.hide(); + } + } + } + exitAnimationComplete() { + this.members.forEach((node) => { + const { options, resumingFrom } = node; + options.onExitComplete && options.onExitComplete(); + if (resumingFrom) { + resumingFrom.options.onExitComplete && + resumingFrom.options.onExitComplete(); + } + }); + } + scheduleRender() { + this.members.forEach((node) => { + node.instance && node.scheduleRender(false); + }); + } + /** + * Clear any leads that have been removed this render to prevent them from being + * used in future animations and to prevent memory leaks + */ + removeLeadSnapshot() { + if (this.lead && this.lead.snapshot) { + this.lead.snapshot = undefined; + } + } + } + + /** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ + const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, + }; + + const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, + }; + const transformAxes = ["", "X", "Y", "Z"]; + /** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ + const animationTarget = 1000; + let id$2 = 0; + function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } + } + function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } + } + function createProjectionNode$1({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id$2++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition$1(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + this.unblockUpdate(); + this.clearAllSnapshots(); + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false) { + const withTransforms = createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(withTransforms, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!node.instance) + continue; + if (!hasTransform(node.latestValues)) + continue; + hasScale(node.latestValues) && node.updateSnapshot(); + const sourceBox = createBox(); + const nodeBox = node.measurePageBox(); + copyBoxInto(sourceBox, nodeBox); + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (relativeParent && relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + // TODO: This is creating a new object every frame + this.target = this.applyTransform(this.layout.layoutBox); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + mixAxisDelta(targetDelta.x, delta.x, progress); + mixAxisDelta(targetDelta.y, delta.y, progress); + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + activeAnimations.layout++; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onStop: () => { + activeAnimations.layout--; + }, + onComplete: () => { + activeAnimations.layout--; + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; + } + function updateLayout(node) { + node.updateLayout(); + } + function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; + } + function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); + } + function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; + } + function clearSnapshot(node) { + node.clearSnapshot(); + } + function clearMeasurements(node) { + node.clearMeasurements(); + } + function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; + } + function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); + } + function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; + } + function resolveTargetDelta(node) { + node.resolveTargetDelta(); + } + function calcProjection(node) { + node.calcProjection(); + } + function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); + } + function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); + } + function mixAxisDelta(output, delta, p) { + output.translate = mixNumber$1(delta.translate, 0, p); + output.scale = mixNumber$1(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; + } + function mixAxis(output, from, to, p) { + output.min = mixNumber$1(from.min, to.min, p); + output.max = mixNumber$1(from.max, to.max, p); + } + function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); + } + function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); + } + const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], + }; + const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); + /** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ + const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : noop$1; + function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); + } + function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); + } + function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); + } + function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; + } + + const DocumentProjectionNode = createProjectionNode$1({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, + }); + + const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); + function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; + } + + const rootProjectionNode = { + current: undefined, + }; + const HTMLProjectionNode = createProjectionNode$1({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), + }); + + const layoutSelector = "[data-layout], [data-layout-id]"; + const noop = () => { }; + function snapshotFromTarget(projection) { + const target = projection.targetWithTransforms || projection.target; + if (!target) + return undefined; + const measuredBox = createBox(); + const layoutBox = createBox(); + copyBoxInto(measuredBox, target); + copyBoxInto(layoutBox, target); + return { + animationId: projection.root?.animationId ?? 0, + measuredBox, + layoutBox, + latestValues: projection.animationValues || projection.latestValues || {}, + source: projection.id, + }; + } + class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.sharedTransitions = new Map(); + this.notifyReady = noop; + this.rejectReady = noop; + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + frame.postRender(() => { + this.start().then(this.notifyReady).catch(this.rejectReady); + }); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + async start() { + const beforeElements = collectLayoutElements(this.scope); + const beforeRecords = this.buildRecords(beforeElements); + beforeRecords.forEach(({ projection }) => { + const hasCurrentAnimation = Boolean(projection.currentAnimation); + const isSharedLayout = Boolean(projection.options.layoutId); + if (hasCurrentAnimation && isSharedLayout) { + const snapshot = snapshotFromTarget(projection); + if (snapshot) { + projection.snapshot = snapshot; + } + else if (projection.snapshot) { + projection.snapshot = undefined; + } + } + else if (projection.snapshot && + (projection.currentAnimation || projection.isProjecting())) { + projection.snapshot = undefined; + } + projection.isPresent = true; + projection.willUpdate(); + }); + await this.updateDom(); + const afterElements = collectLayoutElements(this.scope); + const afterRecords = this.buildRecords(afterElements); + this.handleExitingElements(beforeRecords, afterRecords); + afterRecords.forEach(({ projection }) => { + const instance = projection.instance; + const resumeFromInstance = projection.resumeFrom + ?.instance; + if (!instance || !resumeFromInstance) + return; + if (!("style" in instance)) + return; + const currentTransform = instance.style.transform; + const resumeFromTransform = resumeFromInstance.style.transform; + if (currentTransform && + resumeFromTransform && + currentTransform === resumeFromTransform) { + instance.style.transform = ""; + instance.style.transformOrigin = ""; + } + }); + afterRecords.forEach(({ projection }) => { + projection.isPresent = true; + }); + const root = getProjectionRoot(afterRecords, beforeRecords); + root?.didUpdate(); + await new Promise((resolve) => { + frame.postRender(() => resolve()); + }); + const animations = collectAnimations(afterRecords); + const animation = new GroupAnimation(animations); + return animation; + } + buildRecords(elements) { + const records = []; + const recordMap = new Map(); + for (const element of elements) { + const parentRecord = findParentRecord(element, recordMap, this.scope); + const { layout, layoutId } = readLayoutAttributes(element); + const override = layoutId + ? this.sharedTransitions.get(layoutId) + : undefined; + const transition = override || this.defaultOptions; + const record = getOrCreateRecord(element, parentRecord?.projection, { + layout, + layoutId, + animationType: typeof layout === "string" ? layout : "both", + transition: transition, + }); + recordMap.set(element, record); + records.push(record); + } + return records; + } + handleExitingElements(beforeRecords, afterRecords) { + const afterElementsSet = new Set(afterRecords.map((record) => record.element)); + beforeRecords.forEach((record) => { + if (afterElementsSet.has(record.element)) + return; + // For shared layout elements, relegate to set up resumeFrom + // so the remaining element animates from this position + if (record.projection.options.layoutId) { + record.projection.isPresent = false; + record.projection.relegate(); + } + record.visualElement.unmount(); + visualElementStore.delete(record.element); + }); + // Clear resumeFrom on EXISTING nodes that point to unmounted projections + // This prevents crossfade animation when the source element was removed entirely + // But preserve resumeFrom for NEW nodes so they can animate from the old position + // Also preserve resumeFrom for lead nodes that were just promoted via relegate + const beforeElementsSet = new Set(beforeRecords.map((record) => record.element)); + afterRecords.forEach(({ element, projection }) => { + if (beforeElementsSet.has(element) && + projection.resumeFrom && + !projection.resumeFrom.instance && + !projection.isLead()) { + projection.resumeFrom = undefined; + projection.snapshot = undefined; + } + }); + } + } + function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + // animateLayout(updateDom) + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + // animateLayout(scope, updateDom, options?) + const elements = resolveElements(scopeOrUpdateDom); + const scope = elements[0] || document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; + } + function collectLayoutElements(scope) { + const elements = Array.from(scope.querySelectorAll(layoutSelector)); + if (scope instanceof Element && scope.matches(layoutSelector)) { + if (!elements.includes(scope)) { + elements.unshift(scope); + } + } + return elements; + } + function readLayoutAttributes(element) { + const layoutId = element.getAttribute("data-layout-id") || undefined; + const rawLayout = element.getAttribute("data-layout"); + let layout; + if (rawLayout === "" || rawLayout === "true") { + layout = true; + } + else if (rawLayout) { + layout = rawLayout; + } + return { + layout, + layoutId, + }; + } + function createVisualState() { + return { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }; + } + function getOrCreateRecord(element, parentProjection, projectionOptions) { + const existing = visualElementStore.get(element); + const visualElement = existing ?? + new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: createVisualState(), + }, { allowProjection: true }); + if (!existing || !visualElement.projection) { + visualElement.projection = new HTMLProjectionNode(visualElement.latestValues, parentProjection); + } + visualElement.projection.setOptions({ + ...projectionOptions, + visualElement, + }); + if (!visualElement.current) { + visualElement.mount(element); + } + else if (!visualElement.projection.instance) { + // Mount projection if VisualElement is already mounted but projection isn't + // This happens when animate() was called before animateLayout() + visualElement.projection.mount(element); + } + if (!existing) { + visualElementStore.set(element, visualElement); + } + return { + element, + visualElement, + projection: visualElement.projection, + }; + } + function findParentRecord(element, recordMap, scope) { + let parent = element.parentElement; + while (parent) { + const record = recordMap.get(parent); + if (record) + return record; + if (parent === scope) + break; + parent = parent.parentElement; + } + return undefined; + } + function getProjectionRoot(afterRecords, beforeRecords) { + const record = afterRecords[0] || beforeRecords[0]; + return record?.projection.root; + } + function collectAnimations(afterRecords) { + const animations = new Set(); + afterRecords.forEach((record) => { + const animation = record.projection.currentAnimation; + if (animation) + animations.add(animation); + }); + return Array.from(animations); + } + + /** + * @deprecated + * + * Import as `frame` instead. + */ + const sync = frame; + /** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ + const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; + }, {}); + + /** + * @public + */ + const MotionConfigContext = React$1.createContext({ + transformPagePoint: (p) => p, + isStatic: false, + reducedMotion: "never", + }); + + /** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ + /** + * Set a given ref to a given value + * This utility takes care of different types of refs: callback refs and RefObject(s) + */ + function setRef(ref, value) { + if (typeof ref === "function") { + return ref(value); + } + else if (ref !== null && ref !== undefined) { + ref.current = value; + } + } + /** + * A utility to compose multiple refs together + * Accepts callback refs and RefObject(s) + */ + function composeRefs(...refs) { + return (node) => { + let hasCleanup = false; + const cleanups = refs.map((ref) => { + const cleanup = setRef(ref, node); + if (!hasCleanup && typeof cleanup === "function") { + hasCleanup = true; + } + return cleanup; + }); + // React <19 will log an error to the console if a callback ref returns a + // value. We don't use ref cleanups internally so this will only happen if a + // user's ref callback returns a value, which we only expect if they are + // using the cleanup functionality added in React 19. + if (hasCleanup) { + return () => { + for (let i = 0; i < cleanups.length; i++) { + const cleanup = cleanups[i]; + if (typeof cleanup === "function") { + cleanup(); + } + else { + setRef(refs[i], null); + } + } + }; + } + }; + } + /** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ + function useComposedRefs(...refs) { + // eslint-disable-next-line react-hooks/exhaustive-deps + return React__namespace.useCallback(composeRefs(...refs), refs); + } + + /** + * Measurement functionality has to be within a separate component + * to leverage snapshot lifecycle. + */ + class PopChildMeasure extends React__namespace.Component { + getSnapshotBeforeUpdate(prevProps) { + const element = this.props.childRef.current; + if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) { + const parent = element.offsetParent; + const parentWidth = isHTMLElement(parent) + ? parent.offsetWidth || 0 + : 0; + const parentHeight = isHTMLElement(parent) + ? parent.offsetHeight || 0 + : 0; + const size = this.props.sizeRef.current; + size.height = element.offsetHeight || 0; + size.width = element.offsetWidth || 0; + size.top = element.offsetTop; + size.left = element.offsetLeft; + size.right = parentWidth - size.width - size.left; + size.bottom = parentHeight - size.height - size.top; + } + return null; + } + /** + * Required with getSnapshotBeforeUpdate to stop React complaining. + */ + componentDidUpdate() { } + render() { + return this.props.children; + } + } + function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) { + const id = React$1.useId(); + const ref = React$1.useRef(null); + const size = React$1.useRef({ + width: 0, + height: 0, + top: 0, + left: 0, + right: 0, + bottom: 0, + }); + const { nonce } = React$1.useContext(MotionConfigContext); + /** + * In React 19, refs are passed via props.ref instead of element.ref. + * We check props.ref first (React 19) and fall back to element.ref (React 18). + */ + const childRef = children.props?.ref ?? + children?.ref; + const composedRef = useComposedRefs(ref, childRef); + /** + * We create and inject a style block so we can apply this explicit + * sizing in a non-destructive manner by just deleting the style block. + * + * We can't apply size via render as the measurement happens + * in getSnapshotBeforeUpdate (post-render), likewise if we apply the + * styles directly on the DOM node, we might be overwriting + * styles set via the style prop. + */ + React$1.useInsertionEffect(() => { + const { width, height, top, left, right, bottom } = size.current; + if (isPresent || pop === false || !ref.current || !width || !height) + return; + const x = anchorX === "left" ? `left: ${left}` : `right: ${right}`; + const y = anchorY === "bottom" ? `bottom: ${bottom}` : `top: ${top}`; + ref.current.dataset.motionPopId = id; + const style = document.createElement("style"); + if (nonce) + style.nonce = nonce; + const parent = root ?? document.head; + parent.appendChild(style); + if (style.sheet) { + style.sheet.insertRule(` + [data-motion-pop-id="${id}"] { + position: absolute !important; + width: ${width}px !important; + height: ${height}px !important; + ${x}px !important; + ${y}px !important; + } + `); + } + return () => { + if (parent.contains(style)) { + parent.removeChild(style); + } + }; + }, [isPresent]); + return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, pop: pop, children: pop === false + ? children + : React__namespace.cloneElement(children, { ref: composedRef }) })); + } + + const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }) => { + const presenceChildren = useConstant(newChildrenMap); + const id = React$1.useId(); + let isReusedContext = true; + let context = React$1.useMemo(() => { + isReusedContext = false; + return { + id, + initial, + isPresent, + custom, + onExitComplete: (childId) => { + presenceChildren.set(childId, true); + for (const isComplete of presenceChildren.values()) { + if (!isComplete) + return; // can stop searching when any is incomplete + } + onExitComplete && onExitComplete(); + }, + register: (childId) => { + presenceChildren.set(childId, false); + return () => presenceChildren.delete(childId); + }, + }; + }, [isPresent, presenceChildren, onExitComplete]); + /** + * If the presence of a child affects the layout of the components around it, + * we want to make a new context value to ensure they get re-rendered + * so they can detect that layout change. + */ + if (presenceAffectsLayout && isReusedContext) { + context = { ...context }; + } + React$1.useMemo(() => { + presenceChildren.forEach((_, key) => presenceChildren.set(key, false)); + }, [isPresent]); + /** + * If there's no `motion` components to fire exit animations, we want to remove this + * component immediately. + */ + React__namespace.useEffect(() => { + !isPresent && + !presenceChildren.size && + onExitComplete && + onExitComplete(); + }, [isPresent]); + children = (jsx(PopChild, { pop: mode === "popLayout", isPresent: isPresent, anchorX: anchorX, anchorY: anchorY, root: root, children: children })); + return (jsx(PresenceContext.Provider, { value: context, children: children })); + }; + function newChildrenMap() { + return new Map(); + } + + /** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return

+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ + function usePresence(subscribe = true) { + const context = React$1.useContext(PresenceContext); + if (context === null) + return [true, null]; + const { isPresent, onExitComplete, register } = context; + // It's safe to call the following hooks conditionally (after an early return) because the context will always + // either be null or non-null for the lifespan of the component. + const id = React$1.useId(); + React$1.useEffect(() => { + if (subscribe) { + return register(id); + } + }, [subscribe]); + const safeToRemove = React$1.useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]); + return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; + } + /** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ + function useIsPresent() { + return isPresent(React$1.useContext(PresenceContext)); + } + function isPresent(context) { + return context === null ? true : context.isPresent; + } + + const getChildKey = (child) => child.key || ""; + function onlyElements(children) { + const filtered = []; + // We use forEach here instead of map as map mutates the component key by preprending `.$` + React$1.Children.forEach(children, (child) => { + if (React$1.isValidElement(child)) + filtered.push(child); + }); + return filtered; + } + + /** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ + const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false, anchorX = "left", anchorY = "top", root }) => { + const [isParentPresent, safeToRemove] = usePresence(propagate); + /** + * Filter any children that aren't ReactElements. We can only track components + * between renders with a props.key. + */ + const presentChildren = React$1.useMemo(() => onlyElements(children), [children]); + /** + * Track the keys of the currently rendered children. This is used to + * determine which children are exiting. + */ + const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); + /** + * If `initial={false}` we only want to pass this to components in the first render. + */ + const isInitialRender = React$1.useRef(true); + /** + * A ref containing the currently present children. When all exit animations + * are complete, we use this to re-render the component with the latest children + * *committed* rather than the latest children *rendered*. + */ + const pendingPresentChildren = React$1.useRef(presentChildren); + /** + * Track which exiting children have finished animating out. + */ + const exitComplete = useConstant(() => new Map()); + /** + * Track which components are currently processing exit to prevent duplicate processing. + */ + const exitingComponents = React$1.useRef(new Set()); + /** + * Save children to render as React state. To ensure this component is concurrent-safe, + * we check for exiting children via an effect. + */ + const [diffedChildren, setDiffedChildren] = React$1.useState(presentChildren); + const [renderedChildren, setRenderedChildren] = React$1.useState(presentChildren); + useIsomorphicLayoutEffect(() => { + isInitialRender.current = false; + pendingPresentChildren.current = presentChildren; + /** + * Update complete status of exiting children. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const key = getChildKey(renderedChildren[i]); + if (!presentKeys.includes(key)) { + if (exitComplete.get(key) !== true) { + exitComplete.set(key, false); + } + } + else { + exitComplete.delete(key); + exitingComponents.current.delete(key); + } + } + }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); + const exitingChildren = []; + if (presentChildren !== diffedChildren) { + let nextChildren = [...presentChildren]; + /** + * Loop through all the currently rendered components and decide which + * are exiting. + */ + for (let i = 0; i < renderedChildren.length; i++) { + const child = renderedChildren[i]; + const key = getChildKey(child); + if (!presentKeys.includes(key)) { + nextChildren.splice(i, 0, child); + exitingChildren.push(child); + } + } + /** + * If we're in "wait" mode, and we have exiting children, we want to + * only render these until they've all exited. + */ + if (mode === "wait" && exitingChildren.length) { + nextChildren = exitingChildren; + } + setRenderedChildren(onlyElements(nextChildren)); + setDiffedChildren(presentChildren); + /** + * Early return to ensure once we've set state with the latest diffed + * children, we can immediately re-render. + */ + return null; + } + if (mode === "wait" && + renderedChildren.length > 1) { + console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`); + } + /** + * If we've been provided a forceRender function by the LayoutGroupContext, + * we can use it to force a re-render amongst all surrounding components once + * all components have finished animating out. + */ + const { forceRender } = React$1.useContext(LayoutGroupContext); + return (jsx(Fragment, { children: renderedChildren.map((child) => { + const key = getChildKey(child); + const isPresent = propagate && !isParentPresent + ? false + : presentChildren === renderedChildren || + presentKeys.includes(key); + const onExit = () => { + if (exitingComponents.current.has(key)) { + return; + } + exitingComponents.current.add(key); + if (exitComplete.has(key)) { + exitComplete.set(key, true); + } + else { + return; + } + let isEveryExitComplete = true; + exitComplete.forEach((isExitComplete) => { + if (!isExitComplete) + isEveryExitComplete = false; + }); + if (isEveryExitComplete) { + forceRender?.(); + setRenderedChildren(pendingPresentChildren.current); + propagate && safeToRemove?.(); + onExitComplete && onExitComplete(); + } + }; + return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial + ? undefined + : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, anchorY: anchorY, children: child }, key)); + }) })); + }; + + /** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ + const DeprecatedLayoutGroupContext = React$1.createContext(null); + + function useIsMounted() { + const isMounted = React$1.useRef(false); + useIsomorphicLayoutEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + return isMounted; + } + + function useForceUpdate() { + const isMounted = useIsMounted(); + const [forcedRenderCount, setForcedRenderCount] = React$1.useState(0); + const forceRender = React$1.useCallback(() => { + isMounted.current && setForcedRenderCount(forcedRenderCount + 1); + }, [forcedRenderCount]); + /** + * Defer this to the end of the next animation frame in case there are multiple + * synchronous calls. + */ + const deferredForceRender = React$1.useCallback(() => frame.postRender(forceRender), [forceRender]); + return [deferredForceRender, forcedRenderCount]; + } + + const shouldInheritGroup = (inherit) => inherit === true; + const shouldInheritId = (inherit) => shouldInheritGroup(inherit === true) || inherit === "id"; + const LayoutGroup = ({ children, id, inherit = true }) => { + const layoutGroupContext = React$1.useContext(LayoutGroupContext); + const deprecatedLayoutGroupContext = React$1.useContext(DeprecatedLayoutGroupContext); + const [forceRender, key] = useForceUpdate(); + const context = React$1.useRef(null); + const upstreamId = layoutGroupContext.id || deprecatedLayoutGroupContext; + if (context.current === null) { + if (shouldInheritId(inherit) && upstreamId) { + id = id ? upstreamId + "-" + id : upstreamId; + } + context.current = { + id, + group: shouldInheritGroup(inherit) + ? layoutGroupContext.group || nodeGroup() + : nodeGroup(), + }; + } + const memoizedContext = React$1.useMemo(() => ({ ...context.current, forceRender }), [key]); + return (jsx(LayoutGroupContext.Provider, { value: memoizedContext, children: children })); + }; + + const LazyContext = React$1.createContext({ strict: false }); + + const featureProps = { + animation: [ + "animate", + "variants", + "whileHover", + "whileTap", + "exit", + "whileInView", + "whileFocus", + "whileDrag", + ], + exit: ["exit"], + drag: ["drag", "dragControls"], + focus: ["whileFocus"], + hover: ["whileHover", "onHoverStart", "onHoverEnd"], + tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], + pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], + inView: ["whileInView", "onViewportEnter", "onViewportLeave"], + layout: ["layout", "layoutId"], + }; + let isInitialized = false; + /** + * Initialize feature definitions with isEnabled checks. + * This must be called before any motion components are rendered. + */ + function initFeatureDefinitions() { + if (isInitialized) + return; + const initialFeatureDefinitions = {}; + for (const key in featureProps) { + initialFeatureDefinitions[key] = { + isEnabled: (props) => featureProps[key].some((name) => !!props[name]), + }; + } + setFeatureDefinitions(initialFeatureDefinitions); + isInitialized = true; + } + /** + * Get the current feature definitions, initializing if needed. + */ + function getInitializedFeatureDefinitions() { + initFeatureDefinitions(); + return getFeatureDefinitions(); + } + + function loadFeatures(features) { + const featureDefinitions = getInitializedFeatureDefinitions(); + for (const key in features) { + featureDefinitions[key] = { + ...featureDefinitions[key], + ...features[key], + }; + } + setFeatureDefinitions(featureDefinitions); + } + + /** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ + function LazyMotion({ children, features, strict = false }) { + const [, setIsLoaded] = React$1.useState(!isLazyBundle(features)); + const loadedRenderer = React$1.useRef(undefined); + /** + * If this is a synchronous load, load features immediately + */ + if (!isLazyBundle(features)) { + const { renderer, ...loadedFeatures } = features; + loadedRenderer.current = renderer; + loadFeatures(loadedFeatures); + } + React$1.useEffect(() => { + if (isLazyBundle(features)) { + features().then(({ renderer, ...loadedFeatures }) => { + loadFeatures(loadedFeatures); + loadedRenderer.current = renderer; + setIsLoaded(true); + }); + } + }, []); + return (jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children })); + } + function isLazyBundle(features) { + return typeof features === "function"; + } + + /** + * A list of all valid MotionProps. + * + * @privateRemarks + * This doesn't throw if a `MotionProp` name is missing - it should. + */ + const validMotionProps = new Set([ + "animate", + "exit", + "variants", + "initial", + "style", + "values", + "variants", + "transition", + "transformTemplate", + "custom", + "inherit", + "onBeforeLayoutMeasure", + "onAnimationStart", + "onAnimationComplete", + "onUpdate", + "onDragStart", + "onDrag", + "onDragEnd", + "onMeasureDragConstraints", + "onDirectionLock", + "onDragTransitionEnd", + "_dragX", + "_dragY", + "onHoverStart", + "onHoverEnd", + "onViewportEnter", + "onViewportLeave", + "globalTapTarget", + "propagate", + "ignoreStrict", + "viewport", + ]); + /** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ + function isValidMotionProp(key) { + return (key.startsWith("while") || + (key.startsWith("drag") && key !== "draggable") || + key.startsWith("layout") || + key.startsWith("onTap") || + key.startsWith("onPan") || + key.startsWith("onLayout") || + validMotionProps.has(key)); + } + + let shouldForward = (key) => !isValidMotionProp(key); + function loadExternalIsValidProp(isValidProp) { + if (typeof isValidProp !== "function") + return; + // Explicitly filter our events + shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); + } + /** + * Emotion and Styled Components both allow users to pass through arbitrary props to their components + * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which + * of these should be passed to the underlying DOM node. + * + * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props + * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props + * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of + * `@emotion/is-prop-valid`, however to fix this problem we need to use it. + * + * By making it an optionalDependency we can offer this functionality only in the situations where it's + * actually required. + */ + try { + /** + * We attempt to import this package but require won't be defined in esm environments, in that case + * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed + * in favour of explicit injection. + */ + loadExternalIsValidProp(require("@emotion/is-prop-valid").default); + } + catch { + // We don't need to actually do anything here - the fallback is the existing `isPropValid`. + } + function filterProps(props, isDom, forwardMotionProps) { + const filteredProps = {}; + for (const key in props) { + /** + * values is considered a valid prop by Emotion, so if it's present + * this will be rendered out to the DOM unless explicitly filtered. + * + * We check the type as it could be used with the `feColorMatrix` + * element, which we support. + */ + if (key === "values" && typeof props.values === "object") + continue; + if (shouldForward(key) || + (forwardMotionProps === true && isValidMotionProp(key)) || + (!isDom && !isValidMotionProp(key)) || + // If trying to use native HTML drag events, forward drag listeners + (props["draggable"] && + key.startsWith("onDrag"))) { + filteredProps[key] = + props[key]; + } + } + return filteredProps; + } + + /** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ + function MotionConfig({ children, isValidProp, ...config }) { + isValidProp && loadExternalIsValidProp(isValidProp); + /** + * Inherit props from any parent MotionConfig components + */ + const parentConfig = React$1.useContext(MotionConfigContext); + config = { ...parentConfig, ...config }; + config.transition = resolveTransition(config.transition, parentConfig.transition); + /** + * Don't allow isStatic to change between renders as it affects how many hooks + * motion components fire. + */ + config.isStatic = useConstant(() => config.isStatic); + /** + * Creating a new config context object will re-render every `motion` component + * every time it renders. So we only want to create a new one sparingly. + */ + const context = React$1.useMemo(() => config, [ + JSON.stringify(config.transition), + config.transformPagePoint, + config.reducedMotion, + config.skipAnimations, + ]); + return (jsx(MotionConfigContext.Provider, { value: context, children: children })); + } + + const ReorderContext = React$1.createContext(null); + + /** + * We keep these listed separately as we use the lowercase tag names as part + * of the runtime bundle to detect SVG components + */ + const lowercaseSVGElements = [ + "animate", + "circle", + "defs", + "desc", + "ellipse", + "g", + "image", + "line", + "filter", + "marker", + "mask", + "metadata", + "path", + "pattern", + "polygon", + "polyline", + "rect", + "stop", + "switch", + "symbol", + "svg", + "text", + "tspan", + "use", + "view", + ]; + + function isSVGComponent(Component) { + if ( + /** + * If it's not a string, it's a custom React component. Currently we only support + * HTML custom React components. + */ + typeof Component !== "string" || + /** + * If it contains a dash, the element is a custom HTML webcomponent. + */ + Component.includes("-")) { + return false; + } + else if ( + /** + * If it's in our list of lowercase SVG tags, it's an SVG component + */ + lowercaseSVGElements.indexOf(Component) > -1 || + /** + * If it contains a capital letter, it's an SVG component + */ + /[A-Z]/u.test(Component)) { + return true; + } + return false; + } + + const createDomVisualElement = (Component, options) => { + /** + * Use explicit isSVG override if provided, otherwise auto-detect + */ + const isSVG = options.isSVG ?? isSVGComponent(Component); + return isSVG + ? new SVGVisualElement(options) + : new HTMLVisualElement(options, { + allowProjection: Component !== React$1.Fragment, + }); + }; + + const MotionContext = /* @__PURE__ */ React$1.createContext({}); + + function getCurrentTreeVariants(props, context) { + if (isControllingVariants(props)) { + const { initial, animate } = props; + return { + initial: initial === false || isVariantLabel(initial) + ? initial + : undefined, + animate: isVariantLabel(animate) ? animate : undefined, + }; + } + return props.inherit !== false ? context : {}; + } + + function useCreateMotionContext(props) { + const { initial, animate } = getCurrentTreeVariants(props, React$1.useContext(MotionContext)); + return React$1.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); + } + function variantLabelsAsDependency(prop) { + return Array.isArray(prop) ? prop.join(" ") : prop; + } + + const createHtmlRenderState = () => ({ + style: {}, + transform: {}, + transformOrigin: {}, + vars: {}, + }); + + function copyRawValuesOnly(target, source, props) { + for (const key in source) { + if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { + target[key] = source[key]; + } + } + } + function useInitialMotionValues({ transformTemplate }, visualState) { + return React$1.useMemo(() => { + const state = createHtmlRenderState(); + buildHTMLStyles(state, visualState, transformTemplate); + return Object.assign({}, state.vars, state.style); + }, [visualState]); + } + function useStyle(props, visualState) { + const styleProp = props.style || {}; + const style = {}; + /** + * Copy non-Motion Values straight into style + */ + copyRawValuesOnly(style, styleProp, props); + Object.assign(style, useInitialMotionValues(props, visualState)); + return style; + } + function useHTMLProps(props, visualState) { + // The `any` isn't ideal but it is the type of createElement props argument + const htmlProps = {}; + const style = useStyle(props, visualState); + if (props.drag && props.dragListener !== false) { + // Disable the ghost element when a user drags + htmlProps.draggable = false; + // Disable text selection + style.userSelect = + style.WebkitUserSelect = + style.WebkitTouchCallout = + "none"; + // Disable scrolling on the draggable direction + style.touchAction = + props.drag === true + ? "none" + : `pan-${props.drag === "x" ? "y" : "x"}`; + } + if (props.tabIndex === undefined && + (props.onTap || props.onTapStart || props.whileTap)) { + htmlProps.tabIndex = 0; + } + htmlProps.style = style; + return htmlProps; + } + + const createSvgRenderState = () => ({ + ...createHtmlRenderState(), + attrs: {}, + }); + + function useSVGProps(props, visualState, _isStatic, Component) { + const visualProps = React$1.useMemo(() => { + const state = createSvgRenderState(); + buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style); + return { + ...state.attrs, + style: { ...state.style }, + }; + }, [visualState]); + if (props.style) { + const rawStyles = {}; + copyRawValuesOnly(rawStyles, props.style, props); + visualProps.style = { ...rawStyles, ...visualProps.style }; + } + return visualProps; + } + + function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) { + const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps; + const visualProps = useVisualProps(props, latestValues, isStatic, Component); + const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); + const elementProps = Component !== React$1.Fragment ? { ...filteredProps, ...visualProps, ref } : {}; + /** + * If component has been handed a motion value as its child, + * memoise its initial value and render that. Subsequent updates + * will be handled by the onChange handler + */ + const { children } = props; + const renderedChildren = React$1.useMemo(() => (isMotionValue(children) ? children.get() : children), [children]); + return React$1.createElement(Component, { + ...elementProps, + children: renderedChildren, + }); + } + + function makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) { + const state = { + latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), + renderState: createRenderState(), + }; + return state; + } + function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { + const values = {}; + const motionValues = scrapeMotionValues(props, {}); + for (const key in motionValues) { + values[key] = resolveMotionValue(motionValues[key]); + } + let { initial, animate } = props; + const isControllingVariants$1 = isControllingVariants(props); + const isVariantNode$1 = isVariantNode(props); + if (context && + isVariantNode$1 && + !isControllingVariants$1 && + props.inherit !== false) { + if (initial === undefined) + initial = context.initial; + if (animate === undefined) + animate = context.animate; + } + let isInitialAnimationBlocked = presenceContext + ? presenceContext.initial === false + : false; + isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; + const variantToSet = isInitialAnimationBlocked ? animate : initial; + if (variantToSet && + typeof variantToSet !== "boolean" && + !isAnimationControls(variantToSet)) { + const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; + for (let i = 0; i < list.length; i++) { + const resolved = resolveVariantFromProps(props, list[i]); + if (resolved) { + const { transitionEnd, transition, ...target } = resolved; + for (const key in target) { + let valueTarget = target[key]; + if (Array.isArray(valueTarget)) { + /** + * Take final keyframe if the initial animation is blocked because + * we want to initialise at the end of that blocked animation. + */ + const index = isInitialAnimationBlocked + ? valueTarget.length - 1 + : 0; + valueTarget = valueTarget[index]; + } + if (valueTarget !== null) { + values[key] = valueTarget; + } + } + for (const key in transitionEnd) { + values[key] = transitionEnd[key]; + } + } + } + } + return values; + } + const makeUseVisualState = (config) => (props, isStatic) => { + const context = React$1.useContext(MotionContext); + const presenceContext = React$1.useContext(PresenceContext); + const make = () => makeState(config, props, context, presenceContext); + return isStatic ? make() : useConstant(make); + }; + + const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, + createRenderState: createHtmlRenderState, + }); + + const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({ + scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, + createRenderState: createSvgRenderState, + }); + + const motionComponentSymbol = Symbol.for("motionComponentSymbol"); + + /** + * Creates a ref function that, when called, hydrates the provided + * external ref and VisualElement. + */ + function useMotionRef(visualState, visualElement, externalRef) { + /** + * Store externalRef in a ref to avoid including it in the useCallback + * dependency array. Including externalRef in dependencies causes issues + * with libraries like Radix UI that create new callback refs on each render + * when using asChild - this would cause the callback to be recreated, + * triggering element remounts and breaking AnimatePresence exit animations. + */ + const externalRefContainer = React$1.useRef(externalRef); + React$1.useInsertionEffect(() => { + externalRefContainer.current = externalRef; + }); + // Store cleanup function returned by callback refs (React 19 feature) + const refCleanup = React$1.useRef(null); + return React$1.useCallback((instance) => { + if (instance) { + visualState.onMount?.(instance); + } + if (visualElement) { + instance ? visualElement.mount(instance) : visualElement.unmount(); + } + const ref = externalRefContainer.current; + if (typeof ref === "function") { + if (instance) { + const cleanup = ref(instance); + if (typeof cleanup === "function") { + refCleanup.current = cleanup; + } + } + else if (refCleanup.current) { + refCleanup.current(); + refCleanup.current = null; + } + else { + ref(instance); + } + } + else if (ref) { + ref.current = instance; + } + }, [visualElement]); + } + + /** + * Internal, exported only for usage in Framer + */ + const SwitchLayoutGroupContext = React$1.createContext({}); + + function isRefObject(ref) { + return (ref && + typeof ref === "object" && + Object.prototype.hasOwnProperty.call(ref, "current")); + } + + function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) { + const { visualElement: parent } = React$1.useContext(MotionContext); + const lazyContext = React$1.useContext(LazyContext); + const presenceContext = React$1.useContext(PresenceContext); + const motionConfig = React$1.useContext(MotionConfigContext); + const reducedMotionConfig = motionConfig.reducedMotion; + const skipAnimations = motionConfig.skipAnimations; + const visualElementRef = React$1.useRef(null); + /** + * Track whether the component has been through React's commit phase. + * Used to detect when LazyMotion features load after the component has mounted. + */ + const hasMountedOnce = React$1.useRef(false); + /** + * If we haven't preloaded a renderer, check to see if we have one lazy-loaded + */ + createVisualElement = + createVisualElement || + lazyContext.renderer; + if (!visualElementRef.current && createVisualElement) { + visualElementRef.current = createVisualElement(Component, { + visualState, + parent, + props, + presenceContext, + blockInitialAnimation: presenceContext + ? presenceContext.initial === false + : false, + reducedMotionConfig, + skipAnimations, + isSVG, + }); + /** + * If the component has already mounted before features loaded (e.g. via + * LazyMotion with async feature loading), we need to force the initial + * animation to run. Otherwise state changes that occurred before features + * loaded will be lost and the element will snap to its final state. + */ + if (hasMountedOnce.current && visualElementRef.current) { + visualElementRef.current.manuallyAnimateOnMount = true; + } + } + const visualElement = visualElementRef.current; + /** + * Load Motion gesture and animation features. These are rendered as renderless + * components so each feature can optionally make use of React lifecycle methods. + */ + const initialLayoutGroupConfig = React$1.useContext(SwitchLayoutGroupContext); + if (visualElement && + !visualElement.projection && + ProjectionNodeConstructor && + (visualElement.type === "html" || visualElement.type === "svg")) { + createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); + } + const isMounted = React$1.useRef(false); + React$1.useInsertionEffect(() => { + /** + * Check the component has already mounted before calling + * `update` unnecessarily. This ensures we skip the initial update. + */ + if (visualElement && isMounted.current) { + visualElement.update(props, presenceContext); + } + }); + /** + * Cache this value as we want to know whether HandoffAppearAnimations + * was present on initial render - it will be deleted after this. + */ + const optimisedAppearId = props[optimizedAppearDataAttribute]; + const wantsHandoff = React$1.useRef(Boolean(optimisedAppearId) && + !window.MotionHandoffIsComplete?.(optimisedAppearId) && + window.MotionHasOptimisedAnimation?.(optimisedAppearId)); + useIsomorphicLayoutEffect(() => { + /** + * Track that this component has mounted. This is used to detect when + * LazyMotion features load after the component has already committed. + */ + hasMountedOnce.current = true; + if (!visualElement) + return; + isMounted.current = true; + window.MotionIsMounted = true; + visualElement.updateFeatures(); + visualElement.scheduleRenderMicrotask(); + /** + * Ideally this function would always run in a useEffect. + * + * However, if we have optimised appear animations to handoff from, + * it needs to happen synchronously to ensure there's no flash of + * incorrect styles in the event of a hydration error. + * + * So if we detect a situtation where optimised appear animations + * are running, we use useLayoutEffect to trigger animations. + */ + if (wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + }); + React$1.useEffect(() => { + if (!visualElement) + return; + if (!wantsHandoff.current && visualElement.animationState) { + visualElement.animationState.animateChanges(); + } + if (wantsHandoff.current) { + // This ensures all future calls to animateChanges() in this component will run in useEffect + queueMicrotask(() => { + window.MotionHandoffMarkAsComplete?.(optimisedAppearId); + }); + wantsHandoff.current = false; + } + /** + * Now we've finished triggering animations for this element we + * can wipe the enteringChildren set for the next render. + */ + visualElement.enteringChildren = undefined; + }); + return visualElement; + } + function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { + const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props; + visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] + ? undefined + : getClosestProjectingNode(visualElement.parent)); + visualElement.projection.setOptions({ + layoutId, + layout, + alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)), + visualElement, + /** + * TODO: Update options in an effect. This could be tricky as it'll be too late + * to update by the time layout animations run. + * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, + * ensuring it gets called if there's no potential layout animations. + * + */ + animationType: typeof layout === "string" ? layout : "both", + initialPromotionConfig, + crossfade: layoutCrossfade, + layoutScroll, + layoutRoot, + }); + } + function getClosestProjectingNode(visualElement) { + if (!visualElement) + return undefined; + return visualElement.options.allowProjection !== false + ? visualElement.projection + : getClosestProjectingNode(visualElement.parent); + } + + /** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ + function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) { + preloadedFeatures && loadFeatures(preloadedFeatures); + /** + * Determine whether to use SVG or HTML rendering based on: + * 1. Explicit `type` option (highest priority) + * 2. Auto-detection via `isSVGComponent` + */ + const isSVG = type ? type === "svg" : isSVGComponent(Component); + const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState; + function MotionDOMComponent(props, externalRef) { + /** + * If we need to measure the element we load this functionality in a + * separate class component in order to gain access to getSnapshotBeforeUpdate. + */ + let MeasureLayout; + const configAndProps = { + ...React$1.useContext(MotionConfigContext), + ...props, + layoutId: useLayoutId(props), + }; + const { isStatic } = configAndProps; + const context = useCreateMotionContext(props); + const visualState = useVisualState(props, isStatic); + if (!isStatic && isBrowser$1) { + useStrictMode(configAndProps, preloadedFeatures); + const layoutProjection = getProjectionFunctionality(configAndProps); + MeasureLayout = layoutProjection.MeasureLayout; + /** + * Create a VisualElement for this component. A VisualElement provides a common + * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as + * providing a way of rendering to these APIs outside of the React render loop + * for more performant animations and interactions + */ + context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG); + } + /** + * The mount order and hierarchy is specific to ensure our element ref + * is hydrated by the time features fire their effects. + */ + return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] })); + } + MotionDOMComponent.displayName = `motion.${typeof Component === "string" + ? Component + : `create(${Component.displayName ?? Component.name ?? ""})`}`; + const ForwardRefMotionComponent = React$1.forwardRef(MotionDOMComponent); + ForwardRefMotionComponent[motionComponentSymbol] = Component; + return ForwardRefMotionComponent; + } + function useLayoutId({ layoutId }) { + const layoutGroupId = React$1.useContext(LayoutGroupContext).id; + return layoutGroupId && layoutId !== undefined + ? layoutGroupId + "-" + layoutId + : layoutId; + } + function useStrictMode(configAndProps, preloadedFeatures) { + const isStrict = React$1.useContext(LazyContext).strict; + /** + * If we're in development mode, check to make sure we're not rendering a motion component + * as a child of LazyMotion, as this will break the file-size benefits of using it. + */ + if (preloadedFeatures && + isStrict) { + const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."; + configAndProps.ignoreStrict + ? exports.warning(false, strictMessage, "lazy-strict-mode") + : exports.invariant(false, strictMessage, "lazy-strict-mode"); + } + } + function getProjectionFunctionality(props) { + const featureDefinitions = getInitializedFeatureDefinitions(); + const { drag, layout } = featureDefinitions; + if (!drag && !layout) + return {}; + const combined = { ...drag, ...layout }; + return { + MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) + ? combined.MeasureLayout + : undefined, + ProjectionNode: combined.ProjectionNode, + }; + } + + function createMotionProxy(preloadedFeatures, createVisualElement) { + if (typeof Proxy === "undefined") { + return createMotionComponent; + } + /** + * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. + * Rather than generating them anew every render. + */ + const componentCache = new Map(); + const factory = (Component, options) => { + return createMotionComponent(Component, options, preloadedFeatures, createVisualElement); + }; + /** + * Support for deprecated`motion(Component)` pattern + */ + const deprecatedFactoryFunction = (Component, options) => { + { + warnOnce(false, "motion() is deprecated. Use motion.create() instead."); + } + return factory(Component, options); + }; + return new Proxy(deprecatedFactoryFunction, { + /** + * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. + * The prop name is passed through as `key` and we can use that to generate a `motion` + * DOM component with that name. + */ + get: (_target, key) => { + if (key === "create") + return factory; + /** + * If this element doesn't exist in the component cache, create it and cache. + */ + if (!componentCache.has(key)) { + componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement)); + } + return componentCache.get(key); + }, + }); + } + + class AnimationFeature extends Feature { + /** + * We dynamically generate the AnimationState manager as it contains a reference + * to the underlying animation library. We only want to load that if we load this, + * so people can optionally code split it out using the `m` component. + */ + constructor(node) { + super(node); + node.animationState || (node.animationState = createAnimationState(node)); + } + updateAnimationControlsSubscription() { + const { animate } = this.node.getProps(); + if (isAnimationControls(animate)) { + this.unmountControls = animate.subscribe(this.node); + } + } + /** + * Subscribe any provided AnimationControls to the component's VisualElement + */ + mount() { + this.updateAnimationControlsSubscription(); + } + update() { + const { animate } = this.node.getProps(); + const { animate: prevAnimate } = this.node.prevProps || {}; + if (animate !== prevAnimate) { + this.updateAnimationControlsSubscription(); + } + } + unmount() { + this.node.animationState.reset(); + this.unmountControls?.(); + } + } + + let id$1 = 0; + class ExitAnimationFeature extends Feature { + constructor() { + super(...arguments); + this.id = id$1++; + } + update() { + if (!this.node.presenceContext) + return; + const { isPresent, onExitComplete } = this.node.presenceContext; + const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; + if (!this.node.animationState || isPresent === prevIsPresent) { + return; + } + const exitAnimation = this.node.animationState.setActive("exit", !isPresent); + if (onExitComplete && !isPresent) { + exitAnimation.then(() => { + onExitComplete(this.id); + }); + } + } + mount() { + const { register, onExitComplete } = this.node.presenceContext || {}; + if (onExitComplete) { + onExitComplete(this.id); + } + if (register) { + this.unmount = register(this.id); + } + } + unmount() { } + } + + const animations = { + animation: { + Feature: AnimationFeature, + }, + exit: { + Feature: ExitAnimationFeature, + }, + }; + + function extractEventInfo(event) { + return { + point: { + x: event.pageX, + y: event.pageY, + }, + }; + } + const addPointerInfo = (handler) => { + return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); + }; + + function addPointerEvent(target, eventName, handler, options) { + return addDomEvent(target, eventName, addPointerInfo(handler), options); + } + + // Fixes https://github.com/motiondivision/motion/issues/2270 + const getContextWindow = ({ current }) => { + return current ? current.ownerDocument.defaultView : null; + }; + + const distance = (a, b) => Math.abs(a - b); + function distance2D(a, b) { + // Multi-dimensional + const xDelta = distance(a.x, b.x); + const yDelta = distance(a.y, b.y); + return Math.sqrt(xDelta ** 2 + yDelta ** 2); + } + + const overflowStyles$1 = /*#__PURE__*/ new Set(["auto", "scroll"]); + /** + * @internal + */ + class PanSession { + constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) { + /** + * @internal + */ + this.startEvent = null; + /** + * @internal + */ + this.lastMoveEvent = null; + /** + * @internal + */ + this.lastMoveEventInfo = null; + /** + * @internal + */ + this.handlers = {}; + /** + * @internal + */ + this.contextWindow = window; + /** + * Scroll positions of scrollable ancestors and window. + * @internal + */ + this.scrollPositions = new Map(); + /** + * Cleanup function for scroll listeners. + * @internal + */ + this.removeScrollListeners = null; + this.onElementScroll = (event) => { + this.handleScroll(event.target); + }; + this.onWindowScroll = () => { + this.handleScroll(window); + }; + this.updatePoint = () => { + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const info = getPanInfo(this.lastMoveEventInfo, this.history); + const isPanStarted = this.startEvent !== null; + // Only start panning if the offset is larger than 3 pixels. If we make it + // any larger than this we'll want to reset the pointer history + // on the first update to avoid visual snapping to the cursor. + const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold; + if (!isPanStarted && !isDistancePastThreshold) + return; + const { point } = info; + const { timestamp } = frameData; + this.history.push({ ...point, timestamp }); + const { onStart, onMove } = this.handlers; + if (!isPanStarted) { + onStart && onStart(this.lastMoveEvent, info); + this.startEvent = this.lastMoveEvent; + } + onMove && onMove(this.lastMoveEvent, info); + }; + this.handlePointerMove = (event, info) => { + this.lastMoveEvent = event; + this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint); + // Throttle mouse move event to once per frame + frame.update(this.updatePoint, true); + }; + this.handlePointerUp = (event, info) => { + this.end(); + const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; + // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked) + // This ensures constraint animations continue when interrupted by a click + if (this.dragSnapToOrigin || !this.startEvent) { + resumeAnimation && resumeAnimation(); + } + if (!(this.lastMoveEvent && this.lastMoveEventInfo)) + return; + const panInfo = getPanInfo(event.type === "pointercancel" + ? this.lastMoveEventInfo + : transformPoint(info, this.transformPagePoint), this.history); + if (this.startEvent && onEnd) { + onEnd(event, panInfo); + } + onSessionEnd && onSessionEnd(event, panInfo); + }; + // If we have more than one touch, don't start detecting this gesture + if (!isPrimaryPointer(event)) + return; + this.dragSnapToOrigin = dragSnapToOrigin; + this.handlers = handlers; + this.transformPagePoint = transformPagePoint; + this.distanceThreshold = distanceThreshold; + this.contextWindow = contextWindow || window; + const info = extractEventInfo(event); + const initialInfo = transformPoint(info, this.transformPagePoint); + const { point } = initialInfo; + const { timestamp } = frameData; + this.history = [{ ...point, timestamp }]; + const { onSessionStart } = handlers; + onSessionStart && + onSessionStart(event, getPanInfo(initialInfo, this.history)); + this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp)); + // Start scroll tracking if element provided + if (element) { + this.startScrollTracking(element); + } + } + /** + * Start tracking scroll on ancestors and window. + */ + startScrollTracking(element) { + // Store initial scroll positions for scrollable ancestors + let current = element.parentElement; + while (current) { + const style = getComputedStyle(current); + if (overflowStyles$1.has(style.overflowX) || + overflowStyles$1.has(style.overflowY)) { + this.scrollPositions.set(current, { + x: current.scrollLeft, + y: current.scrollTop, + }); + } + current = current.parentElement; + } + // Track window scroll + this.scrollPositions.set(window, { + x: window.scrollX, + y: window.scrollY, + }); + // Capture listener catches element scroll events as they bubble + window.addEventListener("scroll", this.onElementScroll, { + capture: true, + passive: true, + }); + // Direct window scroll listener (window scroll doesn't bubble) + window.addEventListener("scroll", this.onWindowScroll, { + passive: true, + }); + this.removeScrollListeners = () => { + window.removeEventListener("scroll", this.onElementScroll, { + capture: true, + }); + window.removeEventListener("scroll", this.onWindowScroll); + }; + } + /** + * Handle scroll compensation during drag. + * + * For element scroll: adjusts history origin since pageX/pageY doesn't change. + * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change. + */ + handleScroll(target) { + const initial = this.scrollPositions.get(target); + if (!initial) + return; + const isWindow = target === window; + const current = isWindow + ? { x: window.scrollX, y: window.scrollY } + : { + x: target.scrollLeft, + y: target.scrollTop, + }; + const delta = { x: current.x - initial.x, y: current.y - initial.y }; + if (delta.x === 0 && delta.y === 0) + return; + if (isWindow) { + // Window scroll: pageX/pageY changes, so update lastMoveEventInfo + if (this.lastMoveEventInfo) { + this.lastMoveEventInfo.point.x += delta.x; + this.lastMoveEventInfo.point.y += delta.y; + } + } + else { + // Element scroll: pageX/pageY unchanged, so adjust history origin + if (this.history.length > 0) { + this.history[0].x -= delta.x; + this.history[0].y -= delta.y; + } + } + this.scrollPositions.set(target, current); + frame.update(this.updatePoint, true); + } + updateHandlers(handlers) { + this.handlers = handlers; + } + end() { + this.removeListeners && this.removeListeners(); + this.removeScrollListeners && this.removeScrollListeners(); + this.scrollPositions.clear(); + cancelFrame(this.updatePoint); + } + } + function transformPoint(info, transformPagePoint) { + return transformPagePoint ? { point: transformPagePoint(info.point) } : info; + } + function subtractPoint(a, b) { + return { x: a.x - b.x, y: a.y - b.y }; + } + function getPanInfo({ point }, history) { + return { + point, + delta: subtractPoint(point, lastDevicePoint(history)), + offset: subtractPoint(point, startDevicePoint(history)), + velocity: getVelocity(history, 0.1), + }; + } + function startDevicePoint(history) { + return history[0]; + } + function lastDevicePoint(history) { + return history[history.length - 1]; + } + function getVelocity(history, timeDelta) { + if (history.length < 2) { + return { x: 0, y: 0 }; + } + let i = history.length - 1; + let timestampedPoint = null; + const lastPoint = lastDevicePoint(history); + while (i >= 0) { + timestampedPoint = history[i]; + if (lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta)) { + break; + } + i--; + } + if (!timestampedPoint) { + return { x: 0, y: 0 }; + } + /** + * If the selected point is the pointer-down origin (history[0]), + * there are better movement points available, and the time gap + * is suspiciously large (>2x timeDelta), use the next point instead. + * This prevents stale pointer-down points from diluting velocity + * in hold-then-flick gestures. + */ + if (timestampedPoint === history[0] && + history.length > 2 && + lastPoint.timestamp - timestampedPoint.timestamp > + secondsToMilliseconds(timeDelta) * 2) { + timestampedPoint = history[1]; + } + const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); + if (time === 0) { + return { x: 0, y: 0 }; + } + const currentVelocity = { + x: (lastPoint.x - timestampedPoint.x) / time, + y: (lastPoint.y - timestampedPoint.y) / time, + }; + if (currentVelocity.x === Infinity) { + currentVelocity.x = 0; + } + if (currentVelocity.y === Infinity) { + currentVelocity.y = 0; + } + return currentVelocity; + } + + /** + * Apply constraints to a point. These constraints are both physical along an + * axis, and an elastic factor that determines how much to constrain the point + * by if it does lie outside the defined parameters. + */ + function applyConstraints(point, { min, max }, elastic) { + if (min !== undefined && point < min) { + // If we have a min point defined, and this is outside of that, constrain + point = elastic + ? mixNumber$1(min, point, elastic.min) + : Math.max(point, min); + } + else if (max !== undefined && point > max) { + // If we have a max point defined, and this is outside of that, constrain + point = elastic + ? mixNumber$1(max, point, elastic.max) + : Math.min(point, max); + } + return point; + } + /** + * Calculate constraints in terms of the viewport when defined relatively to the + * measured axis. This is measured from the nearest edge, so a max constraint of 200 + * on an axis with a max value of 300 would return a constraint of 500 - axis length + */ + function calcRelativeAxisConstraints(axis, min, max) { + return { + min: min !== undefined ? axis.min + min : undefined, + max: max !== undefined + ? axis.max + max - (axis.max - axis.min) + : undefined, + }; + } + /** + * Calculate constraints in terms of the viewport when + * defined relatively to the measured bounding box. + */ + function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { + return { + x: calcRelativeAxisConstraints(layoutBox.x, left, right), + y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), + }; + } + /** + * Calculate viewport constraints when defined as another viewport-relative axis + */ + function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { + let min = constraintsAxis.min - layoutAxis.min; + let max = constraintsAxis.max - layoutAxis.max; + // If the constraints axis is actually smaller than the layout axis then we can + // flip the constraints + if (constraintsAxis.max - constraintsAxis.min < + layoutAxis.max - layoutAxis.min) { + [min, max] = [max, min]; + } + return { min, max }; + } + /** + * Calculate viewport constraints when defined as another viewport-relative box + */ + function calcViewportConstraints(layoutBox, constraintsBox) { + return { + x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), + y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), + }; + } + /** + * Calculate a transform origin relative to the source axis, between 0-1, that results + * in an asthetically pleasing scale/transform needed to project from source to target. + */ + function calcOrigin(source, target) { + let origin = 0.5; + const sourceLength = calcLength(source); + const targetLength = calcLength(target); + if (targetLength > sourceLength) { + origin = progress(target.min, target.max - sourceLength, source.min); + } + else if (sourceLength > targetLength) { + origin = progress(source.min, source.max - targetLength, target.min); + } + return clamp(0, 1, origin); + } + /** + * Rebase the calculated viewport constraints relative to the layout.min point. + */ + function rebaseAxisConstraints(layout, constraints) { + const relativeConstraints = {}; + if (constraints.min !== undefined) { + relativeConstraints.min = constraints.min - layout.min; + } + if (constraints.max !== undefined) { + relativeConstraints.max = constraints.max - layout.min; + } + return relativeConstraints; + } + const defaultElastic = 0.35; + /** + * Accepts a dragElastic prop and returns resolved elastic values for each axis. + */ + function resolveDragElastic(dragElastic = defaultElastic) { + if (dragElastic === false) { + dragElastic = 0; + } + else if (dragElastic === true) { + dragElastic = defaultElastic; + } + return { + x: resolveAxisElastic(dragElastic, "left", "right"), + y: resolveAxisElastic(dragElastic, "top", "bottom"), + }; + } + function resolveAxisElastic(dragElastic, minLabel, maxLabel) { + return { + min: resolvePointElastic(dragElastic, minLabel), + max: resolvePointElastic(dragElastic, maxLabel), + }; + } + function resolvePointElastic(dragElastic, label) { + return typeof dragElastic === "number" + ? dragElastic + : dragElastic[label] || 0; + } + + const elementDragControls = new WeakMap(); + class VisualElementDragControls { + constructor(visualElement) { + this.openDragLock = null; + this.isDragging = false; + this.currentDirection = null; + this.originPoint = { x: 0, y: 0 }; + /** + * The permitted boundaries of travel, in pixels. + */ + this.constraints = false; + this.hasMutatedConstraints = false; + /** + * The per-axis resolved elastic values. + */ + this.elastic = createBox(); + /** + * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPointerEvent = null; + /** + * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments. + */ + this.latestPanInfo = null; + this.visualElement = visualElement; + } + start(originEvent, { snapToCursor = false, distanceThreshold } = {}) { + /** + * Don't start dragging if this component is exiting + */ + const { presenceContext } = this.visualElement; + if (presenceContext && presenceContext.isPresent === false) + return; + const onSessionStart = (event) => { + if (snapToCursor) { + this.snapToCursor(extractEventInfo(event).point); + } + this.stopAnimation(); + }; + const onStart = (event, info) => { + // Attempt to grab the global drag gesture lock - maybe make this part of PanSession + const { drag, dragPropagation, onDragStart } = this.getProps(); + if (drag && !dragPropagation) { + if (this.openDragLock) + this.openDragLock(); + this.openDragLock = setDragLock(drag); + // If we don 't have the lock, don't start dragging + if (!this.openDragLock) + return; + } + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.isDragging = true; + this.currentDirection = null; + this.resolveConstraints(); + if (this.visualElement.projection) { + this.visualElement.projection.isAnimationBlocked = true; + this.visualElement.projection.target = undefined; + } + /** + * Record gesture origin and pointer offset + */ + eachAxis((axis) => { + let current = this.getAxisMotionValue(axis).get() || 0; + /** + * If the MotionValue is a percentage value convert to px + */ + if (percent.test(current)) { + const { projection } = this.visualElement; + if (projection && projection.layout) { + const measuredAxis = projection.layout.layoutBox[axis]; + if (measuredAxis) { + const length = calcLength(measuredAxis); + current = length * (parseFloat(current) / 100); + } + } + } + this.originPoint[axis] = current; + }); + // Fire onDragStart event + if (onDragStart) { + frame.update(() => onDragStart(event, info), false, true); + } + addValueToWillChange(this.visualElement, "transform"); + const { animationState } = this.visualElement; + animationState && animationState.setActive("whileDrag", true); + }; + const onMove = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps(); + // If we didn't successfully receive the gesture lock, early return. + if (!dragPropagation && !this.openDragLock) + return; + const { offset } = info; + // Attempt to detect drag direction if directionLock is true + if (dragDirectionLock && this.currentDirection === null) { + this.currentDirection = getCurrentDirection(offset); + // If we've successfully set a direction, notify listener + if (this.currentDirection !== null) { + onDirectionLock && onDirectionLock(this.currentDirection); + } + return; + } + // Update each point with the latest position + this.updateAxis("x", info.point, offset); + this.updateAxis("y", info.point, offset); + /** + * Ideally we would leave the renderer to fire naturally at the end of + * this frame but if the element is about to change layout as the result + * of a re-render we want to ensure the browser can read the latest + * bounding box to ensure the pointer and element don't fall out of sync. + */ + this.visualElement.render(); + /** + * This must fire after the render call as it might trigger a state + * change which itself might trigger a layout update. + */ + if (onDrag) { + frame.update(() => onDrag(event, info), false, true); + } + }; + const onSessionEnd = (event, info) => { + this.latestPointerEvent = event; + this.latestPanInfo = info; + this.stop(event, info); + this.latestPointerEvent = null; + this.latestPanInfo = null; + }; + const resumeAnimation = () => { + const { dragSnapToOrigin: snap } = this.getProps(); + if (snap || this.constraints) { + this.startAnimation({ x: 0, y: 0 }); + } + }; + const { dragSnapToOrigin } = this.getProps(); + this.panSession = new PanSession(originEvent, { + onSessionStart, + onStart, + onMove, + onSessionEnd, + resumeAnimation, + }, { + transformPagePoint: this.visualElement.getTransformPagePoint(), + dragSnapToOrigin, + distanceThreshold, + contextWindow: getContextWindow(this.visualElement), + element: this.visualElement.current, + }); + } + /** + * @internal + */ + stop(event, panInfo) { + const finalEvent = event || this.latestPointerEvent; + const finalPanInfo = panInfo || this.latestPanInfo; + const isDragging = this.isDragging; + this.cancel(); + if (!isDragging || !finalPanInfo || !finalEvent) + return; + const { velocity } = finalPanInfo; + this.startAnimation(velocity); + const { onDragEnd } = this.getProps(); + if (onDragEnd) { + frame.postRender(() => onDragEnd(finalEvent, finalPanInfo)); + } + } + /** + * @internal + */ + cancel() { + this.isDragging = false; + const { projection, animationState } = this.visualElement; + if (projection) { + projection.isAnimationBlocked = false; + } + this.endPanSession(); + const { dragPropagation } = this.getProps(); + if (!dragPropagation && this.openDragLock) { + this.openDragLock(); + this.openDragLock = null; + } + animationState && animationState.setActive("whileDrag", false); + } + /** + * Clean up the pan session without modifying other drag state. + * This is used during unmount to ensure event listeners are removed + * without affecting projection animations or drag locks. + * @internal + */ + endPanSession() { + this.panSession && this.panSession.end(); + this.panSession = undefined; + } + updateAxis(axis, _point, offset) { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!offset || !shouldDrag(axis, drag, this.currentDirection)) + return; + const axisValue = this.getAxisMotionValue(axis); + let next = this.originPoint[axis] + offset[axis]; + // Apply constraints + if (this.constraints && this.constraints[axis]) { + next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); + } + axisValue.set(next); + } + resolveConstraints() { + const { dragConstraints, dragElastic } = this.getProps(); + const layout = this.visualElement.projection && + !this.visualElement.projection.layout + ? this.visualElement.projection.measure(false) + : this.visualElement.projection?.layout; + const prevConstraints = this.constraints; + if (dragConstraints && isRefObject(dragConstraints)) { + if (!this.constraints) { + this.constraints = this.resolveRefConstraints(); + } + } + else { + if (dragConstraints && layout) { + this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints); + } + else { + this.constraints = false; + } + } + this.elastic = resolveDragElastic(dragElastic); + /** + * If we're outputting to external MotionValues, we want to rebase the measured constraints + * from viewport-relative to component-relative. This only applies to relative (non-ref) + * constraints, as ref-based constraints from calcViewportConstraints are already in the + * correct coordinate space for the motion value transform offset. + */ + if (prevConstraints !== this.constraints && + !isRefObject(dragConstraints) && + layout && + this.constraints && + !this.hasMutatedConstraints) { + eachAxis((axis) => { + if (this.constraints !== false && + this.getAxisMotionValue(axis)) { + this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]); + } + }); + } + } + resolveRefConstraints() { + const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); + if (!constraints || !isRefObject(constraints)) + return false; + const constraintsElement = constraints.current; + exports.invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref"); + const { projection } = this.visualElement; + // TODO + if (!projection || !projection.layout) + return false; + const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); + let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); + /** + * If there's an onMeasureDragConstraints listener we call it and + * if different constraints are returned, set constraints to that + */ + if (onMeasureDragConstraints) { + const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); + this.hasMutatedConstraints = !!userConstraints; + if (userConstraints) { + measuredConstraints = convertBoundingBoxToBox(userConstraints); + } + } + return measuredConstraints; + } + startAnimation(velocity) { + const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps(); + const constraints = this.constraints || {}; + const momentumAnimations = eachAxis((axis) => { + if (!shouldDrag(axis, drag, this.currentDirection)) { + return; + } + let transition = (constraints && constraints[axis]) || {}; + if (dragSnapToOrigin) + transition = { min: 0, max: 0 }; + /** + * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame + * of spring animations so we should look into adding a disable spring option to `inertia`. + * We could do something here where we affect the `bounceStiffness` and `bounceDamping` + * using the value of `dragElastic`. + */ + const bounceStiffness = dragElastic ? 200 : 1000000; + const bounceDamping = dragElastic ? 40 : 10000000; + const inertia = { + type: "inertia", + velocity: dragMomentum ? velocity[axis] : 0, + bounceStiffness, + bounceDamping, + timeConstant: 750, + restDelta: 1, + restSpeed: 10, + ...dragTransition, + ...transition, + }; + // If we're not animating on an externally-provided `MotionValue` we can use the + // component's animation controls which will handle interactions with whileHover (etc), + // otherwise we just have to animate the `MotionValue` itself. + return this.startAxisValueAnimation(axis, inertia); + }); + // Run all animations and then resolve the new drag constraints. + return Promise.all(momentumAnimations).then(onDragTransitionEnd); + } + startAxisValueAnimation(axis, transition) { + const axisValue = this.getAxisMotionValue(axis); + addValueToWillChange(this.visualElement, axis); + return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); + } + stopAnimation() { + eachAxis((axis) => this.getAxisMotionValue(axis).stop()); + } + /** + * Drag works differently depending on which props are provided. + * + * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. + * - Otherwise, we apply the delta to the x/y motion values. + */ + getAxisMotionValue(axis) { + const dragKey = `_drag${axis.toUpperCase()}`; + const props = this.visualElement.getProps(); + const externalMotionValue = props[dragKey]; + return externalMotionValue + ? externalMotionValue + : this.visualElement.getValue(axis, (props.initial + ? props.initial[axis] + : undefined) || 0); + } + snapToCursor(point) { + eachAxis((axis) => { + const { drag } = this.getProps(); + // If we're not dragging this axis, do an early return. + if (!shouldDrag(axis, drag, this.currentDirection)) + return; + const { projection } = this.visualElement; + const axisValue = this.getAxisMotionValue(axis); + if (projection && projection.layout) { + const { min, max } = projection.layout.layoutBox[axis]; + /** + * The layout measurement includes the current transform value, + * so we need to add it back to get the correct snap position. + * This fixes an issue where elements with initial coordinates + * would snap to the wrong position on the first drag. + */ + const current = axisValue.get() || 0; + axisValue.set(point[axis] - mixNumber$1(min, max, 0.5) + current); + } + }); + } + /** + * When the viewport resizes we want to check if the measured constraints + * have changed and, if so, reposition the element within those new constraints + * relative to where it was before the resize. + */ + scalePositionWithinConstraints() { + if (!this.visualElement.current) + return; + const { drag, dragConstraints } = this.getProps(); + const { projection } = this.visualElement; + if (!isRefObject(dragConstraints) || !projection || !this.constraints) + return; + /** + * Stop current animations as there can be visual glitching if we try to do + * this mid-animation + */ + this.stopAnimation(); + /** + * Record the relative position of the dragged element relative to the + * constraints box and save as a progress value. + */ + const boxProgress = { x: 0, y: 0 }; + eachAxis((axis) => { + const axisValue = this.getAxisMotionValue(axis); + if (axisValue && this.constraints !== false) { + const latest = axisValue.get(); + boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); + } + }); + /** + * Update the layout of this element and resolve the latest drag constraints + */ + const { transformTemplate } = this.visualElement.getProps(); + this.visualElement.current.style.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + /** + * Reset constraints so resolveConstraints() will recalculate them + * with the freshly measured layout rather than returning the cached value. + */ + this.constraints = false; + this.resolveConstraints(); + /** + * For each axis, calculate the current progress of the layout axis + * within the new constraints. + */ + eachAxis((axis) => { + if (!shouldDrag(axis, drag, null)) + return; + /** + * Calculate a new transform based on the previous box progress + */ + const axisValue = this.getAxisMotionValue(axis); + const { min, max } = this.constraints[axis]; + axisValue.set(mixNumber$1(min, max, boxProgress[axis])); + }); + /** + * Flush the updated transform to the DOM synchronously to prevent + * a visual flash at the element's CSS layout position (0,0) when + * the transform was stripped for measurement. + */ + this.visualElement.render(); + } + addListeners() { + if (!this.visualElement.current) + return; + elementDragControls.set(this.visualElement, this); + const element = this.visualElement.current; + /** + * Attach a pointerdown event listener on this DOM element to initiate drag tracking. + */ + const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { + const { drag, dragListener = true } = this.getProps(); + const target = event.target; + /** + * Only block drag if clicking on a text input child element + * (input, textarea, select, contenteditable) where users might + * want to select text or interact with the control. + * + * Buttons and links don't block drag since they don't have + * click-and-move actions of their own. + */ + const isClickingTextInputChild = target !== element && isElementTextInput(target); + if (drag && dragListener && !isClickingTextInputChild) { + this.start(event); + } + }); + /** + * If using ref-based constraints, observe both the draggable element + * and the constraint container for size changes via ResizeObserver. + * Setup is deferred because dragConstraints.current is null when + * addListeners first runs (React hasn't committed the ref yet). + */ + let stopResizeObservers; + const measureDragConstraints = () => { + const { dragConstraints } = this.getProps(); + if (isRefObject(dragConstraints) && dragConstraints.current) { + this.constraints = this.resolveRefConstraints(); + if (!stopResizeObservers) { + stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints()); + } + } + }; + const { projection } = this.visualElement; + const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); + if (projection && !projection.layout) { + projection.root && projection.root.updateScroll(); + projection.updateLayout(); + } + frame.read(measureDragConstraints); + /** + * Attach a window resize listener to scale the draggable target within its defined + * constraints as the window resizes. + */ + const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); + /** + * If the element's layout changes, calculate the delta and apply that to + * the drag gesture's origin point. + */ + const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { + if (this.isDragging && hasLayoutChanged) { + eachAxis((axis) => { + const motionValue = this.getAxisMotionValue(axis); + if (!motionValue) + return; + this.originPoint[axis] += delta[axis].translate; + motionValue.set(motionValue.get() + delta[axis].translate); + }); + this.visualElement.render(); + } + })); + return () => { + stopResizeListener(); + stopPointerListener(); + stopMeasureLayoutListener(); + stopLayoutUpdateListener && stopLayoutUpdateListener(); + stopResizeObservers && stopResizeObservers(); + }; + } + getProps() { + const props = this.visualElement.getProps(); + const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props; + return { + ...props, + drag, + dragDirectionLock, + dragPropagation, + dragConstraints, + dragElastic, + dragMomentum, + }; + } + } + function skipFirstCall(callback) { + let isFirst = true; + return () => { + if (isFirst) { + isFirst = false; + return; + } + callback(); + }; + } + function startResizeObservers(element, constraintsElement, onResize) { + const stopElement = resize(element, skipFirstCall(onResize)); + const stopContainer = resize(constraintsElement, skipFirstCall(onResize)); + return () => { + stopElement(); + stopContainer(); + }; + } + function shouldDrag(direction, drag, currentDirection) { + return ((drag === true || drag === direction) && + (currentDirection === null || currentDirection === direction)); + } + /** + * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower + * than the provided threshold, return `null`. + * + * @param offset - The x/y offset from origin. + * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. + */ + function getCurrentDirection(offset, lockThreshold = 10) { + let direction = null; + if (Math.abs(offset.y) > lockThreshold) { + direction = "y"; + } + else if (Math.abs(offset.x) > lockThreshold) { + direction = "x"; + } + return direction; + } + + class DragGesture extends Feature { + constructor(node) { + super(node); + this.removeGroupControls = noop$1; + this.removeListeners = noop$1; + this.controls = new VisualElementDragControls(node); + } + mount() { + // If we've been provided a DragControls for manual control over the drag gesture, + // subscribe this component to it on mount. + const { dragControls } = this.node.getProps(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + this.removeListeners = this.controls.addListeners() || noop$1; + } + update() { + const { dragControls } = this.node.getProps(); + const { dragControls: prevDragControls } = this.node.prevProps || {}; + if (dragControls !== prevDragControls) { + this.removeGroupControls(); + if (dragControls) { + this.removeGroupControls = dragControls.subscribe(this.controls); + } + } + } + unmount() { + this.removeGroupControls(); + this.removeListeners(); + /** + * In React 19, during list reorder reconciliation, components may + * briefly unmount and remount while the drag is still active. If we're + * actively dragging, we should NOT end the pan session - it will + * continue tracking pointer events via its window-level listeners. + * + * The pan session will be properly cleaned up when: + * 1. The drag ends naturally (pointerup/pointercancel) + * 2. The component is truly removed from the DOM + */ + if (!this.controls.isDragging) { + this.controls.endPanSession(); + } + } + } + + const asyncHandler = (handler) => (event, info) => { + if (handler) { + frame.update(() => handler(event, info), false, true); + } + }; + class PanGesture extends Feature { + constructor() { + super(...arguments); + this.removePointerDownListener = noop$1; + } + onPointerDown(pointerDownEvent) { + this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { + transformPagePoint: this.node.getTransformPagePoint(), + contextWindow: getContextWindow(this.node), + }); + } + createPanHandlers() { + const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); + return { + onSessionStart: asyncHandler(onPanSessionStart), + onStart: asyncHandler(onPanStart), + onMove: asyncHandler(onPan), + onEnd: (event, info) => { + delete this.session; + if (onPanEnd) { + frame.postRender(() => onPanEnd(event, info)); + } + }, + }; + } + mount() { + this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); + } + update() { + this.session && this.session.updateHandlers(this.createPanHandlers()); + } + unmount() { + this.removePointerDownListener(); + this.session && this.session.end(); + } + } + + /** + * Track whether we've taken any snapshots yet. If not, + * we can safely skip notification of didUpdate. + * + * Difficult to capture in a test but to prevent flickering + * we must set this to true either on update or unmount. + * Running `next-env/layout-id` in Safari will show this behaviour if broken. + */ + let hasTakenAnySnapshot = false; + class MeasureLayoutWithContext extends React$1.Component { + /** + * This only mounts projection nodes for components that + * need measuring, we might want to do it for all components + * in order to incorporate transforms + */ + componentDidMount() { + const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; + const { projection } = visualElement; + if (projection) { + if (layoutGroup.group) + layoutGroup.group.add(projection); + if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { + switchLayoutGroup.register(projection); + } + if (hasTakenAnySnapshot) { + projection.root.didUpdate(); + } + projection.addEventListener("animationComplete", () => { + this.safeToRemove(); + }); + projection.setOptions({ + ...projection.options, + layoutDependency: this.props.layoutDependency, + onExitComplete: () => this.safeToRemove(), + }); + } + globalProjectionState.hasEverUpdated = true; + } + getSnapshotBeforeUpdate(prevProps) { + const { layoutDependency, visualElement, drag, isPresent } = this.props; + const { projection } = visualElement; + if (!projection) + return null; + /** + * TODO: We use this data in relegate to determine whether to + * promote a previous element. There's no guarantee its presence data + * will have updated by this point - if a bug like this arises it will + * have to be that we markForRelegation and then find a new lead some other way, + * perhaps in didUpdate + */ + projection.isPresent = isPresent; + if (prevProps.layoutDependency !== layoutDependency) { + projection.setOptions({ + ...projection.options, + layoutDependency, + }); + } + hasTakenAnySnapshot = true; + if (drag || + prevProps.layoutDependency !== layoutDependency || + layoutDependency === undefined || + prevProps.isPresent !== isPresent) { + projection.willUpdate(); + } + else { + this.safeToRemove(); + } + if (prevProps.isPresent !== isPresent) { + if (isPresent) { + projection.promote(); + } + else if (!projection.relegate()) { + /** + * If there's another stack member taking over from this one, + * it's in charge of the exit animation and therefore should + * be in charge of the safe to remove. Otherwise we call it here. + */ + frame.postRender(() => { + const stack = projection.getStack(); + if (!stack || !stack.members.length) { + this.safeToRemove(); + } + }); + } + } + return null; + } + componentDidUpdate() { + const { projection } = this.props.visualElement; + if (projection) { + projection.root.didUpdate(); + microtask.postRender(() => { + if (!projection.currentAnimation && projection.isLead()) { + this.safeToRemove(); + } + }); + } + } + componentWillUnmount() { + const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props; + const { projection } = visualElement; + hasTakenAnySnapshot = true; + if (projection) { + projection.scheduleCheckAfterUnmount(); + if (layoutGroup && layoutGroup.group) + layoutGroup.group.remove(projection); + if (promoteContext && promoteContext.deregister) + promoteContext.deregister(projection); + } + } + safeToRemove() { + const { safeToRemove } = this.props; + safeToRemove && safeToRemove(); + } + render() { + return null; + } + } + function MeasureLayout(props) { + const [isPresent, safeToRemove] = usePresence(); + const layoutGroup = React$1.useContext(LayoutGroupContext); + return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: React$1.useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove })); + } + + const drag = { + pan: { + Feature: PanGesture, + }, + drag: { + Feature: DragGesture, + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, + }; + + function handleHoverEvent(node, event, lifecycle) { + const { props } = node; + if (node.animationState && props.whileHover) { + node.animationState.setActive("whileHover", lifecycle === "Start"); + } + const eventName = ("onHover" + lifecycle); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } + } + class HoverGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + this.unmount = hover(current, (_element, startEvent) => { + handleHoverEvent(this.node, startEvent, "Start"); + return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); + }); + } + unmount() { } + } + + class FocusGesture extends Feature { + constructor() { + super(...arguments); + this.isActive = false; + } + onFocus() { + let isFocusVisible = false; + /** + * If this element doesn't match focus-visible then don't + * apply whileHover. But, if matches throws that focus-visible + * is not a valid selector then in that browser outline styles will be applied + * to the element by default and we want to match that behaviour with whileFocus. + */ + try { + isFocusVisible = this.node.current.matches(":focus-visible"); + } + catch (e) { + isFocusVisible = true; + } + if (!isFocusVisible || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", true); + this.isActive = true; + } + onBlur() { + if (!this.isActive || !this.node.animationState) + return; + this.node.animationState.setActive("whileFocus", false); + this.isActive = false; + } + mount() { + this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); + } + unmount() { } + } + + function handlePressEvent(node, event, lifecycle) { + const { props } = node; + if (node.current instanceof HTMLButtonElement && node.current.disabled) { + return; + } + if (node.animationState && props.whileTap) { + node.animationState.setActive("whileTap", lifecycle === "Start"); + } + const eventName = ("onTap" + (lifecycle === "End" ? "" : lifecycle)); + const callback = props[eventName]; + if (callback) { + frame.postRender(() => callback(event, extractEventInfo(event))); + } + } + class PressGesture extends Feature { + mount() { + const { current } = this.node; + if (!current) + return; + const { globalTapTarget, propagate } = this.node.props; + this.unmount = press(current, (_element, startEvent) => { + handlePressEvent(this.node, startEvent, "Start"); + return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); + }, { + useGlobalTarget: globalTapTarget, + stopPropagation: propagate?.tap === false, + }); + } + unmount() { } + } + + /** + * Map an IntersectionHandler callback to an element. We only ever make one handler for one + * element, so even though these handlers might all be triggered by different + * observers, we can keep them in the same map. + */ + const observerCallbacks = new WeakMap(); + /** + * Multiple observers can be created for multiple element/document roots. Each with + * different settings. So here we store dictionaries of observers to each root, + * using serialised settings (threshold/margin) as lookup keys. + */ + const observers = new WeakMap(); + const fireObserverCallback = (entry) => { + const callback = observerCallbacks.get(entry.target); + callback && callback(entry); + }; + const fireAllObserverCallbacks = (entries) => { + entries.forEach(fireObserverCallback); + }; + function initIntersectionObserver({ root, ...options }) { + const lookupRoot = root || document; + /** + * If we don't have an observer lookup map for this root, create one. + */ + if (!observers.has(lookupRoot)) { + observers.set(lookupRoot, {}); + } + const rootObservers = observers.get(lookupRoot); + const key = JSON.stringify(options); + /** + * If we don't have an observer for this combination of root and settings, + * create one. + */ + if (!rootObservers[key]) { + rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options }); + } + return rootObservers[key]; + } + function observeIntersection(element, options, callback) { + const rootInteresectionObserver = initIntersectionObserver(options); + observerCallbacks.set(element, callback); + rootInteresectionObserver.observe(element); + return () => { + observerCallbacks.delete(element); + rootInteresectionObserver.unobserve(element); + }; + } + + const thresholdNames = { + some: 0, + all: 1, + }; + class InViewFeature extends Feature { + constructor() { + super(...arguments); + this.hasEnteredView = false; + this.isInView = false; + } + startObserver() { + this.unmount(); + const { viewport = {} } = this.node.getProps(); + const { root, margin: rootMargin, amount = "some", once } = viewport; + const options = { + root: root ? root.current : undefined, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholdNames[amount], + }; + const onIntersectionUpdate = (entry) => { + const { isIntersecting } = entry; + /** + * If there's been no change in the viewport state, early return. + */ + if (this.isInView === isIntersecting) + return; + this.isInView = isIntersecting; + /** + * Handle hasEnteredView. If this is only meant to run once, and + * element isn't visible, early return. Otherwise set hasEnteredView to true. + */ + if (once && !isIntersecting && this.hasEnteredView) { + return; + } + else if (isIntersecting) { + this.hasEnteredView = true; + } + if (this.node.animationState) { + this.node.animationState.setActive("whileInView", isIntersecting); + } + /** + * Use the latest committed props rather than the ones in scope + * when this observer is created + */ + const { onViewportEnter, onViewportLeave } = this.node.getProps(); + const callback = isIntersecting ? onViewportEnter : onViewportLeave; + callback && callback(entry); + }; + return observeIntersection(this.node.current, options, onIntersectionUpdate); + } + mount() { + this.startObserver(); + } + update() { + if (typeof IntersectionObserver === "undefined") + return; + const { props, prevProps } = this.node; + const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); + if (hasOptionsChanged) { + this.startObserver(); + } + } + unmount() { } + } + function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { + return (name) => viewport[name] !== prevViewport[name]; + } + + const gestureAnimations = { + inView: { + Feature: InViewFeature, + }, + tap: { + Feature: PressGesture, + }, + focus: { + Feature: FocusGesture, + }, + hover: { + Feature: HoverGesture, + }, + }; + + const layout = { + layout: { + ProjectionNode: HTMLProjectionNode, + MeasureLayout, + }, + }; + + const featureBundle = { + ...animations, + ...gestureAnimations, + ...drag, + ...layout, + }; + + const motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement); + + function checkReorder(order, value, offset, velocity) { + if (!velocity) + return order; + const index = order.findIndex((item) => item.value === value); + if (index === -1) + return order; + const nextOffset = velocity > 0 ? 1 : -1; + const nextItem = order[index + nextOffset]; + if (!nextItem) + return order; + const item = order[index]; + const nextLayout = nextItem.layout; + const nextItemCenter = mixNumber$1(nextLayout.min, nextLayout.max, 0.5); + if ((nextOffset === 1 && item.layout.max + offset > nextItemCenter) || + (nextOffset === -1 && item.layout.min + offset < nextItemCenter)) { + return moveItem(order, index, index + nextOffset); + } + return order; + } + + function ReorderGroupComponent({ children, as = "ul", axis = "y", onReorder, values, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const order = []; + const isReordering = React$1.useRef(false); + const groupRef = React$1.useRef(null); + exports.invariant(Boolean(values), "Reorder.Group must be provided a values prop", "reorder-values"); + const context = { + axis, + groupRef, + registerItem: (value, layout) => { + // If the entry was already added, update it rather than adding it again + const idx = order.findIndex((entry) => value === entry.value); + if (idx !== -1) { + order[idx].layout = layout[axis]; + } + else { + order.push({ value: value, layout: layout[axis] }); + } + order.sort(compareMin); + }, + updateOrder: (item, offset, velocity) => { + if (isReordering.current) + return; + const newOrder = checkReorder(order, item, offset, velocity); + if (order !== newOrder) { + isReordering.current = true; + onReorder(newOrder + .map(getValue) + .filter((value) => values.indexOf(value) !== -1)); + } + }, + }; + React$1.useEffect(() => { + isReordering.current = false; + }); + // Combine refs if external ref is provided + const setRef = (element) => { + groupRef.current = element; + if (typeof externalRef === "function") { + externalRef(element); + } + else if (externalRef) { + externalRef.current = element; + } + }; + /** + * Disable browser scroll anchoring on the group container. + * When items reorder, scroll anchoring can cause the browser to adjust + * the scroll position, which interferes with drag position calculations. + */ + const groupStyle = { + overflowAnchor: "none", + ...props.style, + }; + return (jsx(Component, { ...props, style: groupStyle, ref: setRef, ignoreStrict: true, children: jsx(ReorderContext.Provider, { value: context, children: children }) })); + } + const ReorderGroup = /*@__PURE__*/ React$1.forwardRef(ReorderGroupComponent); + function getValue(item) { + return item.value; + } + function compareMin(a, b) { + return a.layout.min - b.layout.min; + } + + /** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ + function useMotionValue(initial) { + const value = useConstant(() => motionValue(initial)); + /** + * If this motion value is being used in static mode, like on + * the Framer canvas, force components to rerender when the motion + * value is updated. + */ + const { isStatic } = React$1.useContext(MotionConfigContext); + if (isStatic) { + const [, setLatest] = React$1.useState(initial); + React$1.useEffect(() => value.on("change", setLatest), []); + } + return value; + } + + function useCombineMotionValues(values, combineValues) { + /** + * Initialise the returned motion value. This remains the same between renders. + */ + const value = useMotionValue(combineValues()); + /** + * Create a function that will update the template motion value with the latest values. + * This is pre-bound so whenever a motion value updates it can schedule its + * execution in Framesync. If it's already been scheduled it won't be fired twice + * in a single frame. + */ + const updateValue = () => value.set(combineValues()); + /** + * Synchronously update the motion value with the latest values during the render. + * This ensures that within a React render, the styles applied to the DOM are up-to-date. + */ + updateValue(); + /** + * Subscribe to all motion values found within the template. Whenever any of them change, + * schedule an update. + */ + useIsomorphicLayoutEffect(() => { + const scheduleUpdate = () => frame.preRender(updateValue, false, true); + const subscriptions = values.map((v) => v.on("change", scheduleUpdate)); + return () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(updateValue); + }; + }); + return value; + } + + function useComputed(compute) { + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * will be saved into this array. + */ + collectMotionValues.current = []; + compute(); + const value = useCombineMotionValues(collectMotionValues.current, compute); + /** + * Synchronously close session of collectMotionValues. + */ + collectMotionValues.current = undefined; + return value; + } + + function useTransform(input, inputRangeOrTransformer, outputRangeOrMap, options) { + if (typeof input === "function") { + return useComputed(input); + } + /** + * Detect if outputRangeOrMap is an output map (object with keys) + * rather than an output range (array). + */ + const isOutputMap = outputRangeOrMap !== undefined && + !Array.isArray(outputRangeOrMap) && + typeof inputRangeOrTransformer !== "function"; + if (isOutputMap) { + return useMapTransform(input, inputRangeOrTransformer, outputRangeOrMap, options); + } + const outputRange = outputRangeOrMap; + const transformer = typeof inputRangeOrTransformer === "function" + ? inputRangeOrTransformer + : transform(inputRangeOrTransformer, outputRange, options); + const result = Array.isArray(input) + ? useListTransform(input, transformer) + : useListTransform([input], ([latest]) => transformer(latest)); + const inputAccelerate = !Array.isArray(input) + ? input.accelerate + : undefined; + if (inputAccelerate && + !inputAccelerate.isTransformed && + typeof inputRangeOrTransformer !== "function" && + Array.isArray(outputRangeOrMap) && + options?.clamp !== false) { + result.accelerate = { + ...inputAccelerate, + times: inputRangeOrTransformer, + keyframes: outputRangeOrMap, + isTransformed: true, + ...(options?.ease ? { ease: options.ease } : {}), + }; + } + return result; + } + function useListTransform(values, transformer) { + const latest = useConstant(() => []); + return useCombineMotionValues(values, () => { + latest.length = 0; + const numValues = values.length; + for (let i = 0; i < numValues; i++) { + latest[i] = values[i].get(); + } + return transformer(latest); + }); + } + function useMapTransform(inputValue, inputRange, outputMap, options) { + /** + * Capture keys once to ensure hooks are called in consistent order. + */ + const keys = useConstant(() => Object.keys(outputMap)); + const output = useConstant(() => ({})); + for (const key of keys) { + output[key] = useTransform(inputValue, inputRange, outputMap[key], options); + } + return output; + } + + const threshold = 50; + const maxSpeed = 25; + const overflowStyles = new Set(["auto", "scroll"]); + // Track initial scroll limits per scrollable element (Bug 1 fix) + const initialScrollLimits = new WeakMap(); + const activeScrollEdge = new WeakMap(); + // Track which group element is currently dragging to clear state on end + let currentGroupElement = null; + function resetAutoScrollState() { + if (currentGroupElement) { + const scrollableAncestor = findScrollableAncestor(currentGroupElement, "y"); + if (scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + } + // Also try x axis + const scrollableAncestorX = findScrollableAncestor(currentGroupElement, "x"); + if (scrollableAncestorX && scrollableAncestorX !== scrollableAncestor) { + activeScrollEdge.delete(scrollableAncestorX); + initialScrollLimits.delete(scrollableAncestorX); + } + currentGroupElement = null; + } + } + function isScrollableElement(element, axis) { + const style = getComputedStyle(element); + const overflow = axis === "x" ? style.overflowX : style.overflowY; + const isDocumentScroll = element === document.body || + element === document.documentElement; + return overflowStyles.has(overflow) || isDocumentScroll; + } + function findScrollableAncestor(element, axis) { + let current = element?.parentElement; + while (current) { + if (isScrollableElement(current, axis)) { + return current; + } + current = current.parentElement; + } + return null; + } + function getScrollAmount(pointerPosition, scrollElement, axis) { + const rect = scrollElement.getBoundingClientRect(); + const start = axis === "x" ? Math.max(0, rect.left) : Math.max(0, rect.top); + const end = axis === "x" ? Math.min(window.innerWidth, rect.right) : Math.min(window.innerHeight, rect.bottom); + const distanceFromStart = pointerPosition - start; + const distanceFromEnd = end - pointerPosition; + if (distanceFromStart < threshold) { + const intensity = 1 - distanceFromStart / threshold; + return { amount: -maxSpeed * intensity * intensity, edge: "start" }; + } + else if (distanceFromEnd < threshold) { + const intensity = 1 - distanceFromEnd / threshold; + return { amount: maxSpeed * intensity * intensity, edge: "end" }; + } + return { amount: 0, edge: null }; + } + function autoScrollIfNeeded(groupElement, pointerPosition, axis, velocity) { + if (!groupElement) + return; + // Track the group element for cleanup + currentGroupElement = groupElement; + const scrollableAncestor = findScrollableAncestor(groupElement, axis); + if (!scrollableAncestor) + return; + // Convert pointer position from page coordinates to viewport coordinates. + // The gesture system uses pageX/pageY but getBoundingClientRect() returns + // viewport-relative coordinates, so we need to account for page scroll. + const viewportPointerPosition = pointerPosition - (axis === "x" ? window.scrollX : window.scrollY); + const { amount: scrollAmount, edge } = getScrollAmount(viewportPointerPosition, scrollableAncestor, axis); + // If not in any threshold zone, clear all state + if (edge === null) { + activeScrollEdge.delete(scrollableAncestor); + initialScrollLimits.delete(scrollableAncestor); + return; + } + const currentActiveEdge = activeScrollEdge.get(scrollableAncestor); + const isDocumentScroll = scrollableAncestor === document.body || + scrollableAncestor === document.documentElement; + // If not currently scrolling this edge, check velocity to see if we should start + if (currentActiveEdge !== edge) { + // Only start scrolling if velocity is towards the edge + const shouldStart = (edge === "start" && velocity < 0) || + (edge === "end" && velocity > 0); + if (!shouldStart) + return; + // Activate this edge + activeScrollEdge.set(scrollableAncestor, edge); + // Record initial scroll limit (prevents infinite scroll) + const maxScroll = axis === "x" + ? scrollableAncestor.scrollWidth - (isDocumentScroll ? window.innerWidth : scrollableAncestor.clientWidth) + : scrollableAncestor.scrollHeight - (isDocumentScroll ? window.innerHeight : scrollableAncestor.clientHeight); + initialScrollLimits.set(scrollableAncestor, maxScroll); + } + // Cap scrolling at initial limit (prevents infinite scroll) + if (scrollAmount > 0) { + const initialLimit = initialScrollLimits.get(scrollableAncestor); + const currentScroll = axis === "x" + ? (isDocumentScroll ? window.scrollX : scrollableAncestor.scrollLeft) + : (isDocumentScroll ? window.scrollY : scrollableAncestor.scrollTop); + if (currentScroll >= initialLimit) + return; + } + // Apply scroll + if (axis === "x") { + if (isDocumentScroll) { + window.scrollBy({ left: scrollAmount }); + } + else { + scrollableAncestor.scrollLeft += scrollAmount; + } + } + else { + if (isDocumentScroll) { + window.scrollBy({ top: scrollAmount }); + } + else { + scrollableAncestor.scrollTop += scrollAmount; + } + } + } + + function useDefaultMotionValue(value, defaultValue = 0) { + return isMotionValue(value) ? value : useMotionValue(defaultValue); + } + function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) { + const Component = useConstant(() => motion[as]); + const context = React$1.useContext(ReorderContext); + const point = { + x: useDefaultMotionValue(style.x), + y: useDefaultMotionValue(style.y), + }; + const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset"); + exports.invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child"); + const { axis, registerItem, updateOrder, groupRef } = context; + return (jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => { + const { velocity, point: pointerPoint } = gesturePoint; + const offset = point[axis].get(); + // Always attempt to update order - checkReorder handles the logic + updateOrder(value, offset, velocity[axis]); + autoScrollIfNeeded(groupRef.current, pointerPoint[axis], axis, velocity[axis]); + onDrag && onDrag(event, gesturePoint); + }, onDragEnd: (event, gesturePoint) => { + resetAutoScrollState(); + onDragEnd && onDragEnd(event, gesturePoint); + }, onLayoutMeasure: (measured) => { + registerItem(value, measured); + }, ref: externalRef, ignoreStrict: true, children: children })); + } + const ReorderItem = /*@__PURE__*/ React$1.forwardRef(ReorderItemComponent); + + var namespace = /*#__PURE__*/Object.freeze({ + __proto__: null, + Group: ReorderGroup, + Item: ReorderItem + }); + + function isDOMKeyframes(keyframes) { + return typeof keyframes === "object" && !Array.isArray(keyframes); + } + + function resolveSubjects(subject, keyframes, scope, selectorCache) { + if (subject == null) { + return []; + } + if (typeof subject === "string" && isDOMKeyframes(keyframes)) { + return resolveElements(subject, scope, selectorCache); + } + else if (subject instanceof NodeList) { + return Array.from(subject); + } + else if (Array.isArray(subject)) { + return subject.filter((s) => s != null); + } + else { + return [subject]; + } + } + + function calculateRepeatDuration(duration, repeat, _repeatDelay) { + return duration * (repeat + 1); + } + + /** + * Given a absolute or relative time definition and current/prev time state of the sequence, + * calculate an absolute time for the next keyframes. + */ + function calcNextTime(current, next, prev, labels) { + if (typeof next === "number") { + return next; + } + else if (next.startsWith("-") || next.startsWith("+")) { + return Math.max(0, current + parseFloat(next)); + } + else if (next === "<") { + return prev; + } + else if (next.startsWith("<")) { + return Math.max(0, prev + parseFloat(next.slice(1))); + } + else { + return labels.get(next) ?? current; + } + } + + function eraseKeyframes(sequence, startTime, endTime) { + for (let i = 0; i < sequence.length; i++) { + const keyframe = sequence[i]; + if (keyframe.at > startTime && keyframe.at < endTime) { + removeItem(sequence, keyframe); + // If we remove this item we have to push the pointer back one + i--; + } + } + } + function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { + /** + * Erase every existing value between currentTime and targetTime, + * this will essentially splice this timeline into any currently + * defined ones. + */ + eraseKeyframes(sequence, startTime, endTime); + for (let i = 0; i < keyframes.length; i++) { + sequence.push({ + value: keyframes[i], + at: mixNumber$1(startTime, endTime, offset[i]), + easing: getEasingForSegment(easing, i), + }); + } + } + + /** + * Take an array of times that represent repeated keyframes. For instance + * if we have original times of [0, 0.5, 1] then our repeated times will + * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back + * down to a 0-1 scale. + */ + function normalizeTimes(times, repeat) { + for (let i = 0; i < times.length; i++) { + times[i] = times[i] / (repeat + 1); + } + } + + function compareByTime(a, b) { + if (a.at === b.at) { + if (a.value === null) + return 1; + if (b.value === null) + return -1; + return 0; + } + else { + return a.at - b.at; + } + } + + const defaultSegmentEasing = "easeInOut"; + const MAX_REPEAT = 20; + function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) { + const defaultDuration = defaultTransition.duration || 0.3; + const animationDefinitions = new Map(); + const sequences = new Map(); + const elementCache = {}; + const timeLabels = new Map(); + let prevTime = 0; + let currentTime = 0; + let totalDuration = 0; + /** + * Build the timeline by mapping over the sequence array and converting + * the definitions into keyframes and offsets with absolute time values. + * These will later get converted into relative offsets in a second pass. + */ + for (let i = 0; i < sequence.length; i++) { + const segment = sequence[i]; + /** + * If this is a timeline label, mark it and skip the rest of this iteration. + */ + if (typeof segment === "string") { + timeLabels.set(segment, currentTime); + continue; + } + else if (!Array.isArray(segment)) { + timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels)); + continue; + } + let [subject, keyframes, transition = {}] = segment; + /** + * If a relative or absolute time value has been specified we need to resolve + * it in relation to the currentTime. + */ + if (transition.at !== undefined) { + currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels); + } + /** + * Keep track of the maximum duration in this definition. This will be + * applied to currentTime once the definition has been parsed. + */ + let maxDuration = 0; + const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => { + const valueKeyframesAsList = keyframesAsList(valueKeyframes); + const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = defaultTransition.type || "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition; + let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition; + /** + * Resolve stagger() if defined. + */ + const calculatedDelay = typeof delay === "function" + ? delay(elementIndex, numSubjects) + : delay; + /** + * If this animation should and can use a spring, generate a spring easing function. + */ + const numKeyframes = valueKeyframesAsList.length; + const createGenerator = isGenerator(type) + ? type + : generators?.[type || "keyframes"]; + if (numKeyframes <= 2 && createGenerator) { + /** + * As we're creating an easing function from a spring, + * ideally we want to generate it using the real distance + * between the two keyframes. However this isn't always + * possible - in these situations we use 0-100. + */ + let absoluteDelta = 100; + if (numKeyframes === 2 && + isNumberKeyframesArray(valueKeyframesAsList)) { + const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0]; + absoluteDelta = Math.abs(delta); + } + const springTransition = { + ...defaultTransition, + ...remainingTransition, + }; + if (duration !== undefined) { + springTransition.duration = secondsToMilliseconds(duration); + } + const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator); + ease = springEasing.ease; + duration = springEasing.duration; + } + duration ?? (duration = defaultDuration); + const startTime = currentTime + calculatedDelay; + /** + * If there's only one time offset of 0, fill in a second with length 1 + */ + if (times.length === 1 && times[0] === 0) { + times[1] = 1; + } + /** + * Fill out if offset if fewer offsets than keyframes + */ + const remainder = times.length - valueKeyframesAsList.length; + remainder > 0 && fillOffset(times, remainder); + /** + * If only one value has been set, ie [1], push a null to the start of + * the keyframe array. This will let us mark a keyframe at this point + * that will later be hydrated with the previous value. + */ + valueKeyframesAsList.length === 1 && + valueKeyframesAsList.unshift(null); + /** + * Handle repeat options + */ + if (repeat) { + exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20", "repeat-count-high"); + duration = calculateRepeatDuration(duration, repeat); + const originalKeyframes = [...valueKeyframesAsList]; + const originalTimes = [...times]; + ease = Array.isArray(ease) ? [...ease] : [ease]; + const originalEase = [...ease]; + for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) { + valueKeyframesAsList.push(...originalKeyframes); + for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) { + times.push(originalTimes[keyframeIndex] + (repeatIndex + 1)); + ease.push(keyframeIndex === 0 + ? "linear" + : getEasingForSegment(originalEase, keyframeIndex - 1)); + } + } + normalizeTimes(times, repeat); + } + const targetTime = startTime + duration; + /** + * Add keyframes, mapping offsets to absolute time. + */ + addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime); + maxDuration = Math.max(calculatedDelay + duration, maxDuration); + totalDuration = Math.max(targetTime, totalDuration); + }; + if (isMotionValue(subject)) { + const subjectSequence = getSubjectSequence(subject, sequences); + resolveValueSequence(keyframes, transition, getValueSequence("default", subjectSequence)); + } + else { + const subjects = resolveSubjects(subject, keyframes, scope, elementCache); + const numSubjects = subjects.length; + /** + * For every element in this segment, process the defined values. + */ + for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) { + /** + * Cast necessary, but we know these are of this type + */ + keyframes = keyframes; + transition = transition; + const thisSubject = subjects[subjectIndex]; + const subjectSequence = getSubjectSequence(thisSubject, sequences); + for (const key in keyframes) { + resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects); + } + } + } + prevTime = currentTime; + currentTime += maxDuration; + } + /** + * For every element and value combination create a new animation. + */ + sequences.forEach((valueSequences, element) => { + for (const key in valueSequences) { + const valueSequence = valueSequences[key]; + /** + * Arrange all the keyframes in ascending time order. + */ + valueSequence.sort(compareByTime); + const keyframes = []; + const valueOffset = []; + const valueEasing = []; + /** + * For each keyframe, translate absolute times into + * relative offsets based on the total duration of the timeline. + */ + for (let i = 0; i < valueSequence.length; i++) { + const { at, value, easing } = valueSequence[i]; + keyframes.push(value); + valueOffset.push(progress(0, totalDuration, at)); + valueEasing.push(easing || "easeOut"); + } + /** + * If the first keyframe doesn't land on offset: 0 + * provide one by duplicating the initial keyframe. This ensures + * it snaps to the first keyframe when the animation starts. + */ + if (valueOffset[0] !== 0) { + valueOffset.unshift(0); + keyframes.unshift(keyframes[0]); + valueEasing.unshift(defaultSegmentEasing); + } + /** + * If the last keyframe doesn't land on offset: 1 + * provide one with a null wildcard value. This will ensure it + * stays static until the end of the animation. + */ + if (valueOffset[valueOffset.length - 1] !== 1) { + valueOffset.push(1); + keyframes.push(null); + } + if (!animationDefinitions.has(element)) { + animationDefinitions.set(element, { + keyframes: {}, + transition: {}, + }); + } + const definition = animationDefinitions.get(element); + definition.keyframes[key] = keyframes; + /** + * Exclude `type` from defaultTransition since springs have been + * converted to duration-based easing functions in resolveValueSequence. + * Including `type: "spring"` would cause JSAnimation to error when + * the merged keyframes array has more than 2 keyframes. + */ + const { type: _type, ...remainingDefaultTransition } = defaultTransition; + definition.transition[key] = { + ...remainingDefaultTransition, + duration: totalDuration, + ease: valueEasing, + times: valueOffset, + ...sequenceTransition, + }; + } + }); + return animationDefinitions; + } + function getSubjectSequence(subject, sequences) { + !sequences.has(subject) && sequences.set(subject, {}); + return sequences.get(subject); + } + function getValueSequence(name, sequences) { + if (!sequences[name]) + sequences[name] = []; + return sequences[name]; + } + function keyframesAsList(keyframes) { + return Array.isArray(keyframes) ? keyframes : [keyframes]; + } + function getValueTransition(transition, key) { + return transition && transition[key] + ? { + ...transition, + ...transition[key], + } + : { ...transition }; + } + const isNumber = (keyframe) => typeof keyframe === "number"; + const isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber); + + function createDOMVisualElement(element) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + attrs: {}, + }, + latestValues: {}, + }, + }; + const node = isSVGElement(element) && !isSVGSVGElement(element) + ? new SVGVisualElement(options) + : new HTMLVisualElement(options); + node.mount(element); + visualElementStore.set(element, node); + } + function createObjectVisualElement(subject) { + const options = { + presenceContext: null, + props: {}, + visualState: { + renderState: { + output: {}, + }, + latestValues: {}, + }, + }; + const node = new ObjectVisualElement(options); + node.mount(subject); + visualElementStore.set(subject, node); + } + + function isSingleValue(subject, keyframes) { + return (isMotionValue(subject) || + typeof subject === "number" || + (typeof subject === "string" && !isDOMKeyframes(keyframes))); + } + /** + * Implementation + */ + function animateSubject(subject, keyframes, options, scope) { + const animations = []; + if (isSingleValue(subject, keyframes)) { + animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes) + ? keyframes.default || keyframes + : keyframes, options ? options.default || options : options)); + } + else { + // Gracefully handle null/undefined subjects (e.g., from querySelector returning null) + if (subject == null) { + return animations; + } + const subjects = resolveSubjects(subject, keyframes, scope); + const numSubjects = subjects.length; + exports.invariant(Boolean(numSubjects), "No valid elements provided.", "no-valid-elements"); + for (let i = 0; i < numSubjects; i++) { + const thisSubject = subjects[i]; + const createVisualElement = thisSubject instanceof Element + ? createDOMVisualElement + : createObjectVisualElement; + if (!visualElementStore.has(thisSubject)) { + createVisualElement(thisSubject); + } + const visualElement = visualElementStore.get(thisSubject); + const transition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if ("delay" in transition && + typeof transition.delay === "function") { + transition.delay = transition.delay(i, numSubjects); + } + animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {})); + } + } + return animations; + } + + function animateSequence(sequence, options, scope) { + const animations = []; + /** + * Pre-process: replace function segments with MotionValue segments, + * subscribe callbacks immediately + */ + const processedSequence = sequence.map((segment) => { + if (Array.isArray(segment) && typeof segment[0] === "function") { + const callback = segment[0]; + const mv = motionValue(0); + mv.on("change", callback); + if (segment.length === 1) { + return [mv, [0, 1]]; + } + else if (segment.length === 2) { + return [mv, [0, 1], segment[1]]; + } + else { + return [mv, segment[1], segment[2]]; + } + } + return segment; + }); + const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring }); + animationDefinitions.forEach(({ keyframes, transition }, subject) => { + animations.push(...animateSubject(subject, keyframes, transition)); + }); + return animations; + } + + function isSequence(value) { + return Array.isArray(value) && value.some(Array.isArray); + } + /** + * Creates an animation function that is optionally scoped + * to a specific element. + */ + function createScopedAnimate(options = {}) { + const { scope, reduceMotion } = options; + /** + * Implementation + */ + function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) { + let animations = []; + let animationOnComplete; + if (isSequence(subjectOrSequence)) { + animations = animateSequence(subjectOrSequence, reduceMotion !== undefined + ? { reduceMotion, ...optionsOrKeyframes } + : optionsOrKeyframes, scope); + } + else { + // Extract top-level onComplete so it doesn't get applied per-value + const { onComplete, ...rest } = options || {}; + if (typeof onComplete === "function") { + animationOnComplete = onComplete; + } + animations = animateSubject(subjectOrSequence, optionsOrKeyframes, (reduceMotion !== undefined + ? { reduceMotion, ...rest } + : rest), scope); + } + const animation = new GroupAnimationWithThen(animations); + if (animationOnComplete) { + animation.finished.then(animationOnComplete); + } + if (scope) { + scope.animations.push(animation); + animation.finished.then(() => { + removeItem(scope.animations, animation); + }); + } + return animation; + } + return scopedAnimate; + } + const animate = createScopedAnimate(); + + function animateElements(elementOrSelector, keyframes, options, scope) { + // Gracefully handle null/undefined elements (e.g., from querySelector returning null) + if (elementOrSelector == null) { + return []; + } + const elements = resolveElements(elementOrSelector, scope); + const numElements = elements.length; + exports.invariant(Boolean(numElements), "No valid elements provided.", "no-valid-elements"); + /** + * WAAPI doesn't support interrupting animations. + * + * Therefore, starting animations requires a three-step process: + * 1. Stop existing animations (write styles to DOM) + * 2. Resolve keyframes (read styles from DOM) + * 3. Create new animations (write styles to DOM) + * + * The hybrid `animate()` function uses AsyncAnimation to resolve + * keyframes before creating new animations, which removes style + * thrashing. Here, we have much stricter filesize constraints. + * Therefore we do this in a synchronous way that ensures that + * at least within `animate()` calls there is no style thrashing. + * + * In the motion-native-animate-mini-interrupt benchmark this + * was 80% faster than a single loop. + */ + const animationDefinitions = []; + /** + * Step 1: Build options and stop existing animations (write) + */ + for (let i = 0; i < numElements; i++) { + const element = elements[i]; + const elementTransition = { ...options }; + /** + * Resolve stagger function if provided. + */ + if (typeof elementTransition.delay === "function") { + elementTransition.delay = elementTransition.delay(i, numElements); + } + for (const valueName in keyframes) { + let valueKeyframes = keyframes[valueName]; + if (!Array.isArray(valueKeyframes)) { + valueKeyframes = [valueKeyframes]; + } + const valueOptions = { + ...getValueTransition$1(elementTransition, valueName), + }; + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + /** + * If there's an existing animation playing on this element then stop it + * before creating a new one. + */ + const map = getAnimationMap(element); + const key = animationMapKey(valueName, valueOptions.pseudoElement || ""); + const currentAnimation = map.get(key); + currentAnimation && currentAnimation.stop(); + animationDefinitions.push({ + map, + key, + unresolvedKeyframes: valueKeyframes, + options: { + ...valueOptions, + element, + name: valueName, + allowFlatten: !elementTransition.type && !elementTransition.ease, + }, + }); + } + } + /** + * Step 2: Resolve keyframes (read) + */ + for (let i = 0; i < animationDefinitions.length; i++) { + const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i]; + const { element, name, pseudoElement } = animationOptions; + if (!pseudoElement && unresolvedKeyframes[0] === null) { + unresolvedKeyframes[0] = getComputedStyle$2(element, name); + } + fillWildcards(unresolvedKeyframes); + applyPxDefaults(unresolvedKeyframes, name); + /** + * If we only have one keyframe, explicitly read the initial keyframe + * from the computed style. This is to ensure consistency with WAAPI behaviour + * for restarting animations, for instance .play() after finish, when it + * has one vs two keyframes. + */ + if (!pseudoElement && unresolvedKeyframes.length < 2) { + unresolvedKeyframes.unshift(getComputedStyle$2(element, name)); + } + animationOptions.keyframes = unresolvedKeyframes; + } + /** + * Step 3: Create new animations (write) + */ + const animations = []; + for (let i = 0; i < animationDefinitions.length; i++) { + const { map, key, options: animationOptions } = animationDefinitions[i]; + const animation = new NativeAnimation(animationOptions); + map.set(key, animation); + animation.finished.finally(() => map.delete(key)); + animations.push(animation); + } + return animations; + } + + const createScopedWaapiAnimate = (scope) => { + function scopedAnimate(elementOrSelector, keyframes, options) { + return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope)); + } + return scopedAnimate; + }; + const animateMini = /*@__PURE__*/ createScopedWaapiAnimate(); + + /** + * A time in milliseconds, beyond which we consider the scroll velocity to be 0. + */ + const maxElapsed = 50; + const createAxisInfo = () => ({ + current: 0, + offset: [], + progress: 0, + scrollLength: 0, + targetOffset: 0, + targetLength: 0, + containerLength: 0, + velocity: 0, + }); + const createScrollInfo = () => ({ + time: 0, + x: createAxisInfo(), + y: createAxisInfo(), + }); + const keys = { + x: { + length: "Width", + position: "Left", + }, + y: { + length: "Height", + position: "Top", + }, + }; + function updateAxisInfo(element, axisName, info, time) { + const axis = info[axisName]; + const { length, position } = keys[axisName]; + const prev = axis.current; + const prevTime = info.time; + axis.current = element[`scroll${position}`]; + axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]; + axis.offset.length = 0; + axis.offset[0] = 0; + axis.offset[1] = axis.scrollLength; + axis.progress = progress(0, axis.scrollLength, axis.current); + const elapsed = time - prevTime; + axis.velocity = + elapsed > maxElapsed + ? 0 + : velocityPerSecond(axis.current - prev, elapsed); + } + function updateScrollInfo(element, info, time) { + updateAxisInfo(element, "x", info, time); + updateAxisInfo(element, "y", info, time); + info.time = time; + } + + function calcInset(element, container) { + const inset = { x: 0, y: 0 }; + let current = element; + while (current && current !== container) { + if (isHTMLElement(current)) { + inset.x += current.offsetLeft; + inset.y += current.offsetTop; + current = current.offsetParent; + } + else if (current.tagName === "svg") { + /** + * This isn't an ideal approach to measuring the offset of tags. + * It would be preferable, given they behave like HTMLElements in most ways + * to use offsetLeft/Top. But these don't exist on . Likewise we + * can't use .getBBox() like most SVG elements as these provide the offset + * relative to the SVG itself, which for is usually 0x0. + */ + const svgBoundingBox = current.getBoundingClientRect(); + current = current.parentElement; + const parentBoundingBox = current.getBoundingClientRect(); + inset.x += svgBoundingBox.left - parentBoundingBox.left; + inset.y += svgBoundingBox.top - parentBoundingBox.top; + } + else if (current instanceof SVGGraphicsElement) { + const { x, y } = current.getBBox(); + inset.x += x; + inset.y += y; + let svg = null; + let parent = current.parentNode; + while (!svg) { + if (parent.tagName === "svg") { + svg = parent; + } + parent = current.parentNode; + } + current = svg; + } + else { + break; + } + } + return inset; + } + + const namedEdges = { + start: 0, + center: 0.5, + end: 1, + }; + function resolveEdge(edge, length, inset = 0) { + let delta = 0; + /** + * If we have this edge defined as a preset, replace the definition + * with the numerical value. + */ + if (edge in namedEdges) { + edge = namedEdges[edge]; + } + /** + * Handle unit values + */ + if (typeof edge === "string") { + const asNumber = parseFloat(edge); + if (edge.endsWith("px")) { + delta = asNumber; + } + else if (edge.endsWith("%")) { + edge = asNumber / 100; + } + else if (edge.endsWith("vw")) { + delta = (asNumber / 100) * document.documentElement.clientWidth; + } + else if (edge.endsWith("vh")) { + delta = (asNumber / 100) * document.documentElement.clientHeight; + } + else { + edge = asNumber; + } + } + /** + * If the edge is defined as a number, handle as a progress value. + */ + if (typeof edge === "number") { + delta = length * edge; + } + return inset + delta; + } + + const defaultOffset = [0, 0]; + function resolveOffset(offset, containerLength, targetLength, targetInset) { + let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; + let targetPoint = 0; + let containerPoint = 0; + if (typeof offset === "number") { + /** + * If we're provided offset: [0, 0.5, 1] then each number x should become + * [x, x], so we default to the behaviour of mapping 0 => 0 of both target + * and container etc. + */ + offsetDefinition = [offset, offset]; + } + else if (typeof offset === "string") { + offset = offset.trim(); + if (offset.includes(" ")) { + offsetDefinition = offset.split(" "); + } + else { + /** + * If we're provided a definition like "100px" then we want to apply + * that only to the top of the target point, leaving the container at 0. + * Whereas a named offset like "end" should be applied to both. + */ + offsetDefinition = [offset, namedEdges[offset] ? offset : `0`]; + } + } + targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset); + containerPoint = resolveEdge(offsetDefinition[1], containerLength); + return targetPoint - containerPoint; + } + + const ScrollOffset = { + Enter: [ + [0, 1], + [1, 1], + ], + Exit: [ + [0, 0], + [1, 0], + ], + Any: [ + [1, 0], + [0, 1], + ], + All: [ + [0, 0], + [1, 1], + ], + }; + + const point = { x: 0, y: 0 }; + function getTargetSize(target) { + return "getBBox" in target && target.tagName !== "svg" + ? target.getBBox() + : { width: target.clientWidth, height: target.clientHeight }; + } + function resolveOffsets(container, info, options) { + const { offset: offsetDefinition = ScrollOffset.All } = options; + const { target = container, axis = "y" } = options; + const lengthLabel = axis === "y" ? "height" : "width"; + const inset = target !== container ? calcInset(target, container) : point; + /** + * Measure the target and container. If they're the same thing then we + * use the container's scrollWidth/Height as the target, from there + * all other calculations can remain the same. + */ + const targetSize = target === container + ? { width: container.scrollWidth, height: container.scrollHeight } + : getTargetSize(target); + const containerSize = { + width: container.clientWidth, + height: container.clientHeight, + }; + /** + * Reset the length of the resolved offset array rather than creating a new one. + * TODO: More reusable data structures for targetSize/containerSize would also be good. + */ + info[axis].offset.length = 0; + /** + * Populate the offset array by resolving the user's offset definition into + * a list of pixel scroll offets. + */ + let hasChanged = !info[axis].interpolate; + const numOffsets = offsetDefinition.length; + for (let i = 0; i < numOffsets; i++) { + const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); + if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { + hasChanged = true; + } + info[axis].offset[i] = offset; + } + /** + * If the pixel scroll offsets have changed, create a new interpolator function + * to map scroll value into a progress. + */ + if (hasChanged) { + info[axis].interpolate = interpolate(info[axis].offset, defaultOffset$1(offsetDefinition), { clamp: false }); + info[axis].interpolatorOffsets = [...info[axis].offset]; + } + info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current)); + } + + function measure(container, target = container, info) { + /** + * Find inset of target within scrollable container + */ + info.x.targetOffset = 0; + info.y.targetOffset = 0; + if (target !== container) { + let node = target; + while (node && node !== container) { + info.x.targetOffset += node.offsetLeft; + info.y.targetOffset += node.offsetTop; + node = node.offsetParent; + } + } + info.x.targetLength = + target === container ? target.scrollWidth : target.clientWidth; + info.y.targetLength = + target === container ? target.scrollHeight : target.clientHeight; + info.x.containerLength = container.clientWidth; + info.y.containerLength = container.clientHeight; + /** + * In development mode ensure scroll containers aren't position: static as this makes + * it difficult to measure their relative positions. + */ + { + if (container && target && target !== container) { + warnOnce(getComputedStyle(container).position !== "static", "Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly."); + } + } + } + function createOnScrollHandler(element, onScroll, info, options = {}) { + return { + measure: (time) => { + measure(element, options.target, info); + updateScrollInfo(element, info, time); + if (options.offset || options.target) { + resolveOffsets(element, info, options); + } + }, + notify: () => onScroll(info), + }; + } + + const scrollListeners = new WeakMap(); + const resizeListeners = new WeakMap(); + const onScrollHandlers = new WeakMap(); + const scrollSize = new WeakMap(); + const dimensionCheckProcesses = new WeakMap(); + const getEventTarget = (element) => element === document.scrollingElement ? window : element; + function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) { + if (!container) + return noop$1; + let containerHandlers = onScrollHandlers.get(container); + /** + * Get the onScroll handlers for this container. + * If one isn't found, create a new one. + */ + if (!containerHandlers) { + containerHandlers = new Set(); + onScrollHandlers.set(container, containerHandlers); + } + /** + * Create a new onScroll handler for the provided callback. + */ + const info = createScrollInfo(); + const containerHandler = createOnScrollHandler(container, onScroll, info, options); + containerHandlers.add(containerHandler); + /** + * Check if there's a scroll event listener for this container. + * If not, create one. + */ + if (!scrollListeners.has(container)) { + const measureAll = () => { + for (const handler of containerHandlers) { + handler.measure(frameData.timestamp); + } + frame.preUpdate(notifyAll); + }; + const notifyAll = () => { + for (const handler of containerHandlers) { + handler.notify(); + } + }; + const listener = () => frame.read(measureAll); + scrollListeners.set(container, listener); + const target = getEventTarget(container); + window.addEventListener("resize", listener, { passive: true }); + if (container !== document.documentElement) { + resizeListeners.set(container, resize(container, listener)); + } + target.addEventListener("scroll", listener, { passive: true }); + listener(); + } + /** + * Enable content size tracking if requested and not already enabled. + */ + if (trackContentSize && !dimensionCheckProcesses.has(container)) { + const listener = scrollListeners.get(container); + // Store initial scroll dimensions (object is reused to avoid allocation) + const size = { + width: container.scrollWidth, + height: container.scrollHeight, + }; + scrollSize.set(container, size); + // Add frame-based scroll dimension checking to detect content changes + const checkScrollDimensions = () => { + const newWidth = container.scrollWidth; + const newHeight = container.scrollHeight; + if (size.width !== newWidth || size.height !== newHeight) { + listener(); + size.width = newWidth; + size.height = newHeight; + } + }; + // Schedule with keepAlive=true to run every frame + const dimensionCheckProcess = frame.read(checkScrollDimensions, true); + dimensionCheckProcesses.set(container, dimensionCheckProcess); + } + const listener = scrollListeners.get(container); + frame.read(listener, false, true); + return () => { + cancelFrame(listener); + /** + * Check if we even have any handlers for this container. + */ + const currentHandlers = onScrollHandlers.get(container); + if (!currentHandlers) + return; + currentHandlers.delete(containerHandler); + if (currentHandlers.size) + return; + /** + * If no more handlers, remove the scroll listener too. + */ + const scrollListener = scrollListeners.get(container); + scrollListeners.delete(container); + if (scrollListener) { + getEventTarget(container).removeEventListener("scroll", scrollListener); + resizeListeners.get(container)?.(); + window.removeEventListener("resize", scrollListener); + } + // Clean up scroll dimension checking + const dimensionCheckProcess = dimensionCheckProcesses.get(container); + if (dimensionCheckProcess) { + cancelFrame(dimensionCheckProcess); + dimensionCheckProcesses.delete(container); + } + scrollSize.delete(container); + }; + } + + function canUseNativeTimeline(target) { + return (typeof window !== "undefined" && !target && supportsScrollTimeline()); + } + + const timelineCache = new Map(); + function scrollTimelineFallback(options) { + const currentTime = { value: 0 }; + const cancel = scrollInfo((info) => { + currentTime.value = info[options.axis].progress * 100; + }, options); + return { currentTime, cancel }; + } + function getTimeline({ source, container, ...options }) { + const { axis } = options; + if (source) + container = source; + const containerCache = timelineCache.get(container) ?? new Map(); + timelineCache.set(container, containerCache); + const targetKey = options.target ?? "self"; + const targetCache = containerCache.get(targetKey) ?? {}; + const axisKey = axis + (options.offset ?? []).join(","); + if (!targetCache[axisKey]) { + targetCache[axisKey] = + canUseNativeTimeline(options.target) + ? new ScrollTimeline({ source: container, axis }) + : scrollTimelineFallback({ container, ...options }); + } + return targetCache[axisKey]; + } + + function attachToAnimation(animation, options) { + const timeline = getTimeline(options); + return animation.attachTimeline({ + timeline: options.target ? undefined : timeline, + observe: (valueAnimation) => { + valueAnimation.pause(); + return observeTimeline((progress) => { + valueAnimation.time = + valueAnimation.iterationDuration * progress; + }, timeline); + }, + }); + } + + /** + * If the onScroll function has two arguments, it's expecting + * more specific information about the scroll from scrollInfo. + */ + function isOnScrollWithInfo(onScroll) { + return onScroll.length === 2; + } + function attachToFunction(onScroll, options) { + if (isOnScrollWithInfo(onScroll)) { + return scrollInfo((info) => { + onScroll(info[options.axis].progress, info); + }, options); + } + else { + return observeTimeline(onScroll, getTimeline(options)); + } + } + + function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) { + if (!container) + return noop$1; + const optionsWithDefaults = { axis, container, ...options }; + return typeof onScroll === "function" + ? attachToFunction(onScroll, optionsWithDefaults) + : attachToAnimation(onScroll, optionsWithDefaults); + } + + const thresholds = { + some: 0, + all: 1, + }; + function inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = "some" } = {}) { + const elements = resolveElements(elementOrSelector); + const activeIntersections = new WeakMap(); + const onIntersectionChange = (entries) => { + entries.forEach((entry) => { + const onEnd = activeIntersections.get(entry.target); + /** + * If there's no change to the intersection, we don't need to + * do anything here. + */ + if (entry.isIntersecting === Boolean(onEnd)) + return; + if (entry.isIntersecting) { + const newOnEnd = onStart(entry.target, entry); + if (typeof newOnEnd === "function") { + activeIntersections.set(entry.target, newOnEnd); + } + else { + observer.unobserve(entry.target); + } + } + else if (typeof onEnd === "function") { + onEnd(entry); + activeIntersections.delete(entry.target); + } + }); + }; + const observer = new IntersectionObserver(onIntersectionChange, { + root, + rootMargin, + threshold: typeof amount === "number" ? amount : thresholds[amount], + }); + elements.forEach((element) => observer.observe(element)); + return () => observer.disconnect(); + } + + const m = /*@__PURE__*/ createMotionProxy(); + + function useUnmountEffect(callback) { + return React$1.useEffect(() => () => callback(), []); + } + + /** + * @public + */ + const domAnimation = { + renderer: createDomVisualElement, + ...animations, + ...gestureAnimations, + }; + + /** + * @public + */ + const domMax = { + ...domAnimation, + ...drag, + ...layout, + }; + + /** + * @public + */ + const domMin = { + renderer: createDomVisualElement, + ...animations, + }; + + function useMotionValueEvent(value, event, callback) { + /** + * useInsertionEffect will create subscriptions before any other + * effects will run. Effects run upwards through the tree so it + * can be that binding a useLayoutEffect higher up the tree can + * miss changes from lower down the tree. + */ + React$1.useInsertionEffect(() => value.on(event, callback), [value, event, callback]); + } + + const createScrollMotionValues = () => ({ + scrollX: motionValue(0), + scrollY: motionValue(0), + scrollXProgress: motionValue(0), + scrollYProgress: motionValue(0), + }); + const isRefPending = (ref) => { + if (!ref) + return false; + return !ref.current; + }; + function makeAccelerateConfig(axis, options, container) { + return { + factory: (animation) => scroll(animation, { ...options, axis, container }), + times: [0, 1], + keyframes: [0, 1], + ease: (v) => v, + duration: 1, + }; + } + function useScroll({ container, target, ...options } = {}) { + const values = useConstant(createScrollMotionValues); + if (!target && canUseNativeTimeline()) { + const resolvedContainer = container?.current || undefined; + values.scrollXProgress.accelerate = makeAccelerateConfig("x", options, resolvedContainer); + values.scrollYProgress.accelerate = makeAccelerateConfig("y", options, resolvedContainer); + } + const scrollAnimation = React$1.useRef(null); + const needsStart = React$1.useRef(false); + const start = React$1.useCallback(() => { + scrollAnimation.current = scroll((_progress, { x, y, }) => { + values.scrollX.set(x.current); + values.scrollXProgress.set(x.progress); + values.scrollY.set(y.current); + values.scrollYProgress.set(y.progress); + }, { + ...options, + container: container?.current || undefined, + target: target?.current || undefined, + }); + return () => { + scrollAnimation.current?.(); + }; + }, [container, target, JSON.stringify(options.offset)]); + useIsomorphicLayoutEffect(() => { + needsStart.current = false; + if (isRefPending(container) || isRefPending(target)) { + needsStart.current = true; + return; + } + else { + return start(); + } + }, [start]); + React$1.useEffect(() => { + if (needsStart.current) { + exports.invariant(!isRefPending(container), "Container ref is defined but not hydrated", "use-scroll-ref"); + exports.invariant(!isRefPending(target), "Target ref is defined but not hydrated", "use-scroll-ref"); + return start(); + } + else { + return; + } + }, [start]); + return values; + } + + /** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ + function useElementScroll(ref) { + { + warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref })."); + } + return useScroll({ container: ref }); + } + + /** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ + function useViewportScroll() { + { + warnOnce(false, "useViewportScroll is deprecated. Convert to useScroll()."); + } + return useScroll(); + } + + /** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ + function useMotionTemplate(fragments, ...values) { + /** + * Create a function that will build a string from the latest motion values. + */ + const numFragments = fragments.length; + function buildValue() { + let output = ``; + for (let i = 0; i < numFragments; i++) { + output += fragments[i]; + const value = values[i]; + if (value) { + output += isMotionValue(value) ? value.get() : value; + } + } + return output; + } + return useCombineMotionValues(values.filter(isMotionValue), buildValue); + } + + function useFollowValue(source, options = {}) { + const { isStatic } = React$1.useContext(MotionConfigContext); + const getFromSource = () => (isMotionValue(source) ? source.get() : source); + // isStatic will never change, allowing early hooks return + if (isStatic) { + return useTransform(getFromSource); + } + const value = useMotionValue(getFromSource()); + React$1.useInsertionEffect(() => { + return attachFollow(value, source, options); + }, [value, JSON.stringify(options)]); + return value; + } + + function useSpring(source, options = {}) { + return useFollowValue(source, { type: "spring", ...options }); + } + + function useAnimationFrame(callback) { + const initialTimestamp = React$1.useRef(0); + const { isStatic } = React$1.useContext(MotionConfigContext); + React$1.useEffect(() => { + if (isStatic) + return; + const provideTimeSinceStart = ({ timestamp, delta }) => { + if (!initialTimestamp.current) + initialTimestamp.current = timestamp; + callback(timestamp - initialTimestamp.current, delta); + }; + frame.update(provideTimeSinceStart, true); + return () => cancelFrame(provideTimeSinceStart); + }, [callback]); + } + + function useTime() { + const time = useMotionValue(0); + useAnimationFrame((t) => time.set(t)); + return time; + } + + /** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ + function useVelocity(value) { + const velocity = useMotionValue(value.getVelocity()); + const updateVelocity = () => { + const latest = value.getVelocity(); + velocity.set(latest); + /** + * If we still have velocity, schedule an update for the next frame + * to keep checking until it is zero. + */ + if (latest) + frame.update(updateVelocity); + }; + useMotionValueEvent(value, "change", () => { + // Schedule an update to this value at the end of the current frame. + frame.update(updateVelocity, false, true); + }); + return velocity; + } + + class WillChangeMotionValue extends MotionValue { + constructor() { + super(...arguments); + this.isEnabled = false; + } + add(name) { + if (transformProps.has(name) || acceleratedValues.has(name)) { + this.isEnabled = true; + this.update(); + } + } + update() { + this.set(this.isEnabled ? "transform" : "auto"); + } + } + + function useWillChange() { + return useConstant(() => new WillChangeMotionValue("auto")); + } + + /** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ + function useReducedMotion() { + /** + * Lazy initialisation of prefersReducedMotion + */ + !hasReducedMotionListener.current && initPrefersReducedMotion(); + const [shouldReduceMotion] = React$1.useState(prefersReducedMotion.current); + { + warnOnce(shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * TODO See if people miss automatically updating shouldReduceMotion setting + */ + return shouldReduceMotion; + } + + function useReducedMotionConfig() { + const reducedMotionPreference = useReducedMotion(); + const { reducedMotion } = React$1.useContext(MotionConfigContext); + if (reducedMotion === "never") { + return false; + } + else if (reducedMotion === "always") { + return true; + } + else { + return reducedMotionPreference; + } + } + + function stopAnimation(visualElement) { + visualElement.values.forEach((value) => value.stop()); + } + function setVariants(visualElement, variantLabels) { + const reversedLabels = [...variantLabels].reverse(); + reversedLabels.forEach((key) => { + const variant = visualElement.getVariant(key); + variant && setTarget(visualElement, variant); + if (visualElement.variantChildren) { + visualElement.variantChildren.forEach((child) => { + setVariants(child, variantLabels); + }); + } + }); + } + function setValues(visualElement, definition) { + if (Array.isArray(definition)) { + return setVariants(visualElement, definition); + } + else if (typeof definition === "string") { + return setVariants(visualElement, [definition]); + } + else { + setTarget(visualElement, definition); + } + } + /** + * @public + */ + function animationControls() { + /** + * Track whether the host component has mounted. + */ + let hasMounted = false; + /** + * A collection of linked component animation controls. + */ + const subscribers = new Set(); + const controls = { + subscribe(visualElement) { + subscribers.add(visualElement); + return () => void subscribers.delete(visualElement); + }, + start(definition, transitionOverride) { + exports.invariant(hasMounted, "controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook."); + const animations = []; + subscribers.forEach((visualElement) => { + animations.push(animateVisualElement(visualElement, definition, { + transitionOverride, + })); + }); + return Promise.all(animations); + }, + set(definition) { + exports.invariant(hasMounted, "controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."); + return subscribers.forEach((visualElement) => { + setValues(visualElement, definition); + }); + }, + stop() { + subscribers.forEach((visualElement) => { + stopAnimation(visualElement); + }); + }, + mount() { + hasMounted = true; + return () => { + hasMounted = false; + controls.stop(); + }; + }, + }; + return controls; + } + + function useAnimate() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const reduceMotion = useReducedMotionConfig() ?? undefined; + const animate = React$1.useMemo(() => createScopedAnimate({ scope, reduceMotion }), [scope, reduceMotion]); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + scope.animations.length = 0; + }); + return [scope, animate]; + } + + function useAnimateMini() { + const scope = useConstant(() => ({ + current: null, // Will be hydrated by React + animations: [], + })); + const animate = useConstant(() => createScopedWaapiAnimate(scope)); + useUnmountEffect(() => { + scope.animations.forEach((animation) => animation.stop()); + }); + return [scope, animate]; + } + + /** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ + function useAnimationControls() { + const controls = useConstant(animationControls); + useIsomorphicLayoutEffect(controls.mount, []); + return controls; + } + const useAnimation = useAnimationControls; + + function usePresenceData() { + const context = React$1.useContext(PresenceContext); + return context ? context.custom : undefined; + } + + /** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return
+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ + function useDomEvent(ref, eventName, handler, options) { + React$1.useEffect(() => { + const element = ref.current; + if (handler && element) { + return addDomEvent(element, eventName, handler, options); + } + }, [ref, eventName, handler, options]); + } + + /** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ + class DragControls { + constructor() { + this.componentControls = new Set(); + } + /** + * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. + * + * @internal + */ + subscribe(controls) { + this.componentControls.add(controls); + return () => this.componentControls.delete(controls); + } + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event, options) { + this.componentControls.forEach((controls) => { + controls.start(event.nativeEvent || event, options); + }); + } + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel() { + this.componentControls.forEach((controls) => { + controls.cancel(); + }); + } + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop() { + this.componentControls.forEach((controls) => { + controls.stop(); + }); + } + } + const createDragControls = () => new DragControls(); + /** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ + function useDragControls() { + return useConstant(createDragControls); + } + + /** + * Checks if a component is a `motion` component. + */ + function isMotionComponent(component) { + return (component !== null && + typeof component === "object" && + motionComponentSymbol in component); + } + + /** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ + function unwrapMotionComponent(component) { + if (isMotionComponent(component)) { + return component[motionComponentSymbol]; + } + return undefined; + } + + function useInstantLayoutTransition() { + return startTransition; + } + function startTransition(callback) { + if (!rootProjectionNode.current) + return; + rootProjectionNode.current.isUpdating = false; + rootProjectionNode.current.blockUpdate(); + callback && callback(); + } + + function useResetProjection() { + const reset = React$1.useCallback(() => { + const root = rootProjectionNode.current; + if (!root) + return; + root.resetTree(); + }, []); + return reset; + } + + /** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ + function useCycle(...items) { + const index = React$1.useRef(0); + const [item, setItem] = React$1.useState(items[index.current]); + const runCycle = React$1.useCallback((next) => { + index.current = + typeof next !== "number" + ? wrap(0, items.length, index.current + 1) + : next; + setItem(items[index.current]); + }, + // The array will change on each call, but by putting items.length at + // the front of this array, we guarantee the dependency comparison will match up + // eslint-disable-next-line react-hooks/exhaustive-deps + [items.length, ...items]); + return [item, runCycle]; + } + + function useInView(ref, { root, margin, amount, once = false, initial = false, } = {}) { + const [isInView, setInView] = React$1.useState(initial); + React$1.useEffect(() => { + if (!ref.current || (once && isInView)) + return; + const onEnter = () => { + setInView(true); + return once ? undefined : () => setInView(false); + }; + const options = { + root: (root && root.current) || undefined, + margin, + amount, + }; + return inView(ref.current, onEnter, options); + }, [root, ref, margin, once, amount]); + return isInView; + } + + function useInstantTransition() { + const [forceUpdate, forcedRenderCount] = useForceUpdate(); + const startInstantLayoutTransition = useInstantLayoutTransition(); + const unlockOnFrameRef = React$1.useRef(-1); + React$1.useEffect(() => { + /** + * Unblock after two animation frames, otherwise this will unblock too soon. + */ + frame.postRender(() => frame.postRender(() => { + /** + * If the callback has been called again after the effect + * triggered this 2 frame delay, don't unblock animations. This + * prevents the previous effect from unblocking the current + * instant transition too soon. This becomes more likely when + * used in conjunction with React.startTransition(). + */ + if (forcedRenderCount !== unlockOnFrameRef.current) + return; + MotionGlobalConfig.instantAnimations = false; + })); + }, [forcedRenderCount]); + return (callback) => { + startInstantLayoutTransition(() => { + MotionGlobalConfig.instantAnimations = true; + forceUpdate(); + callback(); + unlockOnFrameRef.current = forcedRenderCount + 1; + }); + }; + } + function disableInstantTransitions() { + MotionGlobalConfig.instantAnimations = false; + } + + function usePageInView() { + const [isInView, setIsInView] = React$1.useState(true); + React$1.useEffect(() => { + const handleVisibilityChange = () => setIsInView(!document.hidden); + if (document.hidden) { + handleVisibilityChange(); + } + document.addEventListener("visibilitychange", handleVisibilityChange); + return () => { + document.removeEventListener("visibilitychange", handleVisibilityChange); + }; + }, []); + return isInView; + } + + /** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ + function transformViewBoxPoint(svgRef) { + return (point) => { + const svg = svgRef.current; + if (!svg) { + return point; + } + // Get the viewBox attribute + const viewBox = svg.viewBox?.baseVal; + if (!viewBox || (viewBox.width === 0 && viewBox.height === 0)) { + // No viewBox or empty viewBox - no transformation needed + return point; + } + // Get the rendered dimensions of the SVG + const bbox = svg.getBoundingClientRect(); + if (bbox.width === 0 || bbox.height === 0) { + return point; + } + // Calculate scale factors + const scaleX = viewBox.width / bbox.width; + const scaleY = viewBox.height / bbox.height; + // Get the SVG's position on the page + const svgX = bbox.left + window.scrollX; + const svgY = bbox.top + window.scrollY; + // Transform the point: + // 1. Calculate position relative to SVG + // 2. Scale by viewBox/viewport ratio + // 3. Add back the SVG position (but in SVG coordinates) + return { + x: (point.x - svgX) * scaleX + svgX, + y: (point.y - svgY) * scaleY + svgY, + }; + }; + } + + const appearAnimationStore = new Map(); + const appearComplete = new Map(); + + const appearStoreId = (elementId, valueName) => { + const key = transformProps.has(valueName) ? "transform" : valueName; + return `${elementId}: ${key}`; + }; + + function handoffOptimizedAppearAnimation(elementId, valueName, frame) { + const storeId = appearStoreId(elementId, valueName); + const optimisedAnimation = appearAnimationStore.get(storeId); + if (!optimisedAnimation) { + return null; + } + const { animation, startTime } = optimisedAnimation; + function cancelAnimation() { + window.MotionCancelOptimisedAnimation?.(elementId, valueName, frame); + } + /** + * We can cancel the animation once it's finished now that we've synced + * with Motion. + * + * Prefer onfinish over finished as onfinish is backwards compatible with + * older browsers. + */ + animation.onfinish = cancelAnimation; + if (startTime === null || window.MotionHandoffIsComplete?.(elementId)) { + /** + * If the startTime is null, this animation is the Paint Ready detection animation + * and we can cancel it immediately without handoff. + * + * Or if we've already handed off the animation then we're now interrupting it. + * In which case we need to cancel it. + */ + cancelAnimation(); + return null; + } + else { + return startTime; + } + } + + /** + * A single time to use across all animations to manually set startTime + * and ensure they're all in sync. + */ + let startFrameTime; + /** + * A dummy animation to detect when Chrome is ready to start + * painting the page and hold off from triggering the real animation + * until then. We only need one animation to detect paint ready. + * + * https://bugs.chromium.org/p/chromium/issues/detail?id=1406850 + */ + let readyAnimation; + /** + * Keep track of animations that were suspended vs cancelled so we + * can easily resume them when we're done measuring layout. + */ + const suspendedAnimations = new Set(); + function resumeSuspendedAnimations() { + suspendedAnimations.forEach((data) => { + data.animation.play(); + data.animation.startTime = data.startTime; + }); + suspendedAnimations.clear(); + } + function startOptimizedAppearAnimation(element, name, keyframes, options, onReady) { + // Prevent optimised appear animations if Motion has already started animating. + if (window.MotionIsMounted) { + return; + } + const id = element.dataset[optimizedAppearDataId]; + if (!id) + return; + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + const storeId = appearStoreId(id, name); + if (!readyAnimation) { + readyAnimation = startWaapiAnimation(element, name, [keyframes[0], keyframes[0]], + /** + * 10 secs is basically just a super-safe duration to give Chrome + * long enough to get the animation ready. + */ + { duration: 10000, ease: "linear" }); + appearAnimationStore.set(storeId, { + animation: readyAnimation, + startTime: null, + }); + /** + * If there's no readyAnimation then there's been no instantiation + * of handoff animations. + */ + window.MotionHandoffAnimation = handoffOptimizedAppearAnimation; + window.MotionHasOptimisedAnimation = (elementId, valueName) => { + if (!elementId) + return false; + /** + * Keep a map of elementIds that have started animating. We check + * via ID instead of Element because of hydration errors and + * pre-hydration checks. We also actively record IDs as they start + * animating rather than simply checking for data-appear-id as + * this attrbute might be present but not lead to an animation, for + * instance if the element's appear animation is on a different + * breakpoint. + */ + if (!valueName) { + return appearComplete.has(elementId); + } + const animationId = appearStoreId(elementId, valueName); + return Boolean(appearAnimationStore.get(animationId)); + }; + window.MotionHandoffMarkAsComplete = (elementId) => { + if (appearComplete.has(elementId)) { + appearComplete.set(elementId, true); + } + }; + window.MotionHandoffIsComplete = (elementId) => { + return appearComplete.get(elementId) === true; + }; + /** + * We only need to cancel transform animations as + * they're the ones that will interfere with the + * layout animation measurements. + */ + window.MotionCancelOptimisedAnimation = (elementId, valueName, frame, canResume) => { + const animationId = appearStoreId(elementId, valueName); + const data = appearAnimationStore.get(animationId); + if (!data) + return; + if (frame && canResume === undefined) { + /** + * Wait until the end of the subsequent frame to cancel the animation + * to ensure we don't remove the animation before the main thread has + * had a chance to resolve keyframes and render. + */ + frame.postRender(() => { + frame.postRender(() => { + data.animation.cancel(); + }); + }); + } + else { + data.animation.cancel(); + } + if (frame && canResume) { + suspendedAnimations.add(data); + frame.render(resumeSuspendedAnimations); + } + else { + appearAnimationStore.delete(animationId); + /** + * If there are no more animations left, we can remove the cancel function. + * This will let us know when we can stop checking for conflicting layout animations. + */ + if (!appearAnimationStore.size) { + window.MotionCancelOptimisedAnimation = undefined; + } + } + }; + window.MotionCheckAppearSync = (visualElement, valueName, value) => { + const appearId = getOptimisedAppearId(visualElement); + if (!appearId) + return; + const valueIsOptimised = window.MotionHasOptimisedAnimation?.(appearId, valueName); + const externalAnimationValue = visualElement.props.values?.[valueName]; + if (!valueIsOptimised || !externalAnimationValue) + return; + const removeSyncCheck = value.on("change", (latestValue) => { + if (externalAnimationValue.get() !== latestValue) { + window.MotionCancelOptimisedAnimation?.(appearId, valueName); + removeSyncCheck(); + } + }); + return removeSyncCheck; + }; + } + const startAnimation = () => { + readyAnimation.cancel(); + const appearAnimation = startWaapiAnimation(element, name, keyframes, options); + /** + * Record the time of the first started animation. We call performance.now() once + * here and once in handoff to ensure we're getting + * close to a frame-locked time. This keeps all animations in sync. + */ + if (startFrameTime === undefined) { + startFrameTime = performance.now(); + } + appearAnimation.startTime = startFrameTime; + appearAnimationStore.set(storeId, { + animation: appearAnimation, + startTime: startFrameTime, + }); + if (onReady) + onReady(appearAnimation); + }; + appearComplete.set(id, false); + if (readyAnimation.ready) { + readyAnimation.ready.then(startAnimation).catch(noop$1); + } + else { + startAnimation(); + } + } + + const createObject = () => ({}); + class StateVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.measureInstanceViewportBox = createBox; + } + build() { } + resetTransform() { } + restoreTransform() { } + removeValueFromRenderState() { } + renderInstance() { } + scrapeMotionValuesFromProps() { + return createObject(); + } + getBaseTargetFromProps() { + return undefined; + } + readValueFromInstance(_state, key, options) { + return options.initialState[key] || 0; + } + sortInstanceNodePosition() { + return 0; + } + } + const useVisualState = makeUseVisualState({ + scrapeMotionValuesFromProps: createObject, + createRenderState: createObject, + }); + /** + * This is not an officially supported API and may be removed + * on any version. + */ + function useAnimatedState(initialState) { + const [animationState, setAnimationState] = React$1.useState(initialState); + const visualState = useVisualState({}, false); + const element = useConstant(() => { + return new StateVisualElement({ + props: { + onUpdate: (v) => { + setAnimationState({ ...v }); + }, + }, + visualState, + presenceContext: null, + }, { initialState }); + }); + React$1.useLayoutEffect(() => { + element.mount({}); + return () => element.unmount(); + }, [element]); + const startAnimation = useConstant(() => (animationDefinition) => { + return animateVisualElement(element, animationDefinition); + }); + return [animationState, startAnimation]; + } + + let id = 0; + const AnimateSharedLayout = ({ children }) => { + React__namespace.useEffect(() => { + exports.invariant(false, "AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations"); + }, []); + return (jsx(LayoutGroup, { id: useConstant(() => `asl-${id++}`), children: children })); + }; + + // Keep things reasonable and avoid scale: Infinity. In practise we might need + // to add another value, opacity, that could interpolate scaleX/Y [0,0.01] => [0,1] + // to simply hide content at unreasonable scales. + const maxScale = 100000; + const invertScale = (scale) => scale > 0.001 ? 1 / scale : maxScale; + let hasWarned = false; + /** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ + function useInvertedScale(scale) { + let parentScaleX = useMotionValue(1); + let parentScaleY = useMotionValue(1); + const { visualElement } = React$1.useContext(MotionContext); + exports.invariant(!!(scale || visualElement), "If no scale values are provided, useInvertedScale must be used within a child of another motion component."); + exports.warning(hasWarned, "useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."); + hasWarned = true; + if (scale) { + parentScaleX = scale.scaleX || parentScaleX; + parentScaleY = scale.scaleY || parentScaleY; + } + else if (visualElement) { + parentScaleX = visualElement.getValue("scaleX", 1); + parentScaleY = visualElement.getValue("scaleY", 1); + } + const scaleX = useTransform(parentScaleX, invertScale); + const scaleY = useTransform(parentScaleY, invertScale); + return { scaleX, scaleY }; + } + + exports.AnimatePresence = AnimatePresence; + exports.AnimateSharedLayout = AnimateSharedLayout; + exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; + exports.DOMKeyframesResolver = DOMKeyframesResolver; + exports.DOMVisualElement = DOMVisualElement; + exports.DeprecatedLayoutGroupContext = DeprecatedLayoutGroupContext; + exports.DocumentProjectionNode = DocumentProjectionNode; + exports.DragControls = DragControls; + exports.Feature = Feature; + exports.FlatTree = FlatTree; + exports.GroupAnimation = GroupAnimation; + exports.GroupAnimationWithThen = GroupAnimationWithThen; + exports.HTMLProjectionNode = HTMLProjectionNode; + exports.HTMLVisualElement = HTMLVisualElement; + exports.JSAnimation = JSAnimation; + exports.KeyframeResolver = KeyframeResolver; + exports.LayoutAnimationBuilder = LayoutAnimationBuilder; + exports.LayoutGroup = LayoutGroup; + exports.LayoutGroupContext = LayoutGroupContext; + exports.LazyMotion = LazyMotion; + exports.MotionConfig = MotionConfig; + exports.MotionConfigContext = MotionConfigContext; + exports.MotionContext = MotionContext; + exports.MotionGlobalConfig = MotionGlobalConfig; + exports.MotionValue = MotionValue; + exports.NativeAnimation = NativeAnimation; + exports.NativeAnimationExtended = NativeAnimationExtended; + exports.NativeAnimationWrapper = NativeAnimationWrapper; + exports.NodeStack = NodeStack; + exports.ObjectVisualElement = ObjectVisualElement; + exports.PopChild = PopChild; + exports.PresenceChild = PresenceChild; + exports.PresenceContext = PresenceContext; + exports.Reorder = namespace; + exports.SVGVisualElement = SVGVisualElement; + exports.SubscriptionManager = SubscriptionManager; + exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext; + exports.ViewTransitionBuilder = ViewTransitionBuilder; + exports.VisualElement = VisualElement; + exports.WillChangeMotionValue = WillChangeMotionValue; + exports.acceleratedValues = acceleratedValues; + exports.activeAnimations = activeAnimations; + exports.addAttrValue = addAttrValue; + exports.addDomEvent = addDomEvent; + exports.addPointerEvent = addPointerEvent; + exports.addPointerInfo = addPointerInfo; + exports.addScaleCorrector = addScaleCorrector; + exports.addStyleValue = addStyleValue; + exports.addUniqueItem = addUniqueItem; + exports.addValueToWillChange = addValueToWillChange; + exports.alpha = alpha; + exports.analyseComplexValue = analyseComplexValue; + exports.animate = animate; + exports.animateMini = animateMini; + exports.animateMotionValue = animateMotionValue; + exports.animateSingleValue = animateSingleValue; + exports.animateTarget = animateTarget; + exports.animateValue = animateValue; + exports.animateVariant = animateVariant; + exports.animateView = animateView; + exports.animateVisualElement = animateVisualElement; + exports.animationControls = animationControls; + exports.animationMapKey = animationMapKey; + exports.animations = animations; + exports.anticipate = anticipate; + exports.applyAxisDelta = applyAxisDelta; + exports.applyBoxDelta = applyBoxDelta; + exports.applyGeneratorOptions = applyGeneratorOptions; + exports.applyPointDelta = applyPointDelta; + exports.applyPxDefaults = applyPxDefaults; + exports.applyTreeDeltas = applyTreeDeltas; + exports.aspectRatio = aspectRatio; + exports.attachFollow = attachFollow; + exports.attachSpring = attachSpring; + exports.attrEffect = attrEffect; + exports.axisDeltaEquals = axisDeltaEquals; + exports.axisEquals = axisEquals; + exports.axisEqualsRounded = axisEqualsRounded; + exports.backIn = backIn; + exports.backInOut = backInOut; + exports.backOut = backOut; + exports.boxEquals = boxEquals; + exports.boxEqualsRounded = boxEqualsRounded; + exports.buildHTMLStyles = buildHTMLStyles; + exports.buildProjectionTransform = buildProjectionTransform; + exports.buildSVGAttrs = buildSVGAttrs; + exports.buildSVGPath = buildSVGPath; + exports.buildTransform = buildTransform; + exports.calcAxisDelta = calcAxisDelta; + exports.calcBoxDelta = calcBoxDelta; + exports.calcChildStagger = calcChildStagger; + exports.calcGeneratorDuration = calcGeneratorDuration; + exports.calcLength = calcLength; + exports.calcRelativeAxis = calcRelativeAxis; + exports.calcRelativeAxisPosition = calcRelativeAxisPosition; + exports.calcRelativeBox = calcRelativeBox; + exports.calcRelativePosition = calcRelativePosition; + exports.camelCaseAttributes = camelCaseAttributes; + exports.camelToDash = camelToDash; + exports.cancelFrame = cancelFrame; + exports.cancelMicrotask = cancelMicrotask; + exports.cancelSync = cancelSync; + exports.checkVariantsDidChange = checkVariantsDidChange; + exports.circIn = circIn; + exports.circInOut = circInOut; + exports.circOut = circOut; + exports.clamp = clamp; + exports.cleanDirtyNodes = cleanDirtyNodes; + exports.collectMotionValues = collectMotionValues; + exports.color = color; + exports.compareByDepth = compareByDepth; + exports.complex = complex; + exports.containsCSSVariable = containsCSSVariable; + exports.convertBoundingBoxToBox = convertBoundingBoxToBox; + exports.convertBoxToBoundingBox = convertBoxToBoundingBox; + exports.convertOffsetToTimes = convertOffsetToTimes; + exports.copyAxisDeltaInto = copyAxisDeltaInto; + exports.copyAxisInto = copyAxisInto; + exports.copyBoxInto = copyBoxInto; + exports.correctBorderRadius = correctBorderRadius; + exports.correctBoxShadow = correctBoxShadow; + exports.createAnimationState = createAnimationState; + exports.createAxis = createAxis; + exports.createAxisDelta = createAxisDelta; + exports.createBox = createBox; + exports.createDelta = createDelta; + exports.createGeneratorEasing = createGeneratorEasing; + exports.createProjectionNode = createProjectionNode$1; + exports.createRenderBatcher = createRenderBatcher; + exports.createScopedAnimate = createScopedAnimate; + exports.cubicBezier = cubicBezier; + exports.cubicBezierAsString = cubicBezierAsString; + exports.defaultEasing = defaultEasing; + exports.defaultOffset = defaultOffset$1; + exports.defaultTransformValue = defaultTransformValue; + exports.defaultValueTypes = defaultValueTypes; + exports.degrees = degrees; + exports.delay = delay; + exports.delayInSeconds = delayInSeconds; + exports.dimensionValueTypes = dimensionValueTypes; + exports.disableInstantTransitions = disableInstantTransitions; + exports.distance = distance; + exports.distance2D = distance2D; + exports.domAnimation = domAnimation; + exports.domMax = domMax; + exports.domMin = domMin; + exports.eachAxis = eachAxis; + exports.easeIn = easeIn; + exports.easeInOut = easeInOut; + exports.easeOut = easeOut; + exports.easingDefinitionToFunction = easingDefinitionToFunction; + exports.fillOffset = fillOffset; + exports.fillWildcards = fillWildcards; + exports.filterProps = filterProps; + exports.findDimensionValueType = findDimensionValueType; + exports.findValueType = findValueType; + exports.flushKeyframeResolvers = flushKeyframeResolvers; + exports.followValue = followValue; + exports.frame = frame; + exports.frameData = frameData; + exports.frameSteps = frameSteps; + exports.generateLinearEasing = generateLinearEasing; + exports.getAnimatableNone = getAnimatableNone; + exports.getAnimationMap = getAnimationMap; + exports.getComputedStyle = getComputedStyle$2; + exports.getDefaultTransition = getDefaultTransition; + exports.getDefaultValueType = getDefaultValueType; + exports.getEasingForSegment = getEasingForSegment; + exports.getFeatureDefinitions = getFeatureDefinitions; + exports.getFinalKeyframe = getFinalKeyframe; + exports.getMixer = getMixer; + exports.getOptimisedAppearId = getOptimisedAppearId; + exports.getOriginIndex = getOriginIndex; + exports.getValueAsType = getValueAsType; + exports.getValueTransition = getValueTransition$1; + exports.getVariableValue = getVariableValue; + exports.getVariantContext = getVariantContext; + exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; + exports.getViewAnimations = getViewAnimations; + exports.globalProjectionState = globalProjectionState; + exports.has2DTranslate = has2DTranslate; + exports.hasReducedMotionListener = hasReducedMotionListener; + exports.hasScale = hasScale; + exports.hasTransform = hasTransform; + exports.hasWarned = hasWarned$1; + exports.hex = hex; + exports.hover = hover; + exports.hsla = hsla; + exports.hslaToRgba = hslaToRgba; + exports.inView = inView; + exports.inertia = inertia; + exports.initPrefersReducedMotion = initPrefersReducedMotion; + exports.interpolate = interpolate; + exports.invisibleValues = invisibleValues; + exports.isAnimationControls = isAnimationControls; + exports.isBezierDefinition = isBezierDefinition; + exports.isBrowser = isBrowser$1; + exports.isCSSVariableName = isCSSVariableName; + exports.isCSSVariableToken = isCSSVariableToken; + exports.isControllingVariants = isControllingVariants; + exports.isDeltaZero = isDeltaZero; + exports.isDragActive = isDragActive; + exports.isDragging = isDragging; + exports.isEasingArray = isEasingArray; + exports.isElementKeyboardAccessible = isElementKeyboardAccessible; + exports.isElementTextInput = isElementTextInput; + exports.isForcedMotionValue = isForcedMotionValue; + exports.isGenerator = isGenerator; + exports.isHTMLElement = isHTMLElement; + exports.isKeyframesTarget = isKeyframesTarget; + exports.isMotionComponent = isMotionComponent; + exports.isMotionValue = isMotionValue; + exports.isNear = isNear; + exports.isNodeOrChild = isNodeOrChild; + exports.isNumericalString = isNumericalString; + exports.isObject = isObject; + exports.isPrimaryPointer = isPrimaryPointer; + exports.isSVGElement = isSVGElement; + exports.isSVGSVGElement = isSVGSVGElement; + exports.isSVGTag = isSVGTag; + exports.isTransitionDefined = isTransitionDefined; + exports.isValidMotionProp = isValidMotionProp; + exports.isVariantLabel = isVariantLabel; + exports.isVariantNode = isVariantNode; + exports.isWaapiSupportedEasing = isWaapiSupportedEasing; + exports.isWillChangeMotionValue = isWillChangeMotionValue; + exports.isZeroValueString = isZeroValueString; + exports.keyframes = keyframes; + exports.m = m; + exports.makeAnimationInstant = makeAnimationInstant; + exports.makeUseVisualState = makeUseVisualState; + exports.mapEasingToNativeEasing = mapEasingToNativeEasing; + exports.mapValue = mapValue; + exports.maxGeneratorDuration = maxGeneratorDuration; + exports.measurePageBox = measurePageBox; + exports.measureViewportBox = measureViewportBox; + exports.memo = memo; + exports.microtask = microtask; + exports.millisecondsToSeconds = millisecondsToSeconds; + exports.mirrorEasing = mirrorEasing; + exports.mix = mix; + exports.mixArray = mixArray; + exports.mixColor = mixColor; + exports.mixComplex = mixComplex; + exports.mixImmediate = mixImmediate; + exports.mixLinearColor = mixLinearColor; + exports.mixNumber = mixNumber$1; + exports.mixObject = mixObject; + exports.mixValues = mixValues; + exports.mixVisibility = mixVisibility; + exports.motion = motion; + exports.motionValue = motionValue; + exports.moveItem = moveItem; + exports.nodeGroup = nodeGroup; + exports.noop = noop$1; + exports.number = number; + exports.numberValueTypes = numberValueTypes; + exports.observeTimeline = observeTimeline; + exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; + exports.optimizedAppearDataId = optimizedAppearDataId; + exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; + exports.parseCSSVariable = parseCSSVariable; + exports.parseValueFromTransform = parseValueFromTransform; + exports.percent = percent; + exports.pipe = pipe; + exports.pixelsToPercent = pixelsToPercent; + exports.positionalKeys = positionalKeys; + exports.prefersReducedMotion = prefersReducedMotion; + exports.press = press; + exports.progress = progress; + exports.progressPercentage = progressPercentage; + exports.propEffect = propEffect; + exports.propagateDirtyNodes = propagateDirtyNodes; + exports.px = px; + exports.readTransformValue = readTransformValue; + exports.recordStats = recordStats; + exports.removeAxisDelta = removeAxisDelta; + exports.removeAxisTransforms = removeAxisTransforms; + exports.removeBoxTransforms = removeBoxTransforms; + exports.removeItem = removeItem; + exports.removePointDelta = removePointDelta; + exports.renderHTML = renderHTML; + exports.renderSVG = renderSVG; + exports.resize = resize; + exports.resolveElements = resolveElements; + exports.resolveMotionValue = resolveMotionValue; + exports.resolveTransition = resolveTransition; + exports.resolveVariant = resolveVariant; + exports.resolveVariantFromProps = resolveVariantFromProps; + exports.reverseEasing = reverseEasing; + exports.rgbUnit = rgbUnit; + exports.rgba = rgba; + exports.rootProjectionNode = rootProjectionNode; + exports.scale = scale; + exports.scaleCorrectors = scaleCorrectors; + exports.scalePoint = scalePoint; + exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; + exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; + exports.scroll = scroll; + exports.scrollInfo = scrollInfo; + exports.secondsToMilliseconds = secondsToMilliseconds; + exports.setDragLock = setDragLock; + exports.setFeatureDefinitions = setFeatureDefinitions; + exports.setStyle = setStyle; + exports.setTarget = setTarget; + exports.spring = spring; + exports.springValue = springValue; + exports.stagger = stagger; + exports.startOptimizedAppearAnimation = startOptimizedAppearAnimation; + exports.startWaapiAnimation = startWaapiAnimation; + exports.statsBuffer = statsBuffer; + exports.steps = steps; + exports.styleEffect = styleEffect; + exports.supportedWaapiEasing = supportedWaapiEasing; + exports.supportsBrowserAnimation = supportsBrowserAnimation; + exports.supportsFlags = supportsFlags; + exports.supportsLinearEasing = supportsLinearEasing; + exports.supportsPartialKeyframes = supportsPartialKeyframes; + exports.supportsScrollTimeline = supportsScrollTimeline; + exports.svgEffect = svgEffect; + exports.sync = sync; + exports.testValueType = testValueType; + exports.time = time; + exports.transform = transform; + exports.transformAxis = transformAxis; + exports.transformBox = transformBox; + exports.transformBoxPoints = transformBoxPoints; + exports.transformPropOrder = transformPropOrder; + exports.transformProps = transformProps; + exports.transformValue = transformValue; + exports.transformValueTypes = transformValueTypes; + exports.transformViewBoxPoint = transformViewBoxPoint; + exports.translateAxis = translateAxis; + exports.unwrapMotionComponent = unwrapMotionComponent; + exports.updateMotionValuesFromProps = updateMotionValuesFromProps; + exports.useAnimate = useAnimate; + exports.useAnimateMini = useAnimateMini; + exports.useAnimation = useAnimation; + exports.useAnimationControls = useAnimationControls; + exports.useAnimationFrame = useAnimationFrame; + exports.useComposedRefs = useComposedRefs; + exports.useCycle = useCycle; + exports.useDeprecatedAnimatedState = useAnimatedState; + exports.useDeprecatedInvertedScale = useInvertedScale; + exports.useDomEvent = useDomEvent; + exports.useDragControls = useDragControls; + exports.useElementScroll = useElementScroll; + exports.useFollowValue = useFollowValue; + exports.useForceUpdate = useForceUpdate; + exports.useInView = useInView; + exports.useInstantLayoutTransition = useInstantLayoutTransition; + exports.useInstantTransition = useInstantTransition; + exports.useIsPresent = useIsPresent; + exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect; + exports.useMotionTemplate = useMotionTemplate; + exports.useMotionValue = useMotionValue; + exports.useMotionValueEvent = useMotionValueEvent; + exports.usePageInView = usePageInView; + exports.usePresence = usePresence; + exports.usePresenceData = usePresenceData; + exports.useReducedMotion = useReducedMotion; + exports.useReducedMotionConfig = useReducedMotionConfig; + exports.useResetProjection = useResetProjection; + exports.useScroll = useScroll; + exports.useSpring = useSpring; + exports.useTime = useTime; + exports.useTransform = useTransform; + exports.useUnmountEffect = useUnmountEffect; + exports.useVelocity = useVelocity; + exports.useViewportScroll = useViewportScroll; + exports.useWillChange = useWillChange; + exports.variantPriorityOrder = variantPriorityOrder; + exports.variantProps = variantProps; + exports.velocityPerSecond = velocityPerSecond; + exports.vh = vh; + exports.visualElementStore = visualElementStore; + exports.vw = vw; + exports.warnOnce = warnOnce; + exports.wrap = wrap; + +})); diff --git a/node_modules/framer-motion/dist/framer-motion.js b/node_modules/framer-motion/dist/framer-motion.js new file mode 100644 index 00000000..b7dfff4b --- /dev/null +++ b/node_modules/framer-motion/dist/framer-motion.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),s=React,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,s={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===s[i]&&(s[i]=e[i]);return{$$typeof:o,type:t,key:r,ref:u,props:s,_owner:l.current}}const h=r,d=u,p=u,m=e.createContext({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function T([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&in>e?e:n{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(P(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(P(e,n))});const b={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function A(t){return"object"==typeof t&&null!==t}const M=t=>/^0[^.\s]+$/u.test(t);function V(t){let e;return()=>(void 0===e&&(e=t()),e)}const C=t=>t,k=(t,e)=>n=>e(t(n)),R=(...t)=>t.reduce(k),D=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class L{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,j=t=>t/1e3;function I(t,e){return e?t*(1e3/e):0}const O=new Set;const F=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},W=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function U(t,e,n,i){if(t===e&&n===i)return C;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=W(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:W(s(t),e,i)}const N=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,$=t=>e=>1-t(1-e),Y=U(.33,1.53,.69,.99),H=$(Y),z=N(H),X=t=>(t*=2)<1?.5*H(t):.5*(2-Math.pow(2,-10*(t-1))),K=t=>1-Math.sin(Math.acos(t)),G=$(K),_=N(K),q=U(.42,0,1,1),Z=U(0,0,.58,1),J=U(.42,0,.58,1);const Q=t=>Array.isArray(t)&&"number"!=typeof t[0];function tt(t,e){return Q(t)?t[F(0,t.length,e)]:t}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linear:C,easeIn:q,easeInOut:J,easeOut:Z,circIn:K,circInOut:_,circOut:G,backIn:H,backInOut:z,backOut:Y,anticipate:X},it=e=>{if(et(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,o]=e;return U(n,i,s,o)}return"string"==typeof e?(t.invariant(void 0!==nt[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nt[e]):e},st=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],ot={value:null,addProjectionMetrics:null};function rt(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=st.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(c),e&&ot.value&&ot.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const o=b.useManualTiming?s.timestamp:performance.now();n=!1,b.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:st.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===ht&&pt.set(ct.isProcessing||b.useManualTiming?ct.timestamp:performance.now()),ht),set:t=>{ht=t,queueMicrotask(dt)}},mt={layout:0,mainThread:0,waapi:0},ft=t=>e=>"string"==typeof e&&e.startsWith(t),gt=ft("--"),yt=ft("var(--"),vt=t=>!!yt(t)&&xt.test(t.split("/*")[0].trim()),xt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function wt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},St={...Tt,transform:t=>S(0,1,t)},Pt={...Tt,default:1},bt=t=>Math.round(1e5*t)/1e5,Et=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const At=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Mt=(t,e)=>n=>Boolean("string"==typeof n&&At.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Vt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Et);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ct={...Tt,transform:t=>Math.round((t=>S(0,255,t))(t))},kt={test:Mt("rgb","red"),parse:Vt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ct.transform(t)+", "+Ct.transform(e)+", "+Ct.transform(n)+", "+bt(St.transform(i))+")"};const Rt={test:Mt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:kt.transform},Dt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Lt=Dt("deg"),Bt=Dt("%"),jt=Dt("px"),It=Dt("vh"),Ot=Dt("vw"),Ft=(()=>({...Bt,parse:t=>Bt.parse(t)/100,transform:t=>Bt.transform(100*t)}))(),Wt={test:Mt("hsl","hue"),parse:Vt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Bt.transform(bt(e))+", "+Bt.transform(bt(n))+", "+bt(St.transform(i))+")"},Ut={test:t=>kt.test(t)||Rt.test(t)||Wt.test(t),parse:t=>kt.test(t)?kt.parse(t):Wt.test(t)?Wt.parse(t):Rt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?kt.transform(t):Wt.transform(t),getAnimatableNone:t=>{const e=Ut.parse(t);return e.alpha=0,Ut.transform(e)}},Nt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $t="number",Yt="color",Ht=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function zt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Ht,t=>(Ut.test(t)?(i.color.push(o),s.push(Yt),n.push(Ut.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push($t),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Xt(t){return zt(t).values}function Kt(t){const{split:e,types:n}=zt(t),i=e.length;return t=>{let s="";for(let o=0;o"number"==typeof t?0:Ut.test(t)?Ut.getAnimatableNone(t):t;const _t={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Et)?.length||0)+(t.match(Nt)?.length||0)>0},parse:Xt,createTransformer:Kt,getAnimatableNone:function(t){const e=Xt(t);return Kt(t)(e.map(Gt))}};function qt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Zt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=qt(a,i,t+1/3),o=qt(a,i,t),r=qt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Jt(t,e){return n=>n>0?e:t}const Qt=(t,e,n)=>t+(e-t)*n,te=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},ee=[Rt,kt,Wt];function ne(e){const n=(i=e,ee.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===Wt&&(s=Zt(s)),s}const ie=(t,e)=>{const n=ne(t),i=ne(e);if(!n||!i)return Jt(t,e);const s={...n};return t=>(s.red=te(n.red,i.red,t),s.green=te(n.green,i.green,t),s.blue=te(n.blue,i.blue,t),s.alpha=Qt(n.alpha,i.alpha,t),kt.transform(s))},se=new Set(["none","hidden"]);function oe(t,e){return se.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function re(t,e){return n=>Qt(t,e,n)}function ae(t){return"number"==typeof t?re:"string"==typeof t?vt(t)?Jt:Ut.test(t)?ie:ue:Array.isArray(t)?le:"object"==typeof t?Ut.test(t)?ie:ce:Jt}function le(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>ae(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const ue=(e,n)=>{const i=_t.createTransformer(n),s=zt(e),o=zt(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?se.has(e)&&!o.values.length||se.has(n)&&!s.values.length?oe(e,n):R(le(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>at.update(e,t),stop:()=>lt(e),now:()=>ct.isProcessing?ct.timestamp:pt.now()}},pe=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=me?1/0:e}function ge(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(fe(i),me);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:j(s)}}function ye(t,e,n){const i=Math.max(e-5,0);return I(n-t(i),e-i)}const ve=100,xe=10,we=1,Te=0,Se=800,Pe=.3,be=.3,Ee={granular:.01,default:2},Ae={granular:.005,default:.5},Me=.01,Ve=10,Ce=.05,ke=1,Re=.001;function De({duration:e=Se,bounce:n=Pe,velocity:i=Te,mass:s=we}){let o,r;t.warning(e<=B(Ve),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=S(Ce,ke,a),e=S(Me,Ve,j(e)),a<1?(o=t=>{const n=t*a,s=n*e,o=n-i,r=Be(t,a),l=Math.exp(-s);return Re-o/r*l},r=t=>{const n=t*a*e,s=n*i+i,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=Be(Math.pow(t,2),a);return(-o(t)+Re>0?-1:1)*((s-r)*l)/c}):(o=t=>Math.exp(-t*e)*((t-i)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(i-t)));const l=function(t,e,n){let i=n;for(let n=1;nvoid 0!==t[e])}function Fe(t=be,e=Pe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Te,stiffness:ve,damping:xe,mass:we,isResolvedFromDuration:!1,...t};if(!Oe(t,Ie)&&Oe(t,je))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*S(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:we,stiffness:s,damping:o}}else{const n=De(t);e={...e,...n,mass:we},e.isResolvedFromDuration=!0}return e}({...n,velocity:-j(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),g=r-o,y=j(Math.sqrt(l/u)),v=Math.abs(g)<5;let x;if(i||(i=v?Ee.granular:Ee.default),s||(s=v?Ae.granular:Ae.default),f<1){const t=Be(y,f);x=e=>{const n=Math.exp(-f*y*e);return r-n*((m+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const w={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0===t?m:0;f<1&&(n=0===t?B(m):ye(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(fe(w),me),e=pe(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function We({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=Fe({keyframes:[d.value,p(d.value)],velocity:ye(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function Ue(e,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=e.length;if(t.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(t,e,n){const i=[],s=n||b.mix||he,o=t.length-1;for(let n=0;n{if(a&&t1)for(;iu(S(e[0],e[r-1],t)):u}function Ne(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=D(0,e,i);t.push(Qt(n,1,s))}}function $e(t){const e=[0];return Ne(e,t.length-1),e}function Ye(t,e){return t.map(t=>t*e)}function He(t,e){return t.map(()=>e||J).splice(0,t.length-1)}function ze({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Q(i)?i.map(it):it(i),o={done:!1,value:e[0]},r=Ue(Ye(n&&n.length===e.length?n:$e(e),t),e,{ease:Array.isArray(s)?s:He(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}Fe.applyToOptions=t=>{const e=ge(t,100,Fe);return t.ease=e.ease,t.duration=B(e.duration),t.type="keyframes",t};const Xe=t=>null!==t;function Ke(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Xe),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ge={decay:We,inertia:We,tween:ze,keyframes:ze,spring:Fe};function _e(t){"string"==typeof t.type&&(t.type=Ge[t.type])}class qe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ze=t=>t/100;class Je extends qe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==pt.now()&&this.tick(pt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},mt.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;_e(t);const{type:e=ze,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||ze;a!==ze&&"number"!=typeof r[0]&&(this.mixKeyframes=R(Ze,he(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=fe(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v=this.currentTime,x=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(x=o)),v=S(0,1,n)*r}const w=y?{done:!1,value:c[0]}:x.next(v);s&&(w.value=s(w.value));let{done:T}=w;y||null===a||(T=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return P&&p!==We&&(w.value=Ke(c,this.options,f,this.speed)),m&&m(w.value),P&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return j(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(this.currentTime)}set time(t){t=B(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(pt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=j(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=de,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(pt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,mt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Qe(t){for(let e=1;e180*t/Math.PI,en=t=>{const e=tn(Math.atan2(t[1],t[0]));return sn(e)},nn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:en,rotateZ:en,skewX:t=>tn(Math.atan(t[1])),skewY:t=>tn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},sn=t=>((t%=360)<0&&(t+=360),t),on=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),rn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),an={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:on,scaleY:rn,scale:t=>(on(t)+rn(t))/2,rotateX:t=>sn(tn(Math.atan2(t[6],t[5]))),rotateY:t=>sn(tn(Math.atan2(-t[2],t[0]))),rotateZ:en,rotate:en,skewX:t=>tn(Math.atan(t[4])),skewY:t=>tn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ln(t){return t.includes("scale")?1:0}function cn(t,e){if(!t||"none"===t)return ln(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=an,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=nn,s=e}if(!s)return ln(e);const o=i[e],r=s[1].split(",").map(hn);return"function"==typeof o?o(r):r[o]}const un=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return cn(n,e)};function hn(t){return parseFloat(t.trim())}const dn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pn=(()=>new Set(dn))(),mn=t=>t===Tt||t===jt,fn=new Set(["x","y","z"]),gn=dn.filter(t=>!fn.has(t));const yn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>cn(e,"x"),y:(t,{transform:e})=>cn(e,"y")};yn.translateX=yn.x,yn.translateY=yn.y;const vn=new Set;let xn=!1,wn=!1,Tn=!1;function Sn(){if(wn){const t=Array.from(vn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return gn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}wn=!1,xn=!1,vn.forEach(t=>t.complete(Tn)),vn.clear()}function Pn(){vn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(wn=!0)})}function bn(){Tn=!0,Pn(),Sn(),Tn=!1}class En{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(vn.add(this),xn||(xn=!0,at.read(Pn),at.resolveKeyframes(Sn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}Qe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),vn.delete(this)}cancel(){"scheduled"===this.state&&(vn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const An=t=>t.startsWith("--");function Mn(t,e,n){An(e)?t.style.setProperty(e,n):t.style[e]=n}const Vn={};function Cn(t,e){const n=V(t);return()=>Vn[e]??n()}const kn=Cn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Rn=Cn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Dn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Ln={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Dn([0,.65,.55,1]),circOut:Dn([.55,0,1,.45]),backIn:Dn([.31,.01,.66,-.59]),backOut:Dn([.33,1.53,.69,.99])};function Bn(t,e){return t?"function"==typeof t?Rn()?pe(t,e):"ease-out":et(t)?Dn(t):Array.isArray(t)?t.map(t=>Bn(t,e)||Ln.easeOut):Ln[t]:void 0}function jn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Bn(a,s);Array.isArray(h)&&(u.easing=h),ot.value&&mt.waapi++;const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};c&&(d.pseudoElement=c);const p=t.animate(u,d);return ot.value&&p.finished.finally(()=>{mt.waapi--}),p}function In(t){return"function"==typeof t&&"applyToOptions"in t}function On({type:t,...e}){return In(t)&&Rn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Fn extends qe{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=On(e);this.animation=jn(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Ke(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):Mn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return j(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=B(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&kn()?(this.animation.timeline=t,C):e(this)}}const Wn={anticipate:X,backInOut:z,circInOut:_};function Un(t){"string"==typeof t.ease&&t.ease in Wn&&(t.ease=Wn[t.ease])}class Nn extends Fn{constructor(t){Un(t),_e(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Je({...o,autoplay:!1}),a=Math.max(10,pt.now()-this.startTime),l=S(0,10,a-10);e.setWithVelocity(r.sample(Math.max(0,a-l)).value,r.sample(a).value,l),r.stop()}}const $n=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!_t.test(t)&&"0"!==t||t.startsWith("url(")));function Yn(t){t.duration=0,t.type="keyframes"}const Hn=new Set(["opacity","clipPath","filter","transform"]),zn=V(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Xn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return zn()&&n&&Hn.has(n)&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class Kn extends qe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||En;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=pt.now(),function(e,n,i,s){const o=e[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=$n(o,n),l=$n(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},d=!c&&Xn(h),p=h.motionValue?.owner?.current,m=d?new Nn({...h,element:p}):new Je(h);m.finished.then(()=>{this.notifyFinished()}).catch(C),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),bn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Gn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return _n(this.animations,"duration")}get iterationDuration(){return _n(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function _n(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class qn extends Gn{then(t,e){return this.finished.finally(t).then(()=>{})}}class Zn extends Fn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Jn=new WeakMap,Qn=(t,e="")=>`${t}:${e}`;function ti(t){const e=Jn.get(t)||new Map;return Jn.set(t,e),e}function ei(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const ni=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ii(t){const e=ni.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function si(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=ii(e);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return E(t)?parseFloat(t):t}return vt(o)?si(o,n,i+1):o}const oi={type:"spring",stiffness:500,damping:25,restSpeed:10},ri={type:"keyframes",duration:.8},ai={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},li=(t,{keyframes:e})=>e.length>2?ri:pn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:oi:ai,ci=t=>null!==t;function ui(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(ci),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}function hi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function di(t,e){const n=t?.[e]??t?.default??t;return n!==t?hi(n,t):n}function pi({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const mi=(t,e,n,i={},s,o)=>r=>{const a=di(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=B(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};pi(a)||Object.assign(u,li(t,u)),u.duration&&(u.duration=B(u.duration)),u.repeatDelay&&(u.repeatDelay=B(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Yn(u),0===u.delay&&(h=!0)),(b.instantAnimations||b.skipAnimations||s?.shouldSkipAnimations)&&(h=!0,Yn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=ui(u.keyframes,a);if(void 0!==t)return void at.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Je(u):new Kn(u)};function fi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function gi(t,e,n,i){if("function"==typeof e){const[s,o]=fi(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=fi(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function yi(t,e,n){const i=t.getProps();return gi(i,e,void 0!==n?n:i.custom,t)}const vi=new Set(["width","height","top","left","right","bottom",...dn]),xi={current:void 0};class wi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=pt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=pt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new L);const n=this.events[t].add(e);return"change"===t?()=>{n(),at.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return xi.current&&xi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=pt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return I(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ti(t,e){return new wi(t,e)}const Si=t=>Array.isArray(t);function Pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ti(n))}function bi(t){return Si(t)?t[t.length-1]||0:t}function Ei(t,e){const n=yi(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){Pi(t,e,bi(o[e]))}}const Ai=t=>Boolean(t&&t.getVelocity);function Mi(t){return Boolean(Ai(t)&&t.add)}function Vi(t,e){const n=t.getValue("willChange");if(Mi(n))return n.add(e);if(!n&&b.WillChange){const n=new b.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function Ci(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ki="framerAppearId",Ri="data-"+Ci(ki);function Di(t){return t.props[Ri]}function Li({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Bi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?hi(o,l):l;const c=o?.reduceMotion;i&&(o=i);const u=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&Li(h,e))continue;const r={delay:n,...di(o||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating&&!Array.isArray(s)&&s===l&&!r.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=Di(t);if(n){const t=window.MotionHandoffAnimation(n,e,at);null!==t&&(r.startTime=t,d=!0)}}Vi(t,e);const p=c??t.shouldReduceMotion;i.start(mi(e,i,s,p&&vi.has(e)?{type:!1}:r,t,d));const m=i.animation;m&&u.push(m)}if(r){const e=()=>at.update(()=>{r&&Ei(t,r)});u.length?Promise.all(u).then(e):e()}return u}function ji(t,e,n={}){const i=yi(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Bi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ji(l,e,{...r,delay:n+("function"==typeof i?0:i)+ei(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function Ii(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>ji(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=ji(t,e,n);else{const s="function"==typeof e?yi(t,e,n.custom):e;i=Promise.all(Bi(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Oi=t=>e=>e.test(t),Fi=[Tt,jt,Bt,Lt,Ot,It,{test:t=>"auto"===t,parse:t=>t}],Wi=t=>Fi.find(Oi(t));function Ui(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const Ni=new Set(["brightness","contrast","saturate","opacity"]);function $i(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Et)||[];if(!i)return t;const s=n.replace(i,"");let o=Ni.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Yi=/\b([a-z-]*)\(.*?\)/gu,Hi={..._t,getAnimatableNone:t=>{const e=t.match(Yi);return e?e.map($i).join(" "):t}},zi={..._t,getAnimatableNone:t=>{const e=_t.parse(t);return _t.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Xi={...Tt,transform:Math.round},Ki={rotate:Lt,rotateX:Lt,rotateY:Lt,rotateZ:Lt,scale:Pt,scaleX:Pt,scaleY:Pt,scaleZ:Pt,skew:Lt,skewX:Lt,skewY:Lt,distance:jt,translateX:jt,translateY:jt,translateZ:jt,x:jt,y:jt,z:jt,perspective:jt,transformPerspective:jt,opacity:St,originX:Ft,originY:Ft,originZ:jt},Gi={borderWidth:jt,borderTopWidth:jt,borderRightWidth:jt,borderBottomWidth:jt,borderLeftWidth:jt,borderRadius:jt,borderTopLeftRadius:jt,borderTopRightRadius:jt,borderBottomRightRadius:jt,borderBottomLeftRadius:jt,width:jt,maxWidth:jt,height:jt,maxHeight:jt,top:jt,right:jt,bottom:jt,left:jt,inset:jt,insetBlock:jt,insetBlockStart:jt,insetBlockEnd:jt,insetInline:jt,insetInlineStart:jt,insetInlineEnd:jt,padding:jt,paddingTop:jt,paddingRight:jt,paddingBottom:jt,paddingLeft:jt,paddingBlock:jt,paddingBlockStart:jt,paddingBlockEnd:jt,paddingInline:jt,paddingInlineStart:jt,paddingInlineEnd:jt,margin:jt,marginTop:jt,marginRight:jt,marginBottom:jt,marginLeft:jt,marginBlock:jt,marginBlockStart:jt,marginBlockEnd:jt,marginInline:jt,marginInlineStart:jt,marginInlineEnd:jt,fontSize:jt,backgroundPositionX:jt,backgroundPositionY:jt,...Ki,zIndex:Xi,fillOpacity:St,strokeOpacity:St,numOctaves:Xi},_i={...Gi,color:Ut,backgroundColor:Ut,outlineColor:Ut,fill:Ut,stroke:Ut,borderColor:Ut,borderTopColor:Ut,borderRightColor:Ut,borderBottomColor:Ut,borderLeftColor:Ut,filter:Hi,WebkitFilter:Hi,mask:zi,WebkitMask:zi},qi=t=>_i[t],Zi=new Set([Hi,zi]);function Ji(t,e){let n=qi(t);return Zi.has(n)||(n=_t),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Qi=new Set(["auto","none","0"]);class ts extends En{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const es=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function ns(t,e){for(let n=0;n{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),ss=new Set(["opacity","clipPath","filter","transform"]);function os(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function rs(t){return(e,n)=>{const i=os(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const as=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ls{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const o=this.values.get(t);o&&o.onRemove();const r=()=>{const i=e.get();this.latest[t]=s?as(i,Gi[t]):i,n&&at.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&<(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function cs(t){const e=new WeakMap,n=[];return(i,s)=>{const o=e.get(i)??new ls;e.set(i,o);for(const e in s){const r=s[e],a=t(i,o,e,r);n.push(a)}return()=>{for(const t of n)t()}}}const us=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?Ci(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},hs=rs(cs(us)),ds=cs((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function ps(t){return A(t)&&"offsetHeight"in t}const ms={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const fs=new Set(["originX","originY","originZ"]),gs=(t,e,n,i)=>{let s,o;return pn.has(n)?(e.get("transform")||(ps(t)||e.get("transformBox")||gs(t,e,"transformBox",new wi("fill-box")),e.set("transform",new wi("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=An(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},ys=rs(cs(gs));const vs=rs(cs((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return at.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new wi("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return us(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?gs:us)(t,e,n,i)}));const{schedule:xs,cancel:ws}=rt(queueMicrotask,!1),Ts={x:!1,y:!1};function Ss(){return Ts.x||Ts.y}function Ps(t){return"x"===t||"y"===t?Ts[t]?null:(Ts[t]=!0,()=>{Ts[t]=!1}):Ts.x||Ts.y?null:(Ts.x=Ts.y=!0,()=>{Ts.x=Ts.y=!1})}function bs(t,e){const n=os(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Es(t,e,n={}){const[i,s,o]=bs(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Ss())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const As=(t,e)=>!!e&&(t===e||As(t,e.parentElement)),Ms=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Vs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Cs(t){return Vs.has(t.tagName)||!0===t.isContentEditable}const ks=new Set(["INPUT","SELECT","TEXTAREA"]);function Rs(t){return ks.has(t.tagName)||!0===t.isContentEditable}const Ds=new WeakSet;function Ls(t){return e=>{"Enter"===e.key&&t(e)}}function Bs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function js(t){return Ms(t)&&!Ss()}const Is=new WeakSet;function Os(t,e,n={}){const[i,s,o]=bs(t,n),r=t=>{const i=t.currentTarget;if(!js(t))return;if(Is.has(t))return;Ds.add(i),n.stopPropagation&&Is.add(t);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Ds.has(i)&&Ds.delete(i),js(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||As(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ps(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Ls(()=>{if(Ds.has(n))return;Bs(n,"down");const t=Ls(()=>{Bs(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Bs(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),Cs(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Fs(t,e){const n=window.getComputedStyle(t);return An(e)?n.getPropertyValue(e):n[e]}function Ws(t){return A(t)&&"ownerSVGElement"in t}const Us=new WeakMap;let Ns;const $s=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ws(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ys=$s("inline","width","offsetWidth"),Hs=$s("block","height","offsetHeight");function zs({target:t,borderBoxSize:e}){Us.get(t)?.forEach(n=>{n(t,{get width(){return Ys(t,e)},get height(){return Hs(t,e)}})})}function Xs(t){t.forEach(zs)}function Ks(t,e){Ns||"undefined"!=typeof ResizeObserver&&(Ns=new ResizeObserver(Xs));const n=os(t);return n.forEach(t=>{let n=Us.get(t);n||(n=new Set,Us.set(t,n)),n.add(e),Ns?.observe(t)}),()=>{n.forEach(t=>{const n=Us.get(t);n?.delete(e),n?.size||Ns?.unobserve(t)})}}const Gs=new Set;let _s;function qs(t){return Gs.add(t),_s||(_s=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gs.forEach(e=>e(t))},window.addEventListener("resize",_s)),()=>{Gs.delete(t),Gs.size||"function"!=typeof _s||(window.removeEventListener("resize",_s),_s=void 0)}}function Zs(t,e){return"function"==typeof t?qs(t):Ks(t,e)}function Js(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return at.preUpdate(i,!0),()=>lt(i)}function Qs(){const{value:t}=ot;null!==t?(t.frameloop.rate.push(ct.delta),t.animations.mainThread.push(mt.mainThread),t.animations.waapi.push(mt.waapi),t.animations.layout.push(mt.layout)):lt(Qs)}function to(t){return t.reduce((t,e)=>t+e,0)/t.length}function eo(t,e=to){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const no=t=>Math.round(1e3/t);function io(){ot.value=null,ot.addProjectionMetrics=null}function so(){const{value:t}=ot;if(!t)throw new Error("Stats are not being measured");io(),lt(Qs);const e={frameloop:{setup:eo(t.frameloop.setup),rate:eo(t.frameloop.rate),read:eo(t.frameloop.read),resolveKeyframes:eo(t.frameloop.resolveKeyframes),preUpdate:eo(t.frameloop.preUpdate),update:eo(t.frameloop.update),preRender:eo(t.frameloop.preRender),render:eo(t.frameloop.render),postRender:eo(t.frameloop.postRender)},animations:{mainThread:eo(t.animations.mainThread),waapi:eo(t.animations.waapi),layout:eo(t.animations.layout)},layoutProjection:{nodes:eo(t.layoutProjection.nodes),calculatedTargetDeltas:eo(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:eo(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=no(n.min),n.max=no(n.max),n.avg=no(n.avg),[n.min,n.max]=[n.max,n.min],e}function oo(t){return Ws(t)&&"svg"===t.tagName}function ro(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function ao(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Ue(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function lo(t,e){const n=Ti(Ai(t)?t.get():t);return co(n,t,e),n}function co(t,e,n={}){const i=t.get();let s,o=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{o&&(o.stop(),o=null)};if(t.attach((e,i)=>{r=e,s=t=>i(uo(t,a)),at.postRender(()=>{(()=>{l();const e=ho(t.get()),i=ho(r);e!==i&&(o=new Je({keyframes:[e,i],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}))})(),t.events.animationStart?.notify(),o?.then(()=>{t.events.animationComplete?.notify()})})},l),Ai(e)){const n=e.on("change",e=>t.set(uo(e,a))),i=t.on("destroy",n);return()=>{n(),i()}}return l}function uo(t,e){return e?t+e:t}function ho(t){return"number"==typeof t?t:parseFloat(t)}function po(t){const e=[];xi.current=e;const n=t();xi.current=void 0;const i=Ti(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>at.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),lt(i)})}(e,i,t),i}const mo=[...Fi,Ut,_t],fo=t=>mo.find(Oi(t));function go(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let yo={},vo=null;const xo=(t,e)=>{yo[t]=e},wo=()=>{vo||(vo=document.createElement("style"),vo.id="motion-view");let t="";for(const e in yo){const n=yo[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}vo.textContent=t,document.head.appendChild(vo),yo={}},To=()=>{vo&&vo.parentElement&&vo.parentElement.removeChild(vo)};function So(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Po(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function bo(){return document.getAnimations().filter(Po)}const Eo=["layout","enter","exit","new","old"];function Ao(t){const{update:e,targets:n,options:i}=t;if(!document.startViewTransition)return new Promise(async t=>{await e(),t(new Gn([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||xo(":root",{"view-transition-name":"none"}),xo("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),wo();const s=document.startViewTransition(async()=>{await e()});return s.finished.finally(()=>{To()}),new Promise(t=>{s.ready.then(()=>{const e=bo(),s=[];n.forEach((t,e)=>{for(const n of Eo){if(!t[n])continue;const{keyframes:o,options:r}=t[n];for(let[t,a]of Object.entries(o)){if(!a)continue;const o={...di(i,t),...di(r,t)},l=go(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof o.delay&&(o.delay=o.delay(0,1)),o.duration&&(o.duration=B(o.duration)),o.delay&&(o.delay=B(o.delay));const c=new Fn({...o,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});s.push(c)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=So(o);if(!r)continue;const a=n.get(r.layer);if(a)Mo(a,"enter")&&Mo(a,"exit")&&e.getKeyframes().some(t=>t.mixBlendMode)?s.push(new Zn(t)):t.cancel();else{const n="group"===r.type?"layout":"";let o={...di(i,n)};o.duration&&(o.duration=B(o.duration)),o=On(o);const a=Bn(o.ease,o.duration);e.updateTiming({delay:B(o.delay??0),duration:o.duration,easing:a}),s.push(new Zn(t))}}t(new Gn(s))})})}function Mo(t,e){return t?.[e]?.keyframes.opacity}let Vo=[],Co=null;function ko(){Co=null;const[t]=Vo;var e;t&&(w(Vo,e=t),Co=e,Ao(e).then(t=>{e.notifyReady(t),t.finished.finally(ko)}))}function Ro(){for(let t=Vo.length-1;t>=0;t--){const e=Vo[t],{interrupt:n}=e.options;if("immediate"===n){const n=Vo.slice(0,t+1).map(t=>t.update),i=Vo.slice(t+1);e.update=()=>{n.forEach(t=>t())},Vo=[e,...i];break}}Co&&"immediate"!==Vo[0]?.options.interrupt||ko()}class Do{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.notifyReady=C,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...e},n=this,Vo.push(n),xs.render(Ro)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Lo=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),jo=()=>({min:0,max:0}),Io=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Oo=new WeakMap;function Fo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Wo(t){return"string"==typeof t||Array.isArray(t)}const Uo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],No=["initial",...Uo];function $o(t){return Fo(t.animate)||No.some(e=>Wo(t[e]))}function Yo(t){return Boolean($o(t)||t.variants)}function Ho(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Ai(s))t.addValue(i,s);else if(Ai(o))t.addValue(i,Ti(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Ti(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const zo={current:null},Xo={current:!1},Ko="undefined"!=typeof window;function Go(){if(Xo.current=!0,Ko)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>zo.current=t.matches;t.addEventListener("change",e),e()}else zo.current=!1}const _o=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let qo={};function Zo(t){qo=t}function Jo(){return qo}class Qo{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=En,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=pt.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Xo.current||Go(),this.shouldReduceMotion=zo.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),lt(this.notifyUpdate),lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ss.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Fn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:B(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=pn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&at.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in qo){const e=qo[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<_o.length;e++){const n=_o[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Ho(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ti(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(E(n)||M(n))?n=parseFloat(n):!fo(n)&&_t.test(e)&&(n=Ji(t,e)),this.setBaseTarget(t,Ai(n)?n.get():n)),Ai(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=gi(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Ai(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new L),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){xs.render(this.render)}}class tr extends Qo{constructor(){super(...arguments),this.KeyframeResolver=ts}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ai(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class er{constructor(t){this.isMounted=!1,this.node=t}update(){}}function nr({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ir({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function sr(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function or(t){return void 0===t||1===t}function rr({scale:t,scaleX:e,scaleY:n}){return!or(t)||!or(e)||!or(n)}function ar(t){return rr(t)||lr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function lr(t){return cr(t.x)||cr(t.y)}function cr(t){return t&&"0%"!==t}function ur(t,e,n){return n+e*(t-n)}function hr(t,e,n,i,s){return void 0!==s&&(t=ur(t,s,i)),ur(t,n,i)+e}function dr(t,e=0,n=1,i,s){t.min=hr(t.min,e,n,i,s),t.max=hr(t.max,e,n,i,s)}function pr(t,{x:e,y:n}){dr(t.x,e.translate,e.scale,e.originPoint),dr(t.y,n.translate,n.scale,n.originPoint)}const mr=.999999999999,fr=1.0000000000001;function gr(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;amr&&(e.x=1),e.ymr&&(e.y=1)}function yr(t,e){t.min=t.min+e,t.max=t.max+e}function vr(t,e,n,i,s=.5){dr(t,e,n,Qt(t.min,t.max,s),i)}function xr(t,e){vr(t.x,e.x,e.scaleX,e.scale,e.originX),vr(t.y,e.y,e.scaleY,e.scale,e.originY)}function wr(t,e){return nr(sr(t.getBoundingClientRect(),e))}function Tr(t,e,n){const i=wr(t,n),{scroll:s}=e;return s&&(yr(i.x,s.offset.x),yr(i.y,s.offset.y)),i}const Sr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pr=dn.length;function br(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!jt.test(t))return t;t=parseFloat(t)}return`${Mr(t,e.target.x)}% ${Mr(t,e.target.y)}%`}},Cr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=_t.parse(t);if(s.length>5)return i;const o=_t.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=Qt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},kr={borderRadius:{...Vr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vr,borderTopRightRadius:Vr,borderBottomLeftRadius:Vr,borderBottomRightRadius:Vr,boxShadow:Cr};function Rr(t,{layout:e,layoutId:n}){return pn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!kr[t]||"opacity"===t)}function Dr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(Ai(i[e])||s&&Ai(s[e])||Rr(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Lr extends tr{constructor(){super(...arguments),this.type="html",this.renderInstance=Ar}readValueFromInstance(t,e){if(pn.has(e))return this.projection?.isProjecting?ln(e):un(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(gt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return wr(t,e)}build(t,e,n){Er(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Dr(t,e,n)}}class Br extends Qo{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const jr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ir={offset:"strokeDashoffset",array:"strokeDasharray"};function Or(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?jr:Ir;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Fr=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Wr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Er(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const t of Fr)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&Or(h,s,o,r,!1)}const Ur=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Nr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function $r(t,e,n,i){Ar(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ur.has(n)?n:Ci(n),e.attrs[n])}function Yr(t,e,n){const i=Dr(t,e,n);for(const n in t)if(Ai(t[n])||Ai(e[n])){i[-1!==dn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Hr extends tr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Io}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(pn.has(e)){const t=qi(e);return t&&t.default||0}return e=Ur.has(e)?e:Ci(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Yr(t,e,n)}build(t,e,n){Wr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){$r(t,e,0,i)}mount(t){this.isSVGTag=Nr(t.tagName),super.mount(t)}}const zr=No.length;function Xr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Xr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>Ii(t,e,n)))}(t),n=Qr(),i=!0;const s=e=>(n,i)=>{const s=yi(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=Xr(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<_r;e++){const d=Gr[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],f=Wo(m),g=d===o?p.isActive:null;!1===g&&(h=e);let y=m===a[d]&&m!==r[d]&&f;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...u},!p.isActive&&null===g||!m&&!p.prevProp||Fo(m)||"boolean"==typeof m)continue;if("exit"===d&&p.isActive&&!0!==g){p.prevResolvedValues&&(u={...u,...p.prevResolvedValues});continue}const v=Zr(p.prevProp,m);let x=v||d===o&&p.isActive&&!y&&f||e>h&&f,w=!1;const T=Array.isArray(m)?m:[m];let S=T.reduce(s(d),{});!1===g&&(S={});const{prevResolvedValues:P={}}=p,b={...P,...S},E=e=>{x=!0,c.has(e)&&(w=!0,c.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in b){const e=S[t],n=P[t];if(u.hasOwnProperty(t))continue;let i=!1;i=Si(e)&&Si(n)?!Kr(e,n):e!==n,i?null!=e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),i&&t.blockInitialAnimation&&(x=!1);const A=y&&v;x&&(!A||w)&&l.push(...T.map(e=>{const n={type:d};if("string"==typeof e&&i&&!A&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=yi(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=ei(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof r.initial){const n=yi(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Qr()}}}function Zr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Kr(e,t)}function Jr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Qr(){return{animate:Jr(!0),whileInView:Jr(),whileHover:Jr(),whileTap:Jr(),whileDrag:Jr(),whileFocus:Jr(),exit:Jr()}}function ta(t,e){t.min=e.min,t.max=e.max}function ea(t,e){ta(t.x,e.x),ta(t.y,e.y)}function na(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function ia(t){return t.max-t.min}function sa(t,e,n){return Math.abs(t-e)<=n}function oa(t,e,n,i=.5){t.origin=i,t.originPoint=Qt(e.min,e.max,t.origin),t.scale=ia(n)/ia(e),t.translate=Qt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function ra(t,e,n,i){oa(t.x,e.x,n.x,i?i.originX:void 0),oa(t.y,e.y,n.y,i?i.originY:void 0)}function aa(t,e,n){t.min=n.min+e.min,t.max=t.min+ia(e)}function la(t,e,n){aa(t.x,e.x,n.x),aa(t.y,e.y,n.y)}function ca(t,e,n){t.min=e.min-n.min,t.max=t.min+ia(e)}function ua(t,e,n){ca(t.x,e.x,n.x),ca(t.y,e.y,n.y)}function ha(t,e,n,i,s){return t=ur(t-=e,1/n,i),void 0!==s&&(t=ur(t,1/s,i)),t}function da(t,e=0,n=1,i=.5,s,o=t,r=t){if(Bt.test(e)){e=parseFloat(e);e=Qt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Qt(o.min,o.max,i);t===o&&(a-=e),t.min=ha(t.min,e,n,a,s),t.max=ha(t.max,e,n,a,s)}function pa(t,e,[n,i,s],o,r){da(t,e[n],e[i],e[s],e.scale,o,r)}const ma=["x","scaleX","originX"],fa=["y","scaleY","originY"];function ga(t,e,n,i){pa(t.x,e,ma,n?n.x:void 0,i?i.x:void 0),pa(t.y,e,fa,n?n.y:void 0,i?i.y:void 0)}function ya(t){return 0===t.translate&&1===t.scale}function va(t){return ya(t.x)&&ya(t.y)}function xa(t,e){return t.min===e.min&&t.max===e.max}function wa(t,e){return xa(t.x,e.x)&&xa(t.y,e.y)}function Ta(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Sa(t,e){return Ta(t.x,e.x)&&Ta(t.y,e.y)}function Pa(t){return ia(t.x)/ia(t.y)}function ba(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ea(t){return[t("x"),t("y")]}function Aa(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Ma=["TopLeft","TopRight","BottomLeft","BottomRight"],Va=Ma.length,Ca=t=>"string"==typeof t?parseFloat(t):t,ka=t=>"number"==typeof t||jt.test(t);function Ra(t,e,n,i,s,o){s?(t.opacity=Qt(0,n.opacity??1,La(i)),t.opacityExit=Qt(e.opacity??1,0,Ba(i))):o&&(t.opacity=Qt(e.opacity??1,n.opacity??1,i));for(let s=0;sie?1:n(D(t,e,i))}function Ia(t,e,n){const i=Ai(t)?t:Ti(t);return i.start(mi("",i,e,n)),i.animation}function Oa(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Fa=(t,e)=>t.depth-e.depth;class Wa{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Fa),this.isDirty=!1,this.children.forEach(t)}}function Ua(t,e){const n=pt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(lt(i),t(o-e))};return at.setup(i,!0),()=>lt(i)}function Na(t){return Ai(t)?t.get():t}class $a{constructor(){this.members=[]}add(t){x(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1===i.isConnected&&!1!==n.isPresent&&!n.snapshot&&w(this.members,n)}t.scheduleRender()}remove(t){if(w(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t],i=e.instance;if(!1!==e.isPresent&&(!i||!1!==i.isConnected)){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender();const i=n.options.layoutDependency,s=t.options.layoutDependency;if(!(void 0!==i&&void 0!==s&&i===s)){const i=n.instance;i&&!1===i.isConnected&&!n.snapshot||(t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:o}=t.options;!1===o&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Ya={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ha={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},za=["","X","Y","Z"];let Xa=0;function Ka(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Ga(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Di(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Ga(i)}function _a({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Xa++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ot.value&&(Ha.nodes=Ha.calculatedTargetDeltas=Ha.calculatedProjections=0),this.nodes.forEach(Ja),this.nodes.forEach(ol),this.nodes.forEach(rl),this.nodes.forEach(Qa),ot.addProjectionMetrics&&ot.addProjectionMetrics(Ha)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;at.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=Ua(s,250),Ya.hasAnimatedSinceResize&&(Ya.hasAnimatedSinceResize=!1,this.nodes.forEach(sl)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||dl,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Sa(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...di(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||sl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),lt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(al),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ga(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||ia(this.snapshot.measuredBox.x)||ia(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3;cl(o.x,t.x,n),cl(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ua(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(t,e,n,i){ul(t.x,e.x,n.x,i),ul(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,r,n),h&&wa(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),ea(h,this.relativeTarget)),a&&(this.animationValues=s,Ra(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{Ya.hasAnimatedSinceResize=!0,mt.layout++,this.motionValue||(this.motionValue=Ti(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ia(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{mt.layout--},onComplete:()=>{mt.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&gl(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=ia(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=ia(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}ea(e,n),xr(e,s),ra(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new $a);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Ka("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(el),this.root.sharedNodes.clear()}}}function qa(t){t.updateLayout()}function Za(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?Ea(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=ia(i);i.min=n[t].min,i.max=i.min+s}):gl(s,e.layoutBox,n)&&Ea(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=ia(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ra(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?ra(a,t.applyTransform(i,!0),e.measuredBox):ra(a,n,e.layoutBox);const l=!va(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};ua(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};ua(a,n,o.layoutBox),Sa(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ja(t){ot.value&&Ha.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Qa(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function tl(t){t.clearSnapshot()}function el(t){t.clearMeasurements()}function nl(t){t.isLayoutDirty=!1}function il(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function sl(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ol(t){t.resolveTargetDelta()}function rl(t){t.calcProjection()}function al(t){t.resetSkewAndRotation()}function ll(t){t.removeLeadSnapshot()}function cl(t,e,n){t.translate=Qt(e.translate,0,n),t.scale=Qt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ul(t,e,n,i){t.min=Qt(e.min,n.min,i),t.max=Qt(e.max,n.max,i)}function hl(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const dl={duration:.45,ease:[.4,0,.1,1]},pl=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ml=pl("applewebkit/")&&!pl("chrome/")?Math.round:C;function fl(t){t.min=ml(t.min),t.max=ml(t.max)}function gl(t,e,n){return"position"===t||"preserve-aspect"===t&&!sa(Pa(e),Pa(n),.2)}function yl(t){return t!==t.root&&t.scroll?.wasRoot}const vl=_a({attachResizeListener:(t,e)=>Oa(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),xl=t=>!t.isLayoutDirty&&t.willUpdate(!1);function wl(){const t=new Set,e=new WeakMap,n=()=>t.forEach(xl);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}}const Tl={current:void 0},Sl=_a({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Tl.current){const t=new vl({});t.mount(window),t.setOptions({layoutScroll:!0}),Tl.current=t}return Tl.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Pl="[data-layout], [data-layout-id]",bl=()=>{};function El(t){const e=Array.from(t.querySelectorAll(Pl));return t instanceof Element&&t.matches(Pl)&&(e.includes(t)||e.unshift(t)),e}function Al(t){const e=t.getAttribute("data-layout-id")||void 0,n=t.getAttribute("data-layout");let i;return""===n||"true"===n?i=!0:n&&(i=n),{layout:i,layoutId:e}}function Ml(t,e,n){const i=Oo.get(t),s=i??new Lr({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0});return i&&s.projection||(s.projection=new Sl(s.latestValues,e)),s.projection.setOptions({...n,visualElement:s}),s.current?s.projection.instance||s.projection.mount(t):s.mount(t),i||Oo.set(t,s),{element:t,visualElement:s,projection:s.projection}}function Vl(t,e,n){let i=t.parentElement;for(;i;){const t=e.get(i);if(t)return t;if(i===n)break;i=i.parentElement}}const Cl=at,kl=st.reduce((t,e)=>(t[e]=t=>lt(t),t),{}),Rl=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Dl(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function Ll(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=Dl(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e{const{width:t,height:e,top:i,left:d,right:p,bottom:m}=u.current;if(n||!1===a||!c.current||!t||!e)return;const f="left"===s?`left: ${d}`:`right: ${p}`,g="bottom"===o?`bottom: ${m}`:`top: ${i}`;c.current.dataset.motionPopId=l;const y=document.createElement("style");h&&(y.nonce=h);const v=r??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`\n [data-motion-pop-id="${l}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${f}px !important;\n ${g}px !important;\n }\n `),()=>{v.contains(y)&&v.removeChild(y)}},[n]),d(Bl,{isPresent:n,childRef:c,sizeRef:u,pop:a,children:!1===a?t:i.cloneElement(t,{ref:m})})}const Il=({children:t,initial:n,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=f(Ol),m=e.useId();let g=!0,y=e.useMemo(()=>(g=!1,{id:m,initial:n,isPresent:s,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;o&&o()},register:t=>(p.set(t,!1),()=>p.delete(t))}),[s,p,o]);return a&&g&&(y={...y}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[s]),i.useEffect(()=>{!s&&!p.size&&o&&o()},[s]),t=d(jl,{pop:"popLayout"===l,isPresent:s,anchorX:c,anchorY:u,root:h,children:t}),d(v.Provider,{value:y,children:t})};function Ol(){return new Map}function Fl(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect(()=>{if(t)return o(r)},[t]);const a=e.useCallback(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,a]:[!0]}const Wl=t=>t.key||"";function Ul(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Nl=e.createContext(null);function $l(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),s=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>at.postRender(s),[s]),n]}const Yl=t=>!0===t,Hl=({children:t,id:n,inherit:i=!0})=>{const s=e.useContext(m),o=e.useContext(Nl),[r,a]=$l(),l=e.useRef(null),c=s.id||o;null===l.current&&((t=>Yl(!0===t)||"id"===t)(i)&&c&&(n=n?c+"-"+n:c),l.current={id:n,group:Yl(i)&&s.group||wl()});const u=e.useMemo(()=>({...l.current,forceRender:r}),[a]);return d(m.Provider,{value:u,children:t})},zl=e.createContext({strict:!1}),Xl={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Kl=!1;function Gl(){return function(){if(Kl)return;const t={};for(const e in Xl)t[e]={isEnabled:t=>Xl[e].some(e=>!!t[e])};Zo(t),Kl=!0}(),Jo()}function _l(t){const e=Gl();for(const n in t)e[n]={...e[n],...t[n]};Zo(e)}function ql(t){return"function"==typeof t}const Zl=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Jl(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Zl.has(t)}let Ql=t=>!Jl(t);function tc(t){"function"==typeof t&&(Ql=e=>e.startsWith("on")?!Jl(e):t(e))}try{tc(require("@emotion/is-prop-valid").default)}catch{}function ec(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Ql(s)||!0===n&&Jl(s)||!e&&!Jl(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}const nc=e.createContext(null),ic=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function sc(t){return"string"==typeof t&&!t.includes("-")&&!!(ic.indexOf(t)>-1||/[A-Z]/u.test(t))}const oc=(t,n)=>n.isSVG??sc(t)?new Hr(n):new Lr(n,{allowProjection:t!==e.Fragment}),rc=e.createContext({});function ac(t){const{initial:n,animate:i}=function(t,e){if($o(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Wo(e)?e:void 0,animate:Wo(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(rc));return e.useMemo(()=>({initial:n,animate:i}),[lc(n),lc(i)])}function lc(t){return Array.isArray(t)?t.join(" "):t}const cc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uc(t,e,n){for(const i in e)Ai(e[i])||Rr(i,n)||(t[i]=e[i])}function hc(t,n){const i={};return uc(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Er(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function dc(t,e){const n={},i=hc(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const pc=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function mc(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Wr(e,n,Nr(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};uc(e,t.style,t),o.style={...e,...o.style}}return o}function fc(t,n,i,{latestValues:s},o,r=!1,a){const l=(a??sc(t)?mc:dc)(n,s,o,t),c=ec(n,"string"==typeof t,r),u=t!==e.Fragment?{...c,...l,ref:i}:{},{children:h}=n,d=e.useMemo(()=>Ai(h)?h.get():h,[h]);return e.createElement(t,{...u,children:d})}function gc(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=Na(o[t]);let{initial:r,animate:a}=t;const l=$o(t),c=Yo(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Fo(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n(n,i)=>{const s=e.useContext(rc),o=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:gc(n,i,s,t),renderState:e()}}(t,n,s,o);return i?r():f(r)},vc=yc({scrapeMotionValuesFromProps:Dr,createRenderState:cc}),xc=yc({scrapeMotionValuesFromProps:Yr,createRenderState:pc}),wc=Symbol.for("motionComponentSymbol");function Tc(t,n,i){const s=e.useRef(i);e.useInsertionEffect(()=>{s.current=i});const o=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=s.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):i(e);else i&&(i.current=e)},[n])}const Sc=e.createContext({});function Pc(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function bc(t,n,i,s,o,r){const{visualElement:a}=e.useContext(rc),l=e.useContext(zl),c=e.useContext(v),u=e.useContext(Rl),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),m=e.useRef(!1);s=s||l.renderer,!p.current&&s&&(p.current=s(t,{visualState:n,parent:a,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const f=p.current,g=e.useContext(Sc);!f||f.projection||!o||"html"!==f.type&&"svg"!==f.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ec(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&Pc(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}(p.current,i,o,g);const x=e.useRef(!1);e.useInsertionEffect(()=>{f&&x.current&&f.update(i,c)});const w=i[Ri],T=e.useRef(Boolean(w)&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return y(()=>{m.current=!0,f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),T.current&&f.animationState&&f.animationState.animateChanges())}),e.useEffect(()=>{f&&(!T.current&&f.animationState&&f.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),T.current=!1),f.enteringChildren=void 0)}),f}function Ec(t){if(t)return!1!==t.options.allowProjection?t.projection:Ec(t.parent)}function Ac(t,{forwardMotionProps:n=!1,type:i}={},s,o){s&&_l(s);const r=i?"svg"===i:sc(t),a=r?xc:vc;function l(i,s){let l;const c={...e.useContext(Rl),...i,layoutId:Mc(i)},{isStatic:u}=c,h=ac(i),m=a(i,u);if(!u&&g){e.useContext(zl).strict;const n=function(t){const e=Gl(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);l=n.MeasureLayout,h.visualElement=bc(t,m,c,o,n.ProjectionNode,r)}return p(rc.Provider,{value:h,children:[l&&h.visualElement?d(l,{visualElement:h.visualElement,...c}):null,fc(t,i,Tc(m,h.visualElement,s),m,u,n,r)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const c=e.forwardRef(l);return c[wc]=t,c}function Mc({layoutId:t}){const n=e.useContext(m).id;return n&&void 0!==t?n+"-"+t:t}function Vc(t,e){if("undefined"==typeof Proxy)return Ac;const n=new Map,i=(n,i)=>Ac(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(s,o)=>"create"===o?i:(n.has(o)||n.set(o,Ac(o,void 0,t,e)),n.get(o))})}let Cc=0;const kc={animation:{Feature:class extends er{constructor(t){super(t),t.animationState||(t.animationState=qr(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Fo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends er{constructor(){super(...arguments),this.id=Cc++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Rc(t){return{point:{x:t.pageX,y:t.pageY}}}const Dc=t=>e=>Ms(e)&&t(e,Rc(e));function Lc(t,e,n,i){return Oa(t,e,Dc(n),i)}const Bc=({current:t})=>t?t.ownerDocument.defaultView:null,jc=(t,e)=>Math.abs(t-e);function Ic(t,e){const n=jc(t.x,e.x),i=jc(t.y,e.y);return Math.sqrt(n**2+i**2)}const Oc=new Set(["auto","scroll"]);class Fc{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Nc(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Ic(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=ct;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Wc(e,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Nc("pointercancel"===t.type?this.lastMoveEventInfo:Wc(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Ms(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=Wc(Rc(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=ct;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,Nc(a,this.history)),this.removeListeners=R(Lc(this.contextWindow,"pointermove",this.handlePointerMove),Lc(this.contextWindow,"pointerup",this.handlePointerUp),Lc(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Oc.has(t.overflowX)||Oc.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),at.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),lt(this.updatePoint)}}function Wc(t,e){return e?{point:e(t.point)}:t}function Uc(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Nc({point:t},e){return{point:t,delta:Uc(t,Yc(e)),offset:Uc(t,$c(e)),velocity:Hc(e,.1)}}function $c(t){return t[0]}function Yc(t){return t[t.length-1]}function Hc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Yc(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>B(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*B(e)&&(i=t[1]);const o=j(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function zc(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Xc(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(Rc(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ps(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ea(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Bt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=ia(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&at.update(()=>s(t,e),!1,!0),Vi(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&at.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:Bc(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&at.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Qc(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?Qt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Pc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:zc(t.x,n,s),y:zc(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Kc){return!1===t?t=0:!0===t&&(t=Kc),{x:Gc(t,"left","right"),y:Gc(t,"top","bottom")}}(e),i!==this.constraints&&!Pc(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Ea(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Pc(e))return!1;const i=e.current;t.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=Tr(i,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Xc(t.x,e.x),y:Xc(t.y,e.y)}}(s.layout.layoutBox,o);if(n){const t=n(ir(r));this.hasMutatedConstraints=!!t,t&&(r=nr(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Ea(r=>{if(!Qc(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Vi(this.visualElement,t),n.start(mi(t,n,0,e,this.visualElement,!1))}stopAnimation(){Ea(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Ea(e=>{const{drag:n}=this.getProps();if(!Qc(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e],r=s.get()||0;s.set(t[e]-Qt(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Pc(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ea(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=ia(t),s=ia(e);return s>i?n=D(e.min,e.max-i,t.min):i>s&&(n=D(t.min,t.max-s,e.min)),S(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ea(e=>{if(!Qc(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Qt(s,o,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;qc.set(this.visualElement,this);const t=this.visualElement.current,e=Lc(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&Rs(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Pc(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Zs(t,Jc(n)),s=Zs(e,Jc(n));return()=>{i(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),at.read(i);const r=Oa(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ea(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Kc,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Jc(t){let e=!0;return()=>{e?e=!1:t()}}function Qc(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const tu=t=>(e,n)=>{t&&at.update(()=>t(e,n),!1,!0)};let eu=!1;class nu extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),eu&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ya.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),eu=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||at.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),xs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;eu=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function iu(t){const[n,i]=Fl(),s=e.useContext(m);return d(nu,{...t,layoutGroup:s,switchLayoutGroup:e.useContext(Sc),isPresent:n,safeToRemove:i})}const su={pan:{Feature:class extends er{constructor(){super(...arguments),this.removePointerDownListener=C}onPointerDown(t){this.session=new Fc(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bc(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:tu(t),onStart:tu(e),onMove:tu(n),onEnd:(t,e)=>{delete this.session,i&&at.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Lc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends er{constructor(t){super(t),this.removeGroupControls=C,this.removeListeners=C,this.controls=new Zc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||C}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Sl,MeasureLayout:iu}};function ou(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&at.postRender(()=>s(e,Rc(e)))}function ru(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&at.postRender(()=>s(e,Rc(e)))}const au=new WeakMap,lu=new WeakMap,cu=t=>{const e=au.get(t.target);e&&e(t)},uu=t=>{t.forEach(cu)};function hu(t,e,n){const i=function({root:t,...e}){const n=t||document;lu.has(n)||lu.set(n,{});const i=lu.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(uu,{root:t,...e})),i[s]}(e);return au.set(t,n),i.observe(t),()=>{au.delete(t),i.unobserve(t)}}const du={some:0,all:1};const pu={inView:{Feature:class extends er{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:du[i]};return hu(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends er{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Os(t,(t,e)=>(ru(this.node,e,"Start"),(t,{success:e})=>ru(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends er{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=R(Oa(this.node.current,"focus",()=>this.onFocus()),Oa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends er{mount(){const{current:t}=this.node;t&&(this.unmount=Es(t,(t,e)=>(ou(this.node,e,"Start"),t=>ou(this.node,t,"End"))))}unmount(){}}}},mu={layout:{ProjectionNode:Sl,MeasureLayout:iu}},fu=Vc({...kc,...pu,...su,...mu},oc);function gu({children:n,as:i="ul",axis:s="y",onReorder:o,values:r,...a},l){const c=f(()=>fu[i]),u=[],h=e.useRef(!1),p=e.useRef(null);t.invariant(Boolean(r),"Reorder.Group must be provided a values prop","reorder-values");const m={axis:s,groupRef:p,registerItem:(t,e)=>{const n=u.findIndex(e=>t===e.value);-1!==n?u[n].layout=e[s]:u.push({value:t,layout:e[s]}),u.sort(xu)},updateOrder:(t,e,n)=>{if(h.current)return;const i=function(t,e,n,i){if(!i)return t;const s=t.findIndex(t=>t.value===e);if(-1===s)return t;const o=i>0?1:-1,r=t[s+o];if(!r)return t;const a=t[s],l=r.layout,c=Qt(l.min,l.max,.5);return 1===o&&a.layout.max+n>c||-1===o&&a.layout.min+n-1!==r.indexOf(t))))}};e.useEffect(()=>{h.current=!1});const g={overflowAnchor:"none",...a.style};return d(c,{...a,style:g,ref:t=>{p.current=t,"function"==typeof l?l(t):l&&(l.current=t)},ignoreStrict:!0,children:d(nc.Provider,{value:m,children:n})})}const yu=e.forwardRef(gu);function vu(t){return t.value}function xu(t,e){return t.layout.min-e.layout.min}function wu(t){const n=f(()=>Ti(t)),{isStatic:i}=e.useContext(Rl);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Tu(t,e){const n=wu(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>at.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),lt(i)}}),n}function Su(t,e,n,i){if("function"==typeof t)return function(t){xi.current=[],t();const e=Tu(xi.current,t);return xi.current=void 0,e}(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const s=f(()=>Object.keys(n)),o=f(()=>({}));for(const r of s)o[r]=Su(t,e,n[r],i);return o}(t,e,n,i);const s="function"==typeof e?e:ao(e,n,i),o=Array.isArray(t)?Pu(t,s):Pu([t],([t])=>s(t)),r=Array.isArray(t)?void 0:t.accelerate;return r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp&&(o.accelerate={...r,times:e,keyframes:n,isTransformed:!0,...i?.ease?{ease:i.ease}:{}}),o}function Pu(t,e){const n=f(()=>[]);return Tu(t,()=>{n.length=0;const i=t.length;for(let e=0;e0))return;Au.set(s,a);const t="x"===n?s.scrollWidth-(c?window.innerWidth:s.clientWidth):s.scrollHeight-(c?window.innerHeight:s.clientHeight);Eu.set(s,t)}if(r>0){const t=Eu.get(s);if(("x"===n?c?window.scrollX:s.scrollLeft:c?window.scrollY:s.scrollTop)>=t)return}"x"===n?c?window.scrollBy({left:r}):s.scrollLeft+=r:c?window.scrollBy({top:r}):s.scrollTop+=r}function Ru(t,e=0){return Ai(t)?t:wu(e)}function Du({children:n,style:i={},value:s,as:o="li",onDrag:r,onDragEnd:a,layout:l=!0,...c},u){const h=f(()=>fu[o]),p=e.useContext(nc),m={x:Ru(i.x),y:Ru(i.y)},g=Su([m.x,m.y],([t,e])=>t||e?1:"unset");t.invariant(Boolean(p),"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:v,updateOrder:x,groupRef:w}=p;return d(h,{drag:y,...c,dragSnapToOrigin:!0,style:{...i,x:m.x,y:m.y,zIndex:g},layout:l,onDrag:(t,e)=>{const{velocity:n,point:i}=e,o=m[y].get();x(s,o,n[y]),ku(w.current,i[y],y,n[y]),r&&r(t,e)},onDragEnd:(t,e)=>{!function(){if(Mu){const t=Cu(Mu,"y");t&&(Au.delete(t),Eu.delete(t));const e=Cu(Mu,"x");e&&e!==t&&(Au.delete(e),Eu.delete(e)),Mu=null}}(),a&&a(t,e)},onLayoutMeasure:t=>{v(s,t)},ref:u,ignoreStrict:!0,children:n})}const Lu=e.forwardRef(Du);var Bu=Object.freeze({__proto__:null,Group:yu,Item:Lu});function ju(t){return"object"==typeof t&&!Array.isArray(t)}function Iu(t,e,n,i){return null==t?[]:"string"==typeof t&&ju(e)?os(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Ou(t,e,n){return t*(e+1)}function Fu(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Wu(t,e,n,i,s,o){!function(t,e,n){for(let i=0;ie&&s.at"number"==typeof t,Ku=t=>t.every(Xu);function Gu(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Ws(t)&&!oo(t)?new Hr(e):new Lr(e);n.mount(t),Oo.set(t,n)}function _u(t){const e=new Br({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Oo.set(t,e)}function qu(e,n,i,s){const o=[];if(function(t,e){return Ai(t)||"number"==typeof t||"string"==typeof t&&!ju(e)}(e,n))o.push(Ia(e,ju(n)&&n.default||n,i&&i.default||i));else{if(null==e)return o;const r=Iu(e,n,s),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t{const c=Hu(e),{delay:u=0,times:h=$e(c),type:m=n.type||"keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...x}=i;let{ease:w=n.ease||"easeOut",duration:T}=i;const S="function"==typeof u?u(a,l):u,P=c.length,b=In(m)?m:o?.[m||"keyframes"];if(P<=2&&b){let t=100;if(2===P&&Ku(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...x};void 0!==T&&(e.duration=B(T));const i=ge(e,t,b);w=i.ease,T=i.duration}T??(T=r);const E=d+S;1===h.length&&0===h[0]&&(h[1]=1);const A=h.length-c.length;if(A>0&&Ne(h,A),1===c.length&&c.unshift(null),f){t.invariant(f<20,"Repeat count too high, must be less than 20","repeat-count-high"),T=Ou(T,f);const e=[...c],n=[...h];w=Array.isArray(w)?[...w]:[w];const i=[...w];for(let t=0;t{for(const s in t){const o=t[s];o.sort(Nu);const r=[],l=[],c=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Ti(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:Fe});return o.forEach(({keyframes:t,transition:e},n)=>{s.push(...qu(n,t,e))}),s}function Ju(t={}){const{scope:e,reduceMotion:n}=t;return function(t,i,s){let o,r=[];if(a=t,Array.isArray(a)&&a.some(Array.isArray))r=Zu(t,void 0!==n?{reduceMotion:n,...i}:i,e);else{const{onComplete:a,...l}=s||{};"function"==typeof a&&(o=a),r=qu(t,i,void 0!==n?{reduceMotion:n,...l}:l,e)}var a;const l=new qn(r);return o&&l.finished.then(o),e&&(e.animations.push(l),l.finished.then(()=>{w(e.animations,l)})),l}}const Qu=Ju();const th=e=>function(n,i,s){return new qn(function(e,n,i,s){if(null==e)return[];const o=os(e,s),r=o.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;te.delete(n)),l.push(s)}return l}(n,i,s,e))},eh=th(),nh={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ih(t,e,n,i){const s=n[e],{length:o,position:r}=nh[e],a=s.current,l=n.time;s.current=t[`scroll${r}`],s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=D(0,s.scrollLength,s.current);const c=i-l;s.velocity=c>50?0:I(s.current-a,c)}const sh={start:0,center:.5,end:1};function oh(t,e,n=0){let i=0;if(t in sh&&(t=sh[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const rh=[0,0];function ah(t,e,n,i){let s=Array.isArray(t)?t:rh,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,sh[t]?t:"0"]),o=oh(s[0],n,i),r=oh(s[1],e),o-r}const lh={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ch={x:0,y:0};function uh(t,e,n){const{offset:i=lh.All}=n,{target:s=t,axis:o="y"}=n,r="y"===o?"height":"width",a=s!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(ps(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(s,t):ch,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let u=!e[o].interpolate;const h=i.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){ih(t,"x",e,n),ih(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&uh(t,n,i)},notify:()=>e(n)}}const dh=new WeakMap,ph=new WeakMap,mh=new WeakMap,fh=new WeakMap,gh=new WeakMap,yh=t=>t===document.scrollingElement?window:t;function vh(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return C;let s=mh.get(e);s||(s=new Set,mh.set(e,s));const o=hh(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!dh.has(e)){const t=()=>{for(const t of s)t.measure(ct.timestamp);at.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>at.read(t);dh.set(e,i);const o=yh(e);window.addEventListener("resize",i,{passive:!0}),e!==document.documentElement&&ph.set(e,Zs(e,i)),o.addEventListener("scroll",i,{passive:!0}),i()}if(n&&!gh.has(e)){const t=dh.get(e),n={width:e.scrollWidth,height:e.scrollHeight};fh.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=at.read(i,!0);gh.set(e,s)}const r=dh.get(e);return at.read(r,!1,!0),()=>{lt(r);const t=mh.get(e);if(!t)return;if(t.delete(o),t.size)return;const n=dh.get(e);dh.delete(e),n&&(yh(e).removeEventListener("scroll",n),ph.get(e)?.(),window.removeEventListener("resize",n));const i=gh.get(e);i&&(lt(i),gh.delete(e)),fh.delete(e)}}function xh(t){return"undefined"!=typeof window&&!t&&kn()}const wh=new Map;function Th({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);const s=wh.get(e)??new Map;wh.set(e,s);const o=n.target??"self",r=s.get(o)??{},a=i+(n.offset??[]).join(",");return r[a]||(r[a]=xh(n.target)?new ScrollTimeline({source:e,axis:i}):function(t){const e={value:0},n=vh(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}({container:e,...n})),r[a]}function Sh(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return C;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?vh(n=>{t(n[e.axis].progress,n)},e):Js(t,Th(e))}(t,s):function(t,e){const n=Th(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),Js(e=>{t.time=t.iterationDuration*e},n))})}(t,s)}const Ph={some:0,all:1};function bh(t,e,{root:n,margin:i,amount:s="some"}={}){const o=os(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:Ph[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()}const Eh=Vc();function Ah(t){return e.useEffect(()=>()=>t(),[])}const Mh={renderer:oc,...kc,...pu},Vh={...Mh,...su,...mu},Ch={renderer:oc,...kc};function kh(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const Rh=()=>({scrollX:Ti(0),scrollY:Ti(0),scrollXProgress:Ti(0),scrollYProgress:Ti(0)}),Dh=t=>!!t&&!t.current;function Lh(t,e,n){return{factory:i=>Sh(i,{...e,axis:t,container:n}),times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function Bh({container:n,target:i,...s}={}){const o=f(Rh);if(!i&&xh()){const t=n?.current||void 0;o.scrollXProgress.accelerate=Lh("x",s,t),o.scrollYProgress.accelerate=Lh("y",s,t)}const r=e.useRef(null),a=e.useRef(!1),l=e.useCallback(()=>(r.current=Sh((t,{x:e,y:n})=>{o.scrollX.set(e.current),o.scrollXProgress.set(e.progress),o.scrollY.set(n.current),o.scrollYProgress.set(n.progress)},{...s,container:n?.current||void 0,target:i?.current||void 0}),()=>{r.current?.()}),[n,i,JSON.stringify(s.offset)]);return y(()=>(a.current=!1,Dh(n)||Dh(i)?void(a.current=!0):l()),[l]),e.useEffect(()=>a.current?(t.invariant(!Dh(n),"Container ref is defined but not hydrated","use-scroll-ref"),t.invariant(!Dh(i),"Target ref is defined but not hydrated","use-scroll-ref"),l()):void 0,[l]),o}function jh(t,n={}){const{isStatic:i}=e.useContext(Rl),s=()=>Ai(t)?t.get():t;if(i)return Su(s);const o=wu(s());return e.useInsertionEffect(()=>co(o,t,n),[o,JSON.stringify(n)]),o}function Ih(t){const n=e.useRef(0),{isStatic:i}=e.useContext(Rl);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return at.update(e,!0),()=>lt(e)},[t])}class Oh extends wi{constructor(){super(...arguments),this.isEnabled=!1}add(t){(pn.has(t)||ss.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Fh(){!Xo.current&&Go();const[t]=e.useState(zo.current);return t}function Wh(){const t=Fh(),{reducedMotion:n}=e.useContext(Rl);return"never"!==n&&("always"===n||t)}function Uh(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&Ei(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{Uh(t,e)})})}function Nh(){let e=!1;const n=new Set,i={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(i,s){t.invariant(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const o=[];return n.forEach(t=>{o.push(Ii(t,i,{transitionOverride:s}))}),Promise.all(o)},set:i=>(t.invariant(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach(t=>{!function(t,e){Array.isArray(e)?Uh(t,e):"string"==typeof e?Uh(t,[e]):Ei(t,e)}(t,i)})),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(e=!0,()=>{e=!1,i.stop()})};return i}function $h(){const t=f(Nh);return y(t.mount,[]),t}const Yh=$h;class Hh{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const zh=()=>new Hh;function Xh(t){return null!==t&&"object"==typeof t&&wc in t}function Kh(){return Gh}function Gh(t){Tl.current&&(Tl.current.isUpdating=!1,Tl.current.blockUpdate(),t&&t())}const _h=new Map,qh=new Map,Zh=(t,e)=>`${t}: ${pn.has(e)?"transform":e}`;function Jh(t,e,n){const i=Zh(t,e),s=_h.get(i);if(!s)return null;const{animation:o,startTime:r}=s;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return o.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let Qh,td;const ed=new Set;function nd(){ed.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),ed.clear()}const id=()=>({});class sd extends Qo{constructor(){super(...arguments),this.measureInstanceViewportBox=Io}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const od=yc({scrapeMotionValuesFromProps:id,createRenderState:id});let rd=0;const ad=t=>t>.001?1/t:1e5;let ld=!1;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[p,g]=Fl(a),v=e.useMemo(()=>Ul(t),[t]),x=a&&!p?[]:v.map(Wl),w=e.useRef(!0),T=e.useRef(v),S=f(()=>new Map),P=e.useRef(new Set),[b,E]=e.useState(v),[A,M]=e.useState(v);y(()=>{w.current=!1,T.current=v;for(let t=0;t{const e=Wl(t),h=!(a&&!p)&&(v===A||x.includes(e));return d(Il,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:o,mode:r,root:u,onExitComplete:h?void 0:()=>{if(P.current.has(e))return;if(P.current.add(e),!S.has(e))return;S.set(e,!0);let t=!0;S.forEach(e=>{e||(t=!1)}),t&&(C?.(),M(T.current),a&&g?.(),s&&s())},anchorX:l,anchorY:c,children:t},e)})})},t.AnimateSharedLayout=({children:e})=>(i.useEffect(()=>{t.invariant(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),d(Hl,{id:f(()=>"asl-"+rd++),children:e})),t.AsyncMotionValueAnimation=Kn,t.DOMKeyframesResolver=ts,t.DOMVisualElement=tr,t.DeprecatedLayoutGroupContext=Nl,t.DocumentProjectionNode=vl,t.DragControls=Hh,t.Feature=er,t.FlatTree=Wa,t.GroupAnimation=Gn,t.GroupAnimationWithThen=qn,t.HTMLProjectionNode=Sl,t.HTMLVisualElement=Lr,t.JSAnimation=Je,t.KeyframeResolver=En,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.sharedTransitions=new Map,this.notifyReady=bl,this.rejectReady=bl,this.scope=t,this.updateDom=e,this.defaultOptions=n,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),at.postRender(()=>{this.start().then(this.notifyReady).catch(this.rejectReady)})}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}async start(){const t=El(this.scope),e=this.buildRecords(t);e.forEach(({projection:t})=>{const e=Boolean(t.currentAnimation),n=Boolean(t.options.layoutId);if(e&&n){const e=function(t){const e=t.targetWithTransforms||t.target;if(!e)return;const n={x:{min:0,max:0},y:{min:0,max:0}},i={x:{min:0,max:0},y:{min:0,max:0}};return ea(n,e),ea(i,e),{animationId:t.root?.animationId??0,measuredBox:n,layoutBox:i,latestValues:t.animationValues||t.latestValues||{},source:t.id}}(t);e?t.snapshot=e:t.snapshot&&(t.snapshot=void 0)}else t.snapshot&&(t.currentAnimation||t.isProjecting())&&(t.snapshot=void 0);t.isPresent=!0,t.willUpdate()}),await this.updateDom();const n=El(this.scope),i=this.buildRecords(n);this.handleExitingElements(e,i),i.forEach(({projection:t})=>{const e=t.instance,n=t.resumeFrom?.instance;if(!e||!n)return;if(!("style"in e))return;const i=e.style.transform,s=n.style.transform;i&&s&&i===s&&(e.style.transform="",e.style.transformOrigin="")}),i.forEach(({projection:t})=>{t.isPresent=!0});const s=function(t,e){const n=t[0]||e[0];return n?.projection.root}(i,e);s?.didUpdate(),await new Promise(t=>{at.postRender(()=>t())});const o=function(t){const e=new Set;return t.forEach(t=>{const n=t.projection.currentAnimation;n&&e.add(n)}),Array.from(e)}(i);return new Gn(o)}buildRecords(t){const e=[],n=new Map;for(const i of t){const t=Vl(i,n,this.scope),{layout:s,layoutId:o}=Al(i),r=(o?this.sharedTransitions.get(o):void 0)||this.defaultOptions,a=Ml(i,t?.projection,{layout:s,layoutId:o,animationType:"string"==typeof s?s:"both",transition:r});n.set(i,a),e.push(a)}return e}handleExitingElements(t,e){const n=new Set(e.map(t=>t.element));t.forEach(t=>{n.has(t.element)||(t.projection.options.layoutId&&(t.projection.isPresent=!1,t.projection.relegate()),t.visualElement.unmount(),Oo.delete(t.element))});const i=new Set(t.map(t=>t.element));e.forEach(({element:t,projection:e})=>{i.has(t)&&e.resumeFrom&&!e.resumeFrom.instance&&!e.isLead()&&(e.resumeFrom=void 0,e.snapshot=void 0)})}},t.LayoutGroup=Hl,t.LayoutGroupContext=m,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,s]=e.useState(!ql(n)),o=e.useRef(void 0);if(!ql(n)){const{renderer:t,...e}=n;o.current=t,_l(e)}return e.useEffect(()=>{ql(n)&&n().then(({renderer:t,...e})=>{_l(e),o.current=t,s(!0)})},[]),d(zl.Provider,{value:{renderer:o.current,strict:i},children:t})},t.MotionConfig=function({children:t,isValidProp:n,...i}){n&&tc(n);const s=e.useContext(Rl);(i={...s,...i}).transition=hi(i.transition,s.transition),i.isStatic=f(()=>i.isStatic);const o=e.useMemo(()=>i,[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion,i.skipAnimations]);return d(Rl.Provider,{value:o,children:t})},t.MotionConfigContext=Rl,t.MotionContext=rc,t.MotionGlobalConfig=b,t.MotionValue=wi,t.NativeAnimation=Fn,t.NativeAnimationExtended=Nn,t.NativeAnimationWrapper=Zn,t.NodeStack=$a,t.ObjectVisualElement=Br,t.PopChild=jl,t.PresenceChild=Il,t.PresenceContext=v,t.Reorder=Bu,t.SVGVisualElement=Hr,t.SubscriptionManager=L,t.SwitchLayoutGroupContext=Sc,t.ViewTransitionBuilder=Do,t.VisualElement=Qo,t.WillChangeMotionValue=Oh,t.acceleratedValues=ss,t.activeAnimations=mt,t.addAttrValue=us,t.addDomEvent=Oa,t.addPointerEvent=Lc,t.addPointerInfo=Dc,t.addScaleCorrector=function(t){for(const e in t)kr[e]=t[e],gt(e)&&(kr[e].isCSSVariable=!0)},t.addStyleValue=gs,t.addUniqueItem=x,t.addValueToWillChange=Vi,t.alpha=St,t.analyseComplexValue=zt,t.animate=Qu,t.animateMini=eh,t.animateMotionValue=mi,t.animateSingleValue=Ia,t.animateTarget=Bi,t.animateValue=function(t){return new Je(t)},t.animateVariant=ji,t.animateView=function(t,e={}){return new Do(t,e)},t.animateVisualElement=Ii,t.animationControls=Nh,t.animationMapKey=Qn,t.animations=kc,t.anticipate=X,t.applyAxisDelta=dr,t.applyBoxDelta=pr,t.applyGeneratorOptions=On,t.applyPointDelta=hr,t.applyPxDefaults=ns,t.applyTreeDeltas=gr,t.aspectRatio=Pa,t.attachFollow=co,t.attachSpring=function(t,e,n){return co(t,e,{type:"spring",...n})},t.attrEffect=hs,t.axisDeltaEquals=ba,t.axisEquals=xa,t.axisEqualsRounded=Ta,t.backIn=H,t.backInOut=z,t.backOut=Y,t.boxEquals=wa,t.boxEqualsRounded=Sa,t.buildHTMLStyles=Er,t.buildProjectionTransform=Aa,t.buildSVGAttrs=Wr,t.buildSVGPath=Or,t.buildTransform=br,t.calcAxisDelta=oa,t.calcBoxDelta=ra,t.calcChildStagger=ei,t.calcGeneratorDuration=fe,t.calcLength=ia,t.calcRelativeAxis=aa,t.calcRelativeAxisPosition=ca,t.calcRelativeBox=la,t.calcRelativePosition=ua,t.camelCaseAttributes=Ur,t.camelToDash=Ci,t.cancelFrame=lt,t.cancelMicrotask=ws,t.cancelSync=kl,t.checkVariantsDidChange=Zr,t.circIn=K,t.circInOut=_,t.circOut=G,t.clamp=S,t.cleanDirtyNodes=Qa,t.collectMotionValues=xi,t.color=Ut,t.compareByDepth=Fa,t.complex=_t,t.containsCSSVariable=wt,t.convertBoundingBoxToBox=nr,t.convertBoxToBoundingBox=ir,t.convertOffsetToTimes=Ye,t.copyAxisDeltaInto=na,t.copyAxisInto=ta,t.copyBoxInto=ea,t.correctBorderRadius=Vr,t.correctBoxShadow=Cr,t.createAnimationState=qr,t.createAxis=jo,t.createAxisDelta=Lo,t.createBox=Io,t.createDelta=Bo,t.createGeneratorEasing=ge,t.createProjectionNode=_a,t.createRenderBatcher=rt,t.createScopedAnimate=Ju,t.cubicBezier=U,t.cubicBezierAsString=Dn,t.defaultEasing=He,t.defaultOffset=$e,t.defaultTransformValue=ln,t.defaultValueTypes=_i,t.degrees=Lt,t.delay=Ua,t.delayInSeconds=function(t,e){return Ua(t,B(e))},t.dimensionValueTypes=Fi,t.disableInstantTransitions=function(){b.instantAnimations=!1},t.distance=jc,t.distance2D=Ic,t.domAnimation=Mh,t.domMax=Vh,t.domMin=Ch,t.eachAxis=Ea,t.easeIn=q,t.easeInOut=J,t.easeOut=Z,t.easingDefinitionToFunction=it,t.fillOffset=Ne,t.fillWildcards=Qe,t.filterProps=ec,t.findDimensionValueType=Wi,t.findValueType=fo,t.flushKeyframeResolvers=bn,t.followValue=lo,t.frame=at,t.frameData=ct,t.frameSteps=ut,t.generateLinearEasing=pe,t.getAnimatableNone=Ji,t.getAnimationMap=ti,t.getComputedStyle=Fs,t.getDefaultTransition=li,t.getDefaultValueType=qi,t.getEasingForSegment=tt,t.getFeatureDefinitions=Jo,t.getFinalKeyframe=ui,t.getMixer=ae,t.getOptimisedAppearId=Di,t.getOriginIndex=ro,t.getValueAsType=as,t.getValueTransition=di,t.getVariableValue=si,t.getVariantContext=Xr,t.getViewAnimationLayerInfo=So,t.getViewAnimations=bo,t.globalProjectionState=Ya,t.has2DTranslate=lr,t.hasReducedMotionListener=Xo,t.hasScale=rr,t.hasTransform=ar,t.hasWarned=function(t){return O.has(t)},t.hex=Rt,t.hover=Es,t.hsla=Wt,t.hslaToRgba=Zt,t.inView=bh,t.inertia=We,t.initPrefersReducedMotion=Go,t.interpolate=Ue,t.invisibleValues=se,t.isAnimationControls=Fo,t.isBezierDefinition=et,t.isBrowser=g,t.isCSSVariableName=gt,t.isCSSVariableToken=vt,t.isControllingVariants=$o,t.isDeltaZero=va,t.isDragActive=Ss,t.isDragging=Ts,t.isEasingArray=Q,t.isElementKeyboardAccessible=Cs,t.isElementTextInput=Rs,t.isForcedMotionValue=Rr,t.isGenerator=In,t.isHTMLElement=ps,t.isKeyframesTarget=Si,t.isMotionComponent=Xh,t.isMotionValue=Ai,t.isNear=sa,t.isNodeOrChild=As,t.isNumericalString=E,t.isObject=A,t.isPrimaryPointer=Ms,t.isSVGElement=Ws,t.isSVGSVGElement=oo,t.isSVGTag=Nr,t.isTransitionDefined=pi,t.isValidMotionProp=Jl,t.isVariantLabel=Wo,t.isVariantNode=Yo,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Rn()||!e||"string"==typeof e&&(e in Ln||Rn())||et(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Mi,t.isZeroValueString=M,t.keyframes=ze,t.m=Eh,t.makeAnimationInstant=Yn,t.makeUseVisualState=yc,t.mapEasingToNativeEasing=Bn,t.mapValue=function(t,e,n,i){const s=ao(e,n,i);return po(()=>s(t.get()))},t.maxGeneratorDuration=me,t.measurePageBox=Tr,t.measureViewportBox=wr,t.memo=V,t.microtask=xs,t.millisecondsToSeconds=j,t.mirrorEasing=N,t.mix=he,t.mixArray=le,t.mixColor=ie,t.mixComplex=ue,t.mixImmediate=Jt,t.mixLinearColor=te,t.mixNumber=Qt,t.mixObject=ce,t.mixValues=Ra,t.mixVisibility=oe,t.motion=fu,t.motionValue=Ti,t.moveItem=T,t.nodeGroup=wl,t.noop=C,t.number=Tt,t.numberValueTypes=Gi,t.observeTimeline=Js,t.optimizedAppearDataAttribute=Ri,t.optimizedAppearDataId=ki,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:os(t)[0]||document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=ii,t.parseValueFromTransform=cn,t.percent=Bt,t.pipe=R,t.pixelsToPercent=Mr,t.positionalKeys=vi,t.prefersReducedMotion=zo,t.press=Os,t.progress=D,t.progressPercentage=Ft,t.propEffect=ds,t.propagateDirtyNodes=Ja,t.px=jt,t.readTransformValue=un,t.recordStats=function(){if(ot.value)throw io(),new Error("Stats are already being measured");const t=ot;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},at.postRender(Qs,!0),so},t.removeAxisDelta=da,t.removeAxisTransforms=pa,t.removeBoxTransforms=ga,t.removeItem=w,t.removePointDelta=ha,t.renderHTML=Ar,t.renderSVG=$r,t.resize=Zs,t.resolveElements=os,t.resolveMotionValue=Na,t.resolveTransition=hi,t.resolveVariant=yi,t.resolveVariantFromProps=gi,t.reverseEasing=$,t.rgbUnit=Ct,t.rgba=kt,t.rootProjectionNode=Tl,t.scale=Pt,t.scaleCorrectors=kr,t.scalePoint=ur,t.scrapeHTMLMotionValuesFromProps=Dr,t.scrapeSVGMotionValuesFromProps=Yr,t.scroll=Sh,t.scrollInfo=vh,t.secondsToMilliseconds=B,t.setDragLock=Ps,t.setFeatureDefinitions=Zo,t.setStyle=Mn,t.setTarget=Ei,t.spring=Fe,t.springValue=function(t,e){return lo(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:ro(n,o),a=Math.abs(r-s);let l=t*a;if(i){const e=o*t;l=it(i)(l/e)*e}return e+l}},t.startOptimizedAppearAnimation=function(t,e,n,i,s){if(window.MotionIsMounted)return;const o=t.dataset[ki];if(!o)return;window.MotionHandoffAnimation=Jh;const r=Zh(o,e);td||(td=jn(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),_h.set(r,{animation:td,startTime:null}),window.MotionHandoffAnimation=Jh,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return qh.has(t);const n=Zh(t,e);return Boolean(_h.get(n))},window.MotionHandoffMarkAsComplete=t=>{qh.has(t)&&qh.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===qh.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const s=Zh(t,e),o=_h.get(s);o&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{o.animation.cancel()})}):o.animation.cancel(),n&&i?(ed.add(o),n.render(nd)):(_h.delete(s),_h.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=Di(t);if(!i)return;const s=window.MotionHasOptimisedAnimation?.(i,e),o=t.props.values?.[e];if(!s||!o)return;const r=n.on("change",t=>{o.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{td.cancel();const o=jn(t,e,n,i);void 0===Qh&&(Qh=performance.now()),o.startTime=Qh,_h.set(r,{animation:o,startTime:Qh}),s&&s(o)};qh.set(o,!1),td.ready?td.ready.then(a).catch(C):a()},t.startWaapiAnimation=jn,t.statsBuffer=ot,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,s="end"===e?Math.floor(i):Math.ceil(i);return S(0,1,s/t)}},t.styleEffect=ys,t.supportedWaapiEasing=Ln,t.supportsBrowserAnimation=Xn,t.supportsFlags=Vn,t.supportsLinearEasing=Rn,t.supportsPartialKeyframes=is,t.supportsScrollTimeline=kn,t.svgEffect=vs,t.sync=Cl,t.testValueType=Oi,t.time=pt,t.transform=ao,t.transformAxis=vr,t.transformBox=xr,t.transformBoxPoints=sr,t.transformPropOrder=dn,t.transformProps=pn,t.transformValue=po,t.transformValueTypes=Ki,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const s=n.getBoundingClientRect();if(0===s.width||0===s.height)return e;const o=i.width/s.width,r=i.height/s.height,a=s.left+window.scrollX,l=s.top+window.scrollY;return{x:(e.x-a)*o+a,y:(e.y-l)*r+l}}},t.translateAxis=yr,t.unwrapMotionComponent=function(t){if(Xh(t))return t[wc]},t.updateMotionValuesFromProps=Ho,t.useAnimate=function(){const t=f(()=>({current:null,animations:[]})),n=Wh()??void 0,i=e.useMemo(()=>Ju({scope:t,reduceMotion:n}),[t,n]);return Ah(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,i]},t.useAnimateMini=function(){const t=f(()=>({current:null,animations:[]})),e=f(()=>th(t));return Ah(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=Yh,t.useAnimationControls=$h,t.useAnimationFrame=Ih,t.useComposedRefs=Ll,t.useCycle=function(...t){const n=e.useRef(0),[i,s]=e.useState(t[n.current]),o=e.useCallback(e=>{n.current="number"!=typeof e?F(0,t.length,n.current+1):e,s(t[n.current])},[t.length,...t]);return[i,o]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),s=od({},!1),o=f(()=>new sd({props:{onUpdate:t=>{i({...t})}},visualState:s,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(o.mount({}),()=>o.unmount()),[o]),[n,f(()=>t=>Ii(o,t))]},t.useDeprecatedInvertedScale=function(n){let i=wu(1),s=wu(1);const{visualElement:o}=e.useContext(rc);return t.invariant(!(!n&&!o),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),t.warning(ld,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),ld=!0,n?(i=n.scaleX||i,s=n.scaleY||s):o&&(i=o.getValue("scaleX",1),s=o.getValue("scaleY",1)),{scaleX:Su(i,ad),scaleY:Su(s,ad)}},t.useDomEvent=function(t,n,i,s){e.useEffect(()=>{const e=t.current;if(i&&e)return Oa(e,n,i,s)},[t,n,i,s])},t.useDragControls=function(){return f(zh)},t.useElementScroll=function(t){return Bh({container:t})},t.useFollowValue=jh,t.useForceUpdate=$l,t.useInView=function(t,{root:n,margin:i,amount:s,once:o=!1,initial:r=!1}={}){const[a,l]=e.useState(r);return e.useEffect(()=>{if(!t.current||o&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:s};return bh(t.current,()=>(l(!0),o?void 0:()=>l(!1)),e)},[n,t,i,o,s]),a},t.useInstantLayoutTransition=Kh,t.useInstantTransition=function(){const[t,n]=$l(),i=Kh(),s=e.useRef(-1);return e.useEffect(()=>{at.postRender(()=>at.postRender(()=>{n===s.current&&(b.instantAnimations=!1)}))},[n]),e=>{i(()=>{b.instantAnimations=!0,t(),e(),s.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return Tu(e.filter(Ai),function(){let i="";for(let s=0;s{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=Fl,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Fh,t.useReducedMotionConfig=Wh,t.useResetProjection=function(){return e.useCallback(()=>{const t=Tl.current;t&&t.resetTree()},[])},t.useScroll=Bh,t.useSpring=function(t,e={}){return jh(t,{type:"spring",...e})},t.useTime=function(){const t=wu(0);return Ih(e=>t.set(e)),t},t.useTransform=Su,t.useUnmountEffect=Ah,t.useVelocity=function(t){const e=wu(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&at.update(n)};return kh(t,"change",()=>{at.update(n,!1,!0)}),e},t.useViewportScroll=function(){return Bh()},t.useWillChange=function(){return f(()=>new Oh("auto"))},t.variantPriorityOrder=Uo,t.variantProps=No,t.velocityPerSecond=I,t.vh=It,t.visualElementStore=Oo,t.vw=Ot,t.warnOnce=function(t,e,n){t||O.has(e)||(console.warn(P(e,n)),O.add(e))},t.wrap=F}); diff --git a/node_modules/framer-motion/dist/m.d.ts b/node_modules/framer-motion/dist/m.d.ts new file mode 100644 index 00000000..b155f073 --- /dev/null +++ b/node_modules/framer-motion/dist/m.d.ts @@ -0,0 +1,412 @@ +/// +import * as React$1 from 'react'; +import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react'; +import { MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties } from 'motion-dom'; + +type MotionValueString = MotionValue; +type MotionValueNumber = MotionValue; +type MotionValueAny = MotionValue; +type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; +type MotionValueHelper = T | AnyMotionValue; +type MakeMotionHelper = { + [K in keyof T]: MotionValueHelper; +}; +type MakeCustomValueTypeHelper = MakeMotionHelper; +type MakeMotion = MakeCustomValueTypeHelper; +type MotionCSS = MakeMotion>; +/** + * @public + */ +type MotionTransform = MakeMotion; +type MotionSVGProps = MakeMotion; +/** + * @public + */ +interface MotionStyle$1 extends MotionCSS, MotionTransform, MotionSVGProps { +} +/** + * Props for `motion` components. + * + * @public + */ +interface MotionProps extends MotionNodeOptions { + /** + * + * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * + * return + * } + * ``` + */ + style?: MotionStyle$1; + children?: React.ReactNode | MotionValueNumber | MotionValueString; +} + +interface HTMLElements { + a: HTMLAnchorElement; + abbr: HTMLElement; + address: HTMLElement; + area: HTMLAreaElement; + article: HTMLElement; + aside: HTMLElement; + audio: HTMLAudioElement; + b: HTMLElement; + base: HTMLBaseElement; + bdi: HTMLElement; + bdo: HTMLElement; + big: HTMLElement; + blockquote: HTMLQuoteElement; + body: HTMLBodyElement; + br: HTMLBRElement; + button: HTMLButtonElement; + canvas: HTMLCanvasElement; + caption: HTMLElement; + center: HTMLElement; + cite: HTMLElement; + code: HTMLElement; + col: HTMLTableColElement; + colgroup: HTMLTableColElement; + data: HTMLDataElement; + datalist: HTMLDataListElement; + dd: HTMLElement; + del: HTMLModElement; + details: HTMLDetailsElement; + dfn: HTMLElement; + dialog: HTMLDialogElement; + div: HTMLDivElement; + dl: HTMLDListElement; + dt: HTMLElement; + em: HTMLElement; + embed: HTMLEmbedElement; + fieldset: HTMLFieldSetElement; + figcaption: HTMLElement; + figure: HTMLElement; + footer: HTMLElement; + form: HTMLFormElement; + h1: HTMLHeadingElement; + h2: HTMLHeadingElement; + h3: HTMLHeadingElement; + h4: HTMLHeadingElement; + h5: HTMLHeadingElement; + h6: HTMLHeadingElement; + head: HTMLHeadElement; + header: HTMLElement; + hgroup: HTMLElement; + hr: HTMLHRElement; + html: HTMLHtmlElement; + i: HTMLElement; + iframe: HTMLIFrameElement; + img: HTMLImageElement; + input: HTMLInputElement; + ins: HTMLModElement; + kbd: HTMLElement; + keygen: HTMLElement; + label: HTMLLabelElement; + legend: HTMLLegendElement; + li: HTMLLIElement; + link: HTMLLinkElement; + main: HTMLElement; + map: HTMLMapElement; + mark: HTMLElement; + menu: HTMLElement; + menuitem: HTMLElement; + meta: HTMLMetaElement; + meter: HTMLMeterElement; + nav: HTMLElement; + noindex: HTMLElement; + noscript: HTMLElement; + object: HTMLObjectElement; + ol: HTMLOListElement; + optgroup: HTMLOptGroupElement; + option: HTMLOptionElement; + output: HTMLOutputElement; + p: HTMLParagraphElement; + param: HTMLParamElement; + picture: HTMLElement; + pre: HTMLPreElement; + progress: HTMLProgressElement; + q: HTMLQuoteElement; + rp: HTMLElement; + rt: HTMLElement; + ruby: HTMLElement; + s: HTMLElement; + samp: HTMLElement; + search: HTMLElement; + slot: HTMLSlotElement; + script: HTMLScriptElement; + section: HTMLElement; + select: HTMLSelectElement; + small: HTMLElement; + source: HTMLSourceElement; + span: HTMLSpanElement; + strong: HTMLElement; + style: HTMLStyleElement; + sub: HTMLElement; + summary: HTMLElement; + sup: HTMLElement; + table: HTMLTableElement; + template: HTMLTemplateElement; + tbody: HTMLTableSectionElement; + td: HTMLTableDataCellElement; + textarea: HTMLTextAreaElement; + tfoot: HTMLTableSectionElement; + th: HTMLTableHeaderCellElement; + thead: HTMLTableSectionElement; + time: HTMLTimeElement; + title: HTMLTitleElement; + tr: HTMLTableRowElement; + track: HTMLTrackElement; + u: HTMLElement; + ul: HTMLUListElement; + var: HTMLElement; + video: HTMLVideoElement; + wbr: HTMLElement; + webview: HTMLWebViewElement; +} + +/** + * @public + */ +type ForwardRefComponent = { + readonly $$typeof: symbol; +} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); +type AttributesWithoutMotionProps = { + [K in Exclude]?: Attributes[K]; +}; +/** + * @public + */ +type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; +/** + * Motion-optimised versions of React's HTML components. + * + * @public + */ +type HTMLMotionComponents = { + [K in keyof HTMLElements]: ForwardRefComponent>; +}; + +type UnionStringArray> = T[number]; +declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"]; +type SVGElements = UnionStringArray; + +interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { +} +/** + * Blanket-accept any SVG attribute as a `MotionValue` + * @public + */ +type SVGAttributesAsMotionValues = MakeMotion>; +type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; +/** + * @public + */ +interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { +} +/** + * Motion-optimised versions of React's SVG components. + * + * @public + */ +type SVGMotionComponents = { + [K in SVGElements]: ForwardRefComponent, SVGMotionProps>>; +}; + +type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents; + +type MotionComponentProps = { + [K in Exclude]?: Props[K]; +} & MotionProps; +type MotionComponent = T extends keyof DOMMotionComponents ? DOMMotionComponents[T] : React$1.ComponentType, "children"> & { + children?: "children" extends keyof P ? P["children"] | MotionComponentProps

["children"] : MotionComponentProps

["children"]; +}>; +interface MotionComponentOptions { + forwardMotionProps?: boolean; + /** + * Specify whether the component renders an HTML or SVG element. + * This is useful when wrapping custom SVG components that need + * SVG-specific attribute handling (like viewBox animation). + * By default, Motion auto-detects based on the component name, + * but custom React components are always treated as HTML. + */ + type?: "html" | "svg"; +} + +declare function createMinimalMotionComponent(Component: TagName | string | React.ComponentType, options?: MotionComponentOptions): MotionComponent; + +/** + * HTML components + */ +declare const MotionA: ForwardRefComponent>; +declare const MotionAbbr: ForwardRefComponent>; +declare const MotionAddress: ForwardRefComponent>; +declare const MotionArea: ForwardRefComponent>; +declare const MotionArticle: ForwardRefComponent>; +declare const MotionAside: ForwardRefComponent>; +declare const MotionAudio: ForwardRefComponent>; +declare const MotionB: ForwardRefComponent>; +declare const MotionBase: ForwardRefComponent>; +declare const MotionBdi: ForwardRefComponent>; +declare const MotionBdo: ForwardRefComponent>; +declare const MotionBig: ForwardRefComponent>; +declare const MotionBlockquote: ForwardRefComponent>; +declare const MotionBody: ForwardRefComponent>; +declare const MotionButton: ForwardRefComponent>; +declare const MotionCanvas: ForwardRefComponent>; +declare const MotionCaption: ForwardRefComponent>; +declare const MotionCite: ForwardRefComponent>; +declare const MotionCode: ForwardRefComponent>; +declare const MotionCol: ForwardRefComponent>; +declare const MotionColgroup: ForwardRefComponent>; +declare const MotionData: ForwardRefComponent>; +declare const MotionDatalist: ForwardRefComponent>; +declare const MotionDd: ForwardRefComponent>; +declare const MotionDel: ForwardRefComponent>; +declare const MotionDetails: ForwardRefComponent>; +declare const MotionDfn: ForwardRefComponent>; +declare const MotionDialog: ForwardRefComponent>; +declare const MotionDiv: ForwardRefComponent>; +declare const MotionDl: ForwardRefComponent>; +declare const MotionDt: ForwardRefComponent>; +declare const MotionEm: ForwardRefComponent>; +declare const MotionEmbed: ForwardRefComponent>; +declare const MotionFieldset: ForwardRefComponent>; +declare const MotionFigcaption: ForwardRefComponent>; +declare const MotionFigure: ForwardRefComponent>; +declare const MotionFooter: ForwardRefComponent>; +declare const MotionForm: ForwardRefComponent>; +declare const MotionH1: ForwardRefComponent>; +declare const MotionH2: ForwardRefComponent>; +declare const MotionH3: ForwardRefComponent>; +declare const MotionH4: ForwardRefComponent>; +declare const MotionH5: ForwardRefComponent>; +declare const MotionH6: ForwardRefComponent>; +declare const MotionHead: ForwardRefComponent>; +declare const MotionHeader: ForwardRefComponent>; +declare const MotionHgroup: ForwardRefComponent>; +declare const MotionHr: ForwardRefComponent>; +declare const MotionHtml: ForwardRefComponent>; +declare const MotionI: ForwardRefComponent>; +declare const MotionIframe: ForwardRefComponent>; +declare const MotionImg: ForwardRefComponent>; +declare const MotionInput: ForwardRefComponent>; +declare const MotionIns: ForwardRefComponent>; +declare const MotionKbd: ForwardRefComponent>; +declare const MotionKeygen: ForwardRefComponent>; +declare const MotionLabel: ForwardRefComponent>; +declare const MotionLegend: ForwardRefComponent>; +declare const MotionLi: ForwardRefComponent>; +declare const MotionLink: ForwardRefComponent>; +declare const MotionMain: ForwardRefComponent>; +declare const MotionMap: ForwardRefComponent>; +declare const MotionMark: ForwardRefComponent>; +declare const MotionMenu: ForwardRefComponent>; +declare const MotionMenuitem: ForwardRefComponent>; +declare const MotionMeter: ForwardRefComponent>; +declare const MotionNav: ForwardRefComponent>; +declare const MotionObject: ForwardRefComponent>; +declare const MotionOl: ForwardRefComponent>; +declare const MotionOptgroup: ForwardRefComponent>; +declare const MotionOption: ForwardRefComponent>; +declare const MotionOutput: ForwardRefComponent>; +declare const MotionP: ForwardRefComponent>; +declare const MotionParam: ForwardRefComponent>; +declare const MotionPicture: ForwardRefComponent>; +declare const MotionPre: ForwardRefComponent>; +declare const MotionProgress: ForwardRefComponent>; +declare const MotionQ: ForwardRefComponent>; +declare const MotionRp: ForwardRefComponent>; +declare const MotionRt: ForwardRefComponent>; +declare const MotionRuby: ForwardRefComponent>; +declare const MotionS: ForwardRefComponent>; +declare const MotionSamp: ForwardRefComponent>; +declare const MotionScript: ForwardRefComponent>; +declare const MotionSection: ForwardRefComponent>; +declare const MotionSelect: ForwardRefComponent>; +declare const MotionSmall: ForwardRefComponent>; +declare const MotionSource: ForwardRefComponent>; +declare const MotionSpan: ForwardRefComponent>; +declare const MotionStrong: ForwardRefComponent>; +declare const MotionStyle: ForwardRefComponent>; +declare const MotionSub: ForwardRefComponent>; +declare const MotionSummary: ForwardRefComponent>; +declare const MotionSup: ForwardRefComponent>; +declare const MotionTable: ForwardRefComponent>; +declare const MotionTbody: ForwardRefComponent>; +declare const MotionTd: ForwardRefComponent>; +declare const MotionTextarea: ForwardRefComponent>; +declare const MotionTfoot: ForwardRefComponent>; +declare const MotionTh: ForwardRefComponent>; +declare const MotionThead: ForwardRefComponent>; +declare const MotionTime: ForwardRefComponent>; +declare const MotionTitle: ForwardRefComponent>; +declare const MotionTr: ForwardRefComponent>; +declare const MotionTrack: ForwardRefComponent>; +declare const MotionU: ForwardRefComponent>; +declare const MotionUl: ForwardRefComponent>; +declare const MotionVideo: ForwardRefComponent>; +declare const MotionWbr: ForwardRefComponent>; +declare const MotionWebview: ForwardRefComponent>; +/** + * SVG components + */ +declare const MotionAnimate: ForwardRefComponent>; +declare const MotionCircle: ForwardRefComponent>; +declare const MotionDefs: ForwardRefComponent>; +declare const MotionDesc: ForwardRefComponent>; +declare const MotionEllipse: ForwardRefComponent>; +declare const MotionG: ForwardRefComponent>; +declare const MotionImage: ForwardRefComponent>; +declare const MotionLine: ForwardRefComponent>; +declare const MotionFilter: ForwardRefComponent>; +declare const MotionMarker: ForwardRefComponent>; +declare const MotionMask: ForwardRefComponent>; +declare const MotionMetadata: ForwardRefComponent>; +declare const MotionPath: ForwardRefComponent>; +declare const MotionPattern: ForwardRefComponent>; +declare const MotionPolygon: ForwardRefComponent>; +declare const MotionPolyline: ForwardRefComponent>; +declare const MotionRect: ForwardRefComponent>; +declare const MotionStop: ForwardRefComponent>; +declare const MotionSvg: ForwardRefComponent>; +declare const MotionSymbol: ForwardRefComponent>; +declare const MotionText: ForwardRefComponent>; +declare const MotionTspan: ForwardRefComponent>; +declare const MotionUse: ForwardRefComponent>; +declare const MotionView: ForwardRefComponent>; +declare const MotionClipPath: ForwardRefComponent>; +declare const MotionFeBlend: ForwardRefComponent>; +declare const MotionFeColorMatrix: ForwardRefComponent>; +declare const MotionFeComponentTransfer: ForwardRefComponent>; +declare const MotionFeComposite: ForwardRefComponent>; +declare const MotionFeConvolveMatrix: ForwardRefComponent>; +declare const MotionFeDiffuseLighting: ForwardRefComponent>; +declare const MotionFeDisplacementMap: ForwardRefComponent>; +declare const MotionFeDistantLight: ForwardRefComponent>; +declare const MotionFeDropShadow: ForwardRefComponent>; +declare const MotionFeFlood: ForwardRefComponent>; +declare const MotionFeFuncA: ForwardRefComponent>; +declare const MotionFeFuncB: ForwardRefComponent>; +declare const MotionFeFuncG: ForwardRefComponent>; +declare const MotionFeFuncR: ForwardRefComponent>; +declare const MotionFeGaussianBlur: ForwardRefComponent>; +declare const MotionFeImage: ForwardRefComponent>; +declare const MotionFeMerge: ForwardRefComponent>; +declare const MotionFeMergeNode: ForwardRefComponent>; +declare const MotionFeMorphology: ForwardRefComponent>; +declare const MotionFeOffset: ForwardRefComponent>; +declare const MotionFePointLight: ForwardRefComponent>; +declare const MotionFeSpecularLighting: ForwardRefComponent>; +declare const MotionFeSpotLight: ForwardRefComponent>; +declare const MotionFeTile: ForwardRefComponent>; +declare const MotionFeTurbulence: ForwardRefComponent>; +declare const MotionForeignObject: ForwardRefComponent>; +declare const MotionLinearGradient: ForwardRefComponent>; +declare const MotionRadialGradient: ForwardRefComponent>; +declare const MotionTextPath: ForwardRefComponent>; + +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, createMinimalMotionComponent as create, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview }; diff --git a/node_modules/framer-motion/dist/mini.d.ts b/node_modules/framer-motion/dist/mini.d.ts new file mode 100644 index 00000000..0c2d756c --- /dev/null +++ b/node_modules/framer-motion/dist/mini.d.ts @@ -0,0 +1,6 @@ +import * as motion_dom from 'motion-dom'; +import { AnimationScope } from 'motion-dom'; + +declare function useAnimateMini(): [AnimationScope, (elementOrSelector: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined) => motion_dom.AnimationPlaybackControlsWithThen]; + +export { useAnimateMini as useAnimate }; diff --git a/node_modules/framer-motion/dist/mini.js b/node_modules/framer-motion/dist/mini.js new file mode 100644 index 00000000..c11d91d4 --- /dev/null +++ b/node_modules/framer-motion/dist/mini.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}let i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(i=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const s=t=>t,o=t=>1e3*t,a=t=>t/1e3,r=t=>null!==t;class l{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function u(t){for(let e=1;et.startsWith("--");const d={};function m(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>d[e]??n()}const c=m(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),p=m(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),f=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,g={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:f([0,.65,.55,1]),circOut:f([.55,0,1,.45]),backIn:f([.31,.01,.66,-.59]),backOut:f([.33,1.53,.69,.99])};function y(t,e){return t?"function"==typeof t?p()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?f(t):Array.isArray(t)?t.map(t=>y(t,e)||g.easeOut):g[t]:void 0}class T extends l{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const d=function({type:t,...e}){return function(t){return"function"==typeof t&&"applyToOptions"in t}(t)&&p()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const d=y(r,s);Array.isArray(d)&&(h.easing=d);const m={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return u&&(m.pseudoElement=u),t.animate(h,m)}(e,n,s,d,o),!1===d.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(r),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){h(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return a(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+a(t)}get time(){return a(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=o(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&c()?(this.animation.timeline=t,s):e(this)}}class b{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return A(this.animations,"duration")}get iterationDuration(){return A(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function A(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class S extends b{then(t,e){return this.finished.finally(t).then(()=>{})}}const E=new WeakMap,k=(t,e="")=>`${t}:${e}`;function v(t){const e=E.get(t)||new Map;return E.set(t,e),e}function w(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const B=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function R(t,e){for(let n=0;nnull!=t)}(t,s),r=a.length;i(Boolean(r),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;te.delete(n)),h.push(s)}return h}t.useAnimate=function(){const t=n(()=>({current:null,animations:[]})),i=n(()=>(t=>function(e,n,i){return new S(M(e,n,i,t))})(t));var s;return s=()=>{t.animations.forEach(t=>t.stop())},e.useEffect(()=>()=>s(),[]),[t,i]}}); diff --git a/node_modules/framer-motion/dist/projection.d.ts b/node_modules/framer-motion/dist/projection.d.ts new file mode 100644 index 00000000..32faa619 --- /dev/null +++ b/node_modules/framer-motion/dist/projection.d.ts @@ -0,0 +1 @@ +export { HTMLProjectionNode, HTMLVisualElement, addScaleCorrector, buildTransform, calcBoxDelta, correctBorderRadius, correctBoxShadow, frame, frameData, mix, nodeGroup, recordStats, statsBuffer } from 'motion-dom'; diff --git a/node_modules/framer-motion/dist/size-rollup-animate.js b/node_modules/framer-motion/dist/size-rollup-animate.js new file mode 100644 index 00000000..c5b3f61d --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-animate.js @@ -0,0 +1,2 @@ +function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);const o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(t,e)=>n=>e(t(n)),c=(...t)=>t.reduce(h),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i1e3*t,f=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function v(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=y(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:y(i(t),e,s)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,T=t=>e=>1-t(1-e),w=v(.33,1.53,.69,.99),M=T(w),S=b(M),A=t=>(t*=2)<1?.5*M(t):.5*(2-Math.pow(2,-10*(t-1))),x=t=>1-Math.sin(Math.acos(t)),V=T(x),k=b(x),C=v(.42,0,1,1),F=v(0,0,.58,1),P=v(.42,0,.58,1),B=t=>Array.isArray(t)&&"number"!=typeof t[0];function R(t,e){return B(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const E=t=>Array.isArray(t)&&"number"==typeof t[0],D={linear:u,easeIn:C,easeInOut:P,easeOut:F,circIn:x,circInOut:k,circOut:V,backIn:M,backInOut:S,backOut:w,anticipate:A},I=t=>{if(E(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return v(e,n,s,r)}return"string"==typeof t?(i(void 0!==D[t],`Invalid easing type '${t}'`,"invalid-easing-type"),D[t]):t},O=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],N={value:null,addProjectionMetrics:null};function $(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=O.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){a.has(e)&&(h.schedule(e),t()),l++,e(o)}const h={schedule:(t,e=!1,r=!1)=>{const o=r&&i?n:s;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{o=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&N.value&&N.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,h.process(t)))}};return h}(a,e?n:void 0),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:O.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e(void 0===Y&&X.set(W.isProcessing||r.useManualTiming?W.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask(U)}},q=t=>e=>"string"==typeof e&&e.startsWith(t),z=q("--"),Z=q("var(--"),_=t=>!!Z(t)&&H.test(t.split("/*")[0].trim()),H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function G(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const J={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Q={...J,transform:t=>e(0,1,t)},tt={...J,default:1},et=t=>Math.round(1e5*t)/1e5,nt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const st=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,it=(t,e)=>n=>Boolean("string"==typeof n&&st.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),rt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(nt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},at={...J,transform:t=>Math.round((t=>e(0,255,t))(t))},ot={test:it("rgb","red"),parse:rt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+at.transform(t)+", "+at.transform(e)+", "+at.transform(n)+", "+et(Q.transform(s))+")"};const lt={test:it("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:ot.transform},ut=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ht=ut("deg"),ct=ut("%"),dt=ut("px"),pt=ut("vh"),mt=ut("vw"),ft=(()=>({...ct,parse:t=>ct.parse(t)/100,transform:t=>ct.transform(100*t)}))(),gt={test:it("hsl","hue"),parse:rt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ct.transform(et(e))+", "+ct.transform(et(n))+", "+et(Q.transform(s))+")"},yt={test:t=>ot.test(t)||lt.test(t)||gt.test(t),parse:t=>ot.test(t)?ot.parse(t):gt.test(t)?gt.parse(t):lt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ot.transform(t):gt.transform(t),getAnimatableNone:t=>{const e=yt.parse(t);return e.alpha=0,yt.transform(e)}},vt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const bt="number",Tt="color",wt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(wt,t=>(yt.test(t)?(s.color.push(r),i.push(Tt),n.push(yt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(bt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function St(t){return Mt(t).values}function At(t){const{split:e,types:n}=Mt(t),s=e.length;return t=>{let i="";for(let r=0;r"number"==typeof t?0:yt.test(t)?yt.getAnimatableNone(t):t;const Vt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(nt)?.length||0)+(t.match(vt)?.length||0)>0},parse:St,createTransformer:At,getAnimatableNone:function(t){const e=St(t);return At(t)(e.map(xt))}};function kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ct(t,e){return n=>n>0?e:t}const Ft=(t,e,n)=>t+(e-t)*n,Pt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Bt=[lt,ot,gt];function Rt(t){const e=(n=t,Bt.find(t=>t.test(n)));var n;if(s(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===gt&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=kt(o,s,t+1/3),r=kt(o,s,t),a=kt(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Et=(t,e)=>{const n=Rt(t),s=Rt(e);if(!n||!s)return Ct(t,e);const i={...n};return t=>(i.red=Pt(n.red,s.red,t),i.green=Pt(n.green,s.green,t),i.blue=Pt(n.blue,s.blue,t),i.alpha=Ft(n.alpha,s.alpha,t),ot.transform(i))},Dt=new Set(["none","hidden"]);function It(t,e){return n=>Ft(t,e,n)}function Ot(t){return"number"==typeof t?It:"string"==typeof t?_(t)?Ct:yt.test(t)?Et:jt:Array.isArray(t)?Nt:"object"==typeof t?yt.test(t)?Et:$t:Ct}function Nt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Ot(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const jt=(t,e)=>{const n=Vt.createTransformer(e),i=Mt(t),r=Mt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Dt.has(t)&&!r.values.length||Dt.has(e)&&!i.values.length?function(t,e){return Dt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):c(Nt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>j.update(e,t),stop:()=>K(e),now:()=>W.isProcessing?W.timestamp:X.now()}},Lt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e=Yt?1/0:e}function Xt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Ut(s),Yt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:f(i)}}function qt(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}const zt=100,Zt=10,_t=1,Ht=0,Gt=800,Jt=.3,Qt=.3,te={granular:.01,default:2},ee={granular:.005,default:.5},ne=.01,se=10,ie=.05,re=1,ae=.001;function oe({duration:t=Gt,bounce:n=Jt,velocity:i=Ht,mass:r=_t}){let a,o;s(t<=m(se),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(ie,re,l),t=e(ne,se,f(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=ue(e,l),o=Math.exp(-s);return ae-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=ue(Math.pow(e,2),l);return(-a(e)+ae>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;nvoid 0!==t[e])}function pe(t=Qt,n=Jt){const s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:i,restDelta:r}=s;const a=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],l={done:!1,value:a},{stiffness:u,damping:h,mass:c,duration:d,velocity:p,isResolvedFromDuration:g}=function(t){let n={velocity:Ht,stiffness:zt,damping:Zt,mass:_t,isResolvedFromDuration:!1,...t};if(!de(t,ce)&&de(t,he))if(t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:_t,stiffness:r,damping:a}}else{const e=oe(t);n={...n,...e,mass:_t},n.isResolvedFromDuration=!0}return n}({...s,velocity:-f(s.velocity||0)}),y=p||0,v=h/(2*Math.sqrt(u*c)),b=o-a,T=f(Math.sqrt(u/c)),w=Math.abs(b)<5;let M;if(i||(i=w?te.granular:te.default),r||(r=w?ee.granular:ee.default),v<1){const t=ue(T,v);M=e=>{const n=Math.exp(-v*T*e);return o-n*((y+v*T*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===v)M=t=>o-Math.exp(-T*t)*(b+(y+T*b)*t);else{const t=T*Math.sqrt(v*v-1);M=e=>{const n=Math.exp(-v*T*e),s=Math.min(t*e,300);return o-n*((y+v*T*b)*Math.sinh(s)+t*b*Math.cosh(s))/t}}const S={calculatedDuration:g&&d||null,next:t=>{const e=M(t);if(g)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?m(y):qt(M,t,e));const s=Math.abs(n)<=i,a=Math.abs(o-e)<=r;l.done=s&&a}return l.value=l.done?o:e,l},toString:()=>{const t=Math.min(Ut(S),Yt),e=Lt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function me({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let T,w;const M=t=>{var e;(e=d.value,void 0!==o&&el)&&(T=t,w=pe({keyframes:[d.value,p(d.value)],velocity:qt(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),M(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}function fe(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Kt,a=t.length-1;for(let n=0;n{if(h&&e1)for(;sf(e(t[0],t[l-1],n)):f}function ge(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Ft(n,1,i))}}function ye(t){const e=[0];return ge(e,t.length-1),e}function ve({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=B(s)?s.map(I):I(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ye(e),t),o=fe(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||P).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}pe.applyToOptions=t=>{const e=Xt(t,100,pe);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};const be=t=>null!==t;function Te(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(be),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const we={decay:me,inertia:me,tween:ve,keyframes:ve,spring:pe};function Me(t){"string"==typeof t.type&&(t.type=we[t.type])}class Se{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ae=t=>t/100;class xe extends Se{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==X.now()&&this.tick(X.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Me(t);const{type:e=ve,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||ve;o!==ve&&"number"!=typeof a[0]&&(this.mixKeyframes=c(Ae,Kt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Ut(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b=this.currentTime,T=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(T=a)),b=e(0,1,s)*o}const w=v?{done:!1,value:h[0]}:T.next(b);r&&(w.value=r(w.value));let{done:M}=w;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==me&&(w.value=Te(h,this.options,g,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(X.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Wt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(X.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ve=t=>180*t/Math.PI,ke=t=>{const e=Ve(Math.atan2(t[1],t[0]));return Fe(e)},Ce={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ke,rotateZ:ke,skewX:t=>Ve(Math.atan(t[1])),skewY:t=>Ve(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Fe=t=>((t%=360)<0&&(t+=360),t),Pe=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Be=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Re={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Pe,scaleY:Be,scale:t=>(Pe(t)+Be(t))/2,rotateX:t=>Fe(Ve(Math.atan2(t[6],t[5]))),rotateY:t=>Fe(Ve(Math.atan2(-t[2],t[0]))),rotateZ:ke,rotate:ke,skewX:t=>Ve(Math.atan(t[4])),skewY:t=>Ve(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ee(t){return t.includes("scale")?1:0}function De(t,e){if(!t||"none"===t)return Ee(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Re,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ce,i=e}if(!i)return Ee(e);const r=s[e],a=i[1].split(",").map(Ie);return"function"==typeof r?r(a):a[r]}function Ie(t){return parseFloat(t.trim())}const Oe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ne=(()=>new Set(Oe))(),$e=t=>t===J||t===dt,je=new Set(["x","y","z"]),Ke=Oe.filter(t=>!je.has(t));const We={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>De(e,"x"),y:(t,{transform:e})=>De(e,"y")};We.translateX=We.x,We.translateY=We.y;const Le=new Set;let Ye=!1,Ue=!1,Xe=!1;function qe(){if(Ue){const t=Array.from(Le).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ke.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ue=!1,Ye=!1,Le.forEach(t=>t.complete(Xe)),Le.clear()}function ze(){Le.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ue=!0)})}class Ze{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Le.add(this),Ye||(Ye=!0,j.read(ze),j.resolveKeyframes(qe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;e_e[e]??n()}const Ge=He(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Je=He(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Qe=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,tn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qe([0,.65,.55,1]),circOut:Qe([.55,0,1,.45]),backIn:Qe([.31,.01,.66,-.59]),backOut:Qe([.33,1.53,.69,.99])};function en(t,e){return t?"function"==typeof t?Je()?Lt(t,e):"ease-out":E(t)?Qe(t):Array.isArray(t)?t.map(t=>en(t,e)||tn.easeOut):tn[t]:void 0}function nn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=en(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(d.pseudoElement=u);return t.animate(h,d)}function sn(t){return"function"==typeof t&&"applyToOptions"in t}class rn extends Se{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return sn(t)&&Je()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=nn(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=Te(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ge()?(this.animation.timeline=t,u):e(this)}}const an={anticipate:A,backInOut:S,circInOut:k};function on(t){"string"==typeof t.ease&&t.ease in an&&(t.ease=an[t.ease])}class ln extends rn{constructor(t){on(t),Me(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const o=new xe({...a,autoplay:!1}),l=Math.max(10,X.now()-this.startTime),u=e(0,10,l-10);n.setWithVelocity(o.sample(Math.max(0,l-u)).value,o.sample(l).value,u),o.stop()}}const un=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Vt.test(t)&&"0"!==t||t.startsWith("url(")));function hn(t){t.duration=0,t.type="keyframes"}const cn=new Set(["opacity","clipPath","filter","transform"]),dn=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class pn extends Se{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=X.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||Ze;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=X.now(),function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=un(r,e),l=un(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},m=!c&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return dn()&&n&&cn.has(n)&&("transform"!==n||!u)&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==a}(p),f=p.motionValue?.owner?.current,g=m?new ln({...p,element:f}):new xe(p);g.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Xe=!0,ze(),qe(),Xe=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class mn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return fn(this.animations,"duration")}get iterationDuration(){return fn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function fn(t,e){let n=0;for(let s=0;sn&&(n=i)}return n}class gn extends mn{then(t,e){return this.finished.finally(t).then(()=>{})}}const yn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=yn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return _(r)?vn(r,e,n+1):r}const bn={type:"spring",stiffness:500,damping:25,restSpeed:10},Tn={type:"keyframes",duration:.8},wn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Mn=(t,{keyframes:e})=>e.length>2?Tn:Ne.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:bn:wn,Sn=t=>null!==t;function An(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function xn(t,e){const n=t?.[e]??t?.default??t;return n!==t?An(n,t):n}const Vn=(t,e,n,s={},i,a)=>o=>{const l=xn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=m(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||Object.assign(c,Mn(t,c)),c.duration&&(c.duration=m(c.duration)),c.repeatDelay&&(c.repeatDelay=m(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(hn(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,hn(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Sn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(c.keyframes,l);if(void 0!==t)return void j.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new xe(c):new pn(c)};function kn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Cn(t,e,n,s){if("function"==typeof e){const[i,r]=kn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=kn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}const Fn=new Set(["width","height","top","left","right","bottom",...Oe]);class Pn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=X.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=X.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),j.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=X.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bn(t,e){return new Pn(t,e)}function Rn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Bn(n))}function En(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Dn(t,e){const n=function(t,e){const n=t.getProps();return Cn(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Rn(t,e,En(r[e]))}}const In=t=>Boolean(t&&t.getVelocity);function On(t,e){const n=t.getValue("willChange");if(s=n,Boolean(In(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function Nn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const $n="data-"+Nn("framerAppearId");function jn(t){return t.props[$n]}function Kn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Wn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?An(r,l):l;const u=r?.reduceMotion;s&&(r=s);const h=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||c&&Kn(c,e))continue;const a={delay:n,...xn(r||{},e)},l=s.get();if(void 0!==l&&!s.isAnimating&&!Array.isArray(i)&&i===l&&!a.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=jn(t);if(n){const t=window.MotionHandoffAnimation(n,e,j);null!==t&&(a.startTime=t,d=!0)}}On(t,e);const p=u??t.shouldReduceMotion;s.start(Vn(e,s,i,p&&Fn.has(e)?{type:!1}:a,t,d));const m=s.animation;m&&h.push(m)}if(a){const e=()=>j.update(()=>{a&&Dn(t,a)});h.length?Promise.all(h).then(e):e()}return h}const Ln=t=>e=>e.test(t),Yn=[J,dt,ct,ht,mt,pt,{test:t=>"auto"===t,parse:t=>t}],Un=t=>Yn.find(Ln(t));function Xn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const qn=new Set(["brightness","contrast","saturate","opacity"]);function zn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(nt)||[];if(!s)return t;const i=n.replace(s,"");let r=qn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Zn=/\b([a-z-]*)\(.*?\)/gu,_n={...Vt,getAnimatableNone:t=>{const e=t.match(Zn);return e?e.map(zn).join(" "):t}},Hn={...Vt,getAnimatableNone:t=>{const e=Vt.parse(t);return Vt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Gn={...J,transform:Math.round},Jn={borderWidth:dt,borderTopWidth:dt,borderRightWidth:dt,borderBottomWidth:dt,borderLeftWidth:dt,borderRadius:dt,borderTopLeftRadius:dt,borderTopRightRadius:dt,borderBottomRightRadius:dt,borderBottomLeftRadius:dt,width:dt,maxWidth:dt,height:dt,maxHeight:dt,top:dt,right:dt,bottom:dt,left:dt,inset:dt,insetBlock:dt,insetBlockStart:dt,insetBlockEnd:dt,insetInline:dt,insetInlineStart:dt,insetInlineEnd:dt,padding:dt,paddingTop:dt,paddingRight:dt,paddingBottom:dt,paddingLeft:dt,paddingBlock:dt,paddingBlockStart:dt,paddingBlockEnd:dt,paddingInline:dt,paddingInlineStart:dt,paddingInlineEnd:dt,margin:dt,marginTop:dt,marginRight:dt,marginBottom:dt,marginLeft:dt,marginBlock:dt,marginBlockStart:dt,marginBlockEnd:dt,marginInline:dt,marginInlineStart:dt,marginInlineEnd:dt,fontSize:dt,backgroundPositionX:dt,backgroundPositionY:dt,...{rotate:ht,rotateX:ht,rotateY:ht,rotateZ:ht,scale:tt,scaleX:tt,scaleY:tt,scaleZ:tt,skew:ht,skewX:ht,skewY:ht,distance:dt,translateX:dt,translateY:dt,translateZ:dt,x:dt,y:dt,z:dt,perspective:dt,transformPerspective:dt,opacity:Q,originX:ft,originY:ft,originZ:dt},zIndex:Gn,fillOpacity:Q,strokeOpacity:Q,numOctaves:Gn},Qn={...Jn,color:yt,backgroundColor:yt,outlineColor:yt,fill:yt,stroke:yt,borderColor:yt,borderTopColor:yt,borderRightColor:yt,borderBottomColor:yt,borderLeftColor:yt,filter:_n,WebkitFilter:_n,mask:Hn,WebkitMask:Hn},ts=t=>Qn[t],es=new Set([_n,Hn]);function ns(t,e){let n=ts(t);return es.has(n)||(n=Vt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ss=new Set(["auto","none","0"]);class is extends Ze{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const rs=new Set(["opacity","clipPath","filter","transform"]);const as=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:os,cancel:ls}=$(queueMicrotask,!1);function us(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const hs=[...Yn,yt,Vt],cs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ds=new WeakMap;const ps=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ms(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||ps.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const fs={current:null},gs={current:!1},ys="undefined"!=typeof window;const vs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let bs={};class Ts{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ze,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=X.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(gs.current||function(){if(gs.current=!0,ys)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fs.current=t.matches;t.addEventListener("change",e),e()}else fs.current=!1}(),this.shouldReduceMotion=fs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),K(this.notifyUpdate),K(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&rs.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:s,times:i,ease:r,duration:a}=e.accelerate,o=new rn({element:this.current,name:t,keyframes:s,times:i,ease:r,duration:m(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=Ne.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&j.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in bs){const e=bs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Bn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!hs.find(Ln(s))&&Vt.test(e)&&(n=ns(t,e))),this.setBaseTarget(t,In(n)?n.get():n)),In(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=Cn(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||In(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){os.render(this.render)}}class ws extends Ts{constructor(){super(...arguments),this.KeyframeResolver=is}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;In(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const Ms={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ss=Oe.length;function As(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Ne.has(t))a=!0;else if(z(t))i[t]=n;else{const e=as(n,Jn[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r{if(!e.target)return t;if("string"==typeof t){if(!dt.test(t))return t;t=parseFloat(t)}return`${Vs(t,e.target.x)}% ${Vs(t,e.target.y)}%`}},Cs={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Vt.parse(t);if(i.length>5)return s;const r=Vt.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=Ft(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},Fs={borderRadius:{...ks,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ks,borderTopRightRadius:ks,borderBottomLeftRadius:ks,borderBottomRightRadius:ks,boxShadow:Cs};function Ps(t,{layout:e,layoutId:n}){return Ne.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Fs[t]||"opacity"===t)}function Bs(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const e in s)(In(s[e])||i&&In(i[e])||Ps(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=s[e]);return r}class Rs extends ws{constructor(){super(...arguments),this.type="html",this.renderInstance=xs}readValueFromInstance(t,e){if(Ne.has(e))return this.projection?.isProjecting?Ee(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return De(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(z(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){As(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Bs(t,e,n)}}class Es extends Ts{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ds={offset:"stroke-dashoffset",array:"stroke-dasharray"},Is={offset:"strokeDashoffset",array:"strokeDasharray"};const Os=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ns(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(As(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox);for(const t of Os)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ds:Is;t[r.offset]=""+-s,t[r.array]=`${e} ${n}`}(c,i,r,a,!1)}const $s=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class js extends ws{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=cs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Ne.has(e)){const t=ts(e);return t&&t.default||0}return e=$s.has(e)?e:Nn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Bs(t,e,n);for(const n in t)(In(t[n])||In(e[n]))&&(s[-1!==Oe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Ns(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){xs(t,e,void 0,s);for(const n in e.attrs)t.setAttribute($s.has(n)?n:Nn(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Ks(t){return"object"==typeof t&&!Array.isArray(t)}function Ws(t,e,n,s){return null==t?[]:"string"==typeof t&&Ks(e)?function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Ls(t,e,n){return t*(e+1)}function Ys(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function Us(e,n,s,i,r,a){!function(e,n,s){for(let i=0;in&&r.at"number"==typeof t,Js=t=>t.every(Gs);function Qs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=us(t)&&!function(t){return us(t)&&"svg"===t.tagName}(t)?new js(e):new Rs(e);n.mount(t),ds.set(t,n)}function ti(t){const e=new Es({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ds.set(t,e)}function ei(t,e,n,s){const r=[];if(function(t,e){return In(t)||"number"==typeof t||"string"==typeof t&&!Ks(e)}(t,e))r.push(function(t,e,n){const s=In(t)?t:Bn(t);return s.start(Vn("",s,e,n)),s.animation}(t,Ks(e)&&e.default||e,n&&n.default||n));else{if(null==t)return r;const a=Ws(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t{const u=_s(t),{delay:h=0,times:c=ye(u),type:d=e.type||"keyframes",repeat:g,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:w=e.ease||"easeOut",duration:M}=n;const S="function"==typeof h?h(o,l):h,A=u.length,x=sn(d)?d:r?.[d||"keyframes"];if(A<=2&&x){let t=100;if(2===A&&Js(u)){const e=u[1]-u[0];t=Math.abs(e)}const n={...e,...T};void 0!==M&&(n.duration=m(M));const s=Xt(n,t,x);w=s.ease,M=s.duration}M??(M=a);const V=p+S;1===c.length&&0===c[0]&&(c[1]=1);const k=c.length-u.length;if(k>0&&ge(c,k),1===u.length&&u.unshift(null),g){i(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),M=Ls(M,g);const t=[...u],e=[...c];w=Array.isArray(w)?[...w]:[w];const n=[...w];for(let s=0;s{for(const i in t){const r=t[i];r.sort(qs);const a=[],l=[],u=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Bn(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:pe});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...ei(n,t,e))}),s}function si(e={}){const{scope:n,reduceMotion:s}=e;return function(e,i,r){let a,o=[];if(l=e,Array.isArray(l)&&l.some(Array.isArray))o=ni(e,void 0!==s?{reduceMotion:s,...i}:i,n);else{const{onComplete:t,...l}=r||{};"function"==typeof t&&(a=t),o=ei(e,i,void 0!==s?{reduceMotion:s,...l}:l,n)}var l;const u=new gn(o);return a&&u.finished.then(a),n&&(n.animations.push(u),u.finished.then(()=>{t(n.animations,u)})),u}}const ii=si();export{ii as animate,si as createScopedAnimate}; +//# sourceMappingURL=size-rollup-animate.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-animate.js.map b/node_modules/framer-motion/dist/size-rollup-animate.js.map new file mode 100644 index 00000000..059c2600 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-animate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-animate.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/wrap.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/stats/buffer.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/spring/defaults.mjs","../../motion-dom/dist/es/animation/generators/spring/find.mjs","../../motion-dom/dist/es/animation/generators/spring/index.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/animation/utils/default-transitions.mjs","../../motion-dom/dist/es/animation/utils/get-final-keyframe.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/render/utils/setters.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/will-change/add-will-change.mjs","../../motion-dom/dist/es/value/will-change/is.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/complex/mask.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../../motion-dom/dist/es/projection/geometry/models.mjs","../../motion-dom/dist/es/render/store.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/utils/motion-values.mjs","../../motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/html/utils/render.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../motion-dom/dist/es/projection/utils/measure.mjs","../../motion-dom/dist/es/projection/geometry/conversion.mjs","../../motion-dom/dist/es/render/object/ObjectVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/utils/render.mjs","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../lib/animation/utils/is-dom-keyframes.js","../lib/animation/animate/resolve-subjects.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/sequence/utils/calc-repeat-duration.js","../lib/animation/sequence/utils/calc-time.js","../lib/animation/sequence/utils/edit.js","../lib/animation/sequence/utils/normalize-times.js","../lib/animation/sequence/utils/sort.js","../lib/animation/sequence/create.js","../lib/animation/utils/create-visual-element.js","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../lib/animation/animate/subject.js","../../motion-dom/dist/es/animation/animate/single-value.mjs","../lib/animation/animate/sequence.js","../lib/animation/animate/index.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n//# sourceMappingURL=is-numerical-string.mjs.map\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n//# sourceMappingURL=is-zero-value-string.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n//# sourceMappingURL=wrap.mjs.map\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from GaĆ«tan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n//# sourceMappingURL=mirror.mjs.map\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n//# sourceMappingURL=reverse.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n//# sourceMappingURL=back.mjs.map\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n//# sourceMappingURL=anticipate.mjs.map\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n//# sourceMappingURL=circ.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n//# sourceMappingURL=ease.mjs.map\n","const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n//# sourceMappingURL=is-easing-array.mjs.map\n","import { wrap } from '../../wrap.mjs';\nimport { isEasingArray } from './is-easing-array.mjs';\n\nfunction getEasingForSegment(easing, i) {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\n}\n\nexport { getEasingForSegment };\n//# sourceMappingURL=get-easing-for-segment.mjs.map\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n//# sourceMappingURL=map.mjs.map\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n\nexport { statsBuffer };\n//# sourceMappingURL=buffer.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n//# sourceMappingURL=sync-time.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n","const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\n\nexport { springDefaults };\n//# sourceMappingURL=defaults.mjs.map\n","import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n//# sourceMappingURL=find.mjs.map\n","import { millisecondsToSeconds, secondsToMilliseconds, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../utils/calc-duration.mjs';\nimport { createGeneratorEasing } from '../utils/create-generator-easing.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=index.mjs.map\n","import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n//# sourceMappingURL=time.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n//# sourceMappingURL=replace-transition-type.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n this.driver?.start(false);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n this.updateTime(time.now());\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n//# sourceMappingURL=parse-transform.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n//# sourceMappingURL=KeyframesResolver.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\n\nexport { supportsScrollTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","import { anticipate, backInOut, circInOut } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n//# sourceMappingURL=unsupported-easing.mjs.map\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n if (options.startTime !== undefined) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * āœ…: 100, \"100px\", \"#fff\"\n * āŒ: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n//# sourceMappingURL=is-animatable.mjs.map\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n//# sourceMappingURL=make-animation-instant.mjs.map\n","import { memo } from 'motion-utils';\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n//# sourceMappingURL=waapi.mjs.map\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n const animation = useWaapi\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n })\n : new JSAnimation(resolvedOptions);\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null) {\n return false;\n }\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n//# sourceMappingURL=can-animate.mjs.map\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n//# sourceMappingURL=GroupAnimation.mjs.map\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n//# sourceMappingURL=GroupAnimationWithThen.mjs.map\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n//# sourceMappingURL=css-variables-conversion.mjs.map\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n//# sourceMappingURL=default-transitions.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final-keyframe.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../utils/get-final-keyframe.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n","/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n\nexport { isTransitionDefined };\n//# sourceMappingURL=is-transition-defined.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n//# sourceMappingURL=keys-position.mjs.map\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n//# sourceMappingURL=index.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n//# sourceMappingURL=setters.mjs.map\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n//# sourceMappingURL=is-keyframes-target.mjs.map\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n//# sourceMappingURL=resolve-dynamic-variants.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n//# sourceMappingURL=add-will-change.mjs.map\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n//# sourceMappingURL=is.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n//# sourceMappingURL=get-appear-id.mjs.map\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n//# sourceMappingURL=auto.mjs.map\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n//# sourceMappingURL=test.mjs.map\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n//# sourceMappingURL=dimensions.mjs.map\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n//# sourceMappingURL=is-none.mjs.map\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n//# sourceMappingURL=filter.mjs.map\n","import { complex } from './index.mjs';\n\nconst mask = {\n ...complex,\n getAnimatableNone: (v) => {\n const parsed = complex.parse(v);\n const transformer = complex.createTransformer(v);\n return transformer(parsed.map((v) => typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v));\n },\n};\n\nexport { mask };\n//# sourceMappingURL=mask.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n//# sourceMappingURL=defaults.mjs.map\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask]);\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (!customTypes.has(defaultValueType))\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n//# sourceMappingURL=animatable-none.mjs.map\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n//# sourceMappingURL=make-none-animatable.mjs.map\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin);\n const targetHasVar = containsCSSVariable(target);\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n//# sourceMappingURL=DOMKeyframesResolver.mjs.map\n","/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved\n // or until we implement support for linear() easing.\n // \"background-color\"\n]);\n\nexport { acceleratedValues };\n//# sourceMappingURL=accelerated-values.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n//# sourceMappingURL=microtask.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n//# sourceMappingURL=find.mjs.map\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n//# sourceMappingURL=models.mjs.map\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n//# sourceMappingURL=store.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n//# sourceMappingURL=state.mjs.map\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n//# sourceMappingURL=motion-values.mjs.map\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n//# sourceMappingURL=DOMVisualElement.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n//# sourceMappingURL=render.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n//# sourceMappingURL=HTMLVisualElement.mjs.map\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n//# sourceMappingURL=measure.mjs.map\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n//# sourceMappingURL=conversion.mjs.map\n","import { createBox } from '../../projection/geometry/models.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nfunction isObjectKey(key, object) {\n return key in object;\n}\nclass ObjectVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.type = \"object\";\n }\n readValueFromInstance(instance, key) {\n if (isObjectKey(key, instance)) {\n const value = instance[key];\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n }\n return undefined;\n }\n getBaseTargetFromProps() {\n return undefined;\n }\n removeValueFromRenderState(key, renderState) {\n delete renderState.output[key];\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n build(renderState, latestValues) {\n Object.assign(renderState.output, latestValues);\n }\n renderInstance(instance, { output }) {\n Object.assign(instance, output);\n }\n sortInstanceNodePosition() {\n return 0;\n }\n}\n\nexport { ObjectVisualElement };\n//# sourceMappingURL=ObjectVisualElement.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs };\n//# sourceMappingURL=build-attrs.mjs.map\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n//# sourceMappingURL=camel-case-attrs.mjs.map\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n//# sourceMappingURL=SVGVisualElement.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n//# sourceMappingURL=render.mjs.map\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","export function isDOMKeyframes(keyframes) {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\n}\n//# sourceMappingURL=is-dom-keyframes.js.map","import { resolveElements, } from \"motion-dom\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nexport function resolveSubjects(subject, keyframes, scope, selectorCache) {\n if (subject == null) {\n return [];\n }\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache);\n }\n else if (subject instanceof NodeList) {\n return Array.from(subject);\n }\n else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null);\n }\n else {\n return [subject];\n }\n}\n//# sourceMappingURL=resolve-subjects.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","export function calculateRepeatDuration(duration, repeat, _repeatDelay) {\n return duration * (repeat + 1);\n}\n//# sourceMappingURL=calc-repeat-duration.js.map","/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(current, next, prev, labels) {\n if (typeof next === \"number\") {\n return next;\n }\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next));\n }\n else if (next === \"<\") {\n return prev;\n }\n else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)));\n }\n else {\n return labels.get(next) ?? current;\n }\n}\n//# sourceMappingURL=calc-time.js.map","import { mixNumber } from \"motion-dom\";\nimport { getEasingForSegment, removeItem } from \"motion-utils\";\nexport function eraseKeyframes(sequence, startTime, endTime) {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i];\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe);\n // If we remove this item we have to push the pointer back one\n i--;\n }\n }\n}\nexport function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime);\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n });\n }\n}\n//# sourceMappingURL=edit.js.map","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times, repeat) {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1);\n }\n}\n//# sourceMappingURL=normalize-times.js.map","export function compareByTime(a, b) {\n if (a.at === b.at) {\n if (a.value === null)\n return 1;\n if (b.value === null)\n return -1;\n return 0;\n }\n else {\n return a.at - b.at;\n }\n}\n//# sourceMappingURL=sort.js.map","import { createGeneratorEasing, defaultOffset, fillOffset, isGenerator, isMotionValue, } from \"motion-dom\";\nimport { getEasingForSegment, invariant, progress, secondsToMilliseconds, } from \"motion-utils\";\nimport { resolveSubjects } from \"../animate/resolve-subjects\";\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\";\nimport { calcNextTime } from \"./utils/calc-time\";\nimport { addKeyframes } from \"./utils/edit\";\nimport { normalizeTimes } from \"./utils/normalize-times\";\nimport { compareByTime } from \"./utils/sort\";\nconst defaultSegmentEasing = \"easeInOut\";\nconst MAX_REPEAT = 20;\nexport function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {\n const defaultDuration = defaultTransition.duration || 0.3;\n const animationDefinitions = new Map();\n const sequences = new Map();\n const elementCache = {};\n const timeLabels = new Map();\n let prevTime = 0;\n let currentTime = 0;\n let totalDuration = 0;\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i];\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime);\n continue;\n }\n else if (!Array.isArray(segment)) {\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\n continue;\n }\n let [subject, keyframes, transition = {}] = segment;\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);\n }\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0;\n const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = defaultTransition.type || \"keyframes\", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay = typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay;\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length;\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"];\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100;\n if (numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)) {\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\n absoluteDelta = Math.abs(delta);\n }\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n };\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration);\n }\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);\n ease = springEasing.ease;\n duration = springEasing.duration;\n }\n duration ?? (duration = defaultDuration);\n const startTime = currentTime + calculatedDelay;\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1;\n }\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length;\n remainder > 0 && fillOffset(times, remainder);\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null);\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(repeat < MAX_REPEAT, \"Repeat count too high, must be less than 20\", \"repeat-count-high\");\n duration = calculateRepeatDuration(duration, repeat, repeatDelay);\n const originalKeyframes = [...valueKeyframesAsList];\n const originalTimes = [...times];\n ease = Array.isArray(ease) ? [...ease] : [ease];\n const originalEase = [...ease];\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes);\n for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {\n times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));\n ease.push(keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(originalEase, keyframeIndex - 1));\n }\n }\n normalizeTimes(times, repeat);\n }\n const targetTime = startTime + duration;\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n };\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences);\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope, elementCache);\n const numSubjects = subjects.length;\n /**\n * For every element in this segment, process the defined values.\n */\n for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes;\n transition = transition;\n const thisSubject = subjects[subjectIndex];\n const subjectSequence = getSubjectSequence(thisSubject, sequences);\n for (const key in keyframes) {\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);\n }\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\n }\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key];\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime);\n const keyframes = [];\n const valueOffset = [];\n const valueEasing = [];\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i];\n keyframes.push(value);\n valueOffset.push(progress(0, totalDuration, at));\n valueEasing.push(easing || \"easeOut\");\n }\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0);\n keyframes.unshift(keyframes[0]);\n valueEasing.unshift(defaultSegmentEasing);\n }\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1);\n keyframes.push(null);\n }\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n });\n }\n const definition = animationDefinitions.get(element);\n definition.keyframes[key] = keyframes;\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } = defaultTransition;\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n };\n }\n });\n return animationDefinitions;\n}\nfunction getSubjectSequence(subject, sequences) {\n !sequences.has(subject) && sequences.set(subject, {});\n return sequences.get(subject);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\nfunction keyframesAsList(keyframes) {\n return Array.isArray(keyframes) ? keyframes : [keyframes];\n}\nexport function getValueTransition(transition, key) {\n return transition && transition[key]\n ? {\n ...transition,\n ...transition[key],\n }\n : { ...transition };\n}\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\n//# sourceMappingURL=create.js.map","import { HTMLVisualElement, isSVGElement, isSVGSVGElement, ObjectVisualElement, SVGVisualElement, visualElementStore, } from \"motion-dom\";\nexport function createDOMVisualElement(element) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n };\n const node = isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options);\n node.mount(element);\n visualElementStore.set(element, node);\n}\nexport function createObjectVisualElement(subject) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n };\n const node = new ObjectVisualElement(options);\n node.mount(subject);\n visualElementStore.set(subject, node);\n}\n//# sourceMappingURL=create-visual-element.js.map","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n//# sourceMappingURL=is-svg-svg-element.mjs.map\n","import { animateTarget, isMotionValue, visualElementStore, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { createDOMVisualElement, createObjectVisualElement, } from \"../utils/create-visual-element\";\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\";\nimport { resolveSubjects } from \"./resolve-subjects\";\nimport { animateSingleValue } from \"motion-dom\";\nfunction isSingleValue(subject, keyframes) {\n return (isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes)));\n}\n/**\n * Implementation\n */\nexport function animateSubject(subject, keyframes, options, scope) {\n const animations = [];\n if (isSingleValue(subject, keyframes)) {\n animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)\n ? keyframes.default || keyframes\n : keyframes, options ? options.default || options : options));\n }\n else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations;\n }\n const subjects = resolveSubjects(subject, keyframes, scope);\n const numSubjects = subjects.length;\n invariant(Boolean(numSubjects), \"No valid elements provided.\", \"no-valid-elements\");\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i];\n const createVisualElement = thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement;\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject);\n }\n const visualElement = visualElementStore.get(thisSubject);\n const transition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (\"delay\" in transition &&\n typeof transition.delay === \"function\") {\n transition.delay = transition.delay(i, numSubjects);\n }\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\n }\n }\n return animations;\n}\n//# sourceMappingURL=subject.js.map","import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n//# sourceMappingURL=single-value.mjs.map\n","import { motionValue, spring, } from \"motion-dom\";\nimport { createAnimationsFromSequence } from \"../sequence/create\";\nimport { animateSubject } from \"./subject\";\nexport function animateSequence(sequence, options, scope) {\n const animations = [];\n /**\n * Pre-process: replace function segments with MotionValue segments,\n * subscribe callbacks immediately\n */\n const processedSequence = sequence.map((segment) => {\n if (Array.isArray(segment) && typeof segment[0] === \"function\") {\n const callback = segment[0];\n const mv = motionValue(0);\n mv.on(\"change\", callback);\n if (segment.length === 1) {\n return [mv, [0, 1]];\n }\n else if (segment.length === 2) {\n return [mv, [0, 1], segment[1]];\n }\n else {\n return [mv, segment[1], segment[2]];\n }\n }\n return segment;\n });\n const animationDefinitions = createAnimationsFromSequence(processedSequence, options, scope, { spring });\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition));\n });\n return animations;\n}\n//# sourceMappingURL=sequence.js.map","import { GroupAnimationWithThen } from \"motion-dom\";\nimport { removeItem } from \"motion-utils\";\nimport { animateSequence } from \"./sequence\";\nimport { animateSubject } from \"./subject\";\nfunction isSequence(value) {\n return Array.isArray(value) && value.some(Array.isArray);\n}\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options = {}) {\n const { scope, reduceMotion } = options;\n /**\n * Implementation\n */\n function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {\n let animations = [];\n let animationOnComplete;\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(subjectOrSequence, reduceMotion !== undefined\n ? { reduceMotion, ...optionsOrKeyframes }\n : optionsOrKeyframes, scope);\n }\n else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {};\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete;\n }\n animations = animateSubject(subjectOrSequence, optionsOrKeyframes, (reduceMotion !== undefined\n ? { reduceMotion, ...rest }\n : rest), scope);\n }\n const animation = new GroupAnimationWithThen(animations);\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete);\n }\n if (scope) {\n scope.animations.push(animation);\n animation.finished.then(() => {\n removeItem(scope.animations, animation);\n });\n }\n return animation;\n }\n return scopedAnimate;\n}\nexport const animate = createScopedAnimate();\n//# sourceMappingURL=index.js.map"],"names":["removeItem","arr","item","index","indexOf","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isZeroValueString","memo","callback","result","undefined","noop","any","combineFunctions","a","b","pipe","transformers","reduce","progress","from","to","value","toFromDifference","SubscriptionManager","constructor","this","subscriptions","add","handler","push","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isEasingArray","ease","Array","isArray","getEasingForSegment","rangeSize","wrap","isBezierDefinition","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","stepsOrder","statsBuffer","addProjectionMetrics","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","stepName","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","numCalls","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","forEach","frameloop","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","frameSteps","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","parseComplexValue","createTransformer","source","numSections","output","convertNumbersToZero","complex","isNaN","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","createGeneratorEasing","options","createGenerator","keyframes","calcGeneratorVelocity","resolveValue","current","prevT","springDefaults","granular","safeMin","findSpring","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","calcAngularFreq","exp","d","e","f","initialGuess","rootIterations","approximateRoot","stiffness","damping","durationKeys","physicsKeys","isSpringType","keys","some","spring","optionsOrVisualDuration","visualDuration","restSpeed","restDelta","isResolvedFromDuration","springOptions","root","PI","derived","getSpringOptions","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","cos","dampedAngularFreq","freqForT","sinh","cosh","calculatedDuration","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","toTransition","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","fillOffset","offset","remaining","offsetProgress","defaultOffset","keyframeValues","times","easingFunctions","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","applyToOptions","generatorOptions","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","isCSSVar","style","setProperty","setStyle","commitStyles","isConnected","effect","getComputedTiming","Number","playbackRate","playState","newStartTime","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","supportsWaapi","Element","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","useWaapi","subject","owner","HTMLElement","transformTemplate","getProps","supportsBrowserAnimation","catch","pendingTimeline","_onReject","finally","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","getMax","methodName","controls","GroupAnimationWithThen","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","animateMotionValue","getVelocity","when","_delay","delayChildren","staggerChildren","staggerDirection","isTransitionDefined","assign","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","getValueState","resolveVariantFromProps","props","custom","variants","positionalKeys","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","getPrevious","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isKeyframesTarget","setTarget","resolveVariant","transitionEnd","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","defaultTransition","reduceMotion","animationTypeState","animationState","getState","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","mask","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","getValueAsType","microtask","cancelMicrotask","isSVGElement","valueTypes","createBox","visualElementStore","WeakMap","variantProps","isControllingVariants","isVariantLabel","prefersReducedMotion","hasReducedMotionListener","isBrowser","propEventHandlers","featureDefinitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","parent","presenceContext","reducedMotionConfig","blockInitialAnimation","visualState","children","isVariantNode","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","variantChildren","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","addEventListener","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","child","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","sortNodePosition","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","transformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","variant","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransform","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","axis","correctBorderRadius","correct","node","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","transformPoint","convertBoundingBoxToBox","point","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","ObjectVisualElement","object","isObjectKey","dashKeys","array","camelKeys","cssMotionPathProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","transformBox","spacing","useDashCase","buildSVGPath","camelCaseAttributes","SVGVisualElement","defaultType","getAttribute","scrapeMotionValuesFromProps$1","charAt","toUpperCase","_styleProp","setAttribute","renderSVG","tag","tagName","isDOMKeyframes","resolveSubjects","scope","selectorCache","elementOrSelector","EventTarget","elements","querySelectorAll","resolveElements","NodeList","s","calculateRepeatDuration","_repeatDelay","calcNextTime","labels","addKeyframes","sequence","endTime","at","eraseKeyframes","normalizeTimes","compareByTime","getSubjectSequence","sequences","getValueSequence","keyframesAsList","isNumber","isNumberKeyframesArray","every","createDOMVisualElement","isSVGSVGElement","createObjectVisualElement","animateSubject","isSingleValue","motionValue$1","animateSingleValue","subjects","numSubjects","thisSubject","createVisualElement","animateSequence","animationDefinitions","sequenceTransition","generators","defaultDuration","elementCache","timeLabels","prevTime","segment","maxDuration","resolveValueSequence","valueKeyframes","valueSequence","elementIndex","valueKeyframesAsList","remainingTransition","calculatedDelay","numKeyframes","absoluteDelta","springTransition","springEasing","remainder","unshift","originalKeyframes","originalTimes","originalEase","repeatIndex","keyframeIndex","targetTime","subjectIndex","subjectSequence","valueSequences","sort","valueOffset","valueEasing","_type","remainingDefaultTransition","createAnimationsFromSequence","mv","createScopedAnimate","subjectOrSequence","optionsOrKeyframes","animationOnComplete"],"mappings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AKgjB,GACtBA,EAAU7K,SAASK,KAAK,KACpBzb,EAAWkkC,EAAMta,WAAY3D,MAG9BA,CACV,CAEL,CACY,MAACnB,GAAUikB"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js b/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js new file mode 100644 index 00000000..41d238d0 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-animation-assets.js @@ -0,0 +1 @@ +const t=(t,e,s)=>s>e?e:s{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i1e3*t,c=t=>t/1e3;function d(t,e){return e?t*(1e3/e):0}const p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],m={value:null,addProjectionMetrics:null};function g(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,s)=>(t[s]=function(t,e){let s=new Set,n=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},h=0;function l(e){a.has(e)&&(u.schedule(e),t()),h++,e(o)}const u={schedule:(t,e=!1,r=!1)=>{const o=r&&i?s:n;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{n.delete(t),a.delete(t)},process:t=>{o=t,i?r=!0:(i=!0,[s,n]=[n,s],s.forEach(l),e&&m.value&&m.value.frameloop[e].push(h),h=0,s.clear(),i=!1,r&&(r=!1,u.process(t)))}};return u}(a,e?s:void 0),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:g,postRender:v}=o,y=()=>{const a=i.useManualTiming?r.timestamp:performance.now();s=!1,i.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),g.process(r),v.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(y))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(y)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e(void 0===V&&M.set(b.isProcessing||i.useManualTiming?b.timestamp:performance.now()),V),set:t=>{V=t,queueMicrotask(S)}},T=t=>e=>"string"==typeof e&&e.startsWith(t),A=T("--"),C=T("var(--"),k=t=>!!C(t)&&x.test(t.split("/*")[0].trim()),x=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function F(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const E={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},B={...E,transform:e=>t(0,1,e)},P={...E,default:1},R=t=>Math.round(1e5*t)/1e5,I=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const N=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,O=(t,e)=>s=>Boolean("string"==typeof s&&N.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),$=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(I);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},L={...E,transform:e=>Math.round((e=>t(0,255,e))(e))},Y={test:O("rgb","red"),parse:$("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+L.transform(t)+", "+L.transform(e)+", "+L.transform(s)+", "+R(B.transform(n))+")"};const W={test:O("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:Y.transform},X=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),j=X("deg"),K=X("%"),U=X("px"),Z=X("vh"),z=X("vw"),D=(()=>({...K,parse:t=>K.parse(t)/100,transform:t=>K.transform(100*t)}))(),q={test:O("hsl","hue"),parse:$("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+K.transform(R(e))+", "+K.transform(R(s))+", "+R(B.transform(n))+")"},H={test:t=>Y.test(t)||W.test(t)||q.test(t),parse:t=>Y.test(t)?Y.parse(t):q.test(t)?q.parse(t):W.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Y.transform(t):q.transform(t),getAnimatableNone:t=>{const e=H.parse(t);return e.alpha=0,H.transform(e)}},_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const G="number",J="color",Q=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Q,t=>(H.test(t)?(n.color.push(r),i.push(J),s.push(H.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(G),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function et(t){return tt(t).values}function st(t){const{split:e,types:s}=tt(t),n=e.length;return t=>{let i="";for(let r=0;r"number"==typeof t?0:H.test(t)?H.getAnimatableNone(t):t;const it={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(I)?.length||0)+(t.match(_)?.length||0)>0},parse:et,createTransformer:st,getAnimatableNone:function(t){const e=et(t);return st(t)(e.map(nt))}},rt=(t,e,s)=>t+(e-t)*s,at=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;enull!==t;function ht(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(ot),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class lt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ut=t=>180*t/Math.PI,ct=t=>{const e=ut(Math.atan2(t[1],t[0]));return pt(e)},dt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ct,rotateZ:ct,skewX:t=>ut(Math.atan(t[1])),skewY:t=>ut(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},pt=t=>((t%=360)<0&&(t+=360),t),ft=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),mt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),gt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ft,scaleY:mt,scale:t=>(ft(t)+mt(t))/2,rotateX:t=>pt(ut(Math.atan2(t[6],t[5]))),rotateY:t=>pt(ut(Math.atan2(-t[2],t[0]))),rotateZ:ct,rotate:ct,skewX:t=>ut(Math.atan(t[4])),skewY:t=>ut(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function vt(t){return t.includes("scale")?1:0}function yt(t,e){if(!t||"none"===t)return vt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=gt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=dt,i=e}if(!i)return vt(e);const r=n[e],a=i[1].split(",").map(wt);return"function"==typeof r?r(a):a[r]}const bt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return yt(s,e)};function wt(t){return parseFloat(t.trim())}const Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],St=(()=>new Set(Vt))(),Mt=t=>t===E||t===U,Tt=new Set(["x","y","z"]),At=Vt.filter(t=>!Tt.has(t));const Ct={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>yt(e,"x"),y:(t,{transform:e})=>yt(e,"y")};Ct.translateX=Ct.x,Ct.translateY=Ct.y;const kt=new Set;let xt=!1,Ft=!1,Et=!1;function Bt(){if(Ft){const t=Array.from(kt).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return At.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ft=!1,xt=!1,kt.forEach(t=>t.complete(Et)),kt.clear()}function Pt(){kt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ft=!0)})}function Rt(){Et=!0,Pt(),Bt(),Et=!1}class It{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(kt.add(this),xt||(xt=!0,v.read(Pt),v.resolveKeyframes(Bt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;eNt[e]??s()}const $t=Ot(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Lt=Ot(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Yt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Wt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yt([0,.65,.55,1]),circOut:Yt([.55,0,1,.45]),backIn:Yt([.31,.01,.66,-.59]),backOut:Yt([.33,1.53,.69,.99])};function Xt(t,e){return t?"function"==typeof t?Lt()?at(t,e):"ease-out":p(t)?Yt(t):Array.isArray(t)?t.map(t=>Xt(t,e)||Wt.easeOut):Wt[t]:void 0}function jt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Xt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Kt(t){return"function"==typeof t&&"applyToOptions"in t}class Ut extends lt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Kt(t)&&Lt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=jt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=ht(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&$t()?(this.animation.timeline=t,h):e(this)}}function Zt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function zt(t,e,s,n){if("function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Zt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class Dt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=M.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=M.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new l);const s=this.events[t].add(e);return"change"===t?()=>{s(),v.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=M.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function qt(t,e){return new Dt(t,e)}const Ht=t=>Boolean(t&&t.getVelocity);function _t(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Gt="data-"+_t("framerAppearId"),Jt=t=>e=>e.test(t),Qt=[E,U,K,j,z,Z,{test:t=>"auto"===t,parse:t=>t}],te=t=>Qt.find(Jt(t)),ee=new Set(["brightness","contrast","saturate","opacity"]);function se(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(I)||[];if(!n)return t;const i=s.replace(n,"");let r=ee.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ne=/\b([a-z-]*)\(.*?\)/gu,ie={...it,getAnimatableNone:t=>{const e=t.match(ne);return e?e.map(se).join(" "):t}},re={...it,getAnimatableNone:t=>{const e=it.parse(t);return it.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ae={...E,transform:Math.round},oe={borderWidth:U,borderTopWidth:U,borderRightWidth:U,borderBottomWidth:U,borderLeftWidth:U,borderRadius:U,borderTopLeftRadius:U,borderTopRightRadius:U,borderBottomRightRadius:U,borderBottomLeftRadius:U,width:U,maxWidth:U,height:U,maxHeight:U,top:U,right:U,bottom:U,left:U,inset:U,insetBlock:U,insetBlockStart:U,insetBlockEnd:U,insetInline:U,insetInlineStart:U,insetInlineEnd:U,padding:U,paddingTop:U,paddingRight:U,paddingBottom:U,paddingLeft:U,paddingBlock:U,paddingBlockStart:U,paddingBlockEnd:U,paddingInline:U,paddingInlineStart:U,paddingInlineEnd:U,margin:U,marginTop:U,marginRight:U,marginBottom:U,marginLeft:U,marginBlock:U,marginBlockStart:U,marginBlockEnd:U,marginInline:U,marginInlineStart:U,marginInlineEnd:U,fontSize:U,backgroundPositionX:U,backgroundPositionY:U,...{rotate:j,rotateX:j,rotateY:j,rotateZ:j,scale:P,scaleX:P,scaleY:P,scaleZ:P,skew:j,skewX:j,skewY:j,distance:U,translateX:U,translateY:U,translateZ:U,x:U,y:U,z:U,perspective:U,transformPerspective:U,opacity:B,originX:D,originY:D,originZ:U},zIndex:ae,fillOpacity:B,strokeOpacity:B,numOctaves:ae},he={...oe,color:H,backgroundColor:H,outlineColor:H,fill:H,stroke:H,borderColor:H,borderTopColor:H,borderRightColor:H,borderBottomColor:H,borderLeftColor:H,filter:ie,WebkitFilter:ie,mask:re,WebkitMask:re},le=t=>he[t],ue=new Set([ie,re]);function ce(t,e){let s=le(t);return ue.has(s)||(s=it),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const de=new Set(["opacity","clipPath","filter","transform"]),pe=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:fe,cancel:me}=g(queueMicrotask,!1),ge=[...Qt,H,it],ve=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ye=new WeakMap;function be(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function we(t){return"string"==typeof t||Array.isArray(t)}const Ve=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Se=["initial",...Ve];function Me(t){return be(t.animate)||Se.some(e=>we(t[e]))}function Te(t){return Boolean(Me(t)||t.variants)}const Ae={current:null},Ce={current:!1},ke="undefined"!=typeof window;const xe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Fe={};function Ee(t){Fe=t}function Be(){return Fe}class Pe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=It,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=M.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ce.current||function(){if(Ce.current=!0,ke)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ae.current=t.matches;t.addEventListener("change",e),e()}else Ae.current=!1}(),this.shouldReduceMotion=Ae.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),y(this.notifyUpdate),y(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&de.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new Ut({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=St.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&v.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Fe){const e=Fe[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=qt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!ge.find(Jt(n))&&it.test(e)&&(s=ce(t,e))),this.setBaseTarget(t,Ht(s)?s.get():s)),Ht(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=zt(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Ht(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){fe.render(this.render)}}const Re={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ie=Vt.length;function Ne(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(St.has(t))a=!0;else if(A(t))i[t]=s;else{const e=pe(s,oe[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r{if(!e.target)return t;if("string"==typeof t){if(!U.test(t))return t;t=parseFloat(t)}return`${Oe(t,e.target.x)}% ${Oe(t,e.target.y)}%`}},Le={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=it.parse(t);if(i.length>5)return n;const r=it.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=rt(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Ye={borderRadius:{...$e,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$e,borderTopRightRadius:$e,borderBottomLeftRadius:$e,borderBottomRightRadius:$e,boxShadow:Le};function We(t,{layout:e,layoutId:s}){return St.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Ye[t]||"opacity"===t)}function Xe(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Ht(n[e])||i&&Ht(i[e])||We(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const je={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ke={offset:"strokeDashoffset",array:"strokeDasharray"};const Ue=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ze(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Ne(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of Ue)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?je:Ke;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const ze=t=>"string"==typeof t&&"svg"===t.toLowerCase();function De(t,e,s){const n=Xe(t,e,s);for(const s in t)if(Ht(t[s])||Ht(e[s])){n[-1!==Vt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const qe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function He(t){return"string"==typeof t&&!t.includes("-")&&!!(qe.indexOf(t)>-1||/[A-Z]/u.test(t))}export{Ct as $,it as A,tt as B,v as C,y as D,b as E,M as F,c as G,d as H,u as I,t as J,at as K,ht as L,i as M,Ut as N,Kt as O,o as P,It as Q,Rt as R,r as S,St as T,Vt as U,qt as V,lt as W,a as X,ce as Y,te as Z,F as _,Me as a,Mt as a0,Pe as a1,vt as a2,bt as a3,A as a4,_t as a5,ve as a6,le as a7,Se as a8,Ve as a9,we as b,We as c,Ne as d,Ze as e,ze as f,He as g,Te as h,Ht as i,be as j,De as k,Be as l,Ee as m,h as n,Gt as o,p,n as q,zt as r,Xe as s,rt as t,Y as u,q as v,s as w,W as x,k as y,H as z}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js b/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js new file mode 100644 index 00000000..8576fdc0 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-animation-m.js @@ -0,0 +1 @@ +import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as o,useContext as e,useMemo as r,Fragment as a,createElement as i,useRef as s,useInsertionEffect as u,useCallback as c,useLayoutEffect as l,useEffect as d,forwardRef as f}from"react";import{i as m,a as p,b as y,c as g,d as v,e as h,f as w,g as S,P as M,r as b,h as E,j as P,k as T,s as C,l as j,m as A,n as V,S as x,o as I,p as L,L as k}from"./size-rollup-dom-max-assets.js";const W=o({strict:!1}),H=o({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),O=o({});function D(t){const{initial:n,animate:o}=function(t,n){if(m(t)){const{initial:n,animate:o}=t;return{initial:!1===n||p(n)?n:void 0,animate:p(o)?o:void 0}}return!1!==t.inherit?n:{}}(t,e(O));return r(()=>({initial:n,animate:o}),[F(n),F(o)])}function F(t){return Array.isArray(t)?t.join(" "):t}const R=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function N(t,n,o){for(const e in n)y(n[e])||g(e,o)||(t[e]=n[e])}function B(t,n){const o={};return N(o,t.style||{},t),Object.assign(o,function({transformTemplate:t},n){return r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{}};return v(o,n,t),Object.assign({},o.vars,o.style)},[n])}(t,n)),o}function q(t,n){const o={},e=B(t,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=e,o}const U=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function $(t,n,o,e){const a=r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return h(o,n,w(e),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[n]);if(t.style){const n={};N(n,t.style,t),a.style={...n,...a.style}}return a}const _=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function z(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||_.has(t)}let G=t=>!z(t);try{"function"==typeof(X=require("@emotion/is-prop-valid").default)&&(G=t=>t.startsWith("on")?!z(t):X(t))}catch{}var X;function Y(t,n,o,{latestValues:e},s,u=!1,c){const l=(c??S(t)?$:q)(n,e,s,t),d=function(t,n,o){const e={};for(const r in t)"values"===r&&"object"==typeof t.values||(G(r)||!0===o&&z(r)||!n&&!z(r)||t.draggable&&r.startsWith("onDrag"))&&(e[r]=t[r]);return e}(n,"string"==typeof t,u),f=t!==a?{...d,...l,ref:o}:{},{children:m}=n,p=r(()=>y(m)?m.get():m,[m]);return i(t,{...f,children:p})}function J(t,n,o,e){const r={},a=e(t,{});for(const t in a)r[t]=b(a[t]);let{initial:i,animate:s}=t;const u=m(t),c=E(t);n&&c&&!u&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let l=!!o&&!1===o.initial;l=l||!1===i;const d=l?s:i;if(d&&"boolean"!=typeof d&&!P(d)){const n=Array.isArray(d)?d:[d];for(let o=0;o(n,o)=>{const r=e(O),a=e(M),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},o,e,r){return{latestValues:J(o,e,r,t),renderState:n()}}(t,n,r,a);return o?i():function(t){const n=s(null);return null===n.current&&(n.current=t()),n.current}(i)},Q=K({scrapeMotionValuesFromProps:C,createRenderState:R}),Z=K({scrapeMotionValuesFromProps:j,createRenderState:U}),tt="undefined"!=typeof window,nt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let ot=!1;function et(){return function(){if(ot)return;const t={};for(const n in nt)t[n]={isEnabled:t=>nt[n].some(n=>!!t[n])};V(t),ot=!0}(),A()}const rt=Symbol.for("motionComponentSymbol");function at(t,n,o){const e=s(o);u(()=>{e.current=o});const r=s(null);return c(o=>{o&&t.onMount?.(o),n&&(o?n.mount(o):n.unmount());const a=e.current;if("function"==typeof a)if(o){const t=a(o);"function"==typeof t&&(r.current=t)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o)},[n])}const it=tt?l:d;function st(t,n,o,r,a,i){const{visualElement:c}=e(O),l=e(W),f=e(M),m=e(H),p=m.reducedMotion,y=m.skipAnimations,g=s(null),v=s(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:n,parent:c,props:o,presenceContext:f,blockInitialAnimation:!!f&&!1===f.initial,reducedMotionConfig:p,skipAnimations:y,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const h=g.current,w=e(x);!h||h.projection||!a||"html"!==h.type&&"svg"!==h.type||function(t,n,o,e){const{layoutId:r,layout:a,drag:i,dragConstraints:s,layoutScroll:u,layoutRoot:c,layoutCrossfade:l}=n;t.projection=new o(t.latestValues,n["data-framer-portal-id"]?void 0:ut(t.parent)),t.projection.setOptions({layoutId:r,layout:a,alwaysMeasureLayout:Boolean(i)||s&&L(s),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:l,layoutScroll:u,layoutRoot:c})}(g.current,o,a,w);const S=s(!1);u(()=>{h&&S.current&&h.update(o,f)});const b=o[I],E=s(Boolean(b)&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return it(()=>{v.current=!0,h&&(S.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),E.current&&h.animationState&&h.animationState.animateChanges())}),d(()=>{h&&(!E.current&&h.animationState&&h.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),E.current=!1),h.enteringChildren=void 0)}),h}function ut(t){if(t)return!1!==t.options.allowProjection?t.projection:ut(t.parent)}function ct(o,{forwardMotionProps:r=!1,type:a}={},i,s){const u=a?"svg"===a:S(o),c=u?Z:Q;function l(a,i){let l;const d={...e(H),...a,layoutId:lt(a)},{isStatic:f}=d,m=D(a),p=c(a,f);if(!f&&tt){e(W).strict;const t=function(t){const n=et(),{drag:o,layout:e}=n;if(!o&&!e)return{};const r={...o,...e};return{MeasureLayout:o?.isEnabled(t)||e?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(d);l=t.MeasureLayout,m.visualElement=st(o,p,d,s,t.ProjectionNode,u)}return t(O.Provider,{value:m,children:[l&&m.visualElement?n(l,{visualElement:m.visualElement,...d}):null,Y(o,a,at(p,m.visualElement,i),p,f,r,u)]})}l.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const d=f(l);return d[rt]=o,d}function lt({layoutId:t}){const n=e(k).id;return n&&void 0!==t?n+"-"+t:t}function dt(t,n){return ct(t,n)}const ft=dt("div");export{ft as MotionDiv}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-animation.js b/node_modules/framer-motion/dist/size-rollup-dom-animation.js new file mode 100644 index 00000000..3b2387e1 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-animation.js @@ -0,0 +1 @@ +import{n as t,p as e,q as n,t as i,u as s,w as r,v as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as T,M as b,W as A,L as x,N as S,O as k,P as M,Q as C,R as V,S as E,T as P,r as D,U as O,V as F,i as I,o as L,X as K,Y as R,Z as B,_ as j,$ as q,a0 as N,a1 as U,a2 as H,a3 as $,a4 as W,d as G,s as _,a5 as z,a6 as Y,k as X,e as J,f as Z,a7 as Q,b as tt,a8 as et,j as nt,a9 as it,g as st}from"./size-rollup-dom-animation-assets.js";import{Fragment as rt}from"react";const ot=(t,e)=>n=>e(t(n)),at=(...t)=>t.reduce(ot),ut=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},lt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ct(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=lt(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:lt(r(t),n,s)}const ht=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,dt=t=>e=>1-t(1-e),pt=ct(.33,1.53,.69,.99),mt=dt(pt),ft=ht(mt),yt=t=>(t*=2)<1?.5*mt(t):.5*(2-Math.pow(2,-10*(t-1))),vt=t=>1-Math.sin(Math.acos(t)),gt=dt(vt),wt=ht(vt),Tt=ct(.42,0,1,1),bt=ct(0,0,.58,1),At=ct(.42,0,.58,1),xt={linear:t,easeIn:Tt,easeInOut:At,easeOut:bt,circIn:vt,circInOut:wt,circOut:gt,backIn:mt,backInOut:ft,backOut:pt,anticipate:yt},St=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return ct(e,i,s,r)}return"string"==typeof t?(n(void 0!==xt[t],`Invalid easing type '${t}'`,"invalid-easing-type"),xt[t]):t};function kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Mt(t,e){return n=>n>0?e:t}const Ct=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Vt=[a,s,o];function Et(t){const e=(n=t,Vt.find(t=>t.test(n)));var n;if(r(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===o&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=kt(a,i,t+1/3),r=kt(a,i,t),o=kt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Pt=(t,e)=>{const n=Et(t),r=Et(e);if(!n||!r)return Mt(t,e);const o={...n};return t=>(o.red=Ct(n.red,r.red,t),o.green=Ct(n.green,r.green,t),o.blue=Ct(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},Dt=new Set(["none","hidden"]);function Ot(t,e){return n=>i(t,e,n)}function Ft(t){return"number"==typeof t?Ot:"string"==typeof t?u(t)?Mt:l.test(t)?Pt:Kt:Array.isArray(t)?It:"object"==typeof t?l.test(t)?Pt:Lt:Mt}function It(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Ft(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Kt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Dt.has(t)&&!s.values.length||Dt.has(e)&&!i.values.length?function(t,e){return Dt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):at(It(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>d.update(e,t),stop:()=>p(e),now:()=>m.isProcessing?m.timestamp:f.now()}},jt=2e4;function qt(t){let e=0;let n=t.next(e);for(;!n.done&&e=jt?1/0:e}function Nt(t,e,n){const i=Math.max(e-5,0);return v(n-t(i),e-i)}const Ut=100,Ht=10,$t=1,Wt=0,Gt=800,_t=.3,zt=.3,Yt={granular:.01,default:2},Xt={granular:.005,default:.5},Jt=.01,Zt=10,Qt=.05,te=1,ee=.001;function ne({duration:t=Gt,bounce:e=_t,velocity:n=Wt,mass:i=$t}){let s,o;r(t<=g(Zt),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=w(Qt,te,a),t=w(Jt,Zt,y(t)),a<1?(s=e=>{const i=e*a,s=i*t,r=i-n,o=se(e,a),u=Math.exp(-s);return ee-r/o*u},o=e=>{const i=e*a*t,r=i*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=se(Math.pow(e,2),a);return(-s(e)+ee>0?-1:1)*((r-o)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let i=n;for(let n=1;nvoid 0!==t[e])}function ue(t=zt,e=_t){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Wt,stiffness:Ut,damping:Ht,mass:$t,isResolvedFromDuration:!1,...t};if(!ae(t,oe)&&ae(t,re))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*w(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:$t,stiffness:s,damping:r}}else{const n=ne(t);e={...e,...n,mass:$t},e.isResolvedFromDuration=!0}return e}({...n,velocity:-y(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),v=o-r,b=y(Math.sqrt(u/c)),A=Math.abs(v)<5;let x;if(i||(i=A?Yt.granular:Yt.default),s||(s=A?Xt.granular:Xt.default),f<1){const t=se(b,f);x=e=>{const n=Math.exp(-f*b*e);return o-n*((m+f*b*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===f)x=t=>o-Math.exp(-b*t)*(v+(m+b*v)*t);else{const t=b*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*b*e),i=Math.min(t*e,300);return o-n*((m+f*b*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const S={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0===t?m:0;f<1&&(n=0===t?g(m):Nt(x,t,e));const r=Math.abs(n)<=i,u=Math.abs(o-e)<=s;a.done=r&&u}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(qt(S),jt),e=T(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function le({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)-m*Math.exp(-t/i),g=t=>y+v(t),w=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let T,b;const A=t=>{var e;(e=d.value,void 0!==a&&eu)&&(T=t,b=ue({keyframes:[d.value,p(d.value)],velocity:Nt(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return A(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==T||(e=!0,w(t),A(t)),void 0!==T&&t>=T?b.next(t-T):(!e&&w(t),d)}}}function ce(e,i,{clamp:s=!0,ease:r,mixer:o}={}){const a=e.length;if(n(a===i.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const u=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const l=function(e,n,i){const s=[],r=i||b.mix||Rt,o=e.length-1;for(let i=0;i{if(u&&t1)for(;nh(w(e[0],e[a-1],t)):h}function he(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=ut(0,e,s);t.push(i(n,1,r))}}(e,t.length-1),e}function de({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(St):St(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:he(e),t),a=ce(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||At).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}ue.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(qt(i),jt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}(t,100,ue);return t.ease=e.ease,t.duration=g(e.duration),t.type="keyframes",t};const pe={decay:le,inertia:le,tween:de,keyframes:de,spring:ue};function me(t){"string"==typeof t.type&&(t.type=pe[t.type])}const fe=t=>t/100;class ye extends A{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==f.now()&&this.tick(f.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;me(t);const{type:e=de,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||de;a!==de&&"number"!=typeof o[0]&&(this.mixKeyframes=at(fe,Rt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=qt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let g=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(T=r)),g=w(0,1,n)*o}const b=v?{done:!1,value:l[0]}:T.next(g);s&&(b.value=s(b.value));let{done:A}=b;v||null===a||(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&A);return S&&p!==le&&(b.value=x(l,this.options,f,this.speed)),m&&m(b.value),S&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=g(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(f.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Bt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(f.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ve={anticipate:yt,backInOut:ft,circInOut:wt};function ge(t){"string"==typeof t.ease&&t.ease in ve&&(t.ease=ve[t.ease])}class we extends S{constructor(t){ge(t),me(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ye({...r,autoplay:!1}),a=Math.max(10,f.now()-this.startTime),u=w(0,10,a-10);e.setWithVelocity(o.sample(Math.max(0,a-u)).value,o.sample(a).value,u),o.stop()}}const Te=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function be(t){t.duration=0,t.type="keyframes"}const Ae=new Set(["opacity","clipPath","filter","transform"]),xe=M(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Se extends A{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=f.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||C;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:u,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=f.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],a=Te(s,e),u=Te(o,e);return r(a===u,`You are trying to animate ${e} from "${s}" to "${o}". "${a?o:s}" is not an animatable value.`,"value-not-animatable"),!(!a||!u)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},p=!c&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return xe()&&n&&Ae.has(n)&&("transform"!==n||!l)&&!u&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(d),m=d.motionValue?.owner?.current,y=p?new we({...d,element:m}):new ye(d);y.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),V()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ke(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}const Me=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ce(t,e,i=1){n(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=Me.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return E(t)?parseFloat(t):t}return u(r)?Ce(r,e,i+1):r}const Ve={type:"spring",stiffness:500,damping:25,restSpeed:10},Ee={type:"keyframes",duration:.8},Pe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},De=(t,{keyframes:e})=>e.length>2?Ee:P.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ve:Pe,Oe=t=>null!==t;function Fe(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ie(t,e){const n=t?.[e]??t?.default??t;return n!==t?Fe(n,t):n}const Le=(t,e,n,i={},s,r)=>o=>{const a=Ie(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=g(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,De(t,c)),c.duration&&(c.duration=g(c.duration)),c.repeatDelay&&(c.repeatDelay=g(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(be(c),0===c.delay&&(h=!0)),(b.instantAnimations||b.skipAnimations||s?.shouldSkipAnimations)&&(h=!0,be(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(Oe),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(c.keyframes,a);if(void 0!==t)return void d.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ye(c):new Se(c)};function Ke(t,e,n){const i=t.getProps();return D(i,e,void 0!==n?n:i.custom,t)}const Re=new Set(["width","height","top","left","right","bottom",...O]),Be=t=>Array.isArray(t);function je(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,F(n))}function qe(t){return Be(t)?t[t.length-1]||0:t}function Ne(t,e){const n=t.getValue("willChange");if(i=n,Boolean(I(i)&&i.add))return n.add(e);if(!n&&b.WillChange){const n=new b.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ue(t){return t.props[L]}function He({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function $e(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Fe(r,u):u;const l=r?.reduceMotion;i&&(r=i);const c=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&He(h,e))continue;const o={delay:n,...Ie(r||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!o.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const n=Ue(t);if(n){const t=window.MotionHandoffAnimation(n,e,d);null!==t&&(o.startTime=t,p=!0)}}Ne(t,e);const m=l??t.shouldReduceMotion;i.start(Le(e,i,s,m&&Re.has(e)?{type:!1}:o,t,p));const f=i.animation;f&&c.push(f)}if(o){const e=()=>d.update(()=>{o&&function(t,e){const n=Ke(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)je(t,e,qe(r[e]))}(t,o)});c.length?Promise.all(c).then(e):e()}return c}function We(t,e,n={}){const i=Ke(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all($e(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(We(u,e,{...o,delay:n+("function"==typeof i?0:i)+ke(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function Ge(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||K(t))}const _e=new Set(["auto","none","0"]);class ze extends C{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ye=!1;function Xe(){return Ye}function Je(t,e){const n=function(t){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ze(t,e,n={}){const[i,s,r]=Je(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Xe())return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const Qe=(t,e)=>!!e&&(t===e||Qe(t,e.parentElement)),tn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const en=new WeakSet;function nn(t){return e=>{"Enter"===e.key&&t(e)}}function sn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!Xe()}const on=new WeakSet;function an(t,e,n={}){const[i,s,r]=Je(t,n),o=t=>{const i=t.currentTarget;if(!rn(t))return;if(on.has(t))return;en.add(i),n.stopPropagation&&on.add(t);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),en.has(i)&&en.delete(i),rn(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Qe(i,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",u,s)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=nn(()=>{if(en.has(n))return;sn(n,"down");const t=nn(()=>{sn(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>sn(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return tn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class un extends U{constructor(){super(...arguments),this.KeyframeResolver=ze}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ln{constructor(t){this.isMounted=!1,this.node=t}update(){}}function cn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class hn extends un{constructor(){super(...arguments),this.type="html",this.renderInstance=cn}readValueFromInstance(t,e){if(P.has(e))return this.projection?.isProjecting?H(e):$(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(W(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){G(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return _(t,e,n)}}const dn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class pn extends un{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(P.has(e)){const t=Q(e);return t&&t.default||0}return e=dn.has(e)?e:z(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return X(t,e,n)}build(t,e,n){J(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){cn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(dn.has(n)?n:z(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Z(t.tagName),super.mount(t)}}const mn=et.length;function fn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&fn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>We(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=We(t,e,n);else{const s="function"==typeof e?Ke(t,e,n.custom):e;i=Promise.all($e(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Tn(t){let e=wn(t),n=xn(),i=!0;const s=e=>(n,i)=>{const s=Ke(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:o}=t,a=fn(t.parent)||{},u=[],l=new Set;let c={},h=1/0;for(let e=0;eh&&f,T=!1;const b=Array.isArray(m)?m:[m];let A=b.reduce(s(d),{});!1===y&&(A={});const{prevResolvedValues:x={}}=p,S={...x,...A},k=e=>{w=!0,l.has(e)&&(T=!0,l.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in S){const e=A[t],n=x[t];if(c.hasOwnProperty(t))continue;let i=!1;i=Be(e)&&Be(n)?!yn(e,n):e!==n,i?null!=e?k(t):l.add(t):void 0!==e&&l.has(t)?k(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=A,p.isActive&&(c={...c,...A}),i&&t.blockInitialAnimation&&(w=!1);const M=v&&g;w&&(!M||T)&&u.push(...b.map(e=>{const n={type:d};if("string"==typeof e&&i&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Ke(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=ke(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(l.size){const e={};if("boolean"!=typeof o.initial){const n=Ke(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}l.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),u.push({animation:e})}let d=Boolean(u.length);return!i||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=xn()}}}function bn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!yn(e,t)}function An(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xn(){return{animate:An(!0),whileInView:An(),whileHover:An(),whileTap:An(),whileDrag:An(),whileFocus:An(),exit:An()}}function Sn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}let kn=0;const Mn={animation:{Feature:class extends ln{constructor(t){super(t),t.animationState||(t.animationState=Tn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();nt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ln{constructor(){super(...arguments),this.id=kn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Cn(t){return{point:{x:t.pageX,y:t.pageY}}}function Vn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&d.postRender(()=>s(e,Cn(e)))}function En(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&d.postRender(()=>s(e,Cn(e)))}const Pn=new WeakMap,Dn=new WeakMap,On=t=>{const e=Pn.get(t.target);e&&e(t)},Fn=t=>{t.forEach(On)};function In(t,e,n){const i=function({root:t,...e}){const n=t||document;Dn.has(n)||Dn.set(n,{});const i=Dn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Fn,{root:t,...e})),i[s]}(e);return Pn.set(t,n),i.observe(t),()=>{Pn.delete(t),i.unobserve(t)}}const Ln={some:0,all:1};const Kn={renderer:(t,e)=>e.isSVG??st(t)?new pn(e):new hn(e,{allowProjection:t!==rt}),...Mn,...{inView:{Feature:class extends ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ln[i]};return In(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ln{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=an(t,(t,e)=>(En(this.node,e,"Start"),(t,{success:e})=>En(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=at(Sn(this.node.current,"focus",()=>this.onFocus()),Sn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ln{mount(){const{current:t}=this.node;t&&(this.unmount=Ze(t,(t,e)=>(Vn(this.node,e,"Start"),t=>Vn(this.node,t,"End"))))}unmount(){}}}}};export{Kn as domAnimation}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js b/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js new file mode 100644 index 00000000..ff6f700f --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-max-assets.js @@ -0,0 +1 @@ +import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(a=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},r=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i1e3*t,f=t=>t/1e3;function m(t,e){return e?t*(1e3/e):0}const g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],b={value:null,addProjectionMetrics:null};function w(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,r=y.reduce((t,s)=>(t[s]=function(t,e){let s=new Set,n=new Set,i=!1,a=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},h=0;function l(e){r.has(e)&&(u.schedule(e),t()),h++,e(o)}const u={schedule:(t,e=!1,a=!1)=>{const o=a&&i?s:n;return e&&r.add(t),o.has(t)||o.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{o=t,i?a=!0:(i=!0,[s,n]=[n,s],s.forEach(l),e&&b.value&&b.value.frameloop[e].push(h),h=0,s.clear(),i=!1,a&&(a=!1,u.process(t)))}};return u}(a,e?s:void 0),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=r,g=()=>{const a=o.useManualTiming?i.timestamp:performance.now();s=!1,o.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,a)=>{const o=r[a];return e[a]=(e,a=!1,r=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,a,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===A&&k.set(M.isProcessing||o.useManualTiming?M.timestamp:performance.now()),A),set:t=>{A=t,queueMicrotask(C)}},x=t=>e=>"string"==typeof e&&e.startsWith(t),F=x("--"),P=x("var(--"),E=t=>!!P(t)&&B.test(t.split("/*")[0].trim()),B=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function R(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const I={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},N={...I,transform:t=>n(0,1,t)},O={...I,default:1},$=t=>Math.round(1e5*t)/1e5,L=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Y=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,j=(t,e)=>s=>Boolean("string"==typeof s&&Y.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,a,r,o]=n.match(L);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(r),alpha:void 0!==o?parseFloat(o):1}},X={...I,transform:t=>Math.round((t=>n(0,255,t))(t))},K={test:j("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+$(N.transform(n))+")"};const U={test:j("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:K.transform},Z=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),z=Z("deg"),D=Z("%"),q=Z("px"),H=Z("vh"),_=Z("vw"),G=(()=>({...D,parse:t=>D.parse(t)/100,transform:t=>D.transform(100*t)}))(),J={test:j("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+D.transform($(e))+", "+D.transform($(s))+", "+$(N.transform(n))+")"},Q={test:t=>K.test(t)||U.test(t)||J.test(t),parse:t=>K.test(t)?K.parse(t):J.test(t)?J.parse(t):U.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?K.transform(t):J.transform(t),getAnimatableNone:t=>{const e=Q.parse(t);return e.alpha=0,Q.transform(e)}},tt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const et="number",st="color",nt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function it(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(nt,t=>(Q.test(t)?(n.color.push(a),i.push(st),s.push(Q.parse(t))):t.startsWith("var(")?(n.var.push(a),i.push("var"),s.push(t)):(n.number.push(a),i.push(et),s.push(parseFloat(t))),++a,"${}")).split("${}");return{values:s,split:r,indexes:n,types:i}}function at(t){return it(t).values}function rt(t){const{split:e,types:s}=it(t),n=e.length;return t=>{let i="";for(let a=0;a"number"==typeof t?0:Q.test(t)?Q.getAnimatableNone(t):t;const ht={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(L)?.length||0)+(t.match(tt)?.length||0)>0},parse:at,createTransformer:rt,getAnimatableNone:function(t){const e=at(t);return rt(t)(e.map(ot))}},lt=(t,e,s)=>t+(e-t)*s,ut=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;enull!==t;function dt(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(ct),r=i<0||e&&"loop"!==s&&e%2==1?0:a.length-1;return r&&void 0!==n?n:a[r]}class pt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ft=t=>180*t/Math.PI,mt=t=>{const e=ft(Math.atan2(t[1],t[0]));return vt(e)},gt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:mt,rotateZ:mt,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},vt=t=>((t%=360)<0&&(t+=360),t),yt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),bt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),wt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yt,scaleY:bt,scale:t=>(yt(t)+bt(t))/2,rotateX:t=>vt(ft(Math.atan2(t[6],t[5]))),rotateY:t=>vt(ft(Math.atan2(-t[2],t[0]))),rotateZ:mt,rotate:mt,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Vt(t){return t.includes("scale")?1:0}function St(t,e){if(!t||"none"===t)return Vt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=wt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=gt,i=e}if(!i)return Vt(e);const a=n[e],r=i[1].split(",").map(Tt);return"function"==typeof a?a(r):r[a]}const Mt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return St(s,e)};function Tt(t){return parseFloat(t.trim())}const At=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ct=(()=>new Set(At))(),kt=t=>t===I||t===q,xt=new Set(["x","y","z"]),Ft=At.filter(t=>!xt.has(t));const Pt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>St(e,"x"),y:(t,{transform:e})=>St(e,"y")};Pt.translateX=Pt.x,Pt.translateY=Pt.y;const Et=new Set;let Bt=!1,Rt=!1,It=!1;function Nt(){if(Rt){const t=Array.from(Et).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ft.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Rt=!1,Bt=!1,Et.forEach(t=>t.complete(It)),Et.clear()}function Ot(){Et.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Rt=!0)})}function $t(){It=!0,Ot(),Nt(),It=!1}class Lt{constructor(t,e,s,n,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Et.add(this),Bt||(Bt=!0,V.read(Ot),V.resolveKeyframes(Nt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),a=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,a);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=a),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;eYt[e]??s()}const Wt=jt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=jt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Kt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Ut={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Kt([0,.65,.55,1]),circOut:Kt([.55,0,1,.45]),backIn:Kt([.31,.01,.66,-.59]),backOut:Kt([.33,1.53,.69,.99])};function Zt(t,e){return t?"function"==typeof t?Xt()?ut(t,e):"ease-out":g(t)?Kt(t):Array.isArray(t)?t.map(t=>Zt(t,e)||Ut.easeOut):Ut[t]:void 0}function zt(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:r="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Zt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:"reverse"===r?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Dt(t){return"function"==typeof t&&"applyToOptions"in t}class qt extends pt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=t,r("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Dt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=zt(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=dt(n,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,c):e(this)}}function Ht(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function _t(t,e,s,n){if("function"==typeof e){const[i,a]=Ht(n);e=e(void 0!==s?s:t.custom,i,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,a]=Ht(n);e=e(void 0!==s?s:t.custom,i,a)}return e}class Gt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=k.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=k.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),V.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=k.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Jt(t,e){return new Gt(t,e)}const Qt=t=>Boolean(t&&t.getVelocity);function te(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ee="data-"+te("framerAppearId"),se=t=>e=>e.test(t),ne=[I,q,D,z,_,H,{test:t=>"auto"===t,parse:t=>t}],ie=t=>ne.find(se(t)),ae=new Set(["brightness","contrast","saturate","opacity"]);function re(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(L)||[];if(!n)return t;const i=s.replace(n,"");let a=ae.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const oe=/\b([a-z-]*)\(.*?\)/gu,he={...ht,getAnimatableNone:t=>{const e=t.match(oe);return e?e.map(re).join(" "):t}},le={...ht,getAnimatableNone:t=>{const e=ht.parse(t);return ht.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ue={...I,transform:Math.round},ce={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,...{rotate:z,rotateX:z,rotateY:z,rotateZ:z,scale:O,scaleX:O,scaleY:O,scaleZ:O,skew:z,skewX:z,skewY:z,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:N,originX:G,originY:G,originZ:q},zIndex:ue,fillOpacity:N,strokeOpacity:N,numOctaves:ue},de={...ce,color:Q,backgroundColor:Q,outlineColor:Q,fill:Q,stroke:Q,borderColor:Q,borderTopColor:Q,borderRightColor:Q,borderBottomColor:Q,borderLeftColor:Q,filter:he,WebkitFilter:he,mask:le,WebkitMask:le},pe=t=>de[t],fe=new Set([he,le]);function me(t,e){let s=pe(t);return fe.has(s)||(s=ht),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ge=new Set(["opacity","clipPath","filter","transform"]),ve=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ye,cancel:be}=w(queueMicrotask,!1),we=[...ne,Q,ht],Ve=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Se=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Me=new WeakMap;function Te(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Ae(t){return"string"==typeof t||Array.isArray(t)}const Ce=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ke=["initial",...Ce];function xe(t){return Te(t.animate)||ke.some(e=>Ae(t[e]))}function Fe(t){return Boolean(xe(t)||t.variants)}const Pe={current:null},Ee={current:!1},Be="undefined"!=typeof window;const Re=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ie={};function Ne(t){Ie=t}function Oe(){return Ie}class $e{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:a,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Lt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=k.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ee.current||function(){if(Ee.current=!0,Be)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Pe.current=t.matches;t.addEventListener("change",e),e()}else Pe.current=!1}(),this.shouldReduceMotion=Pe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),S(this.notifyUpdate),S(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ge.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:a,duration:r}=e.accelerate,o=new qt({element:this.current,name:t,keyframes:n,times:i,ease:a,duration:p(r)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=Ct.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&V.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ie){const e=Ie[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Jt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!we.find(se(n))&&ht.test(e)&&(s=me(t,e))),this.setBaseTarget(t,Qt(s)?s.get():s)),Qt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=_t(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Qt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ye.render(this.render)}}const Le={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ye=At.length;function je(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let r=!1,o=!1;for(const t in e){const s=e[t];if(Ct.has(t))r=!0;else if(F(t))i[t]=s;else{const e=ve(s,ce[t]);t.startsWith("origin")?(o=!0,a[t]=e):n[t]=e}}if(e.transform||(r||s?n.transform=function(t,e,s){let n="",i=!0;for(let a=0;a{if(!e.target)return t;if("string"==typeof t){if(!q.test(t))return t;t=parseFloat(t)}return`${We(t,e.target.x)}% ${We(t,e.target.y)}%`}},Ke={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=ht.parse(t);if(i.length>5)return n;const a=ht.createTransformer(t),r="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+r]/=o,i[1+r]/=h;const l=lt(o,h,.5);return"number"==typeof i[2+r]&&(i[2+r]/=l),"number"==typeof i[3+r]&&(i[3+r]/=l),a(i)}},Ue={borderRadius:{...Xe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xe,borderTopRightRadius:Xe,borderBottomLeftRadius:Xe,borderBottomRightRadius:Xe,boxShadow:Ke};function Ze(t,{layout:e,layoutId:s}){return Ct.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Ue[t]||"opacity"===t)}function ze(t,e,s){const n=t.style,i=e?.style,a={};if(!n)return a;for(const e in n)(Qt(n[e])||i&&Qt(i[e])||Ze(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(a[e]=n[e]);return a}const De={offset:"stroke-dashoffset",array:"stroke-dasharray"},qe={offset:"strokeDashoffset",array:"strokeDasharray"};const He=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _e(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:r=0,...o},h,l,u){if(je(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of He)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?De:qe;t[a.offset]=""+-n,t[a.array]=`${e} ${s}`}(c,i,a,r,!1)}const Ge=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Je(t,e,s){const n=ze(t,e,s);for(const s in t)if(Qt(t[s])||Qt(e[s])){n[-1!==At.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Qe(t){return Qt(t)?t.get():t}const ts=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function es(t){return"string"==typeof t&&!t.includes("-")&&!!(ts.indexOf(t)>-1||/[A-Z]/u.test(t))}const ss=t(null),ns=t({});function is(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{Jt as $,E as A,Q as B,ht as C,it as D,V as E,S as F,M as G,k as H,f as I,m as J,p as K,v as L,n as M,ut as N,o as O,ss as P,dt as Q,qt as R,ns as S,Dt as T,u as U,Lt as V,pt as W,$t as X,h as Y,Ct as Z,At as _,Ae as a,l as a0,me as a1,ie as a2,R as a3,Pt as a4,kt as a5,$e as a6,Vt as a7,Mt as a8,F as a9,te as aa,Se as ab,pe as ac,ke as ad,Ce as ae,D as af,q as ag,e as ah,s as ai,d as aj,T as ak,ye as al,Ve as am,Ue as an,Qt as b,Ze as c,je as d,_e as e,Ge as f,es as g,Fe as h,xe as i,Te as j,_t as k,Je as l,Oe as m,Ne as n,ee as o,is as p,c as q,Qe as r,ze as s,g as t,r as u,lt as v,K as w,a as x,J as y,U as z}; diff --git a/node_modules/framer-motion/dist/size-rollup-dom-max.js b/node_modules/framer-motion/dist/size-rollup-dom-max.js new file mode 100644 index 00000000..9596a0c8 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-dom-max.js @@ -0,0 +1 @@ +import{q as t,t as e,u as i,v as n,w as s,x as o,y as r,z as a,A as l,B as h,C as c,D as u,E as d,F as m,G as p,H as f,I as y,J as g,K as v,M as x,N as T,O as P,W as w,Q as S,R as E,T as D,U as A,V as b,X as k,Y as C,Z as M,k as L,_ as V,$ as R,b as j,o as B,a0 as I,a1 as O,a2 as F,a3 as U,a4 as W,a5 as z,a6 as $,a7 as N,a8 as H,a9 as K,d as G,s as Y,aa as X,ab as q,l as _,e as Z,f as J,ac as Q,a as tt,ad as et,j as it,ae as nt,af as st,ag as ot,ah as rt,ai as at,aj as lt,ak as ht,al as ct,am as ut,r as dt,an as mt,p as pt,P as ft,L as yt,S as gt,g as vt}from"./size-rollup-dom-max-assets.js";import{jsx as xt}from"react/jsx-runtime";import{useContext as Tt,useId as Pt,useEffect as wt,useCallback as St,Component as Et,Fragment as Dt}from"react";function At(t){return"object"==typeof t&&null!==t}const bt=(t,e)=>i=>e(t(i)),kt=(...t)=>t.reduce(bt),Ct=(t,e,i)=>{const n=e-t;return 0===n?1:(i-t)/n},Mt=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function Lt(e,i,n,s){if(e===i&&n===s)return t;const o=t=>function(t,e,i,n,s){let o,r,a=0;do{r=e+(i-e)/2,o=Mt(r,n,s)-t,o>0?i=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(t,0,1,e,n);return t=>0===t||1===t?t:Mt(o(t),i,s)}const Vt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Rt=t=>e=>1-t(1-e),jt=Lt(.33,1.53,.69,.99),Bt=Rt(jt),It=Vt(Bt),Ot=t=>(t*=2)<1?.5*Bt(t):.5*(2-Math.pow(2,-10*(t-1))),Ft=t=>1-Math.sin(Math.acos(t)),Ut=Rt(Ft),Wt=Vt(Ft),zt=Lt(.42,0,1,1),$t=Lt(0,0,.58,1),Nt=Lt(.42,0,.58,1),Ht={linear:t,easeIn:zt,easeInOut:Nt,easeOut:$t,circIn:Ft,circInOut:Wt,circOut:Ut,backIn:Bt,backInOut:It,backOut:jt,anticipate:Ot},Kt=t=>{if(e(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,o]=t;return Lt(e,n,s,o)}return"string"==typeof t?(i(void 0!==Ht[t],`Invalid easing type '${t}'`,"invalid-easing-type"),Ht[t]):t};function Gt(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function Yt(t,e){return i=>i>0?e:t}const Xt=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},qt=[a,s,r];function _t(t){const e=(i=t,qt.find(t=>t.test(i)));var i;if(o(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let n=e.parse(t);return e===r&&(n=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,o=0,r=0;if(e/=100){const n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=Gt(a,n,t+1/3),o=Gt(a,n,t),r=Gt(a,n,t-1/3)}else s=o=r=i;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:n}}(n)),n}const Zt=(t,e)=>{const i=_t(t),o=_t(e);if(!i||!o)return Yt(t,e);const r={...i};return t=>(r.red=Xt(i.red,o.red,t),r.green=Xt(i.green,o.green,t),r.blue=Xt(i.blue,o.blue,t),r.alpha=n(i.alpha,o.alpha,t),s.transform(r))},Jt=new Set(["none","hidden"]);function Qt(t,e){return i=>n(t,e,i)}function te(t){return"number"==typeof t?Qt:"string"==typeof t?l(t)?Yt:h.test(t)?Zt:ne:Array.isArray(t)?ee:"object"==typeof t?h.test(t)?Zt:ie:Yt}function ee(t,e){const i=[...t],n=i.length,s=t.map((t,i)=>te(t)(t,e[i]));return t=>{for(let e=0;e{for(const e in n)i[e]=n[e](t);return i}}const ne=(t,e)=>{const i=c.createTransformer(e),n=u(t),s=u(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?Jt.has(t)&&!s.values.length||Jt.has(e)&&!n.values.length?function(t,e){return Jt.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}(t,e):kt(ee(function(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>d.update(e,t),stop:()=>m(e),now:()=>p.isProcessing?p.timestamp:f.now()}},re=2e4;function ae(t){let e=0;let i=t.next(e);for(;!i.done&&e=re?1/0:e}function le(t,e,i){const n=Math.max(e-5,0);return g(i-t(n),e-n)}const he=100,ce=10,ue=1,de=0,me=800,pe=.3,fe=.3,ye={granular:.01,default:2},ge={granular:.005,default:.5},ve=.01,xe=10,Te=.05,Pe=1,we=.001;function Se({duration:t=me,bounce:e=pe,velocity:i=de,mass:n=ue}){let s,r;o(t<=v(xe),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=x(Te,Pe,a),t=x(ve,xe,y(t)),a<1?(s=e=>{const n=e*a,s=n*t,o=n-i,r=De(e,a),l=Math.exp(-s);return we-o/r*l},r=e=>{const n=e*a*t,o=n*i+i,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-n),h=De(Math.pow(e,2),a);return(-s(e)+we>0?-1:1)*((o-r)*l)/h}):(s=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,i){let n=i;for(let i=1;ivoid 0!==t[e])}function Ce(t=fe,e=pe){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const o=i.keyframes[0],r=i.keyframes[i.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:c,duration:u,velocity:d,isResolvedFromDuration:m}=function(t){let e={velocity:de,stiffness:he,damping:ce,mass:ue,isResolvedFromDuration:!1,...t};if(!ke(t,be)&&ke(t,Ae))if(t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(1.2*i),s=n*n,o=2*x(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:ue,stiffness:s,damping:o}}else{const i=Se(t);e={...e,...i,mass:ue},e.isResolvedFromDuration=!0}return e}({...i,velocity:-y(i.velocity||0)}),p=d||0,f=h/(2*Math.sqrt(l*c)),g=r-o,P=y(Math.sqrt(l/c)),w=Math.abs(g)<5;let S;if(n||(n=w?ye.granular:ye.default),s||(s=w?ge.granular:ge.default),f<1){const t=De(P,f);S=e=>{const i=Math.exp(-f*P*e);return r-i*((p+f*P*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)S=t=>r-Math.exp(-P*t)*(g+(p+P*g)*t);else{const t=P*Math.sqrt(f*f-1);S=e=>{const i=Math.exp(-f*P*e),n=Math.min(t*e,300);return r-i*((p+f*P*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}const E={calculatedDuration:m&&u||null,next:t=>{const e=S(t);if(m)a.done=t>=u;else{let i=0===t?p:0;f<1&&(i=0===t?v(p):le(S,t,e));const o=Math.abs(i)<=n,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(ae(E),re),e=T(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}function Me({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:c}){const u=t[0],d={done:!1,value:u},m=t=>void 0===a?l:void 0===l||Math.abs(a-t)-p*Math.exp(-t/n),v=t=>y+g(t),x=t=>{const e=g(t),i=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:i};let T,P;const w=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,P=Ce({keyframes:[d.value,m(d.value)],velocity:le(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:c}))};return w(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==T||(e=!0,x(t),w(t)),void 0!==T&&t>=T?P.next(t-T):(!e&&x(t),d)}}}function Le(e,n,{clamp:s=!0,ease:o,mixer:r}={}){const a=e.length;if(i(a===n.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>n[0];if(2===a&&n[0]===n[1])return()=>n[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(e,i,n){const s=[],o=n||P.mix||se,r=e.length-1;for(let n=0;n{if(l&&t1)for(;iu(x(e[0],e[a-1],t)):u}function Ve(t){const e=[0];return function(t,e){const i=t[t.length-1];for(let s=1;s<=e;s++){const o=Ct(0,e,s);t.push(n(i,1,o))}}(e,t.length-1),e}function Re({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(n)?n.map(Kt):Kt(n),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(i&&i.length===e.length?i:Ve(e),t),a=Le(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Nt).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}Ce.applyToOptions=t=>{const e=function(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(ae(n),re);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:y(s)}}(t,100,Ce);return t.ease=e.ease,t.duration=v(e.duration),t.type="keyframes",t};const je={decay:Me,inertia:Me,tween:Re,keyframes:Re,spring:Ce};function Be(t){"string"==typeof t.type&&(t.type=je[t.type])}const Ie=t=>t/100;class Oe extends w{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==f.now()&&this.tick(f.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Be(t);const{type:e=Re,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Re;a!==Re&&"number"!=typeof r[0]&&(this.mixKeyframes=kt(Ie,se(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=ae(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);const{delay:l=0,keyframes:h,repeat:c,repeatType:u,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>n;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let v=this.currentTime,T=i;if(c){const t=Math.min(this.currentTime,n)/r;let e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===u?(i=1-i,d&&(i-=d/r)):"mirror"===u&&(T=o)),v=x(0,1,i)*r}const P=g?{done:!1,value:h[0]}:T.next(v);s&&(P.value=s(P.value));let{done:w}=P;g||null===a||(w=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const E=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return E&&m!==Me&&(P.value=S(h,this.options,f,this.speed)),p&&p(P.value),E&&this.finish(),P}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=v(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(f.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=oe,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(f.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Fe={anticipate:Ot,backInOut:It,circInOut:Wt};function Ue(t){"string"==typeof t.ease&&t.ease in Fe&&(t.ease=Fe[t.ease])}class We extends E{constructor(t){Ue(t),Be(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:i,onComplete:n,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Oe({...o,autoplay:!1}),a=Math.max(10,f.now()-this.startTime),l=x(0,10,a-10);e.setWithVelocity(r.sample(Math.max(0,a-l)).value,r.sample(a).value,l),r.stop()}}const ze=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function $e(t){t.duration=0,t.type="keyframes"}const Ne=new Set(["opacity","clipPath","filter","transform"]),He=A(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Ke extends w{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:h,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=f.now();const u={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...c},d=h?.KeyframeResolver||b;this.keyframeResolver=new d(r,(t,e,i)=>this.onKeyframesResolved(t,e,u,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,i,n,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:h,isHandoff:c,onUpdate:u}=n;this.resolvedAt=f.now(),function(t,e,i,n){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],a=ze(s,e),l=ze(r,e);return o(a===l,`You are trying to animate ${e} from "${s}" to "${r}". "${a?r:s}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let i=0;i40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},m=!c&&function(t){const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:h}=e.owner.getProps();return He()&&i&&Ne.has(i)&&("transform"!==i||!h)&&!l&&!n&&"mirror"!==s&&0!==o&&"inertia"!==r}(d),p=d.motionValue?.owner?.current,y=m?new We({...d,element:p}):new Oe(d);y.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),k()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ge(t,e,i,n=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*n;return"function"==typeof i?i(o,r):1===s?o*n:a-o*n}const Ye=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xe(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=function(t){const e=Ye.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return C(t)?parseFloat(t):t}return l(o)?Xe(o,e,n+1):o}const qe={type:"spring",stiffness:500,damping:25,restSpeed:10},_e={type:"keyframes",duration:.8},Ze={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Je=(t,{keyframes:e})=>e.length>2?_e:M.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:qe:Ze,Qe=t=>null!==t;function ti(t,e){if(t?.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function ei(t,e){const i=t?.[e]??t?.default??t;return i!==t?ti(i,t):i}const ii=(t,e,i,n={},s,o)=>r=>{const a=ei(n,t)||{},l=a.delay||n.delay||0;let{elapsed:h=0}=n;h-=v(l);const c={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,Je(t,c)),c.duration&&(c.duration=v(c.duration)),c.repeatDelay&&(c.repeatDelay=v(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let u=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&($e(c),0===c.delay&&(u=!0)),(P.instantAnimations||P.skipAnimations||s?.shouldSkipAnimations)&&(u=!0,$e(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,u&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(Qe),o=e&&"loop"!==i&&e%2==1?0:s.length-1;return o&&void 0!==n?n:s[o]}(c.keyframes,a);if(void 0!==t)return void d.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new Oe(c):new Ke(c)};function ni(t,e,i){const n=t.getProps();return L(n,e,void 0!==i?i:n.custom,t)}const si=new Set(["width","height","top","left","right","bottom",...V]),oi=t=>Array.isArray(t);function ri(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,R(i))}function ai(t){return oi(t)?t[t.length-1]||0:t}function li(t,e){const i=t.getValue("willChange");if(n=i,Boolean(j(n)&&n.add))return i.add(e);if(!i&&P.WillChange){const i=new P.WillChange("auto");t.addValue("willChange",i),i.add(e)}var n}function hi(t){return t.props[B]}function ci({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}function ui(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?ti(o,l):l;const h=o?.reduceMotion;n&&(o=n);const c=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||u&&ci(u,e))continue;const r={delay:i,...ei(o||{},e)},l=n.get();if(void 0!==l&&!n.isAnimating&&!Array.isArray(s)&&s===l&&!r.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const i=hi(t);if(i){const t=window.MotionHandoffAnimation(i,e,d);null!==t&&(r.startTime=t,m=!0)}}li(t,e);const p=h??t.shouldReduceMotion;n.start(ii(e,n,s,p&&si.has(e)?{type:!1}:r,t,m));const f=n.animation;f&&c.push(f)}if(r){const e=()=>d.update(()=>{r&&function(t,e){const i=ni(t,e);let{transitionEnd:n={},transition:s={},...o}=i||{};o={...o,...n};for(const e in o)ri(t,e,ai(o[e]))}(t,r)});c.length?Promise.all(c).then(e):e()}return c}function di(t,e,i={}){const n=ni(t,e,"exit"===i.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const o=n?()=>Promise.all(ui(t,n,i)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(di(l,e,{...r,delay:i+("function"==typeof n?0:n)+Ge(t.variantChildren,l,n,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,n,o,r,a,i)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(i.delay)])}function mi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||I(t))}const pi=new Set(["auto","none","0"]);class fi extends b{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}function yi(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}const gi={x:!1,y:!1};function vi(){return gi.x||gi.y}function xi(t,e){const i=yi(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function Ti(t,e,i={}){const[n,s,o]=xi(t,i);return n.forEach(t=>{let i,n=!1,o=!1;const r=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},a=t=>{n=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(n?o=!0:r(t))};t.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||vi())return;o=!1;const r=e(t,n);"function"==typeof r&&(i=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Pi=(t,e)=>!!e&&(t===e||Pi(t,e.parentElement)),wi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Si=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Ei=new Set(["INPUT","SELECT","TEXTAREA"]);const Di=new WeakSet;function Ai(t){return e=>{"Enter"===e.key&&t(e)}}function bi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ki(t){return wi(t)&&!vi()}const Ci=new WeakSet;function Mi(t,e,i={}){const[n,s,o]=xi(t,i),r=t=>{const n=t.currentTarget;if(!ki(t))return;if(Ci.has(t))return;Di.add(n),i.stopPropagation&&Ci.add(t);const o=e(n,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Di.has(n)&&Di.delete(n),ki(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,n===window||n===document||i.useGlobalTarget||Pi(n,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{var e;(i.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),At(e=t)&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const i=t.currentTarget;if(!i)return;const n=Ai(()=>{if(Di.has(i))return;bi(i,"down");const t=Ai(()=>{bi(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>bi(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),function(t){return Si.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Li(t){return At(t)&&"ownerSVGElement"in t}const Vi=new WeakMap;let Ri;const ji=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:Li(n)&&"getBBox"in n?n.getBBox()[e]:n[i],Bi=ji("inline","width","offsetWidth"),Ii=ji("block","height","offsetHeight");function Oi({target:t,borderBoxSize:e}){Vi.get(t)?.forEach(i=>{i(t,{get width(){return Bi(t,e)},get height(){return Ii(t,e)}})})}function Fi(t){t.forEach(Oi)}function Ui(t,e){Ri||"undefined"!=typeof ResizeObserver&&(Ri=new ResizeObserver(Fi));const i=yi(t);return i.forEach(t=>{let i=Vi.get(t);i||(i=new Set,Vi.set(t,i)),i.add(e),Ri?.observe(t)}),()=>{i.forEach(t=>{const i=Vi.get(t);i?.delete(e),i?.size||Ri?.unobserve(t)})}}const Wi=new Set;let zi;function $i(t){return Wi.add(t),zi||(zi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wi.forEach(e=>e(t))},window.addEventListener("resize",zi)),()=>{Wi.delete(t),Wi.size||"function"!=typeof zi||(window.removeEventListener("resize",zi),zi=void 0)}}function Ni(t,e){return"function"==typeof t?$i(t):Ui(t,e)}class Hi extends ${constructor(){super(...arguments),this.KeyframeResolver=fi}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;j(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Ki{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Gi({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function Yi(t){return void 0===t||1===t}function Xi({scale:t,scaleX:e,scaleY:i}){return!Yi(t)||!Yi(e)||!Yi(i)}function qi(t){return Xi(t)||_i(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function _i(t){return Zi(t.x)||Zi(t.y)}function Zi(t){return t&&"0%"!==t}function Ji(t,e,i){return i+e*(t-i)}function Qi(t,e,i,n,s){return void 0!==s&&(t=Ji(t,s,n)),Ji(t,i,n)+e}function tn(t,e=0,i=1,n,s){t.min=Qi(t.min,e,i,n,s),t.max=Qi(t.max,e,i,n,s)}function en(t,{x:e,y:i}){tn(t.x,e.translate,e.scale,e.originPoint),tn(t.y,i.translate,i.scale,i.originPoint)}const nn=.999999999999,sn=1.0000000000001;function on(t,e){t.min=t.min+e,t.max=t.max+e}function rn(t,e,i,s,o=.5){tn(t,e,i,n(t.min,t.max,o),s)}function an(t,e){rn(t.x,e.x,e.scaleX,e.scale,e.originX),rn(t.y,e.y,e.scaleY,e.scale,e.originY)}function ln(t,e){return Gi(function(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}function hn(t,{style:e,vars:i},n,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,n),i)o.setProperty(r,i[r])}class cn extends Hi{constructor(){super(...arguments),this.type="html",this.renderInstance=hn}readValueFromInstance(t,e){if(M.has(e))return this.projection?.isProjecting?N(e):H(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(K(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}var i}measureInstanceViewportBox(t,{transformPagePoint:e}){return ln(t,e)}build(t,e,i){G(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return Y(t,e,i)}}const un=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class dn extends Hi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=q}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(M.has(e)){const t=Q(e);return t&&t.default||0}return e=un.has(e)?e:X(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return _(t,e,i)}build(t,e,i){Z(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){hn(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(un.has(i)?i:X(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=J(t.tagName),super.mount(t)}}const mn=et.length;function pn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&pn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let i=0;iPromise.all(e.map(({animation:e,options:i})=>function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>di(t,e,i));n=Promise.all(s)}else if("string"==typeof e)n=di(t,e,i);else{const s="function"==typeof e?ni(t,e,i.custom):e;n=Promise.all(ui(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}(t,e,i)))}function xn(t){let e=vn(t),i=wn(),n=!0;const s=e=>(i,n)=>{const s=ni(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function o(o){const{props:r}=t,a=pn(t.parent)||{},l=[],h=new Set;let c={},u=1/0;for(let e=0;eu&&f,T=!1;const P=Array.isArray(p)?p:[p];let w=P.reduce(s(d),{});!1===y&&(w={});const{prevResolvedValues:S={}}=m,E={...S,...w},D=e=>{x=!0,h.has(e)&&(T=!0,h.delete(e)),m.needsAnimating[e]=!0;const i=t.getValue(e);i&&(i.liveStyle=!1)};for(const t in E){const e=w[t],i=S[t];if(c.hasOwnProperty(t))continue;let n=!1;n=oi(e)&&oi(i)?!fn(e,i):e!==i,n?null!=e?D(t):h.add(t):void 0!==e&&h.has(t)?D(t):m.protectedKeys[t]=!0}m.prevProp=p,m.prevResolvedValues=w,m.isActive&&(c={...c,...w}),n&&t.blockInitialAnimation&&(x=!1);const A=g&&v;x&&(!A||T)&&l.push(...P.map(e=>{const i={type:d};if("string"==typeof e&&n&&!A&&t.manuallyAnimateOnMount&&t.parent){const{parent:n}=t,s=ni(n,e);if(n.enteringChildren&&s){const{delayChildren:e}=s.transition||{};i.delay=Ge(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(h.size){const e={};if("boolean"!=typeof r.initial){const i=ni(t,Array.isArray(r.initial)?r.initial[0]:r.initial);i&&i.transition&&(e.transition=i.transition)}h.forEach(i=>{const n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),l.push({animation:e})}let d=Boolean(l.length);return!n||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),n=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;const s=o(e);for(const t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=wn()}}}function Tn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fn(e,t)}function Pn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wn(){return{animate:Pn(!0),whileInView:Pn(),whileHover:Pn(),whileTap:Pn(),whileDrag:Pn(),whileFocus:Pn(),exit:Pn()}}function Sn(t,e){t.min=e.min,t.max=e.max}function En(t,e){Sn(t.x,e.x),Sn(t.y,e.y)}function Dn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function An(t){return t.max-t.min}function bn(t,e,i,s=.5){t.origin=s,t.originPoint=n(e.min,e.max,t.origin),t.scale=An(i)/An(e),t.translate=n(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function kn(t,e,i,n){bn(t.x,e.x,i.x,n?n.originX:void 0),bn(t.y,e.y,i.y,n?n.originY:void 0)}function Cn(t,e,i){t.min=i.min+e.min,t.max=t.min+An(e)}function Mn(t,e,i){t.min=e.min-i.min,t.max=t.min+An(e)}function Ln(t,e,i){Mn(t.x,e.x,i.x),Mn(t.y,e.y,i.y)}function Vn(t,e,i,n,s){return t=Ji(t-=e,1/i,n),void 0!==s&&(t=Ji(t,1/s,n)),t}function Rn(t,e,[i,s,o],r,a){!function(t,e=0,i=1,s=.5,o,r=t,a=t){st.test(e)&&(e=parseFloat(e),e=n(a.min,a.max,e/100)-a.min);if("number"!=typeof e)return;let l=n(r.min,r.max,s);t===r&&(l-=e),t.min=Vn(t.min,e,i,l,o),t.max=Vn(t.max,e,i,l,o)}(t,e[i],e[s],e[o],e.scale,r,a)}const jn=["x","scaleX","originX"],Bn=["y","scaleY","originY"];function In(t,e,i,n){Rn(t.x,e,jn,i?i.x:void 0,n?n.x:void 0),Rn(t.y,e,Bn,i?i.y:void 0,n?n.y:void 0)}function On(t){return 0===t.translate&&1===t.scale}function Fn(t){return On(t.x)&&On(t.y)}function Un(t,e){return t.min===e.min&&t.max===e.max}function Wn(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function zn(t,e){return Wn(t.x,e.x)&&Wn(t.y,e.y)}function $n(t){return An(t.x)/An(t.y)}function Nn(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Hn(t){return[t("x"),t("y")]}const Kn=["TopLeft","TopRight","BottomLeft","BottomRight"],Gn=Kn.length,Yn=t=>"string"==typeof t?parseFloat(t):t,Xn=t=>"number"==typeof t||ot.test(t);function qn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const _n=Jn(0,.5,Ut),Zn=Jn(.5,.95,t);function Jn(t,e,i){return n=>ne?1:i(Ct(t,e,n))}function Qn(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}const ts=(t,e)=>t.depth-e.depth;class es{constructor(){this.children=[],this.isDirty=!1}add(t){rt(this.children,t),this.isDirty=!0}remove(t){at(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ts),this.isDirty=!1,this.children.forEach(t)}}class is{constructor(){this.members=[]}add(t){rt(this.members,t);for(let e=this.members.length-1;e>=0;e--){const i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;const n=i.instance;n&&!1===n.isConnected&&!1!==i.isPresent&&!i.snapshot&&at(this.members,i)}t.scheduleRender()}remove(t){if(at(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let i;for(let t=e;t>=0;t--){const e=this.members[t],n=e.instance;if(!1!==e.isPresent&&(!n||!1!==n.isConnected)){i=e;break}}return!!i&&(this.promote(i),!0)}promote(t,e){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender();const n=i.options.layoutDependency,s=t.options.layoutDependency;if(!(void 0!==n&&void 0!==s&&n===s)){const n=i.instance;n&&!1===n.isConnected&&!i.snapshot||(t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:o}=t.options;!1===o&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const ns={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ss=["","X","Y","Z"];let os=0;function rs(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function as(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=hi(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:e,layoutId:n}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",d,!(e||n))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&as(n)}function ls({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(t={},i=e?.()){this.id=os++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(us),this.nodes.forEach(vs),this.nodes.forEach(xs),this.nodes.forEach(ds)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;d.read(()=>{n=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==n&&(n=t,this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){const i=f.now(),n=({timestamp:s})=>{const o=s-i;o>=e&&(m(n),t(o-e))};return d.setup(n,!0),()=>m(n)}(s,250),ns.hasAnimatedSinceResize&&(ns.hasAnimatedSinceResize=!1,this.nodes.forEach(gs)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||Ds,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!zn(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...ei(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h)}else e||gs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),m(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ts),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&as(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||An(this.snapshot.measuredBox.x)||An(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;tnn&&(e.x=1),e.ynn&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=q());const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Dn(this.prevProjectionDelta.x,this.projectionDelta.x),Dn(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),kn(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Nn(this.projectionDelta.x,this.prevProjectionDelta.x)&&Nn(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ut(),this.projectionDelta=ut(),this.projectionDeltaWithTransform=ut()}setAnimationOrigin(t,e=!1){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r=ut();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a=q(),l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),c=!h||h.members.length<=1,u=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(Es));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const i=e/1e3;var h,m,p,f,y,g;ws(r.x,t.x,i),ws(r.y,t.y,i),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ln(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,f=this.relativeTargetOrigin,y=a,g=i,Ss(p.x,f.x,y.x,g),Ss(p.y,f.y,y.y,g),d&&(h=this.relativeTarget,m=d,Un(h.x,m.x)&&Un(h.y,m.y))&&(this.isProjectionDirty=!1),d||(d=q()),En(d,this.relativeTarget)),l&&(this.animationValues=o,function(t,e,i,s,o,r){o?(t.opacity=n(0,i.opacity??1,_n(s)),t.opacityExit=n(e.opacity??1,0,Zn(s))):r&&(t.opacity=n(e.opacity??1,i.opacity??1,s));for(let o=0;o{ns.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=R(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,i){const n=j(t)?t:R(t);return n.start(ii("",n,e,i)),n.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&Cs(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||q();const e=An(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;const n=An(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}En(e,i),an(e,s),kn(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new is);this.sharedNodes.get(t).add(e);const i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){const n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;const n={};i.z&&rs("z",t,n,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(ps),this.root.sharedNodes.clear()}}}function hs(t){t.updateLayout()}function cs(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?Hn(t=>{const n=o?e.measuredBox[t]:e.layoutBox[t],s=An(n);n.min=i[t].min,n.max=n.min+s}):Cs(s,e.layoutBox,i)&&Hn(n=>{const s=o?e.measuredBox[n]:e.layoutBox[n],r=An(i[n]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+r)});const r=ut();kn(r,i,e.layoutBox);const a=ut();o?kn(a,t.applyTransform(n,!0),e.measuredBox):kn(a,i,e.layoutBox);const l=!Fn(r);let h=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:s,layout:o}=n;if(s&&o){const r=q();Ln(r,e.layoutBox,s.layoutBox);const a=q();Ln(a,i,o.layoutBox),zn(r,a)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function us(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ds(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ms(t){t.clearSnapshot()}function ps(t){t.clearMeasurements()}function fs(t){t.isLayoutDirty=!1}function ys(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function gs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function vs(t){t.resolveTargetDelta()}function xs(t){t.calcProjection()}function Ts(t){t.resetSkewAndRotation()}function Ps(t){t.removeLeadSnapshot()}function ws(t,e,i){t.translate=n(e.translate,0,i),t.scale=n(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function Ss(t,e,i,s){t.min=n(e.min,i.min,s),t.max=n(e.max,i.max,s)}function Es(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Ds={duration:.45,ease:[.4,0,.1,1]},As=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),bs=As("applewebkit/")&&!As("chrome/")?Math.round:t;function ks(t){t.min=bs(t.min),t.max=bs(t.max)}function Cs(t,e,i){return"position"===t||"preserve-aspect"===t&&(n=$n(e),s=$n(i),o=.2,!(Math.abs(n-s)<=o));var n,s,o}function Ms(t){return t!==t.root&&t.scroll?.wasRoot}const Ls=ls({attachResizeListener:(t,e)=>Qn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Vs={current:void 0},Rs=ls({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Vs.current){const t=new Ls({});t.mount(window),t.setOptions({layoutScroll:!0}),Vs.current=t}return Vs.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function js(t){return{point:{x:t.pageX,y:t.pageY}}}function Bs(t,e,i,n){return Qn(t,e,(t=>e=>wi(e)&&t(e,js(e)))(i),n)}const Is=({current:t})=>t?t.ownerDocument.defaultView:null,Os=(t,e)=>Math.abs(t-e);const Fs=new Set(["auto","scroll"]);class Us{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=$s(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){const i=Os(t.x,e.x),n=Os(t.y,e.y);return Math.sqrt(i**2+n**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!i)return;const{point:n}=t,{timestamp:s}=p;this.history.push({...n,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Ws(e,this.transformPagePoint),d.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=$s("pointercancel"===t.type?this.lastMoveEventInfo:Ws(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,o),n&&n(t,o)},!wi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=o,this.contextWindow=n||window;const a=Ws(js(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=p;this.history=[{...l,timestamp:h}];const{onSessionStart:c}=e;c&&c(t,$s(a,this.history)),this.removeListeners=kt(Bs(this.contextWindow,"pointermove",this.handlePointerMove),Bs(this.contextWindow,"pointerup",this.handlePointerUp),Bs(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Fs.has(t.overflowX)||Fs.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const i=t===window,n=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=n.x-e.x,o=n.y-e.y;0===s&&0===o||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,n),d.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),m(this.updatePoint)}}function Ws(t,e){return e?{point:e(t.point)}:t}function zs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function $s({point:t},e){return{point:t,delta:zs(t,Hs(e)),offset:zs(t,Ns(e)),velocity:Ks(e,.1)}}function Ns(t){return t[0]}function Hs(t){return t[t.length-1]}function Ks(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=Hs(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>v(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>2*v(e)&&(n=t[1]);const o=y(s.timestamp-n.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-n.x)/o,y:(s.y-n.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Gs(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function Ys(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(js(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=i)||"y"===o?gi[o]?null:(gi[o]=!0,()=>{gi[o]=!1}):gi.x||gi.y?null:(gi.x=gi.y=!0,()=>{gi.x=gi.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Hn(t=>{let e=this.getAxisMotionValue(t).get()||0;if(st.test(e)){const{projection:i}=this.visualElement;if(i&&i.layout){const n=i.layout.layoutBox[t];if(n){e=An(n)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&d.update(()=>s(t,e),!1,!0),li(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=e;if(n&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let i=null;Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x");return i}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&d.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:i,contextWindow:Is(this.visualElement),element:this.visualElement.current})}stop(t,e){const i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&d.postRender(()=>r(i,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){const{drag:s}=this.getProps();if(!i||!to(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&ti&&(t=s?n(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&pt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&function(t,{top:e,left:i,bottom:n,right:s}){return{x:Gs(t.x,i,s),y:Gs(t.y,e,n)}}(i.layoutBox,t),this.elastic=function(t=Xs){return!1===t?t=0:!0===t&&(t=Xs),{x:qs(t,"left","right"),y:qs(t,"top","bottom")}}(e),n!==this.constraints&&!pt(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Hn(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!pt(t))return!1;const n=t.current;i(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=function(t,e,i){const n=ln(t,i),{scroll:s}=e;return s&&(on(n.x,s.offset.x),on(n.y,s.offset.y)),n}(n,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Ys(t.x,e.x),y:Ys(t.y,e.y)}}(s.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=Gi(t))}return r}startAnimation(t){const{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Hn(r=>{if(!to(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=n?200:1e6,c=n?40:1e7,u={type:"inertia",velocity:i?t[r]:0,bounceStiffness:h,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,u)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const i=this.getAxisMotionValue(t);return li(this.visualElement,t),i.start(ii(t,i,0,e,this.visualElement,!1))}stopAnimation(){Hn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),n=i[e];return n||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Hn(e=>{const{drag:i}=this.getProps();if(!to(e,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(e);if(s&&s.layout){const{min:i,max:r}=s.layout.layoutBox[e],a=o.get()||0;o.set(t[e]-n(i,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!pt(e)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Hn(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const i=e.get();s[t]=function(t,e){let i=.5;const n=An(t),s=An(e);return s>n?i=Ct(e.min,e.max-n,t.min):n>s&&(i=Ct(t.min,t.max-s,e.min)),x(0,1,i)}({min:i,max:i},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Hn(e=>{if(!to(e,t,null))return;const i=this.getAxisMotionValue(e),{min:o,max:r}=this.constraints[e];i.set(n(o,r,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Zs.set(this.visualElement,this);const t=this.visualElement.current,e=Bs(t,"pointerdown",e=>{const{drag:i,dragListener:n=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Ei.has(t.tagName)||!0===t.isContentEditable}(s);i&&n&&!o&&this.start(e)});let i;const n=()=>{const{dragConstraints:e}=this.getProps();pt(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),i||(i=function(t,e,i){const n=Ni(t,Qs(i)),s=Ni(e,Qs(i));return()=>{n(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),d.read(n);const r=Qn(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Hn(e=>{const i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:o=Xs,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Qs(t){let e=!0;return()=>{e?e=!1:t()}}function to(t,e,i){return!(!0!==e&&e!==t||null!==i&&i!==t)}const eo=t=>(e,i)=>{t&&d.update(()=>t(e,i),!1,!0)};let io=!1;class no extends Et{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),io&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ns.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:o}=i;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),io=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||d.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ct.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;io=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function so(t){const[e,i]=function(t=!0){const e=Tt(ft);if(null===e)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,o=Pt();wt(()=>{if(t)return s(o)},[t]);const r=St(()=>t&&n&&n(o),[o,n,t]);return!i&&n?[!1,r]:[!0]}(),n=Tt(yt);return xt(no,{...t,layoutGroup:n,switchLayoutGroup:Tt(gt),isPresent:e,safeToRemove:i})}const oo={pan:{Feature:class extends Ki{constructor(){super(...arguments),this.removePointerDownListener=t}onPointerDown(t){this.session=new Us(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Is(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:eo(t),onStart:eo(e),onMove:eo(i),onEnd:(t,e)=>{delete this.session,n&&d.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=Bs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Ki{constructor(e){super(e),this.removeGroupControls=t,this.removeListeners=t,this.controls=new Js(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||t}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Rs,MeasureLayout:so}},ro={layout:{ProjectionNode:Rs,MeasureLayout:so}};let ao=0;const lo={animation:{Feature:class extends Ki{constructor(t){super(t),t.animationState||(t.animationState=xn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();it(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends Ki{constructor(){super(...arguments),this.id=ao++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function ho(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);const s=n["onHover"+i];s&&d.postRender(()=>s(e,js(e)))}function co(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);const s=n["onTap"+("End"===i?"":i)];s&&d.postRender(()=>s(e,js(e)))}const uo=new WeakMap,mo=new WeakMap,po=t=>{const e=uo.get(t.target);e&&e(t)},fo=t=>{t.forEach(po)};function yo(t,e,i){const n=function({root:t,...e}){const i=t||document;mo.has(i)||mo.set(i,{});const n=mo.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(fo,{root:t,...e})),n[s]}(e);return uo.set(t,i),n.observe(t),()=>{uo.delete(t),n.unobserve(t)}}const go={some:0,all:1};const vo={renderer:(t,e)=>e.isSVG??vt(t)?new dn(e):new cn(e,{allowProjection:t!==Dt}),...lo,...{inView:{Feature:class extends Ki{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:go[n]};return yo(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),o=e?i:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Ki{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=Mi(t,(t,e)=>(co(this.node,e,"Start"),(t,{success:e})=>co(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===i?.tap})}unmount(){}}},focus:{Feature:class extends Ki{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=kt(Qn(this.node.current,"focus",()=>this.onFocus()),Qn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Ki{mount(){const{current:t}=this.node;t&&(this.unmount=Ti(t,(t,e)=>(ho(this.node,e,"Start"),t=>ho(this.node,t,"End"))))}unmount(){}}}}},xo={...vo,...oo,...ro};export{xo as domMax}; diff --git a/node_modules/framer-motion/dist/size-rollup-m.js b/node_modules/framer-motion/dist/size-rollup-m.js new file mode 100644 index 00000000..c8e94b05 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-m.js @@ -0,0 +1,2 @@ +import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as e,useMemo as o,Fragment as a,createElement as s,useRef as i,useInsertionEffect as l,useCallback as c,useLayoutEffect as u,useEffect as f,forwardRef as d}from"react";const p=(t,n,r)=>r>n?n:rt,isStatic:!1,reducedMotion:"never"}),y=r({}),v=(t=>n=>"string"==typeof n&&n.startsWith(t))("--"),b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},w={...b,transform:t=>p(0,1,t)},S={...b,default:1},x=t=>Math.round(1e5*t)/1e5,k=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const B=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,R=(t,n)=>r=>Boolean("string"==typeof r&&B.test(r)&&r.startsWith(t)||n&&!function(t){return null==t}(r)&&Object.prototype.hasOwnProperty.call(r,n)),T=(t,n,r)=>e=>{if("string"!=typeof e)return e;const[o,a,s,i]=e.match(k);return{[t]:parseFloat(o),[n]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==i?parseFloat(i):1}},I={...b,transform:t=>Math.round((t=>p(0,255,t))(t))},M={test:R("rgb","red"),parse:T("red","green","blue"),transform:({red:t,green:n,blue:r,alpha:e=1})=>"rgba("+I.transform(t)+", "+I.transform(n)+", "+I.transform(r)+", "+x(w.transform(e))+")"};const O={test:R("#"),parse:function(t){let n="",r="",e="",o="";return t.length>5?(n=t.substring(1,3),r=t.substring(3,5),e=t.substring(5,7),o=t.substring(7,9)):(n=t.substring(1,2),r=t.substring(2,3),e=t.substring(3,4),o=t.substring(4,5),n+=n,r+=r,e+=e,o+=o),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:M.transform},P=t=>({test:n=>"string"==typeof n&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),A=P("deg"),E=P("%"),W=P("px"),L=(()=>({...E,parse:t=>E.parse(t)/100,transform:t=>E.transform(100*t)}))(),C={test:R("hsl","hue"),parse:T("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:r,alpha:e=1})=>"hsla("+Math.round(t)+", "+E.transform(x(n))+", "+E.transform(x(r))+", "+x(w.transform(e))+")"},j={test:t=>M.test(t)||O.test(t)||C.test(t),parse:t=>M.test(t)?M.parse(t):C.test(t)?C.parse(t):O.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?M.transform(t):C.transform(t),getAnimatableNone:t=>{const n=j.parse(t);return n.alpha=0,j.transform(n)}},V=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",F="color",X=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y(t){const n=t.toString(),r=[],e={color:[],number:[],var:[]},o=[];let a=0;const s=n.replace(X,t=>(j.test(t)?(e.color.push(a),o.push(F),r.push(j.parse(t))):t.startsWith("var(")?(e.var.push(a),o.push("var"),r.push(t)):(e.number.push(a),o.push($),r.push(parseFloat(t))),++a,"${}")).split("${}");return{values:r,split:s,indexes:e,types:o}}function D(t){return Y(t).values}function H(t){const{split:n,types:r}=Y(t),e=n.length;return t=>{let o="";for(let a=0;a"number"==typeof t?0:j.test(t)?j.getAnimatableNone(t):t;const Z={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(k)?.length||0)+(t.match(V)?.length||0)>0},parse:D,createTransformer:H,getAnimatableNone:function(t){const n=D(t);return H(t)(n.map(N))}},z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],U=(()=>new Set(z))();function q(t,n,r,e){if("function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}if("string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}return n}const _=t=>Boolean(t&&t.getVelocity);const G="data-"+"framerAppearId".replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`);const J={...b,transform:Math.round},K={borderWidth:W,borderTopWidth:W,borderRightWidth:W,borderBottomWidth:W,borderLeftWidth:W,borderRadius:W,borderTopLeftRadius:W,borderTopRightRadius:W,borderBottomRightRadius:W,borderBottomLeftRadius:W,width:W,maxWidth:W,height:W,maxHeight:W,top:W,right:W,bottom:W,left:W,inset:W,insetBlock:W,insetBlockStart:W,insetBlockEnd:W,insetInline:W,insetInlineStart:W,insetInlineEnd:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,paddingBlock:W,paddingBlockStart:W,paddingBlockEnd:W,paddingInline:W,paddingInlineStart:W,paddingInlineEnd:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,marginBlock:W,marginBlockStart:W,marginBlockEnd:W,marginInline:W,marginInlineStart:W,marginInlineEnd:W,fontSize:W,backgroundPositionX:W,backgroundPositionY:W,...{rotate:A,rotateX:A,rotateY:A,rotateZ:A,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:A,skewX:A,skewY:A,distance:W,translateX:W,translateY:W,translateZ:W,x:W,y:W,z:W,perspective:W,transformPerspective:W,opacity:w,originX:L,originY:L,originZ:W},zIndex:J,fillOpacity:w,strokeOpacity:w,numOctaves:J},Q=(t,n)=>n&&"number"==typeof t?n.transform(t):t;function tt(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function nt(t){return"string"==typeof t||Array.isArray(t)}const rt=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function et(t){return tt(t.animate)||rt.some(n=>nt(t[n]))}let ot={};const at={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},st=z.length;function it(t,n,r){const{style:e,vars:o,transformOrigin:a}=t;let s=!1,i=!1;for(const t in n){const r=n[t];if(U.has(t))s=!0;else if(v(t))o[t]=r;else{const n=Q(r,K[t]);t.startsWith("origin")?(i=!0,a[t]=n):e[t]=n}}if(n.transform||(s||r?e.transform=function(t,n,r){let e="",o=!0;for(let a=0;a{if(!n.target)return t;if("string"==typeof t){if(!W.test(t))return t;t=parseFloat(t)}return`${lt(t,n.target.x)}% ${lt(t,n.target.y)}%`}},ut={correct:(t,{treeScale:n,projectionDelta:r})=>{const e=t,o=Z.parse(t);if(o.length>5)return e;const a=Z.createTransformer(t),s="number"!=typeof o[0]?1:0,i=r.x.scale*n.x,l=r.y.scale*n.y;o[0+s]/=i,o[1+s]/=l;const c=(u=i)+(l-u)*.5;var u;return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),a(o)}},ft={borderRadius:{...ct,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomLeftRadius:ct,borderBottomRightRadius:ct,boxShadow:ut};function dt(t,{layout:n,layoutId:r}){return U.has(t)||t.startsWith("origin")||(n||void 0!==r)&&(!!ft[t]||"opacity"===t)}function pt(t,n,r){const e=t.style,o=n?.style,a={};if(!e)return a;for(const n in e)(_(e[n])||o&&_(o[n])||dt(n,t)||void 0!==r?.getValue(n)?.liveStyle)&&(a[n]=e[n]);return a}const mt={offset:"stroke-dashoffset",array:"stroke-dasharray"},gt={offset:"strokeDashoffset",array:"strokeDasharray"};const ht=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function yt(t,{attrX:n,attrY:r,attrScale:e,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...i},l,c,u){if(it(t,i,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox);for(const t of ht)void 0!==f[t]&&(d[t]=f[t],delete f[t]);void 0!==n&&(f.x=n),void 0!==r&&(f.y=r),void 0!==e&&(f.scale=e),void 0!==o&&function(t,n,r=1,e=0,o=!0){t.pathLength=1;const a=o?mt:gt;t[a.offset]=""+-e,t[a.array]=`${n} ${r}`}(f,o,a,s,!1)}function vt(t){return _(t)?t.get():t}function bt(t){const{initial:n,animate:r}=function(t,n){if(et(t)){const{initial:n,animate:r}=t;return{initial:!1===n||nt(n)?n:void 0,animate:nt(r)?r:void 0}}return!1!==t.inherit?n:{}}(t,e(y));return o(()=>({initial:n,animate:r}),[wt(n),wt(r)])}function wt(t){return Array.isArray(t)?t.join(" "):t}const St=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function xt(t,n,r){for(const e in n)_(n[e])||dt(e,r)||(t[e]=n[e])}function kt(t,n){const r={};return xt(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n){return o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return it(r,n,t),Object.assign({},r.vars,r.style)},[n])}(t,n)),r}function Bt(t,n){const r={},e=kt(t,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=e,r}const Rt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Tt(t,n,r,e){const a=o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};var o;return yt(r,n,"string"==typeof(o=e)&&"svg"===o.toLowerCase(),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[n]);if(t.style){const n={};xt(n,t.style,t),a.style={...n,...a.style}}return a}const It=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Mt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||It.has(t)}let Ot=t=>!Mt(t);try{"function"==typeof(Pt=require("@emotion/is-prop-valid").default)&&(Ot=t=>t.startsWith("on")?!Mt(t):Pt(t))}catch{}var Pt;const At=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Et(t){return"string"==typeof t&&!t.includes("-")&&!!(At.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wt(t,n,r,{latestValues:e},i,l=!1,c){const u=(c??Et(t)?Tt:Bt)(n,e,i,t),f=function(t,n,r){const e={};for(const o in t)"values"===o&&"object"==typeof t.values||(Ot(o)||!0===r&&Mt(o)||!n&&!Mt(o)||t.draggable&&o.startsWith("onDrag"))&&(e[o]=t[o]);return e}(n,"string"==typeof t,l),d=t!==a?{...f,...u,ref:r}:{},{children:p}=n,m=o(()=>_(p)?p.get():p,[p]);return s(t,{...d,children:m})}const Lt=r(null);function Ct(t,n,r,e){const o={},a=e(t,{});for(const t in a)o[t]=vt(a[t]);let{initial:s,animate:i}=t;const l=et(t),c=function(t){return Boolean(et(t)||t.variants)}(t);n&&c&&!l&&!1!==t.inherit&&(void 0===s&&(s=n.initial),void 0===i&&(i=n.animate));let u=!!r&&!1===r.initial;u=u||!1===s;const f=u?i:s;if(f&&"boolean"!=typeof f&&!tt(f)){const n=Array.isArray(f)?f:[f];for(let r=0;r(n,r)=>{const o=e(y),a=e(Lt),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},r,e,o){return{latestValues:Ct(r,e,o,t),renderState:n()}}(t,n,o,a);return r?s():function(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}(s)},Vt=jt({scrapeMotionValuesFromProps:pt,createRenderState:St}),$t=jt({scrapeMotionValuesFromProps:function(t,n,r){const e=pt(t,n,r);for(const r in t)if(_(t[r])||_(n[r])){e[-1!==z.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return e},createRenderState:Rt}),Ft="undefined"!=typeof window,Xt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Yt=!1;function Dt(){if(Yt)return;const t={};for(const n in Xt)t[n]={isEnabled:t=>Xt[n].some(n=>!!t[n])};ot=t,Yt=!0}function Ht(){return Dt(),ot}const Nt=Symbol.for("motionComponentSymbol");function Zt(t,n,r){const e=i(r);l(()=>{e.current=r});const o=i(null);return c(r=>{r&&t.onMount?.(r),n&&(r?n.mount(r):n.unmount());const a=e.current;if("function"==typeof a)if(r){const t=a(r);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):a(r);else a&&(a.current=r)},[n])}const zt=r({});function Ut(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const qt=Ft?u:f;function _t(t,n,r,o,a,s){const{visualElement:c}=e(y),u=e(g),d=e(Lt),p=e(h),m=p.reducedMotion,v=p.skipAnimations,b=i(null),w=i(!1);o=o||u.renderer,!b.current&&o&&(b.current=o(t,{visualState:n,parent:c,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:v,isSVG:s}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,x=e(zt);!S||S.projection||!a||"html"!==S.type&&"svg"!==S.type||function(t,n,r,e){const{layoutId:o,layout:a,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=n;t.projection=new r(t.latestValues,n["data-framer-portal-id"]?void 0:Gt(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(s)||i&&Ut(i),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:u,layoutScroll:l,layoutRoot:c})}(b.current,r,a,x);const k=i(!1);l(()=>{S&&k.current&&S.update(r,d)});const B=r[G],R=i(Boolean(B)&&!window.MotionHandoffIsComplete?.(B)&&window.MotionHasOptimisedAnimation?.(B));return qt(()=>{w.current=!0,S&&(k.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),R.current&&S.animationState&&S.animationState.animateChanges())}),f(()=>{S&&(!R.current&&S.animationState&&S.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(B)}),R.current=!1),S.enteringChildren=void 0)}),S}function Gt(t){if(t)return!1!==t.options.allowProjection?t.projection:Gt(t.parent)}function Jt(r,{forwardMotionProps:o=!1,type:a}={},s,i){const l=a?"svg"===a:Et(r),c=l?$t:Vt;function u(a,s){let u;const f={...e(h),...a,layoutId:Kt(a)},{isStatic:d}=f,p=bt(a),m=c(a,d);if(!d&&Ft){e(g).strict;const t=function(t){const n=Ht(),{drag:r,layout:e}=n;if(!r&&!e)return{};const o={...r,...e};return{MeasureLayout:r?.isEnabled(t)||e?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(f);u=t.MeasureLayout,p.visualElement=_t(r,m,f,i,t.ProjectionNode,l)}return t(y.Provider,{value:p,children:[u&&p.visualElement?n(u,{visualElement:p.visualElement,...f}):null,Wt(r,a,Zt(m,p.visualElement,s),m,d,o,l)]})}u.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const f=d(u);return f[Nt]=r,f}function Kt({layoutId:t}){const n=e(m).id;return n&&void 0!==t?n+"-"+t:t}function Qt(t,n){return Jt(t,n)}const tn=Qt("div");export{tn as MotionDiv}; +//# sourceMappingURL=size-rollup-m.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-m.js.map b/node_modules/framer-motion/dist/size-rollup-m.js.map new file mode 100644 index 00000000..1f5d810f --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-m.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-m.js","sources":["../../motion-utils/dist/es/clamp.mjs","../lib/context/LayoutGroupContext.js","../lib/context/LazyContext.js","../lib/context/MotionConfigContext.js","../lib/context/MotionContext/index.js","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../lib/context/MotionContext/create.js","../lib/context/MotionContext/utils.js","../lib/render/html/utils/create-render-state.js","../lib/render/html/use-props.js","../lib/render/svg/utils/create-render-state.js","../lib/render/svg/use-props.js","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../lib/motion/utils/valid-prop.js","../lib/render/dom/utils/filter-props.js","../lib/render/svg/lowercase-elements.js","../lib/render/dom/utils/is-svg-component.js","../lib/render/dom/use-render.js","../lib/context/PresenceContext.js","../lib/motion/utils/use-visual-state.js","../lib/utils/use-constant.js","../lib/render/html/use-html-visual-state.js","../lib/render/svg/use-svg-visual-state.js","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../lib/utils/is-browser.js","../lib/motion/features/definitions.js","../lib/motion/utils/symbol.js","../lib/motion/utils/use-motion-ref.js","../lib/context/SwitchLayoutGroupContext.js","../lib/utils/is-ref-object.js","../lib/utils/use-isomorphic-effect.js","../lib/motion/utils/use-visual-element.js","../lib/motion/index.js","../lib/render/components/m/create.js","../lib/render/components/m/elements.js","../lib/render/components/m/size.js"],"sourcesContent":["const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","\"use client\";\nimport { createContext } from \"react\";\nexport const LayoutGroupContext = createContext({});\n//# sourceMappingURL=LayoutGroupContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const LazyContext = createContext({ strict: false });\n//# sourceMappingURL=LazyContext.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n//# sourceMappingURL=MotionConfigContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const MotionContext = /* @__PURE__ */ createContext({});\n//# sourceMappingURL=index.js.map","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs };\n//# sourceMappingURL=build-attrs.mjs.map\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n//# sourceMappingURL=resolve-motion-value.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \".\";\nimport { getCurrentTreeVariants } from \"./utils\";\nexport function useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n//# sourceMappingURL=create.js.map","import { isControllingVariants, isVariantLabel } from \"motion-dom\";\nexport function getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n//# sourceMappingURL=utils.js.map","export const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildHTMLStyles, isForcedMotionValue, isMotionValue } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport function copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nexport function useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n//# sourceMappingURL=use-props.js.map","import { createHtmlRenderState } from \"../../html/utils/create-render-state\";\nexport const createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { copyRawValuesOnly } from \"../html/use-props\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport function useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n//# sourceMappingURL=use-props.js.map","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n//# sourceMappingURL=valid-prop.js.map","import { isValidMotionProp } from \"../../../motion/utils/valid-prop\";\nlet shouldForward = (key) => !isValidMotionProp(key);\nexport function loadExternalIsValidProp(isValidProp) {\n if (typeof isValidProp !== \"function\")\n return;\n // Explicitly filter our events\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n}\ncatch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nexport function filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n//# sourceMappingURL=filter-props.js.map","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n//# sourceMappingURL=lowercase-elements.js.map","import { lowercaseSVGElements } from \"../../svg/lowercase-elements\";\nexport function isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n//# sourceMappingURL=is-svg-component.js.map","\"use client\";\nimport { isMotionValue } from \"motion-dom\";\nimport { Fragment, createElement, useMemo } from \"react\";\nimport { useHTMLProps } from \"../html/use-props\";\nimport { useSVGProps } from \"../svg/use-props\";\nimport { filterProps } from \"./utils/filter-props\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n//# sourceMappingURL=use-render.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const PresenceContext = \n/* @__PURE__ */ createContext(null);\n//# sourceMappingURL=PresenceContext.js.map","\"use client\";\nimport { isAnimationControls, isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, resolveVariantFromProps, } from \"motion-dom\";\nimport { useContext } from \"react\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\nimport { useConstant } from \"../../utils/use-constant\";\nimport { resolveMotionValue } from \"motion-dom\";\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants = checkIsControllingVariants(props);\n const isVariantNode = checkIsVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nexport const makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n//# sourceMappingURL=use-visual-state.js.map","\"use client\";\nimport { useRef } from \"react\";\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n//# sourceMappingURL=use-constant.js.map","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n//# sourceMappingURL=use-html-visual-state.js.map","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n//# sourceMappingURL=use-svg-visual-state.js.map","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\";\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n//# sourceMappingURL=definitions.js.map","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n//# sourceMappingURL=symbol.js.map","\"use client\";\nimport { useCallback, useInsertionEffect, useRef } from \"react\";\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ;\n ref.current = instance;\n }\n }, [visualElement]);\n}\n//# sourceMappingURL=use-motion-ref.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext({});\n//# sourceMappingURL=SwitchLayoutGroupContext.js.map","export function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n//# sourceMappingURL=is-ref-object.js.map","\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\nimport { isBrowser } from \"./is-browser\";\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n//# sourceMappingURL=use-isomorphic-effect.js.map","\"use client\";\nimport { optimizedAppearDataAttribute, } from \"motion-dom\";\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext } from \"../../context/PresenceContext\";\nimport { SwitchLayoutGroupContext, } from \"../../context/SwitchLayoutGroupContext\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\";\nexport function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n//# sourceMappingURL=use-visual-element.js.map","\"use client\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { invariant, warning } from \"motion-utils\";\nimport { forwardRef, useContext } from \"react\";\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\";\nimport { LazyContext } from \"../context/LazyContext\";\nimport { MotionConfigContext } from \"../context/MotionConfigContext\";\nimport { MotionContext } from \"../context/MotionContext\";\nimport { useCreateMotionContext } from \"../context/MotionContext/create\";\nimport { useRender } from \"../render/dom/use-render\";\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\";\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\";\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\";\nimport { isBrowser } from \"../utils/is-browser\";\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\";\nimport { loadFeatures } from \"./features/load-features\";\nimport { motionComponentSymbol } from \"./utils/symbol\";\nimport { useMotionRef } from \"./utils/use-motion-ref\";\nimport { useVisualElement } from \"./utils/use-visual-element\";\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (_jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (_jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n//# sourceMappingURL=index.js.map","import { createMotionComponent } from \"../../../motion\";\nexport function createMinimalMotionComponent(Component, options) {\n return createMotionComponent(Component, options);\n}\n//# sourceMappingURL=create.js.map","\"use client\";\nimport { createMinimalMotionComponent } from \"./create\";\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\");\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\");\nexport const MotionAddress = \n/*@__PURE__*/ createMinimalMotionComponent(\"address\");\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\");\nexport const MotionArticle = \n/*@__PURE__*/ createMinimalMotionComponent(\"article\");\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\");\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\");\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\");\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\");\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\");\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\");\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\");\nexport const MotionBlockquote = \n/*@__PURE__*/ createMinimalMotionComponent(\"blockquote\");\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\");\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\");\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\");\nexport const MotionCaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"caption\");\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\");\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\");\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\");\nexport const MotionColgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"colgroup\");\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\");\nexport const MotionDatalist = \n/*@__PURE__*/ createMinimalMotionComponent(\"datalist\");\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\");\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\");\nexport const MotionDetails = \n/*@__PURE__*/ createMinimalMotionComponent(\"details\");\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\");\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\");\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\");\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\");\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\");\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\");\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\");\nexport const MotionFieldset = \n/*@__PURE__*/ createMinimalMotionComponent(\"fieldset\");\nexport const MotionFigcaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"figcaption\");\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\");\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\");\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\");\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\");\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\");\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\");\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\");\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\");\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\");\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\");\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\");\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\");\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\");\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\");\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\");\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\");\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\");\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\");\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\");\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\");\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\");\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\");\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\");\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\");\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\");\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\");\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\");\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\");\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\");\nexport const MotionMenuitem = \n/*@__PURE__*/ createMinimalMotionComponent(\"menuitem\");\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\");\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\");\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\");\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\");\nexport const MotionOptgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"optgroup\");\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\");\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\");\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\");\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\");\nexport const MotionPicture = \n/*@__PURE__*/ createMinimalMotionComponent(\"picture\");\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\");\nexport const MotionProgress = \n/*@__PURE__*/ createMinimalMotionComponent(\"progress\");\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\");\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\");\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\");\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\");\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\");\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\");\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\");\nexport const MotionSection = \n/*@__PURE__*/ createMinimalMotionComponent(\"section\");\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\");\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\");\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\");\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\");\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\");\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\");\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\");\nexport const MotionSummary = \n/*@__PURE__*/ createMinimalMotionComponent(\"summary\");\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\");\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\");\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\");\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\");\nexport const MotionTextarea = \n/*@__PURE__*/ createMinimalMotionComponent(\"textarea\");\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\");\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\");\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\");\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\");\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\");\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\");\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\");\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\");\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\");\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\");\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\");\nexport const MotionWebview = \n/*@__PURE__*/ createMinimalMotionComponent(\"webview\");\n/**\n * SVG components\n */\nexport const MotionAnimate = \n/*@__PURE__*/ createMinimalMotionComponent(\"animate\");\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\");\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\");\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\");\nexport const MotionEllipse = \n/*@__PURE__*/ createMinimalMotionComponent(\"ellipse\");\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\");\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\");\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\");\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\");\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\");\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\");\nexport const MotionMetadata = \n/*@__PURE__*/ createMinimalMotionComponent(\"metadata\");\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\");\nexport const MotionPattern = \n/*@__PURE__*/ createMinimalMotionComponent(\"pattern\");\nexport const MotionPolygon = \n/*@__PURE__*/ createMinimalMotionComponent(\"polygon\");\nexport const MotionPolyline = \n/*@__PURE__*/ createMinimalMotionComponent(\"polyline\");\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\");\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\");\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\");\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\");\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\");\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\");\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\");\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\");\nexport const MotionClipPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"clipPath\");\nexport const MotionFeBlend = \n/*@__PURE__*/ createMinimalMotionComponent(\"feBlend\");\nexport const MotionFeColorMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\");\nexport const MotionFeComponentTransfer = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\");\nexport const MotionFeComposite = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComposite\");\nexport const MotionFeConvolveMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\");\nexport const MotionFeDiffuseLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\");\nexport const MotionFeDisplacementMap = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\");\nexport const MotionFeDistantLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\");\nexport const MotionFeDropShadow = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\");\nexport const MotionFeFlood = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFlood\");\nexport const MotionFeFuncA = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\");\nexport const MotionFeFuncB = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\");\nexport const MotionFeFuncG = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\");\nexport const MotionFeFuncR = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\");\nexport const MotionFeGaussianBlur = \n/*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\");\nexport const MotionFeImage = \n/*@__PURE__*/ createMinimalMotionComponent(\"feImage\");\nexport const MotionFeMerge = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMerge\");\nexport const MotionFeMergeNode = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\");\nexport const MotionFeMorphology = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\");\nexport const MotionFeOffset = \n/*@__PURE__*/ createMinimalMotionComponent(\"feOffset\");\nexport const MotionFePointLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\");\nexport const MotionFeSpecularLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\");\nexport const MotionFeSpotLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\");\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\");\nexport const MotionFeTurbulence = \n/*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\");\nexport const MotionForeignObject = \n/*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\");\nexport const MotionLinearGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\");\nexport const MotionRadialGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\");\nexport const MotionTextPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"textPath\");\n//# sourceMappingURL=elements.js.map","import { m } from \"./\";\nexport const MotionDiv = m.div;\n//# sourceMappingURL=size.js.map"],"names":["clamp","min","max","v","LayoutGroupContext","createContext","LazyContext","strict","MotionConfigContext","transformPagePoint","p","isStatic","reducedMotion","MotionContext","isCSSVariableName","token","key","startsWith","checkStringStartsWith","number","test","parse","parseFloat","transform","alpha","scale","default","sanitize","Math","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","a","b","c","match","undefined","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","length","substring","parseInt","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","value","originalValue","toString","values","indexes","var","types","i","replace","parsedValue","push","parseComplexValue","createTransformer","source","numSections","output","convertNumbersToZero","complex","isNaN","transformer","map","transformPropOrder","transformProps","Set","resolveVariantFromProps","props","definition","custom","visualElement","current","velocity","variants","isMotionValue","getVelocity","optimizedAppearDataAttribute","toLowerCase","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","getValueAsType","isAnimationControls","start","isVariantLabel","Array","isArray","variantProps","isControllingVariants","animate","some","name","featureDefinitions","translateAlias","numTransforms","buildHTMLStyles","state","latestValues","transformTemplate","style","vars","transformOrigin","hasTransform","hasTransformOrigin","has","valueAsType","transformString","transformIsDefault","valueIsDefault","trim","buildTransform","pixelsToPercent","pixels","axis","correctBorderRadius","correct","latest","node","target","correctBoxShadow","treeScale","projectionDelta","original","shadow","template","offset","xScale","yScale","averageScale","from","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","scrapeMotionValuesFromProps","prevProps","prevStyle","newValues","getValue","liveStyle","dashKeys","array","camelKeys","cssMotionPathProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","styleProp","viewBox","attrs","transformBox","spacing","useDashCase","keys","buildSVGPath","resolveMotionValue","get","useCreateMotionContext","initial","context","inherit","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","prop","join","createHtmlRenderState","copyRawValuesOnly","useStyle","visualState","assign","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","tabIndex","onTap","onTapStart","whileTap","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","tag","rawStyles","validMotionProps","isValidMotionProp","shouldForward","isValidProp","require","lowercaseSVGElements","isSVGComponent","includes","indexOf","useRender","ref","forwardMotionProps","isSVG","filteredProps","isDom","filterProps","elementProps","Fragment","children","renderedChildren","createElement","PresenceContext","makeLatestValues","presenceContext","scrapeMotionValues","motionValues","checkIsControllingVariants","isVariantNode","checkIsVariantNode","isInitialAnimationBlocked","variantToSet","list","resolved","transitionEnd","transition","valueTarget","makeUseVisualState","config","make","createRenderState","renderState","makeState","init","useRef","useConstant","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeMotionValuesFromProps$1","charAt","toUpperCase","isBrowser","window","featureProps","animation","exit","focus","hover","tap","pan","inView","isInitialized","initFeatureDefinitions","initialFeatureDefinitions","isEnabled","getInitializedFeatureDefinitions","motionComponentSymbol","Symbol","for","useMotionRef","externalRef","externalRefContainer","useInsertionEffect","refCleanup","useCallback","instance","onMount","mount","unmount","cleanup","SwitchLayoutGroupContext","isRefObject","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useVisualElement","createVisualElement","ProjectionNodeConstructor","parent","lazyContext","motionConfig","reducedMotionConfig","skipAnimations","visualElementRef","hasMountedOnce","renderer","blockInitialAnimation","manuallyAnimateOnMount","initialLayoutGroupConfig","projection","initialPromotionConfig","dragConstraints","layoutScroll","layoutRoot","layoutCrossfade","getClosestProjectingNode","setOptions","alwaysMeasureLayout","animationType","crossfade","createProjectionNode","isMounted","update","optimisedAppearId","wantsHandoff","MotionHandoffIsComplete","MotionHasOptimisedAnimation","MotionIsMounted","updateFeatures","scheduleRenderMicrotask","animationState","animateChanges","queueMicrotask","MotionHandoffMarkAsComplete","enteringChildren","options","allowProjection","createMotionComponent","preloadedFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","id","createMinimalMotionComponent","MotionDiv"],"mappings":"+PAAA,MAAMA,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECHEC,EAAqBC,EAAc,ICAnCC,EAAcD,EAAc,CAAEE,QAAQ,ICGtCC,EAAsBH,EAAc,CAC7CI,mBAAqBC,GAAMA,EAC3BC,UAAU,EACVC,cAAe,UCNNC,EAAgCR,EAAc,ICDrDS,EADwB,CAACC,GAAWC,GAAuB,iBAARA,GAAoBA,EAAIC,WAAWF,GAE9EG,CAAsB,MCA9BC,EAAS,CACXC,KAAOjB,GAAmB,iBAANA,EACpBkB,MAAOC,WACPC,UAAYpB,GAAMA,GAEhBqB,EAAQ,IACPL,EACHI,UAAYpB,GAAMH,EAAM,EAAG,EAAGG,IAE5BsB,EAAQ,IACPN,EACHO,QAAS,GCXPC,EAAYxB,GAAMyB,KAAKC,MAAU,IAAJ1B,GAAc,ICF3C2B,EAAa,8BCAnB,MAAMC,EAAmB,sHCQnBC,EAAgB,CAACC,EAAMC,IAAc/B,GAChCgC,QAAsB,iBAANhC,GACnB4B,EAAiBX,KAAKjB,IACtBA,EAAEc,WAAWgB,IACZC,ICZT,SAAmB/B,GACf,OAAY,MAALA,CACX,CDWaiC,CAAUjC,IACXkC,OAAOC,UAAUC,eAAeC,KAAKrC,EAAG+B,IAE9CO,EAAa,CAACC,EAAOC,EAAOC,IAAWzC,IACzC,GAAiB,iBAANA,EACP,OAAOA,EACX,MAAO0C,EAAGC,EAAGC,EAAGvB,GAASrB,EAAE6C,MAAMlB,GACjC,MAAO,CACHY,CAACA,GAAQpB,WAAWuB,GACpBF,CAACA,GAAQrB,WAAWwB,GACpBF,CAACA,GAAQtB,WAAWyB,GACpBvB,WAAiByB,IAAVzB,EAA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2J,EAAgB9C,EAAqBgD,EAAiBE,eAAgB5H,EAC3I,CAKA,OAAQ8H,EAAM1b,EAAc2b,SAAU,CAAErX,MAAOwM,EAASoD,SAAU,CAACiH,GAAiBrK,EAAQ5K,cAAiB0V,EAAKT,EAAe,CAAEjV,cAAe4K,EAAQ5K,iBAAkBkV,IAAqB,KAAM3H,GAAUb,EAAW7M,EAAOsR,GAAa5F,EAAaX,EAAQ5K,cAAeoR,GAAc7F,EAAa3R,EAAU6T,EAAoBC,KACjV,CACAsH,EAAmBW,YAAc,UAA+B,iBAAdjJ,EAC5CA,EACA,UAAUA,EAAUiJ,aAAejJ,EAAUzG,MAAQ,QAC3D,MAAM2P,EAA4BC,EAAWb,GAE7C,OADAY,EAA0B5E,IAAyBtE,EAC5CkJ,CACX,CACA,SAAST,IAAYtM,SAAEA,IACnB,MAAMiN,EAAgB/K,EAAW1R,GAAoB0c,GACrD,OAAOD,QAA8B5Z,IAAb2M,EAClBiN,EAAgB,IAAMjN,EACtBA,CACV,CChFO,SAASmN,GAA6BtJ,EAAWiI,GACpD,OAAOE,GAAsBnI,EAAWiI,EAC5C,CCqCO,MCvCMsB,GDuC0BD,GAA6B"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-motion.js b/node_modules/framer-motion/dist/size-rollup-motion.js new file mode 100644 index 00000000..6bb3de27 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-motion.js @@ -0,0 +1,2 @@ +import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useMemo as s,Fragment as o,createElement as r,useRef as a,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect as c,forwardRef as d,useId as p,Component as m}from"react";function f(t,e){-1===t.indexOf(e)&&t.push(e)}function g(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const y=(t,e,n)=>n>e?e:n{},w=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(x=(t,e,n)=>{t||"undefined"==typeof console||console.warn(v(e,n))},w=(t,e,n)=>{if(!t)throw new Error(v(e,n))});const T={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function P(t){return"object"==typeof t&&null!==t}const b=t=>/^0[^.\s]+$/u.test(t);function E(t){let e;return()=>(void 0===e&&(e=t()),e)}const A=t=>t,M=(t,e)=>n=>e(t(n)),V=(...t)=>t.reduce(M),C=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class k{constructor(){this.subscriptions=[]}add(t){return f(this.subscriptions,t),()=>g(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,R=t=>t/1e3;function L(t,e){return e?t*(1e3/e):0}const B=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function j(t,e,n,i){if(t===e&&n===i)return A;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=B(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:B(s(t),e,i)}const F=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,I=t=>e=>1-t(1-e),O=j(.33,1.53,.69,.99),U=I(O),W=F(U),N=t=>(t*=2)<1?.5*U(t):.5*(2-Math.pow(2,-10*(t-1))),$=t=>1-Math.sin(Math.acos(t)),Y=I($),z=F($),X=j(.42,0,1,1),H=j(0,0,.58,1),K=j(.42,0,.58,1),G=t=>Array.isArray(t)&&"number"==typeof t[0],q={linear:A,easeIn:X,easeInOut:K,easeOut:H,circIn:$,circInOut:z,circOut:Y,backIn:U,backInOut:W,backOut:O,anticipate:N},Z=t=>{if(G(t)){w(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return j(e,n,i,s)}return"string"==typeof t?(w(void 0!==q[t],`Invalid easing type '${t}'`,"invalid-easing-type"),q[t]):t},_=n({}),J=n({strict:!1}),Q=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),tt=n({}),et=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],nt={value:null,addProjectionMetrics:null};function it(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=et.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(h),e&&nt.value&&nt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=T.useManualTiming?s.timestamp:performance.now();n=!1,T.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:et.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===lt&&ut.set(rt.isProcessing||T.useManualTiming?rt.timestamp:performance.now()),lt),set:t=>{lt=t,queueMicrotask(ht)}},ct=t=>e=>"string"==typeof e&&e.startsWith(t),dt=ct("--"),pt=ct("var(--"),mt=t=>!!pt(t)&&ft.test(t.split("/*")[0].trim()),ft=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function gt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const yt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},vt={...yt,transform:t=>y(0,1,t)},xt={...yt,default:1},wt=t=>Math.round(1e5*t)/1e5,Tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const St=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pt=(t,e)=>n=>Boolean("string"==typeof n&&St.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),bt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Tt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Et={...yt,transform:t=>Math.round((t=>y(0,255,t))(t))},At={test:Pt("rgb","red"),parse:bt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Et.transform(t)+", "+Et.transform(e)+", "+Et.transform(n)+", "+wt(vt.transform(i))+")"};const Mt={test:Pt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:At.transform},Vt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Ct=Vt("deg"),kt=Vt("%"),Dt=Vt("px"),Rt=Vt("vh"),Lt=Vt("vw"),Bt=(()=>({...kt,parse:t=>kt.parse(t)/100,transform:t=>kt.transform(100*t)}))(),jt={test:Pt("hsl","hue"),parse:bt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+kt.transform(wt(e))+", "+kt.transform(wt(n))+", "+wt(vt.transform(i))+")"},Ft={test:t=>At.test(t)||Mt.test(t)||jt.test(t),parse:t=>At.test(t)?At.parse(t):jt.test(t)?jt.parse(t):Mt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?At.transform(t):jt.transform(t),getAnimatableNone:t=>{const e=Ft.parse(t);return e.alpha=0,Ft.transform(e)}},It=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ot="number",Ut="color",Wt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Nt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Wt,t=>(Ft.test(t)?(i.color.push(o),s.push(Ut),n.push(Ft.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Ot),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function $t(t){return Nt(t).values}function Yt(t){const{split:e,types:n}=Nt(t),i=e.length;return t=>{let s="";for(let o=0;o"number"==typeof t?0:Ft.test(t)?Ft.getAnimatableNone(t):t;const Xt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Tt)?.length||0)+(t.match(It)?.length||0)>0},parse:$t,createTransformer:Yt,getAnimatableNone:function(t){const e=$t(t);return Yt(t)(e.map(zt))}};function Ht(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Kt(t,e){return n=>n>0?e:t}const Gt=(t,e,n)=>t+(e-t)*n,qt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Zt=[Mt,At,jt];function _t(t){const e=(n=t,Zt.find(t=>t.test(n)));var n;if(x(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===jt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ht(a,i,t+1/3),o=Ht(a,i,t),r=Ht(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Jt=(t,e)=>{const n=_t(t),i=_t(e);if(!n||!i)return Kt(t,e);const s={...n};return t=>(s.red=qt(n.red,i.red,t),s.green=qt(n.green,i.green,t),s.blue=qt(n.blue,i.blue,t),s.alpha=Gt(n.alpha,i.alpha,t),At.transform(s))},Qt=new Set(["none","hidden"]);function te(t,e){return n=>Gt(t,e,n)}function ee(t){return"number"==typeof t?te:"string"==typeof t?mt(t)?Kt:Ft.test(t)?Jt:se:Array.isArray(t)?ne:"object"==typeof t?Ft.test(t)?Jt:ie:Kt}function ne(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>ee(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const se=(t,e)=>{const n=Xt.createTransformer(e),i=Nt(t),s=Nt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Qt.has(t)&&!s.values.length||Qt.has(e)&&!i.values.length?function(t,e){return Qt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):V(ne(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>st.update(e,t),stop:()=>ot(e),now:()=>rt.isProcessing?rt.timestamp:ut.now()}},ae=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=le?1/0:e}function ue(t,e,n){const i=Math.max(e-5,0);return L(n-t(i),e-i)}const ce=100,de=10,pe=1,me=0,fe=800,ge=.3,ye=.3,ve={granular:.01,default:2},xe={granular:.005,default:.5},we=.01,Te=10,Se=.05,Pe=1,be=.001;function Ee({duration:t=fe,bounce:e=ge,velocity:n=me,mass:i=pe}){let s,o;x(t<=D(Te),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=y(Se,Pe,r),t=y(we,Te,R(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=Me(e,r),l=Math.exp(-s);return be-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=Me(Math.pow(e,2),r);return(-s(e)+be>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;nvoid 0!==t[e])}function De(t=ye,e=ge){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:me,stiffness:ce,damping:de,mass:pe,isResolvedFromDuration:!1,...t};if(!ke(t,Ce)&&ke(t,Ve))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*y(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:pe,stiffness:s,damping:o}}else{const n=Ee(t);e={...e,...n,mass:pe},e.isResolvedFromDuration=!0}return e}({...n,velocity:-R(n.velocity||0)}),m=d||0,f=h/(2*Math.sqrt(l*u)),g=r-o,v=R(Math.sqrt(l/u)),x=Math.abs(g)<5;let w;if(i||(i=x?ve.granular:ve.default),s||(s=x?xe.granular:xe.default),f<1){const t=Me(v,f);w=e=>{const n=Math.exp(-f*v*e);return r-n*((m+f*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)w=t=>r-Math.exp(-v*t)*(g+(m+v*g)*t);else{const t=v*Math.sqrt(f*f-1);w=e=>{const n=Math.exp(-f*v*e),i=Math.min(t*e,300);return r-n*((m+f*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const T={calculatedDuration:p&&c||null,next:t=>{const e=w(t);if(p)a.done=t>=c;else{let n=0===t?m:0;f<1&&(n=0===t?D(m):ue(w,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(he(T),le),e=ae(e=>T.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return T}function Re({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?g:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&el)&&(w=t,T=De({keyframes:[d.value,p(d.value)],velocity:ue(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function Le(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||T.mix||oe,o=t.length-1;for(let n=0;n{if(r&&n1)for(;ih(y(t[0],t[o-1],e)):h}function Be(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=C(0,e,i);t.push(Gt(n,1,s))}}(e,t.length-1),e}function je({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Z):Z(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Be(e),t),a=Le(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||K).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}De.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(he(i),le);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:R(s)}}(t,100,De);return t.ease=e.ease,t.duration=D(e.duration),t.type="keyframes",t};const Fe=t=>null!==t;function Ie(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Fe),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Oe={decay:Re,inertia:Re,tween:je,keyframes:je,spring:De};function Ue(t){"string"==typeof t.type&&(t.type=Oe[t.type])}class We{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ne=t=>t/100;class $e extends We{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==ut.now()&&this.tick(ut.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Ue(t);const{type:e=je,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||je;a!==je&&"number"!=typeof r[0]&&(this.mixKeyframes=V(Ne,oe(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=he(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:u,repeatType:c,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x=this.currentTime,w=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===c?(n=1-n,d&&(n-=d/r)):"mirror"===c&&(w=o)),x=y(0,1,n)*r}const T=v?{done:!1,value:h[0]}:w.next(x);s&&(T.value=s(T.value));let{done:S}=T;v||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return P&&p!==Re&&(T.value=Ie(h,this.options,f,this.speed)),m&&m(T.value),P&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return R(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+R(t)}get time(){return R(this.currentTime)}set time(t){t=D(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ut.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=R(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=re,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ut.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ye=t=>180*t/Math.PI,ze=t=>{const e=Ye(Math.atan2(t[1],t[0]));return He(e)},Xe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ze,rotateZ:ze,skewX:t=>Ye(Math.atan(t[1])),skewY:t=>Ye(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},He=t=>((t%=360)<0&&(t+=360),t),Ke=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ge=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),qe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ke,scaleY:Ge,scale:t=>(Ke(t)+Ge(t))/2,rotateX:t=>He(Ye(Math.atan2(t[6],t[5]))),rotateY:t=>He(Ye(Math.atan2(-t[2],t[0]))),rotateZ:ze,rotate:ze,skewX:t=>Ye(Math.atan(t[4])),skewY:t=>Ye(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ze(t){return t.includes("scale")?1:0}function _e(t,e){if(!t||"none"===t)return Ze(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=qe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Xe,s=e}if(!s)return Ze(e);const o=i[e],r=s[1].split(",").map(Je);return"function"==typeof o?o(r):r[o]}function Je(t){return parseFloat(t.trim())}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tn=(()=>new Set(Qe))(),en=t=>t===yt||t===Dt,nn=new Set(["x","y","z"]),sn=Qe.filter(t=>!nn.has(t));const on={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>_e(e,"x"),y:(t,{transform:e})=>_e(e,"y")};on.translateX=on.x,on.translateY=on.y;const rn=new Set;let an=!1,ln=!1,hn=!1;function un(){if(ln){const t=Array.from(rn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return sn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ln=!1,an=!1,rn.forEach(t=>t.complete(hn)),rn.clear()}function cn(){rn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ln=!0)})}class dn{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(rn.add(this),an||(an=!0,st.read(cn),st.resolveKeyframes(un))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;epn[e]??n()}const fn=mn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),gn=mn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),yn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,vn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yn([0,.65,.55,1]),circOut:yn([.55,0,1,.45]),backIn:yn([.31,.01,.66,-.59]),backOut:yn([.33,1.53,.69,.99])};function xn(t,e){return t?"function"==typeof t?gn()?ae(t,e):"ease-out":G(t)?yn(t):Array.isArray(t)?t.map(t=>xn(t,e)||vn.easeOut):vn[t]:void 0}function wn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:n};l&&(u.offset=l);const c=xn(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(u,d)}function Tn(t){return"function"==typeof t&&"applyToOptions"in t}class Sn extends We{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,w("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Tn(t)&&gn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=wn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ie(i,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return R(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+R(t)}get time(){return R(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=D(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&fn()?(this.animation.timeline=t,A):e(this)}}const Pn={anticipate:N,backInOut:W,circInOut:z};function bn(t){"string"==typeof t.ease&&t.ease in Pn&&(t.ease=Pn[t.ease])}class En extends Sn{constructor(t){bn(t),Ue(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new $e({...o,autoplay:!1}),a=Math.max(10,ut.now()-this.startTime),l=y(0,10,a-10);e.setWithVelocity(r.sample(Math.max(0,a-l)).value,r.sample(a).value,l),r.stop()}}const An=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Xt.test(t)&&"0"!==t||t.startsWith("url(")));function Mn(t){t.duration=0,t.type="keyframes"}const Vn=new Set(["opacity","clipPath","filter","transform"]),Cn=E(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class kn extends We{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ut.now();const c={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||dn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=n;this.resolvedAt=ut.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=An(s,e),a=An(o,e);return x(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},c=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:h}=e.owner.getProps();return Cn()&&n&&Vn.has(n)&&("transform"!==n||!h)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}(u),d=u.motionValue?.owner?.current,p=c?new En({...u,element:d}):new $e(u);p.finished.then(()=>{this.notifyFinished()}).catch(A),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),hn=!0,cn(),un(),hn=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Dn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const Rn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ln(t,e,n=1){w(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=function(t){const e=Rn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return S(t)?parseFloat(t):t}return mt(s)?Ln(s,e,n+1):s}const Bn={type:"spring",stiffness:500,damping:25,restSpeed:10},jn={type:"keyframes",duration:.8},Fn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},In=(t,{keyframes:e})=>e.length>2?jn:tn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Bn:Fn,On=t=>null!==t;function Un(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Wn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Un(n,t):n}const Nn=(t,e,n,i={},s,o)=>r=>{const a=Wn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=D(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,In(t,u)),u.duration&&(u.duration=D(u.duration)),u.repeatDelay&&(u.repeatDelay=D(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Mn(u),0===u.delay&&(c=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations)&&(c=!0,Mn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(On),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}(u.keyframes,a);if(void 0!==t)return void st.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new $e(u):new kn(u)};function $n(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Yn(t,e,n,i){if("function"==typeof e){const[s,o]=$n(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=$n(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function zn(t,e,n){const i=t.getProps();return Yn(i,e,void 0!==n?n:i.custom,t)}const Xn=new Set(["width","height","top","left","right","bottom",...Qe]);class Hn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=ut.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=ut.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new k);const n=this.events[t].add(e);return"change"===t?()=>{n(),st.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ut.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return L(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Kn(t,e){return new Hn(t,e)}const Gn=t=>Array.isArray(t);function qn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Kn(n))}function Zn(t){return Gn(t)?t[t.length-1]||0:t}const _n=t=>Boolean(t&&t.getVelocity);function Jn(t,e){const n=t.getValue("willChange");if(i=n,Boolean(_n(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Qn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ti="data-"+Qn("framerAppearId");function ei(t){return t.props[ti]}function ni({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function ii(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Un(o,l):l;const h=o?.reduceMotion;i&&(o=i);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&ni(c,e))continue;const r={delay:n,...Wn(o||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating&&!Array.isArray(s)&&s===l&&!r.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=ei(t);if(n){const t=window.MotionHandoffAnimation(n,e,st);null!==t&&(r.startTime=t,d=!0)}}Jn(t,e);const p=h??t.shouldReduceMotion;i.start(Nn(e,i,s,p&&Xn.has(e)?{type:!1}:r,t,d));const m=i.animation;m&&u.push(m)}if(r){const e=()=>st.update(()=>{r&&function(t,e){const n=zn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)qn(t,e,Zn(o[e]))}(t,r)});u.length?Promise.all(u).then(e):e()}return u}function si(t,e,n={}){const i=zn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(ii(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(si(l,e,{...r,delay:n+("function"==typeof i?0:i)+Dn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}const oi=t=>e=>e.test(t),ri=[yt,Dt,kt,Ct,Lt,Rt,{test:t=>"auto"===t,parse:t=>t}],ai=t=>ri.find(oi(t));function li(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const hi=new Set(["brightness","contrast","saturate","opacity"]);function ui(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Tt)||[];if(!i)return t;const s=n.replace(i,"");let o=hi.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ci=/\b([a-z-]*)\(.*?\)/gu,di={...Xt,getAnimatableNone:t=>{const e=t.match(ci);return e?e.map(ui).join(" "):t}},pi={...Xt,getAnimatableNone:t=>{const e=Xt.parse(t);return Xt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},mi={...yt,transform:Math.round},fi={borderWidth:Dt,borderTopWidth:Dt,borderRightWidth:Dt,borderBottomWidth:Dt,borderLeftWidth:Dt,borderRadius:Dt,borderTopLeftRadius:Dt,borderTopRightRadius:Dt,borderBottomRightRadius:Dt,borderBottomLeftRadius:Dt,width:Dt,maxWidth:Dt,height:Dt,maxHeight:Dt,top:Dt,right:Dt,bottom:Dt,left:Dt,inset:Dt,insetBlock:Dt,insetBlockStart:Dt,insetBlockEnd:Dt,insetInline:Dt,insetInlineStart:Dt,insetInlineEnd:Dt,padding:Dt,paddingTop:Dt,paddingRight:Dt,paddingBottom:Dt,paddingLeft:Dt,paddingBlock:Dt,paddingBlockStart:Dt,paddingBlockEnd:Dt,paddingInline:Dt,paddingInlineStart:Dt,paddingInlineEnd:Dt,margin:Dt,marginTop:Dt,marginRight:Dt,marginBottom:Dt,marginLeft:Dt,marginBlock:Dt,marginBlockStart:Dt,marginBlockEnd:Dt,marginInline:Dt,marginInlineStart:Dt,marginInlineEnd:Dt,fontSize:Dt,backgroundPositionX:Dt,backgroundPositionY:Dt,...{rotate:Ct,rotateX:Ct,rotateY:Ct,rotateZ:Ct,scale:xt,scaleX:xt,scaleY:xt,scaleZ:xt,skew:Ct,skewX:Ct,skewY:Ct,distance:Dt,translateX:Dt,translateY:Dt,translateZ:Dt,x:Dt,y:Dt,z:Dt,perspective:Dt,transformPerspective:Dt,opacity:vt,originX:Bt,originY:Bt,originZ:Dt},zIndex:mi,fillOpacity:vt,strokeOpacity:vt,numOctaves:mi},gi={...fi,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:di,WebkitFilter:di,mask:pi,WebkitMask:pi},yi=t=>gi[t],vi=new Set([di,pi]);function xi(t,e){let n=yi(t);return vi.has(n)||(n=Xt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const wi=new Set(["auto","none","0"]);class Ti extends dn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Si=new Set(["opacity","clipPath","filter","transform"]);function Pi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}const bi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;const{schedule:Ei,cancel:Ai}=it(queueMicrotask,!1),Mi={x:!1,y:!1};function Vi(){return Mi.x||Mi.y}function Ci(t,e){const n=Pi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function ki(t,e,n={}){const[i,s,o]=Ci(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Vi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Di=(t,e)=>!!e&&(t===e||Di(t,e.parentElement)),Ri=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Li=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Bi=new Set(["INPUT","SELECT","TEXTAREA"]);const ji=new WeakSet;function Fi(t){return e=>{"Enter"===e.key&&t(e)}}function Ii(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Oi(t){return Ri(t)&&!Vi()}const Ui=new WeakSet;function Wi(t,e,n={}){const[i,s,o]=Ci(t,n),r=t=>{const i=t.currentTarget;if(!Oi(t))return;if(Ui.has(t))return;ji.add(i),n.stopPropagation&&Ui.add(t);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ji.has(i)&&ji.delete(i),Oi(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||Di(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),P(e=t)&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Fi(()=>{if(ji.has(n))return;Ii(n,"down");const t=Fi(()=>{Ii(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ii(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return Li.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Ni(t){return P(t)&&"ownerSVGElement"in t}const $i=new WeakMap;let Yi;const zi=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ni(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Xi=zi("inline","width","offsetWidth"),Hi=zi("block","height","offsetHeight");function Ki({target:t,borderBoxSize:e}){$i.get(t)?.forEach(n=>{n(t,{get width(){return Xi(t,e)},get height(){return Hi(t,e)}})})}function Gi(t){t.forEach(Ki)}function qi(t,e){Yi||"undefined"!=typeof ResizeObserver&&(Yi=new ResizeObserver(Gi));const n=Pi(t);return n.forEach(t=>{let n=$i.get(t);n||(n=new Set,$i.set(t,n)),n.add(e),Yi?.observe(t)}),()=>{n.forEach(t=>{const n=$i.get(t);n?.delete(e),n?.size||Yi?.unobserve(t)})}}const Zi=new Set;let _i;function Ji(t){return Zi.add(t),_i||(_i=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Zi.forEach(e=>e(t))},window.addEventListener("resize",_i)),()=>{Zi.delete(t),Zi.size||"function"!=typeof _i||(window.removeEventListener("resize",_i),_i=void 0)}}function Qi(t,e){return"function"==typeof t?Ji(t):qi(t,e)}const ts=[...ri,Ft,Xt],es=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ns=new WeakMap;function is(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ss(t){return"string"==typeof t||Array.isArray(t)}const os=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rs=["initial",...os];function as(t){return is(t.animate)||rs.some(e=>ss(t[e]))}function ls(t){return Boolean(as(t)||t.variants)}const hs={current:null},us={current:!1},cs="undefined"!=typeof window;const ds=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ps={};function ms(t){ps=t}class fs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=dn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=ut.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(us.current||function(){if(us.current=!0,cs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>hs.current=t.matches;t.addEventListener("change",e),e()}else hs.current=!1}(),this.shouldReduceMotion=hs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ot(this.notifyUpdate),ot(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Si.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Sn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:D(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=tn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&st.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ps){const e=ps[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Kn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(S(n)||b(n))?n=parseFloat(n):(i=n,!ts.find(oi(i))&&Xt.test(e)&&(n=xi(t,e))),this.setBaseTarget(t,_n(n)?n.get():n)),_n(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Yn(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||_n(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new k),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Ei.render(this.render)}}class gs extends fs{constructor(){super(...arguments),this.KeyframeResolver=Ti}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;_n(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ys{constructor(t){this.isMounted=!1,this.node=t}update(){}}function vs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function xs(t){return void 0===t||1===t}function ws({scale:t,scaleX:e,scaleY:n}){return!xs(t)||!xs(e)||!xs(n)}function Ts(t){return ws(t)||Ss(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ss(t){return Ps(t.x)||Ps(t.y)}function Ps(t){return t&&"0%"!==t}function bs(t,e,n){return n+e*(t-n)}function Es(t,e,n,i,s){return void 0!==s&&(t=bs(t,s,i)),bs(t,n,i)+e}function As(t,e=0,n=1,i,s){t.min=Es(t.min,e,n,i,s),t.max=Es(t.max,e,n,i,s)}function Ms(t,{x:e,y:n}){As(t.x,e.translate,e.scale,e.originPoint),As(t.y,n.translate,n.scale,n.originPoint)}const Vs=.999999999999,Cs=1.0000000000001;function ks(t,e){t.min=t.min+e,t.max=t.max+e}function Ds(t,e,n,i,s=.5){As(t,e,n,Gt(t.min,t.max,s),i)}function Rs(t,e){Ds(t.x,e.x,e.scaleX,e.scale,e.originX),Ds(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ls(t,e){return vs(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Bs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},js=Qe.length;function Fs(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(tn.has(t))r=!0;else if(dt(t))s[t]=n;else{const e=bi(n,fi[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!Dt.test(t))return t;t=parseFloat(t)}return`${Os(t,e.target.x)}% ${Os(t,e.target.y)}%`}},Ws={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Xt.parse(t);if(s.length>5)return i;const o=Xt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const h=Gt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=h),"number"==typeof s[3+r]&&(s[3+r]/=h),o(s)}},Ns={borderRadius:{...Us,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Us,borderTopRightRadius:Us,borderBottomLeftRadius:Us,borderBottomRightRadius:Us,boxShadow:Ws};function $s(t,{layout:e,layoutId:n}){return tn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ns[t]||"opacity"===t)}function Ys(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(_n(i[e])||s&&_n(s[e])||$s(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class zs extends gs{constructor(){super(...arguments),this.type="html",this.renderInstance=Is}readValueFromInstance(t,e){if(tn.has(e))return this.projection?.isProjecting?Ze(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return _e(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(dt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ls(t,e)}build(t,e,n){Fs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ys(t,e,n)}}const Xs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hs={offset:"strokeDashoffset",array:"strokeDasharray"};const Ks=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,u){if(Fs(t,a,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of Ks)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==i&&(c.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Xs:Hs;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}(c,s,o,r,!1)}const qs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Zs=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _s(t,e,n){const i=Ys(t,e,n);for(const n in t)if(_n(t[n])||_n(e[n])){i[-1!==Qe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Js extends gs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=es}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(tn.has(e)){const t=yi(e);return t&&t.default||0}return e=qs.has(e)?e:Qn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return _s(t,e,n)}build(t,e,n){Gs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Is(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(qs.has(n)?n:Qn(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Zs(t.tagName),super.mount(t)}}const Qs=rs.length;function to(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&to(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>si(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=si(t,e,n);else{const s="function"==typeof e?zn(t,e,n.custom):e;i=Promise.all(ii(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function oo(t){let e=so(t),n=lo(),i=!0;const s=e=>(n,i)=>{const s=zn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=to(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;ec&&f,w=!1;const T=Array.isArray(m)?m:[m];let S=T.reduce(s(d),{});!1===g&&(S={});const{prevResolvedValues:P={}}=p,b={...P,...S},E=e=>{x=!0,h.has(e)&&(w=!0,h.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in b){const e=S[t],n=P[t];if(u.hasOwnProperty(t))continue;let i=!1;i=Gn(e)&&Gn(n)?!eo(e,n):e!==n,i?null!=e?E(t):h.add(t):void 0!==e&&h.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),i&&t.blockInitialAnimation&&(x=!1);const A=y&&v;x&&(!A||w)&&l.push(...T.map(e=>{const n={type:d};if("string"==typeof e&&i&&!A&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=zn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Dn(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(h.size){const e={};if("boolean"!=typeof r.initial){const n=zn(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}h.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=lo()}}}function ro(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!eo(e,t)}function ao(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lo(){return{animate:ao(!0),whileInView:ao(),whileHover:ao(),whileTap:ao(),whileDrag:ao(),whileFocus:ao(),exit:ao()}}function ho(t,e){t.min=e.min,t.max=e.max}function uo(t,e){ho(t.x,e.x),ho(t.y,e.y)}function co(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function po(t){return t.max-t.min}function mo(t,e,n,i=.5){t.origin=i,t.originPoint=Gt(e.min,e.max,t.origin),t.scale=po(n)/po(e),t.translate=Gt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function fo(t,e,n,i){mo(t.x,e.x,n.x,i?i.originX:void 0),mo(t.y,e.y,n.y,i?i.originY:void 0)}function go(t,e,n){t.min=n.min+e.min,t.max=t.min+po(e)}function yo(t,e,n){t.min=e.min-n.min,t.max=t.min+po(e)}function vo(t,e,n){yo(t.x,e.x,n.x),yo(t.y,e.y,n.y)}function xo(t,e,n,i,s){return t=bs(t-=e,1/n,i),void 0!==s&&(t=bs(t,1/s,i)),t}function wo(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){kt.test(e)&&(e=parseFloat(e),e=Gt(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=Gt(o.min,o.max,i);t===o&&(a-=e),t.min=xo(t.min,e,n,a,s),t.max=xo(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const To=["x","scaleX","originX"],So=["y","scaleY","originY"];function Po(t,e,n,i){wo(t.x,e,To,n?n.x:void 0,i?i.x:void 0),wo(t.y,e,So,n?n.y:void 0,i?i.y:void 0)}function bo(t){return 0===t.translate&&1===t.scale}function Eo(t){return bo(t.x)&&bo(t.y)}function Ao(t,e){return t.min===e.min&&t.max===e.max}function Mo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Vo(t,e){return Mo(t.x,e.x)&&Mo(t.y,e.y)}function Co(t){return po(t.x)/po(t.y)}function ko(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Do(t){return[t("x"),t("y")]}const Ro=["TopLeft","TopRight","BottomLeft","BottomRight"],Lo=Ro.length,Bo=t=>"string"==typeof t?parseFloat(t):t,jo=t=>"number"==typeof t||Dt.test(t);function Fo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Io=Uo(0,.5,Y),Oo=Uo(.5,.95,A);function Uo(t,e,n){return i=>ie?1:n(C(t,e,i))}function Wo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const No=(t,e)=>t.depth-e.depth;class $o{constructor(){this.children=[],this.isDirty=!1}add(t){f(this.children,t),this.isDirty=!0}remove(t){g(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(No),this.isDirty=!1,this.children.forEach(t)}}function Yo(t){return _n(t)?t.get():t}class zo{constructor(){this.members=[]}add(t){f(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1===i.isConnected&&!1!==n.isPresent&&!n.snapshot&&g(this.members,n)}t.scheduleRender()}remove(t){if(g(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t],i=e.instance;if(!1!==e.isPresent&&(!i||!1!==i.isConnected)){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender();const i=n.options.layoutDependency,s=t.options.layoutDependency;if(!(void 0!==i&&void 0!==s&&i===s)){const i=n.instance;i&&!1===i.isConnected&&!n.snapshot||(t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:o}=t.options;!1===o&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Xo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ho=["","X","Y","Z"];let Ko=0;function Go(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function qo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ei(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",st,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&qo(i)}function Zo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Ko++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Qo),this.nodes.forEach(rr),this.nodes.forEach(ar),this.nodes.forEach(tr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;st.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=ut.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(ot(i),t(o-e))};return st.setup(i,!0),()=>ot(i)}(s,250),Xo.hasAnimatedSinceResize&&(Xo.hasAnimatedSinceResize=!1,this.nodes.forEach(or)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||pr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Vo(this.targetLayout,i),h=!e&&n;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Wn(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h)}else e||or(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ot(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(lr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||po(this.snapshot.measuredBox.x)||po(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;tVs&&(e.x=1),e.yVs&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(co(this.prevProjectionDelta.x,this.projectionDelta.x),co(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),fo(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&ko(this.projectionDelta.x,this.prevProjectionDelta.x)&&ko(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),h=!l||l.members.length<=1,u=Boolean(a&&!h&&!0===this.options.crossfade&&!this.path.some(dr));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,g;ur(o.x,t.x,n),ur(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(vo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,g=n,cr(p.x,m.x,f.x,g),cr(p.y,m.y,f.y,g),c&&(l=this.relativeTarget,d=c,Ao(l.x,d.x)&&Ao(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),uo(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=Gt(0,n.opacity??1,Io(i)),t.opacityExit=Gt(e.opacity??1,0,Oo(i))):o&&(t.opacity=Gt(e.opacity??1,n.opacity??1,i));for(let s=0;s{Xo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Kn(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(t,e,n){const i=_n(t)?t:Kn(t);return i.start(Nn("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&yr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=po(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=po(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}uo(e,n),Rs(e,s),fo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new zo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Go("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(nr),this.root.sharedNodes.clear()}}}function _o(t){t.updateLayout()}function Jo(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?Do(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=po(i);i.min=n[t].min,i.max=i.min+s}):yr(s,e.layoutBox,n)&&Do(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=po(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};fo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?fo(a,t.applyTransform(i,!0),e.measuredBox):fo(a,n,e.layoutBox);const l=!Eo(r);let h=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};vo(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};vo(a,n,o.layoutBox),Vo(r,a)||(h=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Qo(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function tr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function er(t){t.clearSnapshot()}function nr(t){t.clearMeasurements()}function ir(t){t.isLayoutDirty=!1}function sr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function or(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function rr(t){t.resolveTargetDelta()}function ar(t){t.calcProjection()}function lr(t){t.resetSkewAndRotation()}function hr(t){t.removeLeadSnapshot()}function ur(t,e,n){t.translate=Gt(e.translate,0,n),t.scale=Gt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function cr(t,e,n,i){t.min=Gt(e.min,n.min,i),t.max=Gt(e.max,n.max,i)}function dr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const pr={duration:.45,ease:[.4,0,.1,1]},mr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),fr=mr("applewebkit/")&&!mr("chrome/")?Math.round:A;function gr(t){t.min=fr(t.min),t.max=fr(t.max)}function yr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Co(e),s=Co(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function vr(t){return t!==t.root&&t.scroll?.wasRoot}const xr=Zo({attachResizeListener:(t,e)=>Wo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),wr={current:void 0},Tr=Zo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!wr.current){const t=new xr({});t.mount(window),t.setOptions({layoutScroll:!0}),wr.current=t}return wr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Sr(t){const{initial:e,animate:n}=function(t,e){if(as(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ss(e)?e:void 0,animate:ss(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(tt));return s(()=>({initial:e,animate:n}),[Pr(e),Pr(n)])}function Pr(t){return Array.isArray(t)?t.join(" "):t}const br=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Er(t,e,n){for(const i in e)_n(e[i])||$s(i,n)||(t[i]=e[i])}function Ar(t,e){const n={};return Er(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Fs(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Mr(t,e){const n={},i=Ar(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Vr=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Cr(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Gs(n,e,Zs(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Er(e,t.style,t),o.style={...e,...o.style}}return o}const kr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Dr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kr.has(t)}let Rr=t=>!Dr(t);try{"function"==typeof(Lr=require("@emotion/is-prop-valid").default)&&(Rr=t=>t.startsWith("on")?!Dr(t):Lr(t))}catch{}var Lr;const Br=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jr(t){return"string"==typeof t&&!t.includes("-")&&!!(Br.indexOf(t)>-1||/[A-Z]/u.test(t))}function Fr(t,e,n,{latestValues:i},a,l=!1,h){const u=(h??jr(t)?Cr:Mr)(e,i,a,t),c=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Rr(s)||!0===n&&Dr(s)||!e&&!Dr(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(e,"string"==typeof t,l),d=t!==o?{...c,...u,ref:n}:{},{children:p}=e,m=s(()=>_n(p)?p.get():p,[p]);return r(t,{...d,children:m})}const Ir=n(null);function Or(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=Yo(o[t]);let{initial:r,animate:a}=t;const l=as(t),h=ls(t);e&&h&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const c=u?a:r;if(c&&"boolean"!=typeof c&&!is(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n(e,n)=>{const s=i(tt),o=i(Ir),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Or(n,i,s,t),renderState:e()}}(t,e,s,o);return n?r():function(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}(r)},Wr=Ur({scrapeMotionValuesFromProps:Ys,createRenderState:br}),Nr=Ur({scrapeMotionValuesFromProps:_s,createRenderState:Vr}),$r="undefined"!=typeof window,Yr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let zr=!1;function Xr(){return function(){if(zr)return;const t={};for(const e in Yr)t[e]={isEnabled:t=>Yr[e].some(e=>!!t[e])};ms(t),zr=!0}(),ps}const Hr=Symbol.for("motionComponentSymbol");function Kr(t,e,n){const i=a(n);l(()=>{i.current=n});const s=a(null);return h(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const o=i.current;if("function"==typeof o)if(n){const t=o(n);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):o(n);else o&&(o.current=n)},[e])}const Gr=n({});function qr(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const Zr=$r?u:c;function _r(t,e,n,s,o,r){const{visualElement:h}=i(tt),u=i(J),d=i(Ir),p=i(Q),m=p.reducedMotion,f=p.skipAnimations,g=a(null),y=a(!1);s=s||u.renderer,!g.current&&s&&(g.current=s(t,{visualState:e,parent:h,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:f,isSVG:r}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const v=g.current,x=i(Gr);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:h,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Jr(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&qr(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:h})}(g.current,n,o,x);const w=a(!1);l(()=>{v&&w.current&&v.update(n,d)});const T=n[ti],S=a(Boolean(T)&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return Zr(()=>{y.current=!0,v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),c(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),S.current=!1),v.enteringChildren=void 0)}),v}function Jr(t){if(t)return!1!==t.options.allowProjection?t.projection:Jr(t.parent)}function Qr(n,{forwardMotionProps:s=!1,type:o}={},r,a){r&&function(t){const e=Xr();for(const n in t)e[n]={...e[n],...t[n]};ms(e)}(r);const l=o?"svg"===o:jr(n),h=l?Nr:Wr;function u(o,r){let u;const c={...i(Q),...o,layoutId:ta(o)},{isStatic:d}=c,p=Sr(o),m=h(o,d);if(!d&&$r){i(J).strict;const t=function(t){const e=Xr(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);u=t.MeasureLayout,p.visualElement=_r(n,m,c,a,t.ProjectionNode,l)}return t(tt.Provider,{value:p,children:[u&&p.visualElement?e(u,{visualElement:p.visualElement,...c}):null,Fr(n,o,Kr(m,p.visualElement,r),m,d,s,l)]})}u.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const c=d(u);return c[Hr]=n,c}function ta({layoutId:t}){const e=i(_).id;return e&&void 0!==t?e+"-"+t:t}const ea=(t,e)=>e.isSVG??jr(t)?new Js(e):new zs(e,{allowProjection:t!==o});let na=0;const ia={animation:{Feature:class extends ys{constructor(t){super(t),t.animationState||(t.animationState=oo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();is(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ys{constructor(){super(...arguments),this.id=na++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function sa(t){return{point:{x:t.pageX,y:t.pageY}}}function oa(t,e,n,i){return Wo(t,e,(t=>e=>Ri(e)&&t(e,sa(e)))(n),i)}const ra=({current:t})=>t?t.ownerDocument.defaultView:null,aa=(t,e)=>Math.abs(t-e);const la=new Set(["auto","scroll"]);class ha{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=da(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=aa(t.x,e.x),i=aa(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=rt;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=ua(e,this.transformPagePoint),st.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=da("pointercancel"===t.type?this.lastMoveEventInfo:ua(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Ri(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=ua(sa(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=rt;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,da(a,this.history)),this.removeListeners=V(oa(this.contextWindow,"pointermove",this.handlePointerMove),oa(this.contextWindow,"pointerup",this.handlePointerUp),oa(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(la.has(t.overflowX)||la.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),st.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ot(this.updatePoint)}}function ua(t,e){return e?{point:e(t.point)}:t}function ca(t,e){return{x:t.x-e.x,y:t.y-e.y}}function da({point:t},e){return{point:t,delta:ca(t,ma(e)),offset:ca(t,pa(e)),velocity:fa(e,.1)}}function pa(t){return t[0]}function ma(t){return t[t.length-1]}function fa(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=ma(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>D(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*D(e)&&(i=t[1]);const o=R(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ga(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function ya(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{e&&this.snapToCursor(sa(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?Mi[o]?null:(Mi[o]=!0,()=>{Mi[o]=!1}):Mi.x||Mi.y?null:(Mi.x=Mi.y=!0,()=>{Mi.x=Mi.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Do(t=>{let e=this.getAxisMotionValue(t).get()||0;if(kt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=po(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&st.update(()=>s(t,e),!1,!0),Jn(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&st.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:ra(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&st.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!ba(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?Gt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&qr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:ga(t.x,n,s),y:ga(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=va){return!1===t?t=0:!0===t&&(t=va),{x:xa(t,"left","right"),y:xa(t,"top","bottom")}}(e),i!==this.constraints&&!qr(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Do(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!qr(t))return!1;const n=t.current;w(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Ls(t,n),{scroll:s}=e;return s&&(ks(i.x,s.offset.x),ks(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:ya(t.x,e.x),y:ya(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=vs(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Do(r=>{if(!ba(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=i?200:1e6,u=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Jn(this.visualElement,t),n.start(Nn(t,n,0,e,this.visualElement,!1))}stopAnimation(){Do(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Do(e=>{const{drag:n}=this.getProps();if(!ba(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e],r=s.get()||0;s.set(t[e]-Gt(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!qr(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Do(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=po(t),s=po(e);return s>i?n=C(e.min,e.max-i,t.min):i>s&&(n=C(t.min,t.max-s,e.min)),y(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Do(e=>{if(!ba(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Gt(s,o,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ta.set(this.visualElement,this);const t=this.visualElement.current,e=oa(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Bi.has(t.tagName)||!0===t.isContentEditable}(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();qr(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Qi(t,Pa(n)),s=Qi(e,Pa(n));return()=>{i(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),st.read(i);const r=Wo(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Do(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=va,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Pa(t){let e=!0;return()=>{e?e=!1:t()}}function ba(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Ea=t=>(e,n)=>{t&&st.update(()=>t(e,n),!1,!0)};let Aa=!1;class Ma extends m{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),Aa&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Xo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),Aa=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||st.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ei.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;Aa=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Va(t){const[n,s]=function(t=!0){const e=i(Ir);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=p();c(()=>{if(t)return o(r)},[t]);const a=h(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,a]:[!0]}(),o=i(_);return e(Ma,{...t,layoutGroup:o,switchLayoutGroup:i(Gr),isPresent:n,safeToRemove:s})}const Ca={pan:{Feature:class extends ys{constructor(){super(...arguments),this.removePointerDownListener=A}onPointerDown(t){this.session=new ha(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ra(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ea(t),onStart:Ea(e),onMove:Ea(n),onEnd:(t,e)=>{delete this.session,i&&st.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=oa(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ys{constructor(t){super(t),this.removeGroupControls=A,this.removeListeners=A,this.controls=new Sa(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||A}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Tr,MeasureLayout:Va}};function ka(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&st.postRender(()=>s(e,sa(e)))}function Da(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&st.postRender(()=>s(e,sa(e)))}const Ra=new WeakMap,La=new WeakMap,Ba=t=>{const e=Ra.get(t.target);e&&e(t)},ja=t=>{t.forEach(Ba)};function Fa(t,e,n){const i=function({root:t,...e}){const n=t||document;La.has(n)||La.set(n,{});const i=La.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(ja,{root:t,...e})),i[s]}(e);return Ra.set(t,n),i.observe(t),()=>{Ra.delete(t),i.unobserve(t)}}const Ia={some:0,all:1};const Oa={...ia,...{inView:{Feature:class extends ys{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ia[i]};return Fa(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ys{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Wi(t,(t,e)=>(Da(this.node,e,"Start"),(t,{success:e})=>Da(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ys{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=V(Wo(this.node.current,"focus",()=>this.onFocus()),Wo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ys{mount(){const{current:t}=this.node;t&&(this.unmount=ki(t,(t,e)=>(ka(this.node,e,"Start"),t=>ka(this.node,t,"End"))))}unmount(){}}}},...Ca,...{layout:{ProjectionNode:Tr,MeasureLayout:Va}}};function Ua(t,e){return Qr(t,e,Oa,ea)}const Wa=Ua("div");export{Wa as MotionDiv}; +//# sourceMappingURL=size-rollup-motion.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-motion.js.map b/node_modules/framer-motion/dist/size-rollup-motion.js.map new file mode 100644 index 00000000..38180c6a --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-motion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-motion.js","sources":["../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../lib/context/LayoutGroupContext.js","../lib/context/LazyContext.js","../lib/context/MotionConfigContext.js","../lib/context/MotionContext/index.js","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/stats/buffer.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/generators/spring/defaults.mjs","../../motion-dom/dist/es/animation/generators/spring/find.mjs","../../motion-dom/dist/es/animation/generators/spring/index.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/utils/calc-child-stagger.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/animation/utils/default-transitions.mjs","../../motion-dom/dist/es/animation/utils/get-final-keyframe.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../motion-dom/dist/es/render/utils/setters.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/will-change/add-will-change.mjs","../../motion-dom/dist/es/value/will-change/is.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/complex/mask.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/gestures/drag/state/is-active.mjs","../../motion-dom/dist/es/gestures/utils/setup.mjs","../../motion-dom/dist/es/gestures/hover.mjs","../../motion-dom/dist/es/gestures/utils/is-node-or-child.mjs","../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs","../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs","../../motion-dom/dist/es/gestures/press/utils/state.mjs","../../motion-dom/dist/es/gestures/press/utils/keyboard.mjs","../../motion-dom/dist/es/gestures/press/index.mjs","../../motion-dom/dist/es/utils/is-html-element.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-dom/dist/es/resize/handle-element.mjs","../../motion-dom/dist/es/resize/handle-window.mjs","../../motion-dom/dist/es/resize/index.mjs","../../motion-dom/dist/es/value/types/utils/find.mjs","../../motion-dom/dist/es/projection/geometry/models.mjs","../../motion-dom/dist/es/render/store.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/utils/motion-values.mjs","../../motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../motion-dom/dist/es/render/Feature.mjs","../../motion-dom/dist/es/projection/geometry/conversion.mjs","../../motion-dom/dist/es/projection/utils/has-transform.mjs","../../motion-dom/dist/es/projection/geometry/delta-apply.mjs","../../motion-dom/dist/es/projection/utils/measure.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/html/utils/render.mjs","../../motion-dom/dist/es/projection/styles/scale-border-radius.mjs","../../motion-dom/dist/es/projection/styles/scale-box-shadow.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/render.mjs","../../motion-dom/dist/es/render/utils/get-variant-context.mjs","../../motion-dom/dist/es/render/utils/shallow-compare.mjs","../../motion-dom/dist/es/render/utils/animation-state.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element.mjs","../../motion-dom/dist/es/projection/geometry/copy.mjs","../../motion-dom/dist/es/projection/geometry/delta-calc.mjs","../../motion-dom/dist/es/projection/geometry/delta-remove.mjs","../../motion-dom/dist/es/projection/geometry/utils.mjs","../../motion-dom/dist/es/projection/utils/each-axis.mjs","../../motion-dom/dist/es/projection/animation/mix-values.mjs","../../motion-dom/dist/es/events/add-dom-event.mjs","../../motion-dom/dist/es/projection/utils/compare-by-depth.mjs","../../motion-dom/dist/es/projection/utils/flat-tree.mjs","../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../../motion-dom/dist/es/projection/shared/stack.mjs","../../motion-dom/dist/es/projection/node/state.mjs","../../motion-dom/dist/es/projection/node/create-projection-node.mjs","../../motion-dom/dist/es/utils/is-svg-svg-element.mjs","../../motion-dom/dist/es/utils/delay.mjs","../../motion-dom/dist/es/animation/animate/single-value.mjs","../../motion-dom/dist/es/projection/styles/transform.mjs","../../motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs","../../motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs","../lib/context/MotionContext/create.js","../lib/context/MotionContext/utils.js","../lib/render/html/utils/create-render-state.js","../lib/render/html/use-props.js","../lib/render/svg/utils/create-render-state.js","../lib/render/svg/use-props.js","../lib/motion/utils/valid-prop.js","../lib/render/dom/utils/filter-props.js","../lib/render/svg/lowercase-elements.js","../lib/render/dom/utils/is-svg-component.js","../lib/render/dom/use-render.js","../lib/context/PresenceContext.js","../lib/motion/utils/use-visual-state.js","../lib/utils/use-constant.js","../lib/render/html/use-html-visual-state.js","../lib/render/svg/use-svg-visual-state.js","../lib/utils/is-browser.js","../lib/motion/features/definitions.js","../lib/motion/utils/symbol.js","../lib/motion/utils/use-motion-ref.js","../lib/context/SwitchLayoutGroupContext.js","../lib/utils/is-ref-object.js","../lib/utils/use-isomorphic-effect.js","../lib/motion/utils/use-visual-element.js","../lib/motion/index.js","../lib/motion/features/load-features.js","../lib/render/dom/create-visual-element.js","../lib/motion/features/animation/exit.js","../lib/motion/features/animations.js","../lib/motion/features/animation/index.js","../lib/events/event-info.js","../lib/events/add-pointer-event.js","../lib/utils/get-context-window.js","../lib/utils/distance.js","../lib/gestures/pan/PanSession.js","../lib/gestures/drag/utils/constraints.js","../lib/gestures/drag/VisualElementDragControls.js","../../motion-dom/dist/es/gestures/drag/state/set-active.mjs","../lib/gestures/pan/index.js","../lib/motion/features/layout/MeasureLayout.js","../lib/components/AnimatePresence/use-presence.js","../lib/motion/features/drag.js","../lib/gestures/drag/index.js","../lib/gestures/hover.js","../lib/gestures/press.js","../lib/motion/features/viewport/observers.js","../lib/motion/features/viewport/index.js","../lib/motion/features/gestures.js","../lib/render/components/motion/feature-bundle.js","../lib/gestures/focus.js","../lib/motion/features/layout.js","../lib/render/components/motion/create.js","../lib/render/components/motion/elements.js","../lib/render/components/motion/size.js"],"sourcesContent":["function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n//# sourceMappingURL=is-numerical-string.mjs.map\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n//# sourceMappingURL=is-zero-value-string.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from GaĆ«tan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n//# sourceMappingURL=mirror.mjs.map\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n//# sourceMappingURL=reverse.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n//# sourceMappingURL=back.mjs.map\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n//# sourceMappingURL=anticipate.mjs.map\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n//# sourceMappingURL=circ.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n//# sourceMappingURL=ease.mjs.map\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n//# sourceMappingURL=map.mjs.map\n","\"use client\";\nimport { createContext } from \"react\";\nexport const LayoutGroupContext = createContext({});\n//# sourceMappingURL=LayoutGroupContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const LazyContext = createContext({ strict: false });\n//# sourceMappingURL=LazyContext.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n//# sourceMappingURL=MotionConfigContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const MotionContext = /* @__PURE__ */ createContext({});\n//# sourceMappingURL=index.js.map","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n\nexport { statsBuffer };\n//# sourceMappingURL=buffer.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n//# sourceMappingURL=sync-time.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n","const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\n\nexport { springDefaults };\n//# sourceMappingURL=defaults.mjs.map\n","import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n//# sourceMappingURL=find.mjs.map\n","import { millisecondsToSeconds, secondsToMilliseconds, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../utils/calc-duration.mjs';\nimport { createGeneratorEasing } from '../utils/create-generator-easing.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=index.mjs.map\n","import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n","const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n//# sourceMappingURL=is-easing-array.mjs.map\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n//# sourceMappingURL=time.mjs.map\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n//# sourceMappingURL=replace-transition-type.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n this.driver?.start(false);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n this.updateTime(time.now());\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n//# sourceMappingURL=parse-transform.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n//# sourceMappingURL=KeyframesResolver.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\n\nexport { supportsScrollTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","import { anticipate, backInOut, circInOut } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n//# sourceMappingURL=unsupported-easing.mjs.map\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n if (options.startTime !== undefined) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);\n motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * āœ…: 100, \"100px\", \"#fff\"\n * āŒ: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n//# sourceMappingURL=is-animatable.mjs.map\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n//# sourceMappingURL=make-animation-instant.mjs.map\n","import { memo } from 'motion-utils';\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n//# sourceMappingURL=waapi.mjs.map\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions);\n const element = resolvedOptions.motionValue?.owner?.current;\n const animation = useWaapi\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n })\n : new JSAnimation(resolvedOptions);\n animation.finished.then(() => {\n this.notifyFinished();\n }).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null) {\n return false;\n }\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n//# sourceMappingURL=can-animate.mjs.map\n","function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child);\n const numChildren = children.size;\n const maxStaggerDuration = (numChildren - 1) * staggerChildren;\n const delayIsFunction = typeof delayChildren === \"function\";\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren;\n}\n\nexport { calcChildStagger };\n//# sourceMappingURL=calc-child-stagger.mjs.map\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n//# sourceMappingURL=css-variables-conversion.mjs.map\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n//# sourceMappingURL=default-transitions.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final-keyframe.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../utils/get-final-keyframe.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n","/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n\nexport { isTransitionDefined };\n//# sourceMappingURL=is-transition-defined.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n//# sourceMappingURL=resolve-dynamic-variants.mjs.map\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n//# sourceMappingURL=keys-position.mjs.map\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n//# sourceMappingURL=index.mjs.map\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n//# sourceMappingURL=is-keyframes-target.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n//# sourceMappingURL=setters.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n//# sourceMappingURL=add-will-change.mjs.map\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n//# sourceMappingURL=is.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n//# sourceMappingURL=get-appear-id.mjs.map\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { calcChildStagger } from '../utils/calc-child-stagger.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n for (const child of visualElement.variantChildren) {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n }\n return Promise.all(animations);\n}\n\nexport { animateVariant };\n//# sourceMappingURL=visual-element-variant.mjs.map\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n//# sourceMappingURL=auto.mjs.map\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n//# sourceMappingURL=test.mjs.map\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n//# sourceMappingURL=dimensions.mjs.map\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n//# sourceMappingURL=is-none.mjs.map\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n//# sourceMappingURL=filter.mjs.map\n","import { complex } from './index.mjs';\n\nconst mask = {\n ...complex,\n getAnimatableNone: (v) => {\n const parsed = complex.parse(v);\n const transformer = complex.createTransformer(v);\n return transformer(parsed.map((v) => typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v));\n },\n};\n\nexport { mask };\n//# sourceMappingURL=mask.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n//# sourceMappingURL=defaults.mjs.map\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask]);\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (!customTypes.has(defaultValueType))\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n//# sourceMappingURL=animatable-none.mjs.map\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n//# sourceMappingURL=make-none-animatable.mjs.map\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin);\n const targetHasVar = containsCSSVariable(target);\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n//# sourceMappingURL=DOMKeyframesResolver.mjs.map\n","/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved\n // or until we implement support for linear() easing.\n // \"background-color\"\n]);\n\nexport { acceleratedValues };\n//# sourceMappingURL=accelerated-values.mjs.map\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n//# sourceMappingURL=microtask.mjs.map\n","const isDragging = {\n x: false,\n y: false,\n};\nfunction isDragActive() {\n return isDragging.x || isDragging.y;\n}\n\nexport { isDragActive, isDragging };\n//# sourceMappingURL=is-active.mjs.map\n","import { resolveElements } from '../../utils/resolve-elements.mjs';\n\nfunction setupGesture(elementOrSelector, options) {\n const elements = resolveElements(elementOrSelector);\n const gestureAbortController = new AbortController();\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n };\n const cancel = () => gestureAbortController.abort();\n return [elements, eventOptions, cancel];\n}\n\nexport { setupGesture };\n//# sourceMappingURL=setup.mjs.map\n","import { isDragActive } from './drag/state/is-active.mjs';\nimport { setupGesture } from './utils/setup.mjs';\n\nfunction isValidHover(event) {\n return !(event.pointerType === \"touch\" || isDragActive());\n}\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nfunction hover(elementOrSelector, onHoverStart, options = {}) {\n const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);\n elements.forEach((element) => {\n let isPressed = false;\n let deferredHoverEnd = false;\n let hoverEndCallback;\n const removePointerLeave = () => {\n element.removeEventListener(\"pointerleave\", onPointerLeave);\n };\n const endHover = (event) => {\n if (hoverEndCallback) {\n hoverEndCallback(event);\n hoverEndCallback = undefined;\n }\n removePointerLeave();\n };\n const onPointerUp = (event) => {\n isPressed = false;\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerUp);\n if (deferredHoverEnd) {\n deferredHoverEnd = false;\n endHover(event);\n }\n };\n const onPointerDown = () => {\n isPressed = true;\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerUp, eventOptions);\n };\n const onPointerLeave = (leaveEvent) => {\n if (leaveEvent.pointerType === \"touch\")\n return;\n if (isPressed) {\n deferredHoverEnd = true;\n return;\n }\n endHover(leaveEvent);\n };\n const onPointerEnter = (enterEvent) => {\n if (!isValidHover(enterEvent))\n return;\n deferredHoverEnd = false;\n const onHoverEnd = onHoverStart(element, enterEvent);\n if (typeof onHoverEnd !== \"function\")\n return;\n hoverEndCallback = onHoverEnd;\n element.addEventListener(\"pointerleave\", onPointerLeave, eventOptions);\n };\n element.addEventListener(\"pointerenter\", onPointerEnter, eventOptions);\n element.addEventListener(\"pointerdown\", onPointerDown, eventOptions);\n });\n return cancel;\n}\n\nexport { hover };\n//# sourceMappingURL=hover.mjs.map\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n//# sourceMappingURL=is-node-or-child.mjs.map\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n//# sourceMappingURL=is-primary-pointer.mjs.map\n","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n]);\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nfunction isElementKeyboardAccessible(element) {\n return (keyboardAccessibleElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"]);\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nfunction isElementTextInput(element) {\n return (textInputElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\n\nexport { isElementKeyboardAccessible, isElementTextInput };\n//# sourceMappingURL=is-keyboard-accessible.mjs.map\n","const isPressing = new WeakSet();\n\nexport { isPressing };\n//# sourceMappingURL=state.mjs.map\n","import { isPressing } from './state.mjs';\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.key !== \"Enter\")\n return;\n callback(event);\n };\n}\nfunction firePointerEvent(target, type) {\n target.dispatchEvent(new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true }));\n}\nconst enableKeyboardPress = (focusEvent, eventOptions) => {\n const element = focusEvent.currentTarget;\n if (!element)\n return;\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element))\n return;\n firePointerEvent(element, \"down\");\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\");\n });\n const handleBlur = () => firePointerEvent(element, \"cancel\");\n element.addEventListener(\"keyup\", handleKeyup, eventOptions);\n element.addEventListener(\"blur\", handleBlur, eventOptions);\n });\n element.addEventListener(\"keydown\", handleKeydown, eventOptions);\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\"blur\", () => element.removeEventListener(\"keydown\", handleKeydown), eventOptions);\n};\n\nexport { enableKeyboardPress };\n//# sourceMappingURL=keyboard.mjs.map\n","import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\nconst claimedPointerDownEvents = new WeakSet();\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n if (claimedPointerDownEvents.has(startEvent))\n return;\n isPressing.add(target);\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent);\n }\n const onPressEnd = onPressStart(target, startEvent);\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerCancel);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n//# sourceMappingURL=index.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n\nexport { isHTMLElement };\n//# sourceMappingURL=is-html-element.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","import { isSVGElement } from '../utils/is-svg-element.mjs';\nimport { resolveElements } from '../utils/resolve-elements.mjs';\n\nconst resizeHandlers = new WeakMap();\nlet observer;\nconst getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][(borderBoxAxis + \"Size\")];\n }\n else if (isSVGElement(target) && \"getBBox\" in target) {\n return target.getBBox()[svgAxis];\n }\n else {\n return target[htmlAxis];\n }\n};\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\");\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\");\nfunction notifyTarget({ target, borderBoxSize }) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize);\n },\n get height() {\n return getHeight(target, borderBoxSize);\n },\n });\n });\n}\nfunction notifyAll(entries) {\n entries.forEach(notifyTarget);\n}\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\")\n return;\n observer = new ResizeObserver(notifyAll);\n}\nfunction resizeElement(target, handler) {\n if (!observer)\n createResizeObserver();\n const elements = resolveElements(target);\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element);\n if (!elementHandlers) {\n elementHandlers = new Set();\n resizeHandlers.set(element, elementHandlers);\n }\n elementHandlers.add(handler);\n observer?.observe(element);\n });\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element);\n elementHandlers?.delete(handler);\n if (!elementHandlers?.size) {\n observer?.unobserve(element);\n }\n });\n };\n}\n\nexport { resizeElement };\n//# sourceMappingURL=handle-element.mjs.map\n","const windowCallbacks = new Set();\nlet windowResizeHandler;\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth;\n },\n get height() {\n return window.innerHeight;\n },\n };\n windowCallbacks.forEach((callback) => callback(info));\n };\n window.addEventListener(\"resize\", windowResizeHandler);\n}\nfunction resizeWindow(callback) {\n windowCallbacks.add(callback);\n if (!windowResizeHandler)\n createWindowResizeHandler();\n return () => {\n windowCallbacks.delete(callback);\n if (!windowCallbacks.size &&\n typeof windowResizeHandler === \"function\") {\n window.removeEventListener(\"resize\", windowResizeHandler);\n windowResizeHandler = undefined;\n }\n };\n}\n\nexport { resizeWindow };\n//# sourceMappingURL=handle-window.mjs.map\n","import { resizeElement } from './handle-element.mjs';\nimport { resizeWindow } from './handle-window.mjs';\n\nfunction resize(a, b) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\n}\n\nexport { resize };\n//# sourceMappingURL=index.mjs.map\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n//# sourceMappingURL=find.mjs.map\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n//# sourceMappingURL=models.mjs.map\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n//# sourceMappingURL=store.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n//# sourceMappingURL=state.mjs.map\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { findValueType } from '../value/types/utils/find.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false;\n }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n//# sourceMappingURL=motion-values.mjs.map\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n//# sourceMappingURL=DOMVisualElement.mjs.map\n","/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nclass Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n//# sourceMappingURL=Feature.mjs.map\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n//# sourceMappingURL=conversion.mjs.map\n","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale({ scale, scaleX, scaleY }) {\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY);\n}\nfunction has2DTranslate(values) {\n return is2DTranslate(values.x) || is2DTranslate(values.y);\n}\nfunction is2DTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { has2DTranslate, hasScale, hasTransform };\n//# sourceMappingURL=has-transform.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n const distanceFromOrigin = point - originPoint;\n const scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, { x, y }) {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\nconst TREE_SCALE_SNAP_MIN = 0.999999999999;\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001;\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\n const treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n let node;\n let delta;\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options;\n if (visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\") {\n continue;\n }\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues);\n }\n }\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN) {\n treeScale.x = 1.0;\n }\n if (treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN) {\n treeScale.y = 1.0;\n }\n}\nfunction translateAxis(axis, distance) {\n axis.min = axis.min + distance;\n axis.max = axis.max + distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);\n}\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform) {\n transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX);\n transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\n//# sourceMappingURL=delta-apply.mjs.map\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n//# sourceMappingURL=measure.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n//# sourceMappingURL=build-transform.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n//# sourceMappingURL=render.mjs.map\n","import { px } from '../../value/types/numbers/units.mjs';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n//# sourceMappingURL=scale-border-radius.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n//# sourceMappingURL=scale-box-shadow.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { correctBorderRadius } from './scale-border-radius.mjs';\nimport { correctBoxShadow } from './scale-box-shadow.mjs';\n\nconst scaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n//# sourceMappingURL=HTMLVisualElement.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs };\n//# sourceMappingURL=build-attrs.mjs.map\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n//# sourceMappingURL=camel-case-attrs.mjs.map\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n//# sourceMappingURL=SVGVisualElement.mjs.map\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n//# sourceMappingURL=render.mjs.map\n","import { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nconst numVariantProps = variantProps.length;\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nfunction getVariantContext(visualElement) {\n if (!visualElement)\n return undefined;\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {};\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial;\n }\n return context;\n }\n const context = {};\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i];\n const prop = visualElement.props[name];\n if (isVariantLabel(prop) || prop === false) {\n context[name] = prop;\n }\n }\n return context;\n}\n\nexport { getVariantContext };\n//# sourceMappingURL=get-variant-context.mjs.map\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n//# sourceMappingURL=shallow-compare.mjs.map\n","import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\nimport { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs';\nimport { getVariantContext } from './get-variant-context.mjs';\nimport { isAnimationControls } from './is-animation-controls.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { shallowCompare } from './shallow-compare.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\nconst numAnimationTypes = variantPriorityOrder.length;\nfunction createAnimateFunction(visualElement) {\n return (animations) => {\n return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n };\n}\nfunction createAnimationState(visualElement) {\n let animate = createAnimateFunction(visualElement);\n let state = createState();\n let isInitialRender = true;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues = (type) => (acc, definition) => {\n const resolved = resolveVariant(visualElement, definition, type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n acc = { ...acc, ...target, ...transitionEnd };\n }\n return acc;\n };\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType) {\n const { props } = visualElement;\n const context = getVariantContext(visualElement.parent) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity;\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i];\n const typeState = state[type];\n const prop = props[type] !== undefined\n ? props[type]\n : context[type];\n const propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited = prop === context[type] &&\n prop !== props[type] &&\n propIsVariant;\n if (isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys };\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n continue;\n }\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n };\n }\n continue;\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n let handledRemovedValues = false;\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState;\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n };\n const markToAnimate = (key) => {\n shouldAnimateType = true;\n if (removedKeys.has(key)) {\n handledRemovedValues = true;\n removedKeys.delete(key);\n }\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n };\n for (const key in allKeys) {\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false;\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev);\n }\n else {\n valueHasChanged = next !== prev;\n }\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange;\n const needsAnimating = !willAnimateViaParent || handledRemovedValues;\n if (shouldAnimateType && needsAnimating) {\n animations.push(...definitionList.map((animation) => {\n const options = { type };\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (typeof animation === \"string\" &&\n isInitialRender &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent) {\n const { parent } = visualElement;\n const parentVariant = resolveVariant(parent, animation);\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } = parentVariant.transition || {};\n options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);\n }\n }\n return {\n animation: animation,\n options,\n };\n }));\n }\n }\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation = {};\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial);\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition;\n }\n }\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key);\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null;\n });\n animations.push({ animation: fallbackAnimation });\n }\n let shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive));\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState();\n /**\n * Temporarily disabling resetting this flag as it prevents components\n * with initial={false} from animating after being remounted, for instance\n * as the child of an Activity component.\n */\n // isInitialRender = true\n },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive = false) {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n };\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n//# sourceMappingURL=animation-state.mjs.map\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n//# sourceMappingURL=visual-element.mjs.map\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisDeltaInto(delta, originDelta) {\n delta.translate = originDelta.translate;\n delta.scale = originDelta.scale;\n delta.originPoint = originDelta.originPoint;\n delta.origin = originDelta.origin;\n}\n\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto };\n//# sourceMappingURL=copy.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\n\nconst SCALE_PRECISION = 0.0001;\nconst SCALE_MIN = 1 - SCALE_PRECISION;\nconst SCALE_MAX = 1 + SCALE_PRECISION;\nconst TRANSLATE_PRECISION = 0.01;\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target, maxDistance) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)) {\n delta.scale = 1.0;\n }\n if ((delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)) {\n delta.translate = 0.0;\n }\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent) {\n target.min = parent.min + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent) {\n calcRelativeAxis(target.x, relative.x, parent.x);\n calcRelativeAxis(target.y, relative.y, parent.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent) {\n target.min = layout.min - parent.min;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n//# sourceMappingURL=delta-calc.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent } from '../../value/types/numbers/units.mjs';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n//# sourceMappingURL=delta-remove.mjs.map\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction axisEquals(a, b) {\n return a.min === b.min && a.max === b.max;\n}\nfunction boxEquals(a, b) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);\n}\nfunction axisEqualsRounded(a, b) {\n return (Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max));\n}\nfunction boxEqualsRounded(a, b) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\nfunction axisDeltaEquals(a, b) {\n return (a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint);\n}\n\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };\n//# sourceMappingURL=utils.mjs.map\n","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\n//# sourceMappingURL=each-axis.mjs.map\n","import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\nimport { progress, circOut, noop } from 'motion-utils';\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\nconst numBorders = borders.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`;\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n//# sourceMappingURL=mix-values.mjs.map\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler);\n}\n\nexport { addDomEvent };\n//# sourceMappingURL=add-dom-event.mjs.map\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n//# sourceMappingURL=compare-by-depth.mjs.map\n","import { addUniqueItem, removeItem } from 'motion-utils';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n//# sourceMappingURL=flat-tree.mjs.map\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n//# sourceMappingURL=resolve-motion-value.mjs.map\n","import { addUniqueItem, removeItem } from 'motion-utils';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n for (let i = this.members.length - 1; i >= 0; i--) {\n const m = this.members[i];\n if (m === node || m === this.lead || m === this.prevLead)\n continue;\n const inst = m.instance;\n if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) {\n removeItem(this.members, m);\n }\n }\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead) {\n this.prevLead = undefined;\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead) {\n this.promote(prevLead);\n }\n }\n }\n relegate(node) {\n const indexOfNode = this.members.findIndex((member) => node === member);\n if (indexOfNode === 0)\n return false;\n /**\n * Find the next projection node that is present\n */\n let prevLead;\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i];\n const inst = member.instance;\n if (member.isPresent !== false && (!inst || inst.isConnected !== false)) {\n prevLead = member;\n break;\n }\n }\n if (prevLead) {\n this.promote(prevLead);\n return true;\n }\n else {\n return false;\n }\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender();\n node.scheduleRender();\n /**\n * If both the new and previous lead have the same defined layoutDependency,\n * skip the shared layout animation. This allows components with layoutId\n * to opt-out of animations when their layoutDependency hasn't changed,\n * even when the component unmounts and remounts in a different location.\n */\n const prevDep = prevLead.options.layoutDependency;\n const nextDep = node.options.layoutDependency;\n const dependencyMatches = prevDep !== undefined &&\n nextDep !== undefined &&\n prevDep === nextDep;\n if (!dependencyMatches) {\n const prevInstance = prevLead.instance;\n const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot;\n if (!isStale) {\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true;\n }\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true;\n }\n }\n }\n const { crossfade } = node.options;\n if (crossfade === false) {\n prevLead.hide();\n }\n }\n }\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node;\n options.onExitComplete && options.onExitComplete();\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete();\n }\n });\n }\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false);\n });\n }\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined;\n }\n }\n}\n\nexport { NodeStack };\n//# sourceMappingURL=stack.mjs.map\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n//# sourceMappingURL=state.mjs.map\n","import { SubscriptionManager, clamp, noop } from 'motion-utils';\nimport { animateSingleValue } from '../../animation/animate/single-value.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\nimport { getValueTransition } from '../../animation/utils/get-value-transition.mjs';\nimport { microtask } from '../../frameloop/microtask.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { isSVGElement } from '../../utils/is-svg-element.mjs';\nimport { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs';\nimport { mixNumber } from '../../utils/mix/number.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { boxEqualsRounded, isDeltaZero, axisDeltaEquals, aspectRatio, boxEquals } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { FlatTree } from '../utils/flat-tree.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { globalProjectionState } from './state.mjs';\nimport { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs';\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n};\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction cancelTreeOptimisedTransformAnimations(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return;\n const { visualElement } = projectionNode.options;\n if (!visualElement)\n return;\n const appearId = getOptimisedAppearId(visualElement);\n if (window.MotionHasOptimisedAnimation(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options;\n window.MotionCancelOptimisedAnimation(appearId, \"transform\", frame, !(layout || layoutId));\n }\n const { parent } = projectionNode;\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent);\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent?.()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n this.animationCommitId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n this.layoutVersion = 0;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.scheduleUpdate = () => this.update();\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0;\n }\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics);\n }\n };\n /**\n * Frame calculations\n */\n this.resolvedRelativeTargetAt = 0.0;\n this.linkedParentVersion = 0;\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n let innerWidth = 0;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth;\n });\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth;\n if (newInnerWidth === innerWidth)\n return;\n innerWidth = newInnerWidth;\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout);\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged;\n if (this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n this.eventHandlers.clear();\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(this);\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate();\n this.clearAllSnapshots();\n this.nodes.forEach(clearMeasurements);\n return;\n }\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes.forEach(clearIsLayoutDirty);\n return;\n }\n this.animationCommitId = this.animationId;\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n else {\n this.isUpdating = false;\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n }\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n frameSteps.update.process(frameData);\n frameSteps.preRender.process(frameData);\n frameSteps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(this.scheduleUpdate);\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n if (this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)) {\n this.snapshot = undefined;\n }\n }\n updateLayout() {\n if (!this.instance)\n return;\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutVersion++;\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance);\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot);\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n }\n return box;\n }\n removeElementScroll(box) {\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll;\n }\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box);\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false) {\n const withTransforms = createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!node.instance)\n continue;\n if (!hasTransform(node.latestValues))\n continue;\n hasScale(node.latestValues) && node.updateSnapshot();\n const sourceBox = createBox();\n const nodeBox = node.measurePageBox();\n copyBoxInto(sourceBox, nodeBox);\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot) {\n this.removeRelativeTarget();\n }\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (relativeParent && relativeParent.layout) {\n this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox);\n }\n else {\n this.removeRelativeTarget();\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n if (relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.createRelativeTarget(relativeParent, this.target, relativeParent.target);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++;\n }\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n createRelativeTarget(relativeParent, layout, parentLayout) {\n this.relativeParent = relativeParent;\n this.linkedParentVersion = relativeParent.layoutVersion;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined;\n }\n calcProjection() {\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas();\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas();\n }\n else {\n copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);\n copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);\n }\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n if (this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||\n !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++;\n }\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta();\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n mixAxisDelta(targetDelta.x, delta.x, progress);\n mixAxisDelta(targetDelta.y, delta.y, progress);\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation?.stop();\n this.resumingFrom?.currentAnimation?.stop();\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n activeAnimations.layout++;\n this.motionValue || (this.motionValue = motionValue(0));\n this.motionValue.jump(0, false);\n this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {\n ...options,\n velocity: 0,\n isSync: true,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onStop: () => {\n activeAnimations.layout--;\n },\n onComplete: () => {\n activeAnimations.layout--;\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.lead || this : this;\n }\n getPrevLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp) {\n if (!this.instance || this.isSVG)\n return;\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\";\n return;\n }\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n targetStyle.visibility = \"\";\n targetStyle.opacity = \"\";\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return;\n }\n targetStyle.visibility = \"\";\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform);\n }\n targetStyle.transform = transform;\n const { x, y } = this.projectionDelta;\n targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i]] = corrected;\n }\n }\n else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n this.options.visualElement.renderState.vars[key] = corrected;\n }\n else {\n targetStyle[key] = corrected;\n }\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\";\n }\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => node.currentAnimation?.stop());\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeLayoutChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++;\n }\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDelta(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\nfunction checkNodeWasScrollRoot(node) {\n return node !== node.root && node.scroll?.wasRoot;\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\n//# sourceMappingURL=create-projection-node.mjs.map\n","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n//# sourceMappingURL=is-svg-svg-element.mjs.map\n","import { time } from '../frameloop/sync-time.mjs';\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.setup(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\nfunction delayInSeconds(callback, timeout) {\n return delay(callback, secondsToMilliseconds(timeout));\n}\n\nexport { delay, delayInSeconds };\n//# sourceMappingURL=delay.mjs.map\n","import { animateMotionValue } from '../interfaces/motion-value.mjs';\nimport { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n//# sourceMappingURL=single-value.mjs.map\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = latestTransform?.z || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n//# sourceMappingURL=transform.mjs.map\n","import { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { createProjectionNode } from './create-projection-node.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n//# sourceMappingURL=DocumentProjectionNode.mjs.map\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n//# sourceMappingURL=HTMLProjectionNode.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \".\";\nimport { getCurrentTreeVariants } from \"./utils\";\nexport function useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n//# sourceMappingURL=create.js.map","import { isControllingVariants, isVariantLabel } from \"motion-dom\";\nexport function getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n//# sourceMappingURL=utils.js.map","export const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildHTMLStyles, isForcedMotionValue, isMotionValue } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport function copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nexport function useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n//# sourceMappingURL=use-props.js.map","import { createHtmlRenderState } from \"../../html/utils/create-render-state\";\nexport const createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { copyRawValuesOnly } from \"../html/use-props\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport function useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n//# sourceMappingURL=use-props.js.map","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n//# sourceMappingURL=valid-prop.js.map","import { isValidMotionProp } from \"../../../motion/utils/valid-prop\";\nlet shouldForward = (key) => !isValidMotionProp(key);\nexport function loadExternalIsValidProp(isValidProp) {\n if (typeof isValidProp !== \"function\")\n return;\n // Explicitly filter our events\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n}\ncatch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nexport function filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n//# sourceMappingURL=filter-props.js.map","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n//# sourceMappingURL=lowercase-elements.js.map","import { lowercaseSVGElements } from \"../../svg/lowercase-elements\";\nexport function isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n//# sourceMappingURL=is-svg-component.js.map","\"use client\";\nimport { isMotionValue } from \"motion-dom\";\nimport { Fragment, createElement, useMemo } from \"react\";\nimport { useHTMLProps } from \"../html/use-props\";\nimport { useSVGProps } from \"../svg/use-props\";\nimport { filterProps } from \"./utils/filter-props\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n//# sourceMappingURL=use-render.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const PresenceContext = \n/* @__PURE__ */ createContext(null);\n//# sourceMappingURL=PresenceContext.js.map","\"use client\";\nimport { isAnimationControls, isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, resolveVariantFromProps, } from \"motion-dom\";\nimport { useContext } from \"react\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\nimport { useConstant } from \"../../utils/use-constant\";\nimport { resolveMotionValue } from \"motion-dom\";\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants = checkIsControllingVariants(props);\n const isVariantNode = checkIsVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nexport const makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n//# sourceMappingURL=use-visual-state.js.map","\"use client\";\nimport { useRef } from \"react\";\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n//# sourceMappingURL=use-constant.js.map","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n//# sourceMappingURL=use-html-visual-state.js.map","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n//# sourceMappingURL=use-svg-visual-state.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\";\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n//# sourceMappingURL=definitions.js.map","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n//# sourceMappingURL=symbol.js.map","\"use client\";\nimport { useCallback, useInsertionEffect, useRef } from \"react\";\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ;\n ref.current = instance;\n }\n }, [visualElement]);\n}\n//# sourceMappingURL=use-motion-ref.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext({});\n//# sourceMappingURL=SwitchLayoutGroupContext.js.map","export function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n//# sourceMappingURL=is-ref-object.js.map","\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\nimport { isBrowser } from \"./is-browser\";\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n//# sourceMappingURL=use-isomorphic-effect.js.map","\"use client\";\nimport { optimizedAppearDataAttribute, } from \"motion-dom\";\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext } from \"../../context/PresenceContext\";\nimport { SwitchLayoutGroupContext, } from \"../../context/SwitchLayoutGroupContext\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\";\nexport function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n//# sourceMappingURL=use-visual-element.js.map","\"use client\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { invariant, warning } from \"motion-utils\";\nimport { forwardRef, useContext } from \"react\";\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\";\nimport { LazyContext } from \"../context/LazyContext\";\nimport { MotionConfigContext } from \"../context/MotionConfigContext\";\nimport { MotionContext } from \"../context/MotionContext\";\nimport { useCreateMotionContext } from \"../context/MotionContext/create\";\nimport { useRender } from \"../render/dom/use-render\";\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\";\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\";\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\";\nimport { isBrowser } from \"../utils/is-browser\";\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\";\nimport { loadFeatures } from \"./features/load-features\";\nimport { motionComponentSymbol } from \"./utils/symbol\";\nimport { useMotionRef } from \"./utils/use-motion-ref\";\nimport { useVisualElement } from \"./utils/use-visual-element\";\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (_jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (_jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n//# sourceMappingURL=index.js.map","import { setFeatureDefinitions } from \"motion-dom\";\nimport { getInitializedFeatureDefinitions } from \"./definitions\";\nexport function loadFeatures(features) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n setFeatureDefinitions(featureDefinitions);\n}\n//# sourceMappingURL=load-features.js.map","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\";\nimport { Fragment } from \"react\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport const createDomVisualElement = (Component, options) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component);\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n });\n};\n//# sourceMappingURL=create-visual-element.js.map","import { Feature } from \"motion-dom\";\nlet id = 0;\nexport class ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n }\n update() {\n if (!this.node.presenceContext)\n return;\n const { isPresent, onExitComplete } = this.node.presenceContext;\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return;\n }\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent);\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id);\n });\n }\n }\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {};\n if (onExitComplete) {\n onExitComplete(this.id);\n }\n if (register) {\n this.unmount = register(this.id);\n }\n }\n unmount() { }\n}\n//# sourceMappingURL=exit.js.map","import { AnimationFeature } from \"./animation\";\nimport { ExitAnimationFeature } from \"./animation/exit\";\nexport const animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n//# sourceMappingURL=animations.js.map","import { createAnimationState, Feature, isAnimationControls, } from \"motion-dom\";\nexport class AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() {\n this.node.animationState.reset();\n this.unmountControls?.();\n }\n}\n//# sourceMappingURL=index.js.map","import { isPrimaryPointer } from \"motion-dom\";\nexport function extractEventInfo(event) {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n };\n}\nexport const addPointerInfo = (handler) => {\n return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n};\n//# sourceMappingURL=event-info.js.map","import { addDomEvent } from \"motion-dom\";\nimport { addPointerInfo } from \"./event-info\";\nexport function addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n//# sourceMappingURL=add-pointer-event.js.map","// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n//# sourceMappingURL=get-context-window.js.map","export const distance = (a, b) => Math.abs(a - b);\nexport function distance2D(a, b) {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x);\n const yDelta = distance(a.y, b.y);\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\n}\n//# sourceMappingURL=distance.js.map","import { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\";\nimport { millisecondsToSeconds, pipe, secondsToMilliseconds, } from \"motion-utils\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { extractEventInfo } from \"../../events/event-info\";\nimport { distance2D } from \"../../utils/distance\";\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nexport class PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n passive: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll, {\n passive: true,\n });\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n//# sourceMappingURL=PanSession.js.map","import { calcLength, mixNumber } from \"motion-dom\";\nimport { progress as calcProgress, clamp, } from \"motion-utils\";\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(point, length, progress, constraints, elastic) {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress;\n return constraints ? applyConstraints(min, constraints, elastic) : min;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n ;\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(layoutBox, constraintsBox) {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(axis, constraints, progress) {\n const axisLength = axis.max - axis.min;\n const min = mixNumber(constraints.min, constraints.max - axisLength, progress);\n return { min, max: min + axisLength };\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nexport const defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nexport function resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nexport function resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n//# sourceMappingURL=constraints.js.map","import { addValueToWillChange, animateMotionValue, calcLength, convertBoundingBoxToBox, convertBoxToBoundingBox, createBox, eachAxis, frame, isElementTextInput, measurePageBox, mixNumber, percent, resize, setDragLock, } from \"motion-dom\";\nimport { invariant } from \"motion-utils\";\nimport { addDomEvent } from \"motion-dom\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { extractEventInfo } from \"../../events/event-info\";\nimport { getContextWindow } from \"../../utils/get-context-window\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { PanSession } from \"../pan/PanSession\";\nimport { applyConstraints, calcOrigin, calcRelativeConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveDragElastic, } from \"./utils/constraints\";\nexport const elementDragControls = new WeakMap();\nexport class VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n this.stopAnimation();\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true);\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true);\n }\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps();\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 });\n }\n };\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.endPanSession();\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial\n ? props.initial[axis]\n : undefined) || 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0;\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current);\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false;\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render();\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n const target = event.target;\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild = target !== element && isElementTextInput(target);\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event);\n }\n });\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers;\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(element, dragConstraints.current, () => this.scalePositionWithinConstraints());\n }\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n stopResizeObservers && stopResizeObservers();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction skipFirstCall(callback) {\n let isFirst = true;\n return () => {\n if (isFirst) {\n isFirst = false;\n return;\n }\n callback();\n };\n}\nfunction startResizeObservers(element, constraintsElement, onResize) {\n const stopElement = resize(element, skipFirstCall(onResize));\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize));\n return () => {\n stopElement();\n stopContainer();\n };\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\nexport function expectsResolvedDragConstraints({ dragConstraints, onMeasureDragConstraints, }) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints;\n}\n//# sourceMappingURL=VisualElementDragControls.js.map","import { isDragging } from './is-active.mjs';\n\nfunction setDragLock(axis) {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null;\n }\n else {\n isDragging[axis] = true;\n return () => {\n isDragging[axis] = false;\n };\n }\n }\n else {\n if (isDragging.x || isDragging.y) {\n return null;\n }\n else {\n isDragging.x = isDragging.y = true;\n return () => {\n isDragging.x = isDragging.y = false;\n };\n }\n }\n}\n\nexport { setDragLock };\n//# sourceMappingURL=set-active.mjs.map\n","import { Feature, frame } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { addPointerEvent } from \"../../events/add-pointer-event\";\nimport { getContextWindow } from \"../../utils/get-context-window\";\nimport { PanSession } from \"./PanSession\";\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.update(() => handler(event, info), false, true);\n }\n};\nexport class PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: asyncHandler(onPan),\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n//# sourceMappingURL=index.js.map","\"use client\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { frame, microtask, globalProjectionState } from \"motion-dom\";\nimport { Component, useContext } from \"react\";\nimport { usePresence } from \"../../../components/AnimatePresence/use-presence\";\nimport { LayoutGroupContext, } from \"../../../context/LayoutGroupContext\";\nimport { SwitchLayoutGroupContext } from \"../../../context/SwitchLayoutGroupContext\";\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false;\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n if (hasTakenAnySnapshot) {\n projection.root.didUpdate();\n }\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n layoutDependency: this.props.layoutDependency,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const { projection } = visualElement;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n if (prevProps.layoutDependency !== layoutDependency) {\n projection.setOptions({\n ...projection.options,\n layoutDependency,\n });\n }\n hasTakenAnySnapshot = true;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { projection } = this.props.visualElement;\n if (projection) {\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n hasTakenAnySnapshot = true;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nexport function MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (_jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\n//# sourceMappingURL=MeasureLayout.js.map","\"use client\";\nimport { useCallback, useContext, useEffect, useId } from \"react\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return

\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed from the tree,\n * but `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nexport function usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return
\n * }\n * ```\n *\n * @public\n */\nexport function useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nexport function isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n//# sourceMappingURL=use-presence.js.map","import { DragGesture } from \"../../gestures/drag\";\nimport { PanGesture } from \"../../gestures/pan\";\nimport { HTMLProjectionNode } from \"../../projection\";\nimport { MeasureLayout } from \"./layout/MeasureLayout\";\nexport const drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n//# sourceMappingURL=drag.js.map","import { Feature } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { VisualElementDragControls } from \"./VisualElementDragControls\";\nexport class DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n update() {\n const { dragControls } = this.node.getProps();\n const { dragControls: prevDragControls } = this.node.prevProps || {};\n if (dragControls !== prevDragControls) {\n this.removeGroupControls();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n }\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession();\n }\n }\n}\n//# sourceMappingURL=index.js.map","import { Feature, frame, hover } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handleHoverEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\");\n }\n const eventName = (\"onHover\" + lifecycle);\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\");\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\");\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=hover.js.map","import { Feature, frame, press } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=press.js.map","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nexport function observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n//# sourceMappingURL=observers.js.map","import { Feature } from \"motion-dom\";\nimport { observeIntersection } from \"./observers\";\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nexport class InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.unmount();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n return observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() { }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n//# sourceMappingURL=index.js.map","import { HoverGesture } from \"../../gestures/hover\";\nimport { FocusGesture } from \"../../gestures/focus\";\nimport { PressGesture } from \"../../gestures/press\";\nimport { InViewFeature } from \"./viewport\";\nexport const gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n//# sourceMappingURL=gestures.js.map","import { animations } from \"../../../motion/features/animations\";\nimport { drag } from \"../../../motion/features/drag\";\nimport { gestureAnimations } from \"../../../motion/features/gestures\";\nimport { layout } from \"../../../motion/features/layout\";\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n};\n//# sourceMappingURL=feature-bundle.js.map","import { Feature, addDomEvent } from \"motion-dom\";\nimport { pipe } from \"motion-utils\";\nexport class FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n//# sourceMappingURL=focus.js.map","import { HTMLProjectionNode } from \"motion-dom\";\nimport { MeasureLayout } from \"./layout/MeasureLayout\";\nexport const layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n//# sourceMappingURL=layout.js.map","import { createMotionComponent } from \"../../../motion\";\nimport { createDomVisualElement } from \"../../dom/create-visual-element\";\nimport { featureBundle } from \"./feature-bundle\";\nexport function createMotionComponentWithFeatures(Component, options) {\n return createMotionComponent(Component, options, featureBundle, createDomVisualElement);\n}\n//# sourceMappingURL=create.js.map","\"use client\";\nimport { createMotionComponentWithFeatures as createMotionComponent } from \"./create\";\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMotionComponent(\"a\");\nexport const MotionAbbr = /*@__PURE__*/ createMotionComponent(\"abbr\");\nexport const MotionAddress = /*@__PURE__*/ createMotionComponent(\"address\");\nexport const MotionArea = /*@__PURE__*/ createMotionComponent(\"area\");\nexport const MotionArticle = /*@__PURE__*/ createMotionComponent(\"article\");\nexport const MotionAside = /*@__PURE__*/ createMotionComponent(\"aside\");\nexport const MotionAudio = /*@__PURE__*/ createMotionComponent(\"audio\");\nexport const MotionB = /*@__PURE__*/ createMotionComponent(\"b\");\nexport const MotionBase = /*@__PURE__*/ createMotionComponent(\"base\");\nexport const MotionBdi = /*@__PURE__*/ createMotionComponent(\"bdi\");\nexport const MotionBdo = /*@__PURE__*/ createMotionComponent(\"bdo\");\nexport const MotionBig = /*@__PURE__*/ createMotionComponent(\"big\");\nexport const MotionBlockquote = \n/*@__PURE__*/ createMotionComponent(\"blockquote\");\nexport const MotionBody = /*@__PURE__*/ createMotionComponent(\"body\");\nexport const MotionButton = /*@__PURE__*/ createMotionComponent(\"button\");\nexport const MotionCanvas = /*@__PURE__*/ createMotionComponent(\"canvas\");\nexport const MotionCaption = /*@__PURE__*/ createMotionComponent(\"caption\");\nexport const MotionCite = /*@__PURE__*/ createMotionComponent(\"cite\");\nexport const MotionCode = /*@__PURE__*/ createMotionComponent(\"code\");\nexport const MotionCol = /*@__PURE__*/ createMotionComponent(\"col\");\nexport const MotionColgroup = /*@__PURE__*/ createMotionComponent(\"colgroup\");\nexport const MotionData = /*@__PURE__*/ createMotionComponent(\"data\");\nexport const MotionDatalist = /*@__PURE__*/ createMotionComponent(\"datalist\");\nexport const MotionDd = /*@__PURE__*/ createMotionComponent(\"dd\");\nexport const MotionDel = /*@__PURE__*/ createMotionComponent(\"del\");\nexport const MotionDetails = /*@__PURE__*/ createMotionComponent(\"details\");\nexport const MotionDfn = /*@__PURE__*/ createMotionComponent(\"dfn\");\nexport const MotionDialog = /*@__PURE__*/ createMotionComponent(\"dialog\");\nexport const MotionDiv = /*@__PURE__*/ createMotionComponent(\"div\");\nexport const MotionDl = /*@__PURE__*/ createMotionComponent(\"dl\");\nexport const MotionDt = /*@__PURE__*/ createMotionComponent(\"dt\");\nexport const MotionEm = /*@__PURE__*/ createMotionComponent(\"em\");\nexport const MotionEmbed = /*@__PURE__*/ createMotionComponent(\"embed\");\nexport const MotionFieldset = /*@__PURE__*/ createMotionComponent(\"fieldset\");\nexport const MotionFigcaption = \n/*@__PURE__*/ createMotionComponent(\"figcaption\");\nexport const MotionFigure = /*@__PURE__*/ createMotionComponent(\"figure\");\nexport const MotionFooter = /*@__PURE__*/ createMotionComponent(\"footer\");\nexport const MotionForm = /*@__PURE__*/ createMotionComponent(\"form\");\nexport const MotionH1 = /*@__PURE__*/ createMotionComponent(\"h1\");\nexport const MotionH2 = /*@__PURE__*/ createMotionComponent(\"h2\");\nexport const MotionH3 = /*@__PURE__*/ createMotionComponent(\"h3\");\nexport const MotionH4 = /*@__PURE__*/ createMotionComponent(\"h4\");\nexport const MotionH5 = /*@__PURE__*/ createMotionComponent(\"h5\");\nexport const MotionH6 = /*@__PURE__*/ createMotionComponent(\"h6\");\nexport const MotionHead = /*@__PURE__*/ createMotionComponent(\"head\");\nexport const MotionHeader = /*@__PURE__*/ createMotionComponent(\"header\");\nexport const MotionHgroup = /*@__PURE__*/ createMotionComponent(\"hgroup\");\nexport const MotionHr = /*@__PURE__*/ createMotionComponent(\"hr\");\nexport const MotionHtml = /*@__PURE__*/ createMotionComponent(\"html\");\nexport const MotionI = /*@__PURE__*/ createMotionComponent(\"i\");\nexport const MotionIframe = /*@__PURE__*/ createMotionComponent(\"iframe\");\nexport const MotionImg = /*@__PURE__*/ createMotionComponent(\"img\");\nexport const MotionInput = /*@__PURE__*/ createMotionComponent(\"input\");\nexport const MotionIns = /*@__PURE__*/ createMotionComponent(\"ins\");\nexport const MotionKbd = /*@__PURE__*/ createMotionComponent(\"kbd\");\nexport const MotionKeygen = /*@__PURE__*/ createMotionComponent(\"keygen\");\nexport const MotionLabel = /*@__PURE__*/ createMotionComponent(\"label\");\nexport const MotionLegend = /*@__PURE__*/ createMotionComponent(\"legend\");\nexport const MotionLi = /*@__PURE__*/ createMotionComponent(\"li\");\nexport const MotionLink = /*@__PURE__*/ createMotionComponent(\"link\");\nexport const MotionMain = /*@__PURE__*/ createMotionComponent(\"main\");\nexport const MotionMap = /*@__PURE__*/ createMotionComponent(\"map\");\nexport const MotionMark = /*@__PURE__*/ createMotionComponent(\"mark\");\nexport const MotionMenu = /*@__PURE__*/ createMotionComponent(\"menu\");\nexport const MotionMenuitem = /*@__PURE__*/ createMotionComponent(\"menuitem\");\nexport const MotionMeter = /*@__PURE__*/ createMotionComponent(\"meter\");\nexport const MotionNav = /*@__PURE__*/ createMotionComponent(\"nav\");\nexport const MotionObject = /*@__PURE__*/ createMotionComponent(\"object\");\nexport const MotionOl = /*@__PURE__*/ createMotionComponent(\"ol\");\nexport const MotionOptgroup = /*@__PURE__*/ createMotionComponent(\"optgroup\");\nexport const MotionOption = /*@__PURE__*/ createMotionComponent(\"option\");\nexport const MotionOutput = /*@__PURE__*/ createMotionComponent(\"output\");\nexport const MotionP = /*@__PURE__*/ createMotionComponent(\"p\");\nexport const MotionParam = /*@__PURE__*/ createMotionComponent(\"param\");\nexport const MotionPicture = /*@__PURE__*/ createMotionComponent(\"picture\");\nexport const MotionPre = /*@__PURE__*/ createMotionComponent(\"pre\");\nexport const MotionProgress = /*@__PURE__*/ createMotionComponent(\"progress\");\nexport const MotionQ = /*@__PURE__*/ createMotionComponent(\"q\");\nexport const MotionRp = /*@__PURE__*/ createMotionComponent(\"rp\");\nexport const MotionRt = /*@__PURE__*/ createMotionComponent(\"rt\");\nexport const MotionRuby = /*@__PURE__*/ createMotionComponent(\"ruby\");\nexport const MotionS = /*@__PURE__*/ createMotionComponent(\"s\");\nexport const MotionSamp = /*@__PURE__*/ createMotionComponent(\"samp\");\nexport const MotionScript = /*@__PURE__*/ createMotionComponent(\"script\");\nexport const MotionSection = /*@__PURE__*/ createMotionComponent(\"section\");\nexport const MotionSelect = /*@__PURE__*/ createMotionComponent(\"select\");\nexport const MotionSmall = /*@__PURE__*/ createMotionComponent(\"small\");\nexport const MotionSource = /*@__PURE__*/ createMotionComponent(\"source\");\nexport const MotionSpan = /*@__PURE__*/ createMotionComponent(\"span\");\nexport const MotionStrong = /*@__PURE__*/ createMotionComponent(\"strong\");\nexport const MotionStyle = /*@__PURE__*/ createMotionComponent(\"style\");\nexport const MotionSub = /*@__PURE__*/ createMotionComponent(\"sub\");\nexport const MotionSummary = /*@__PURE__*/ createMotionComponent(\"summary\");\nexport const MotionSup = /*@__PURE__*/ createMotionComponent(\"sup\");\nexport const MotionTable = /*@__PURE__*/ createMotionComponent(\"table\");\nexport const MotionTbody = /*@__PURE__*/ createMotionComponent(\"tbody\");\nexport const MotionTd = /*@__PURE__*/ createMotionComponent(\"td\");\nexport const MotionTextarea = /*@__PURE__*/ createMotionComponent(\"textarea\");\nexport const MotionTfoot = /*@__PURE__*/ createMotionComponent(\"tfoot\");\nexport const MotionTh = /*@__PURE__*/ createMotionComponent(\"th\");\nexport const MotionThead = /*@__PURE__*/ createMotionComponent(\"thead\");\nexport const MotionTime = /*@__PURE__*/ createMotionComponent(\"time\");\nexport const MotionTitle = /*@__PURE__*/ createMotionComponent(\"title\");\nexport const MotionTr = /*@__PURE__*/ createMotionComponent(\"tr\");\nexport const MotionTrack = /*@__PURE__*/ createMotionComponent(\"track\");\nexport const MotionU = /*@__PURE__*/ createMotionComponent(\"u\");\nexport const MotionUl = /*@__PURE__*/ createMotionComponent(\"ul\");\nexport const MotionVideo = /*@__PURE__*/ createMotionComponent(\"video\");\nexport const MotionWbr = /*@__PURE__*/ createMotionComponent(\"wbr\");\nexport const MotionWebview = /*@__PURE__*/ createMotionComponent(\"webview\");\n/**\n * SVG components\n */\nexport const MotionAnimate = /*@__PURE__*/ createMotionComponent(\"animate\");\nexport const MotionCircle = /*@__PURE__*/ createMotionComponent(\"circle\");\nexport const MotionDefs = /*@__PURE__*/ createMotionComponent(\"defs\");\nexport const MotionDesc = /*@__PURE__*/ createMotionComponent(\"desc\");\nexport const MotionEllipse = /*@__PURE__*/ createMotionComponent(\"ellipse\");\nexport const MotionG = /*@__PURE__*/ createMotionComponent(\"g\");\nexport const MotionImage = /*@__PURE__*/ createMotionComponent(\"image\");\nexport const MotionLine = /*@__PURE__*/ createMotionComponent(\"line\");\nexport const MotionFilter = /*@__PURE__*/ createMotionComponent(\"filter\");\nexport const MotionMarker = /*@__PURE__*/ createMotionComponent(\"marker\");\nexport const MotionMask = /*@__PURE__*/ createMotionComponent(\"mask\");\nexport const MotionMetadata = /*@__PURE__*/ createMotionComponent(\"metadata\");\nexport const MotionPath = /*@__PURE__*/ createMotionComponent(\"path\");\nexport const MotionPattern = /*@__PURE__*/ createMotionComponent(\"pattern\");\nexport const MotionPolygon = /*@__PURE__*/ createMotionComponent(\"polygon\");\nexport const MotionPolyline = /*@__PURE__*/ createMotionComponent(\"polyline\");\nexport const MotionRect = /*@__PURE__*/ createMotionComponent(\"rect\");\nexport const MotionStop = /*@__PURE__*/ createMotionComponent(\"stop\");\nexport const MotionSvg = /*@__PURE__*/ createMotionComponent(\"svg\");\nexport const MotionSymbol = /*@__PURE__*/ createMotionComponent(\"symbol\");\nexport const MotionText = /*@__PURE__*/ createMotionComponent(\"text\");\nexport const MotionTspan = /*@__PURE__*/ createMotionComponent(\"tspan\");\nexport const MotionUse = /*@__PURE__*/ createMotionComponent(\"use\");\nexport const MotionView = /*@__PURE__*/ createMotionComponent(\"view\");\nexport const MotionClipPath = /*@__PURE__*/ createMotionComponent(\"clipPath\");\nexport const MotionFeBlend = /*@__PURE__*/ createMotionComponent(\"feBlend\");\nexport const MotionFeColorMatrix = \n/*@__PURE__*/ createMotionComponent(\"feColorMatrix\");\nexport const MotionFeComponentTransfer = /*@__PURE__*/ createMotionComponent(\"feComponentTransfer\");\nexport const MotionFeComposite = \n/*@__PURE__*/ createMotionComponent(\"feComposite\");\nexport const MotionFeConvolveMatrix = \n/*@__PURE__*/ createMotionComponent(\"feConvolveMatrix\");\nexport const MotionFeDiffuseLighting = \n/*@__PURE__*/ createMotionComponent(\"feDiffuseLighting\");\nexport const MotionFeDisplacementMap = \n/*@__PURE__*/ createMotionComponent(\"feDisplacementMap\");\nexport const MotionFeDistantLight = \n/*@__PURE__*/ createMotionComponent(\"feDistantLight\");\nexport const MotionFeDropShadow = \n/*@__PURE__*/ createMotionComponent(\"feDropShadow\");\nexport const MotionFeFlood = /*@__PURE__*/ createMotionComponent(\"feFlood\");\nexport const MotionFeFuncA = /*@__PURE__*/ createMotionComponent(\"feFuncA\");\nexport const MotionFeFuncB = /*@__PURE__*/ createMotionComponent(\"feFuncB\");\nexport const MotionFeFuncG = /*@__PURE__*/ createMotionComponent(\"feFuncG\");\nexport const MotionFeFuncR = /*@__PURE__*/ createMotionComponent(\"feFuncR\");\nexport const MotionFeGaussianBlur = \n/*@__PURE__*/ createMotionComponent(\"feGaussianBlur\");\nexport const MotionFeImage = /*@__PURE__*/ createMotionComponent(\"feImage\");\nexport const MotionFeMerge = /*@__PURE__*/ createMotionComponent(\"feMerge\");\nexport const MotionFeMergeNode = \n/*@__PURE__*/ createMotionComponent(\"feMergeNode\");\nexport const MotionFeMorphology = \n/*@__PURE__*/ createMotionComponent(\"feMorphology\");\nexport const MotionFeOffset = /*@__PURE__*/ createMotionComponent(\"feOffset\");\nexport const MotionFePointLight = \n/*@__PURE__*/ createMotionComponent(\"fePointLight\");\nexport const MotionFeSpecularLighting = \n/*@__PURE__*/ createMotionComponent(\"feSpecularLighting\");\nexport const MotionFeSpotLight = \n/*@__PURE__*/ createMotionComponent(\"feSpotLight\");\nexport const MotionFeTile = /*@__PURE__*/ createMotionComponent(\"feTile\");\nexport const MotionFeTurbulence = \n/*@__PURE__*/ createMotionComponent(\"feTurbulence\");\nexport const MotionForeignObject = \n/*@__PURE__*/ createMotionComponent(\"foreignObject\");\nexport const MotionLinearGradient = \n/*@__PURE__*/ createMotionComponent(\"linearGradient\");\nexport const MotionRadialGradient = \n/*@__PURE__*/ createMotionComponent(\"radialGradient\");\nexport const MotionTextPath = /*@__PURE__*/ createMotionComponent(\"textPath\");\n//# sourceMappingURL=elements.js.map","import { motion } from \"./\";\nexport const MotionDiv = motion.div;\n//# sourceMappingURL=size.js.map"],"names":["addUniqueItem","arr","item","indexOf","push","removeItem","index","splice","clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isNumericalString","test","isObject","value","isZeroValueString","memo","callback","result","undefined","noop","any","combineFunctions","a","b","pipe","transformers","reduce","progress","from","to","toFromDifference","SubscriptionManager","constructor","this","subscriptions","add","handler","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","getTForX","aX","x","lowerBound","upperBound","currentX","currentT","Math","abs","binarySubdivide","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isBezierDefinition","Array","isArray","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","LayoutGroupContext","createContext","LazyContext","strict","MotionConfigContext","transformPagePoint","isStatic","reducedMotion","MotionContext","stepsOrder","statsBuffer","addProjectionMetrics","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","stepName","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","numCalls","triggerCallback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","frameData","forEach","frameloop","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","frame","cancelFrame","frameSteps","requestAnimationFrame","clearTime","time","set","newTime","queueMicrotask","checkStringStartsWith","token","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","parseComplexValue","createTransformer","source","numSections","output","convertNumbersToZero","complex","isNaN","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","next","done","Infinity","calcGeneratorVelocity","resolveValue","current","prevT","springDefaults","granular","safeMin","findSpring","bounce","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","calcAngularFreq","exp","d","e","f","initialGuess","rootIterations","approximateRoot","stiffness","damping","durationKeys","physicsKeys","isSpringType","options","keys","some","spring","optionsOrVisualDuration","visualDuration","keyframes","restSpeed","restDelta","isResolvedFromDuration","springOptions","root","PI","derived","getSpringOptions","initialVelocity","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","cos","dampedAngularFreq","freqForT","sinh","cosh","calculatedDuration","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","toTransition","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","calcLatest","applyFriction","latest","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","ease","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","offset","remaining","offsetProgress","fillOffset","keyframeValues","times","easingFunctions","isEasingArray","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","applyToOptions","generatorOptions","createGenerator","createGeneratorEasing","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","decay","tween","replaceTransitionType","transition","WithPromise","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","startTime","isStopped","currentTime","holdTime","playbackSpeed","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","sample","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","currentIteration","floor","iterationProgress","isAnimationFinished","finish","reject","iterationDuration","driver","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","radToDeg","rad","rotate","angle","atan2","rebaseAngle","matrix2dParsers","y","translateX","translateY","scaleX","scaleY","rotateZ","skewX","atan","skewY","skew","matrix3dParsers","z","translateZ","rotateX","rotateY","defaultTransformValue","name","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","positionalValues","width","paddingLeft","paddingRight","height","paddingTop","paddingBottom","top","_bbox","left","bottom","right","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","resolver","needsMeasurement","elementsToMeasure","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","cubicBezierAsString","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","fill","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","animation","onfinish","keyframe","updateMotionValue","isCSSVar","style","setProperty","setStyle","commitStyles","isConnected","effect","getComputedTiming","Number","playbackRate","playState","newStartTime","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampleAnimation","setWithVelocity","isAnimatable","makeAnimationInstant","acceleratedValues","supportsWaapi","Element","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","sync","isHandoff","resolvedAt","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","resolvedOptions","useWaapi","subject","owner","HTMLElement","transformTemplate","getProps","supportsBrowserAnimation","catch","pendingTimeline","_onReject","finally","calcChildStagger","children","child","delayChildren","staggerChildren","staggerDirection","sort","sortNodePosition","numChildren","size","maxStaggerDuration","splitCSSVariableRegex","getVariableValue","depth","fallback","exec","token1","token2","parseCSSVariable","resolved","getComputedStyle","getPropertyValue","trimmed","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","animateMotionValue","getVelocity","when","_delay","isTransitionDefined","assign","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","getValueState","resolveVariantFromProps","props","custom","variants","resolveVariant","positionalKeys","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","getPrevious","startAnimation","animationStart","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","isKeyframesTarget","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","transitionEnd","defaultTransition","reduceMotion","animations","animationTypeState","animationState","getState","latestValues","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","setTarget","all","animateVariant","variant","presenceContext","getAnimation","getChildAnimations","variantChildren","forwardDelay","animateChildren","first","last","testValueType","dimensionValueTypes","findDimensionValueType","isNone","maxDefaults","applyDefaultFilter","slice","defaultValue","functionRegex","functions","join","mask","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","maxWidth","maxHeight","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","scaleZ","distance","perspective","transformPerspective","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","invalidTemplates","DOMKeyframesResolver","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","pageYOffset","measuredOrigin","measureViewportBox","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","resolveElements","elementOrSelector","scope","selectorCache","EventTarget","elements","querySelectorAll","getValueAsType","microtask","cancelMicrotask","isDragging","isDragActive","setupGesture","gestureAbortController","AbortController","passive","signal","abort","hover","onHoverStart","eventOptions","hoverEndCallback","isPressed","deferredHoverEnd","endHover","event","removeEventListener","onPointerLeave","onPointerUp","leaveEvent","pointerType","addEventListener","enterEvent","onHoverEnd","isNodeOrChild","parent","parentElement","isPrimaryPointer","button","isPrimary","keyboardAccessibleElements","textInputElements","isPressing","filterEvents","firePointerEvent","dispatchEvent","PointerEvent","bubbles","isValidPressEvent","claimedPointerDownEvents","press","targetOrSelector","onPressStart","targets","cancelEvents","startPress","startEvent","currentTarget","stopPropagation","onPressEnd","onPointerEnd","endEvent","success","onPointerCancel","upEvent","useGlobalTarget","cancelEvent","focusEvent","handleKeydown","handleKeyup","enableKeyboardPress","tagName","isContentEditable","isElementKeyboardAccessible","hasAttribute","tabIndex","isSVGElement","resizeHandlers","WeakMap","observer","borderBoxAxis","svgAxis","htmlAxis","borderBoxSize","getBBox","getWidth","getHeight","notifyTarget","notifyAll","entries","resizeElement","ResizeObserver","elementHandlers","unobserve","windowCallbacks","windowResizeHandler","resizeWindow","info","innerWidth","innerHeight","resize","valueTypes","createBox","visualElementStore","isAnimationControls","isVariantLabel","variantPriorityOrder","variantProps","isControllingVariants","isVariantNode","prefersReducedMotion","hasReducedMotionListener","isBrowser","propEventHandlers","featureDefinitions","setFeatureDefinitions","definitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","reducedMotionConfig","blockInitialAnimation","visualState","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","projection","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","manuallyAnimateOnMount","initialMotionValues","mount","instance","removeFromVariantTree","addVariantChild","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","initPrefersReducedMotion","addChild","unmount","remove","removeChild","feature","isMounted","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","build","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","getClosestVariantNode","closestVariantNode","removeValueFromRenderState","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","getBaseTarget","valueFromInitial","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","vars","childSubscription","textContent","node","convertBoundingBoxToBox","isIdentityScale","hasScale","hasTransform","has2DTranslate","is2DTranslate","scalePoint","point","originPoint","applyPointDelta","translate","boxScale","applyAxisDelta","axis","applyBoxDelta","box","TREE_SCALE_SNAP_MIN","TREE_SCALE_SNAP_MAX","translateAxis","transformAxis","axisTranslate","axisScale","axisOrigin","transformBox","transformPoint","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","translateAlias","numTransforms","buildHTMLStyles","transformOrigin","hasTransformOrigin","valueAsType","transformString","transformIsDefault","valueIsDefault","buildTransform","renderHTML","styleProp","elementStyle","applyProjectionStyles","pixelsToPercent","pixels","correctBorderRadius","correct","correctBoxShadow","treeScale","projectionDelta","original","shadow","xScale","yScale","averageScale","scaleCorrectors","applyTo","boxShadow","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","isProjecting","readTransformValue","computedStyle","dashKeys","array","camelKeys","cssMotionPathProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","isSVGTag","viewBox","attrs","spacing","useDashCase","buildSVGPath","camelCaseAttributes","tag","scrapeMotionValuesFromProps$1","charAt","toUpperCase","SVGVisualElement","defaultType","getAttribute","_styleProp","setAttribute","renderSVG","numVariantProps","getVariantContext","context","prop","shallowCompare","prevLength","reversePriorityOrder","numAnimationTypes","createAnimateFunction","resolvedDefinition","animateVisualElement","createAnimationState","createState","isInitialRender","buildResolvedTypeValues","animateChanges","changedActiveType","removedKeys","encounteredKeys","removedVariantIndex","typeState","propIsVariant","activeDelta","isActive","isInherited","prevProp","prevResolvedValues","variantDidChange","checkVariantsDidChange","shouldAnimateType","handledRemovedValues","definitionList","resolvedValues","allKeys","markToAnimate","valueHasChanged","willAnimateViaParent","parentVariant","fallbackAnimation","initialTransition","fallbackTarget","shouldAnimate","setActive","setAnimateFunction","makeAnimator","reset","createTypeState","whileInView","whileHover","whileTap","whileDrag","whileFocus","exit","copyAxisInto","originAxis","copyBoxInto","originBox","copyAxisDeltaInto","originDelta","calcLength","calcAxisDelta","calcBoxDelta","calcRelativeAxis","relative","calcRelativeAxisPosition","calcRelativePosition","removePointDelta","removeAxisTransforms","transforms","scaleKey","originKey","sourceAxis","removeAxisDelta","xKeys","yKeys","removeBoxTransforms","sourceBox","isAxisDeltaZero","isDeltaZero","axisEquals","axisEqualsRounded","boxEqualsRounded","aspectRatio","axisDeltaEquals","eachAxis","borders","numBorders","asNumber","isPx","getRadius","radiusName","easeCrossfadeIn","compress","easeCrossfadeOut","addDomEvent","compareByDepth","FlatTree","isDirty","resolveMotionValue","NodeStack","members","m","lead","prevLead","inst","isPresent","snapshot","promote","relegate","indexOfNode","findIndex","member","preserveFollowOpacity","show","prevDep","layoutDependency","nextDep","prevInstance","resumeFrom","preserveOpacity","animationValues","isUpdating","isLayoutDirty","crossfade","hide","exitAnimationComplete","resumingFrom","onExitComplete","removeLeadSnapshot","globalProjectionState","hasAnimatedSinceResize","hasEverUpdated","transformAxes","id","resetDistortingTransform","sharedAnimationValues","cancelTreeOptimisedTransformAnimations","projectionNode","hasCheckedOptimisedAppear","MotionHasOptimisedAnimation","MotionCancelOptimisedAnimation","createProjectionNode","attachResizeListener","defaultParent","measureScroll","checkIsScrollRoot","resetTransform","animationId","animationCommitId","isTreeAnimating","isAnimationBlocked","isProjectionDirty","isSharedProjectionDirty","updateManuallyBlocked","updateBlockedByResize","isSVG","needsReset","shouldResetTransform","eventHandlers","hasTreeAnimated","layoutVersion","updateScheduled","scheduleUpdate","projectionUpdateScheduled","checkUpdateFailed","clearAllSnapshots","updateProjection","nodes","propagateDirtyNodes","resolveTargetDelta","calcProjection","cleanDirtyNodes","resolvedRelativeTargetAt","linkedParentVersion","hasProjected","isVisible","animationProgress","sharedNodes","path","notifyListeners","subscriptionManager","hasListeners","cancelDelay","resizeUnblockUpdate","newInnerWidth","timeout","checkElapsed","finishAnimation","registerSharedNode","hasLayoutChanged","hasRelativeLayoutChanged","newLayout","isTreeAnimationBlocked","relativeTarget","layoutTransition","defaultLayoutTransition","onLayoutAnimationStart","onLayoutAnimationComplete","hasTargetChanged","targetLayout","hasOnlyRelativeTargetChanged","layoutRoot","currentAnimation","animationOptions","setAnimationOrigin","isLead","willUpdate","stack","getStack","blockUpdate","unblockUpdate","isUpdateBlocked","startUpdate","resetSkewAndRotation","getTransformTemplate","shouldNotifyListeners","updateScroll","prevTransformTemplateValue","updateSnapshot","clearMeasurements","clearIsLayoutDirty","resetTransformStyle","updateLayout","notifyLayoutUpdate","didUpdate","clearSnapshot","removeLeadSnapshots","scheduleUpdateProjection","scheduleCheckAfterUnmount","measure","measuredBox","alwaysMeasureLayout","prevLayout","layoutCorrected","layoutBox","phase","layoutScroll","scroll","isRoot","wasRoot","isResetRequested","hasProjection","transformTemplateValue","transformTemplateHasChanged","removeTransform","pageBox","measurePageBox","removeElementScroll","roundAxis","checkNodeWasScrollRoot","boxWithoutScroll","applyTransform","transformOnly","withTransforms","boxWithoutTransform","setTargetDelta","targetDelta","setOptions","forceRelativeParentToResolveTarget","relativeParent","forceRecalculation","getLead","isShared","attemptToResolveRelativeTarget","getClosestProjectingParent","removeRelativeTarget","createRelativeTarget","targetWithTransforms","relativeTargetOrigin","parentLayout","canSkip","pendingAnimation","prevTreeScaleX","prevTreeScaleY","treePath","isSharedTransition","treeLength","display","applyTreeDeltas","prevProjectionDelta","createProjectionDeltas","projectionDeltaWithTransform","snapshotLatestValues","mixedValues","relativeLayout","isSharedLayoutAnimation","isOnlyMember","shouldCrossfadeOpacity","hasOpacityCrossfade","prevRelativeTarget","mixTargetDelta","mixAxisDelta","mixAxis","follow","opacityExit","borderLabel","followRadius","leadRadius","mixValues","motionValue$1","animateSingleValue","completeAnimation","applyTransformsToTarget","shouldAnimatePositionOnly","animationType","xLength","yLength","config","initialPromotionConfig","shouldPreserveFollowOpacity","getPrevLead","hasDistortingTransform","resetValues","targetStyle","visibility","pointerEvents","valuesToRender","latestTransform","xTranslate","yTranslate","zTranslate","elementScaleX","elementScaleY","buildProjectionTransform","isCSSVariable","corrected","num","resetTree","measuredLayout","axisSnapshot","layoutDelta","visualDelta","parentSnapshot","relativeSnapshot","onBeforeLayoutMeasure","userAgentContains","string","navigator","userAgent","roundPoint","maxDistance","DocumentProjectionNode","ref","documentElement","scrollLeft","body","scrollTop","rootProjectionNode","HTMLProjectionNode","documentNode","position","useCreateMotionContext","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","createHtmlRenderState","copyRawValuesOnly","useStyle","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","onTap","onTapStart","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","rawStyles","validMotionProps","isValidMotionProp","shouldForward","isValidProp","require","lowercaseSVGElements","isSVGComponent","useRender","forwardMotionProps","filteredProps","isDom","filterProps","elementProps","Fragment","renderedChildren","PresenceContext","makeLatestValues","scrapeMotionValues","motionValues","checkIsControllingVariants","checkIsVariantNode","isInitialAnimationBlocked","variantToSet","list","makeUseVisualState","make","createRenderState","makeState","useRef","useConstant","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeSVGMotionValuesFromProps","featureProps","focus","tap","pan","inView","isInitialized","getInitializedFeatureDefinitions","initialFeatureDefinitions","initFeatureDefinitions","motionComponentSymbol","Symbol","for","useMotionRef","externalRef","externalRefContainer","useInsertionEffect","refCleanup","useCallback","onMount","SwitchLayoutGroupContext","isRefObject","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useVisualElement","createVisualElement","ProjectionNodeConstructor","lazyContext","motionConfig","visualElementRef","hasMountedOnce","renderer","initialLayoutGroupConfig","dragConstraints","layoutCrossfade","getClosestProjectingNode","optimisedAppearId","wantsHandoff","MotionHandoffIsComplete","MotionIsMounted","MotionHandoffMarkAsComplete","allowProjection","createMotionComponent","preloadedFeatures","loadFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","createDomVisualElement","updateAnimationControlsSubscription","unmountControls","subscribe","prevAnimate","prevIsPresent","exitAnimation","register","extractEventInfo","pageX","pageY","addPointerEvent","addPointerInfo","getContextWindow","ownerDocument","defaultView","overflowStyles","PanSession","handlers","contextWindow","dragSnapToOrigin","distanceThreshold","lastMoveEvent","lastMoveEventInfo","scrollPositions","removeScrollListeners","onElementScroll","handleScroll","onWindowScroll","updatePoint","getPanInfo","history","isPanStarted","isDistancePastThreshold","xDelta","yDelta","distance2D","onStart","onMove","handlePointerMove","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","initialInfo","onSessionStart","removeListeners","startScrollTracking","overflowX","overflowY","scrollX","scrollY","capture","isWindow","updateHandlers","subtractPoint","lastDevicePoint","startDevicePoint","timeDelta","timestampedPoint","lastPoint","calcRelativeAxisConstraints","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","elementDragControls","VisualElementDragControls","openDragLock","currentDirection","constraints","hasMutatedConstraints","elastic","latestPointerEvent","latestPanInfo","originEvent","snapToCursor","panSession","stopAnimation","dragPropagation","onDragStart","resolveConstraints","getAxisMotionValue","measuredAxis","dragDirectionLock","onDirectionLock","onDrag","lockThreshold","getCurrentDirection","updateAxis","snap","finalEvent","finalPanInfo","onDragEnd","endPanSession","_point","shouldDrag","axisValue","applyConstraints","prevConstraints","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","relativeConstraints","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","constraintsBox","viewportBox","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","startAxisValueAnimation","dragKey","externalMotionValue","scalePositionWithinConstraints","boxProgress","sourceLength","targetLength","calcProgress","calcOrigin","addListeners","stopPointerListener","isClickingTextInputChild","isElementTextInput","stopResizeObservers","measureDragConstraints","onResize","stopElement","skipFirstCall","stopContainer","startResizeObservers","stopMeasureLayoutListener","stopResizeListener","stopLayoutUpdateListener","isFirst","asyncHandler","hasTakenAnySnapshot","MeasureLayoutWithContext","componentDidMount","layoutGroup","switchLayoutGroup","group","safeToRemove","getSnapshotBeforeUpdate","componentDidUpdate","componentWillUnmount","promoteContext","deregister","useId","usePresence","removePointerDownListener","onPointerDown","pointerDownEvent","session","createPanHandlers","onPanSessionStart","onPanStart","onPan","onPanEnd","removeGroupControls","controls","dragControls","prevDragControls","handleHoverEvent","lifecycle","handlePressEvent","HTMLButtonElement","disabled","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","observeIntersection","rootInteresectionObserver","lookupRoot","rootObservers","JSON","stringify","IntersectionObserver","initIntersectionObserver","thresholdNames","featureBundle","hasEnteredView","isInView","startObserver","viewport","rootMargin","amount","once","threshold","isIntersecting","onViewportEnter","onViewportLeave","prevViewport","hasViewportOptionChanged","globalTapTarget","propagate","_element","onFocus","isFocusVisible","onBlur","createMotionComponentWithFeatures","MotionDiv"],"mappings":"yRAAA,SAASA,EAAcC,EAAKC,IACG,IAAvBD,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,EACjB,CACA,SAASG,EAAWJ,EAAKC,GACrB,MAAMI,EAAQL,EAAIE,QAAQD,GACtBI,GAAS,GACTL,EAAIM,OAAOD,EAAO,EAC1B,CCRA,MAAME,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM,IAAIG,MAAMX,EAAmBC,EAASC,MCbxD,MAAMU,EAAqB,CAAE,ECGvBC,EAAqBd,GAAM,+BAA+Be,KAAKf,GCHrE,SAASgB,EAASC,GACd,MAAwB,iBAAVA,GAAgC,OAAVA,CACxC,CCCA,MAAMC,EAAqBlB,GAAM,cAAce,KAAKf,GCFpD,SAASmB,EAAKC,GACV,IAAIC,EACJ,MAAO,UACYC,IAAXD,IACAA,EAASD,KACNC,EAEf,CCPA,MAAME,EAAQC,GAAQA,ECMhBC,EAAmB,CAACC,EAAGC,IAAO3B,GAAM2B,EAAED,EAAE1B,IACxC4B,EAAO,IAAIC,IAAiBA,EAAaC,OAAOL,GCKhDM,EAAW,CAACC,EAAMC,EAAIhB,KACxB,MAAMiB,EAAmBD,EAAKD,EAC9B,OAA4B,IAArBE,EAAyB,GAAKjB,EAAQe,GAAQE,GCbzD,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACxB,CACD,GAAAC,CAAIC,GAEA,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,IAELnR,KAAKm/B,QAAUxI,GAAMxlB,EAAS,CAACmiD,EAAUr6B,KACrCk4B,GAAiBnxD,KAAK0iC,KAAMzJ,EAAY,SAChCK,GAAa63B,GAAiBnxD,KAAK0iC,KAAMpJ,EAAU,SAElE,CACD,OAAA6F,GAAa,QKhBVigB,MELe,CAClB9Y,OAAQ,CACJmf,eAAgBnH,GAChB8G,oBCFD,SAASsO,GAAkC1T,EAAWntC,GACzD,OAAOkyC,GAAsB/E,EAAWntC,EAASy/C,GAAepM,GACpE,CC6BO,MCjCMyN,GDiC0B5O,GAAsB"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-scroll.js b/node_modules/framer-motion/dist/size-rollup-scroll.js new file mode 100644 index 00000000..bcd4a87d --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-scroll.js @@ -0,0 +1,2 @@ +const e=(e,t,n)=>n>t?t:n{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(e,n,r)=>{e||"undefined"==typeof console||console.warn(t(n,r))},r=(e,n,r)=>{if(!e)throw new Error(t(n,r))});const s={};function o(e){return"object"==typeof e&&null!==e}const i=e=>e,a=(e,t)=>n=>t(e(n)),c=(...e)=>e.reduce(a),l=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};const u=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],f={value:null,addProjectionMetrics:null};function h(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=u.reduce((e,t)=>(e[t]=function(e,t){let n=new Set,r=new Set,s=!1,o=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){i.has(t)&&(u.schedule(t),e()),c++,t(a)}const u={schedule:(e,t=!1,o=!1)=>{const a=o&&s?n:r;return t&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{r.delete(e),i.delete(e)},process:e=>{a=e,s?o=!0:(s=!0,[n,r]=[r,n],n.forEach(l),t&&f.value&&f.value.frameloop[t].push(c),c=0,n.clear(),s=!1,o&&(o=!1,u.process(e)))}};return u}(i,t),e),{}),{setup:c,read:l,resolveKeyframes:h,preUpdate:d,update:g,preRender:p,render:m,postRender:v}=a,y=()=>{const i=s.useManualTiming?o.timestamp:performance.now();n=!1,s.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1)),o.timestamp=i,o.isProcessing=!0,c.process(o),l.process(o),h.process(o),d.process(o),g.process(o),p.process(o),m.process(o),v.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(y))};return{schedule:u.reduce((t,s)=>{const i=a[s];return t[s]=(t,s=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(y)),i.schedule(t,s,a)),t},{}),cancel:e=>{for(let t=0;tt=>"string"==typeof t&&t.startsWith(e))("var(--"),y=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,b={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},w={...b,transform:t=>e(0,1,t)},x=e=>Math.round(1e5*e)/1e5,E=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const W=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,L=(e,t)=>n=>Boolean("string"==typeof n&&W.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),M=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[s,o,i,a]=r.match(E);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},A={...b,transform:t=>Math.round((t=>e(0,255,t))(t))},B={test:L("rgb","red"),parse:M("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+A.transform(e)+", "+A.transform(t)+", "+A.transform(n)+", "+x(w.transform(r))+")"};const S={test:L("#"),parse:function(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:B.transform},O=(e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}))("%"),T={test:L("hsl","hue"),parse:M("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+O.transform(x(t))+", "+O.transform(x(n))+", "+x(w.transform(r))+")"},$={test:e=>B.test(e)||S.test(e)||T.test(e),parse:e=>B.test(e)?B.parse(e):T.test(e)?T.parse(e):S.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?B.transform(e):T.transform(e),getAnimatableNone:e=>{const t=$.parse(e);return t.alpha=0,$.transform(t)}},H=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const z="number",F="color",N=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function k(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(N,e=>($.test(e)?(r.color.push(o),s.push(F),n.push($.parse(e))):e.startsWith("var(")?(r.var.push(o),s.push("var"),n.push(e)):(r.number.push(o),s.push(z),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:i,indexes:r,types:s}}function P(e){return k(e).values}function R(e){const{split:t,types:n}=k(e),r=t.length;return e=>{let s="";for(let o=0;o"number"==typeof e?0:$.test(e)?$.getAnimatableNone(e):e;const j={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(E)?.length||0)+(e.match(H)?.length||0)>0},parse:P,createTransformer:R,getAnimatableNone:function(e){const t=P(e);return R(e)(t.map(q))}};function U(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function C(e,t){return n=>n>0?t:e}const I=(e,t,n)=>e+(t-e)*n,G=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},V=[S,B,T];function D(e){const t=(r=e,V.find(e=>e.test(r)));var r;if(n(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(t))return!1;let s=t.parse(e);return t===T&&(s=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let s=0,o=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=U(a,r,e+1/3),o=U(a,r,e),i=U(a,r,e-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(s)),s}const K=(e,t)=>{const n=D(e),r=D(t);if(!n||!r)return C(e,t);const s={...n};return e=>(s.red=G(n.red,r.red,e),s.green=G(n.green,r.green,e),s.blue=G(n.blue,r.blue,e),s.alpha=I(n.alpha,r.alpha,e),B.transform(s))},_=new Set(["none","hidden"]);function J(e,t){return n=>I(e,t,n)}function Q(e){return"number"==typeof e?J:"string"==typeof e?v(t=e)&&y.test(t.split("/*")[0].trim())?C:$.test(e)?K:Z:Array.isArray(e)?X:"object"==typeof e?$.test(e)?K:Y:C;var t}function X(e,t){const n=[...e],r=n.length,s=e.map((e,n)=>Q(e)(e,t[n]));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Z=(e,t)=>{const r=j.createTransformer(t),s=k(e),o=k(t);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?_.has(e)&&!o.values.length||_.has(t)&&!s.values.length?function(e,t){return _.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):c(X(function(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;sn[0];if(2===f&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[f-1]&&(t=[...t].reverse(),n=[...n].reverse());const d=function(e,t,n){const r=[],o=n||s.mix||ee,a=e.length-1;for(let n=0;n{if(h&&e1)for(;rp(e(t[0],t[f-1],n)):p}function ne(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=l(0,t,r);e.push(I(n,1,s))}}(t,e.length-1),t}const re={};function se(e,t){const n=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(e);return()=>re[t]??n()}const oe=se(()=>void 0!==window.ScrollTimeline,"scrollTimeline");function ie(e){return o(e)&&"offsetHeight"in e}const ae=new WeakMap;let ce;const le=(e,t,n)=>(r,s)=>{return s&&s[0]?s[0][e+"Size"]:o(i=r)&&"ownerSVGElement"in i&&"getBBox"in r?r.getBBox()[t]:r[n];var i},ue=le("inline","width","offsetWidth"),fe=le("block","height","offsetHeight");function he({target:e,borderBoxSize:t}){ae.get(e)?.forEach(n=>{n(e,{get width(){return ue(e,t)},get height(){return fe(e,t)}})})}function de(e){e.forEach(he)}function ge(e,t){ce||"undefined"!=typeof ResizeObserver&&(ce=new ResizeObserver(de));const n=function(e){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e).filter(e=>null!=e)}(e);return n.forEach(e=>{let n=ae.get(e);n||(n=new Set,ae.set(e,n)),n.add(t),ce?.observe(e)}),()=>{n.forEach(e=>{const n=ae.get(e);n?.delete(t),n?.size||ce?.unobserve(e)})}}const pe=new Set;let me;function ve(e){return pe.add(e),me||(me=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};pe.forEach(t=>t(e))},window.addEventListener("resize",me)),()=>{pe.delete(e),pe.size||"function"!=typeof me||(window.removeEventListener("resize",me),me=void 0)}}function ye(e,t){let n;const r=()=>{const{currentTime:r}=t,s=(null===r?0:r.value)/100;n!==s&&e(s),n=s};return d.preUpdate(r,!0),()=>g(r)}const be={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function we(e,t,n,r){const s=n[t],{length:o,position:i}=be[t],a=s.current,c=n.time;s.current=e[`scroll${i}`],s.scrollLength=e[`scroll${o}`]-e[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=l(0,s.scrollLength,s.current);const u=r-c;var f,h;s.velocity=u>50?0:(f=s.current-a,(h=u)?f*(1e3/h):0)}const xe={start:0,center:.5,end:1};function Ee(e,t,n=0){let r=0;if(e in xe&&(e=xe[e]),"string"==typeof e){const t=parseFloat(e);e.endsWith("px")?r=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?r=t/100*document.documentElement.clientWidth:e.endsWith("vh")?r=t/100*document.documentElement.clientHeight:e=t}return"number"==typeof e&&(r=t*e),n+r}const We=[0,0];function Le(e,t,n,r){let s=Array.isArray(e)?e:We,o=0,i=0;return"number"==typeof e?s=[e,e]:"string"==typeof e&&(s=(e=e.trim()).includes(" ")?e.split(" "):[e,xe[e]?e:"0"]),o=Ee(s[0],n,r),i=Ee(s[1],t),o-i}const Me={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ae={x:0,y:0};function Be(t,n,r){const{offset:s=Me.All}=r,{target:o=t,axis:i="y"}=r,a="y"===i?"height":"width",c=o!==t?function(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(ie(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if("svg"===r.tagName){const e=r.getBoundingClientRect();r=r.parentElement;const t=r.getBoundingClientRect();n.x+=e.left-t.left,n.y+=e.top-t.top}else{if(!(r instanceof SVGGraphicsElement))break;{const{x:e,y:t}=r.getBBox();n.x+=e,n.y+=t;let s=null,o=r.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=r.parentNode;r=s}}return n}(o,t):Ae,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(e){return"getBBox"in e&&"svg"!==e.tagName?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};n[i].offset.length=0;let f=!n[i].interpolate;const h=s.length;for(let e=0;e{!function(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}(e,r.target,n),function(e,t,n){we(e,"x",t,n),we(e,"y",t,n),t.time=n}(e,n,t),(r.offset||r.target)&&Be(e,n,r)},notify:()=>t(n)}}const Oe=new WeakMap,Te=new WeakMap,$e=new WeakMap,He=new WeakMap,ze=new WeakMap,Fe=e=>e===document.scrollingElement?window:e;function Ne(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return i;let s=$e.get(t);s||(s=new Set,$e.set(t,s));const o=Se(t,e,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},r);if(s.add(o),!Oe.has(t)){const e=()=>{for(const e of s)e.measure(p.timestamp);d.preUpdate(n)},n=()=>{for(const e of s)e.notify()},r=()=>d.read(e);Oe.set(t,r);const o=Fe(t);window.addEventListener("resize",r,{passive:!0}),t!==document.documentElement&&Te.set(t,(c=r,"function"==typeof(a=t)?ve(a):ge(a,c))),o.addEventListener("scroll",r,{passive:!0}),r()}var a,c;if(n&&!ze.has(t)){const e=Oe.get(t),n={width:t.scrollWidth,height:t.scrollHeight};He.set(t,n);const r=()=>{const r=t.scrollWidth,s=t.scrollHeight;n.width===r&&n.height===s||(e(),n.width=r,n.height=s)},s=d.read(r,!0);ze.set(t,s)}const l=Oe.get(t);return d.read(l,!1,!0),()=>{g(l);const e=$e.get(t);if(!e)return;if(e.delete(o),e.size)return;const n=Oe.get(t);Oe.delete(t),n&&(Fe(t).removeEventListener("scroll",n),Te.get(t)?.(),window.removeEventListener("resize",n));const r=ze.get(t);r&&(g(r),ze.delete(t)),He.delete(t)}}const ke=new Map;function Pe({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);const s=ke.get(t)??new Map;ke.set(t,s);const o=n.target??"self",i=s.get(o)??{},a=r+(n.offset??[]).join(",");var c;return i[a]||(i[a]=(c=n.target,"undefined"!=typeof window&&!c&&oe()?new ScrollTimeline({source:t,axis:r}):function(e){const t={value:0},n=Ne(n=>{t.value=100*n[e.axis].progress},e);return{currentTime:t,cancel:n}}({container:t,...n}))),i[a]}function Re(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return i;const s={axis:t,container:n,...r};return"function"==typeof e?function(e,t){return function(e){return 2===e.length}(e)?Ne(n=>{e(n[t.axis].progress,n)},t):ye(e,Pe(t))}(e,s):function(e,t){const n=Pe(t);return e.attachTimeline({timeline:t.target?void 0:n,observe:e=>(e.pause(),ye(t=>{e.time=e.iterationDuration*t},n))})}(e,s)}export{Re as scroll}; +//# sourceMappingURL=size-rollup-scroll.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-scroll.js.map b/node_modules/framer-motion/dist/size-rollup-scroll.js.map new file mode 100644 index 00000000..73b44f05 --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-scroll.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-scroll.js","sources":["../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/stats/buffer.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/is-html-element.mjs","../../motion-dom/dist/es/resize/handle-element.mjs","../../motion-dom/dist/es/utils/is-svg-element.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/resize/handle-window.mjs","../../motion-dom/dist/es/scroll/observe.mjs","../lib/render/dom/scroll/info.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/render/dom/scroll/offsets/edge.js","../lib/render/dom/scroll/offsets/offset.js","../lib/render/dom/scroll/offsets/presets.js","../lib/render/dom/scroll/offsets/index.js","../lib/render/dom/scroll/offsets/inset.js","../lib/render/dom/scroll/on-scroll-handler.js","../lib/render/dom/scroll/track.js","../../motion-dom/dist/es/resize/index.mjs","../lib/render/dom/scroll/utils/get-timeline.js","../lib/render/dom/scroll/utils/can-use-native-timeline.js","../lib/render/dom/scroll/index.js","../lib/render/dom/scroll/attach-function.js","../lib/render/dom/scroll/attach-animation.js"],"sourcesContent":["const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n\nexport { statsBuffer };\n//# sourceMappingURL=buffer.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n//# sourceMappingURL=index.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\n\nexport { supportsScrollTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n\nexport { isHTMLElement };\n//# sourceMappingURL=is-html-element.mjs.map\n","import { isSVGElement } from '../utils/is-svg-element.mjs';\nimport { resolveElements } from '../utils/resolve-elements.mjs';\n\nconst resizeHandlers = new WeakMap();\nlet observer;\nconst getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][(borderBoxAxis + \"Size\")];\n }\n else if (isSVGElement(target) && \"getBBox\" in target) {\n return target.getBBox()[svgAxis];\n }\n else {\n return target[htmlAxis];\n }\n};\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\");\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\");\nfunction notifyTarget({ target, borderBoxSize }) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize);\n },\n get height() {\n return getHeight(target, borderBoxSize);\n },\n });\n });\n}\nfunction notifyAll(entries) {\n entries.forEach(notifyTarget);\n}\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\")\n return;\n observer = new ResizeObserver(notifyAll);\n}\nfunction resizeElement(target, handler) {\n if (!observer)\n createResizeObserver();\n const elements = resolveElements(target);\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element);\n if (!elementHandlers) {\n elementHandlers = new Set();\n resizeHandlers.set(element, elementHandlers);\n }\n elementHandlers.add(handler);\n observer?.observe(element);\n });\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element);\n elementHandlers?.delete(handler);\n if (!elementHandlers?.size) {\n observer?.unobserve(element);\n }\n });\n };\n}\n\nexport { resizeElement };\n//# sourceMappingURL=handle-element.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n//# sourceMappingURL=is-svg-element.mjs.map\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","const windowCallbacks = new Set();\nlet windowResizeHandler;\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth;\n },\n get height() {\n return window.innerHeight;\n },\n };\n windowCallbacks.forEach((callback) => callback(info));\n };\n window.addEventListener(\"resize\", windowResizeHandler);\n}\nfunction resizeWindow(callback) {\n windowCallbacks.add(callback);\n if (!windowResizeHandler)\n createWindowResizeHandler();\n return () => {\n windowCallbacks.delete(callback);\n if (!windowCallbacks.size &&\n typeof windowResizeHandler === \"function\") {\n window.removeEventListener(\"resize\", windowResizeHandler);\n windowResizeHandler = undefined;\n }\n };\n}\n\nexport { resizeWindow };\n//# sourceMappingURL=handle-window.mjs.map\n","import { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nfunction observeTimeline(update, timeline) {\n let prevProgress;\n const onFrame = () => {\n const { currentTime } = timeline;\n const percentage = currentTime === null ? 0 : currentTime.value;\n const progress = percentage / 100;\n if (prevProgress !== progress) {\n update(progress);\n }\n prevProgress = progress;\n };\n frame.preUpdate(onFrame, true);\n return () => cancelFrame(onFrame);\n}\n\nexport { observeTimeline };\n//# sourceMappingURL=observe.mjs.map\n","import { progress, velocityPerSecond } from \"motion-utils\";\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50;\nconst createAxisInfo = () => ({\n current: 0,\n offset: [],\n progress: 0,\n scrollLength: 0,\n targetOffset: 0,\n targetLength: 0,\n containerLength: 0,\n velocity: 0,\n});\nexport const createScrollInfo = () => ({\n time: 0,\n x: createAxisInfo(),\n y: createAxisInfo(),\n});\nconst keys = {\n x: {\n length: \"Width\",\n position: \"Left\",\n },\n y: {\n length: \"Height\",\n position: \"Top\",\n },\n};\nfunction updateAxisInfo(element, axisName, info, time) {\n const axis = info[axisName];\n const { length, position } = keys[axisName];\n const prev = axis.current;\n const prevTime = info.time;\n axis.current = element[`scroll${position}`];\n axis.scrollLength = element[`scroll${length}`] - element[`client${length}`];\n axis.offset.length = 0;\n axis.offset[0] = 0;\n axis.offset[1] = axis.scrollLength;\n axis.progress = progress(0, axis.scrollLength, axis.current);\n const elapsed = time - prevTime;\n axis.velocity =\n elapsed > maxElapsed\n ? 0\n : velocityPerSecond(axis.current - prev, elapsed);\n}\nexport function updateScrollInfo(element, info, time) {\n updateAxisInfo(element, \"x\", info, time);\n updateAxisInfo(element, \"y\", info, time);\n info.time = time;\n}\n//# sourceMappingURL=info.js.map","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","export const namedEdges = {\n start: 0,\n center: 0.5,\n end: 1,\n};\nexport function resolveEdge(edge, length, inset = 0) {\n let delta = 0;\n /**\n * If we have this edge defined as a preset, replace the definition\n * with the numerical value.\n */\n if (edge in namedEdges) {\n edge = namedEdges[edge];\n }\n /**\n * Handle unit values\n */\n if (typeof edge === \"string\") {\n const asNumber = parseFloat(edge);\n if (edge.endsWith(\"px\")) {\n delta = asNumber;\n }\n else if (edge.endsWith(\"%\")) {\n edge = asNumber / 100;\n }\n else if (edge.endsWith(\"vw\")) {\n delta = (asNumber / 100) * document.documentElement.clientWidth;\n }\n else if (edge.endsWith(\"vh\")) {\n delta = (asNumber / 100) * document.documentElement.clientHeight;\n }\n else {\n edge = asNumber;\n }\n }\n /**\n * If the edge is defined as a number, handle as a progress value.\n */\n if (typeof edge === \"number\") {\n delta = length * edge;\n }\n return inset + delta;\n}\n//# sourceMappingURL=edge.js.map","import { namedEdges, resolveEdge } from \"./edge\";\nconst defaultOffset = [0, 0];\nexport function resolveOffset(offset, containerLength, targetLength, targetInset) {\n let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset;\n let targetPoint = 0;\n let containerPoint = 0;\n if (typeof offset === \"number\") {\n /**\n * If we're provided offset: [0, 0.5, 1] then each number x should become\n * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n * and container etc.\n */\n offsetDefinition = [offset, offset];\n }\n else if (typeof offset === \"string\") {\n offset = offset.trim();\n if (offset.includes(\" \")) {\n offsetDefinition = offset.split(\" \");\n }\n else {\n /**\n * If we're provided a definition like \"100px\" then we want to apply\n * that only to the top of the target point, leaving the container at 0.\n * Whereas a named offset like \"end\" should be applied to both.\n */\n offsetDefinition = [offset, namedEdges[offset] ? offset : `0`];\n }\n }\n targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset);\n containerPoint = resolveEdge(offsetDefinition[1], containerLength);\n return targetPoint - containerPoint;\n}\n//# sourceMappingURL=offset.js.map","export const ScrollOffset = {\n Enter: [\n [0, 1],\n [1, 1],\n ],\n Exit: [\n [0, 0],\n [1, 0],\n ],\n Any: [\n [1, 0],\n [0, 1],\n ],\n All: [\n [0, 0],\n [1, 1],\n ],\n};\n//# sourceMappingURL=presets.js.map","import { defaultOffset, interpolate } from \"motion-dom\";\nimport { clamp } from \"motion-utils\";\nimport { calcInset } from \"./inset\";\nimport { resolveOffset } from \"./offset\";\nimport { ScrollOffset } from \"./presets\";\nconst point = { x: 0, y: 0 };\nfunction getTargetSize(target) {\n return \"getBBox\" in target && target.tagName !== \"svg\"\n ? target.getBBox()\n : { width: target.clientWidth, height: target.clientHeight };\n}\nexport function resolveOffsets(container, info, options) {\n const { offset: offsetDefinition = ScrollOffset.All } = options;\n const { target = container, axis = \"y\" } = options;\n const lengthLabel = axis === \"y\" ? \"height\" : \"width\";\n const inset = target !== container ? calcInset(target, container) : point;\n /**\n * Measure the target and container. If they're the same thing then we\n * use the container's scrollWidth/Height as the target, from there\n * all other calculations can remain the same.\n */\n const targetSize = target === container\n ? { width: container.scrollWidth, height: container.scrollHeight }\n : getTargetSize(target);\n const containerSize = {\n width: container.clientWidth,\n height: container.clientHeight,\n };\n /**\n * Reset the length of the resolved offset array rather than creating a new one.\n * TODO: More reusable data structures for targetSize/containerSize would also be good.\n */\n info[axis].offset.length = 0;\n /**\n * Populate the offset array by resolving the user's offset definition into\n * a list of pixel scroll offets.\n */\n let hasChanged = !info[axis].interpolate;\n const numOffsets = offsetDefinition.length;\n for (let i = 0; i < numOffsets; i++) {\n const offset = resolveOffset(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]);\n if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) {\n hasChanged = true;\n }\n info[axis].offset[i] = offset;\n }\n /**\n * If the pixel scroll offsets have changed, create a new interpolator function\n * to map scroll value into a progress.\n */\n if (hasChanged) {\n info[axis].interpolate = interpolate(info[axis].offset, defaultOffset(offsetDefinition), { clamp: false });\n info[axis].interpolatorOffsets = [...info[axis].offset];\n }\n info[axis].progress = clamp(0, 1, info[axis].interpolate(info[axis].current));\n}\n//# sourceMappingURL=index.js.map","import { isHTMLElement } from \"motion-dom\";\nexport function calcInset(element, container) {\n const inset = { x: 0, y: 0 };\n let current = element;\n while (current && current !== container) {\n if (isHTMLElement(current)) {\n inset.x += current.offsetLeft;\n inset.y += current.offsetTop;\n current = current.offsetParent;\n }\n else if (current.tagName === \"svg\") {\n /**\n * This isn't an ideal approach to measuring the offset of tags.\n * It would be preferable, given they behave like HTMLElements in most ways\n * to use offsetLeft/Top. But these don't exist on . Likewise we\n * can't use .getBBox() like most SVG elements as these provide the offset\n * relative to the SVG itself, which for is usually 0x0.\n */\n const svgBoundingBox = current.getBoundingClientRect();\n current = current.parentElement;\n const parentBoundingBox = current.getBoundingClientRect();\n inset.x += svgBoundingBox.left - parentBoundingBox.left;\n inset.y += svgBoundingBox.top - parentBoundingBox.top;\n }\n else if (current instanceof SVGGraphicsElement) {\n const { x, y } = current.getBBox();\n inset.x += x;\n inset.y += y;\n let svg = null;\n let parent = current.parentNode;\n while (!svg) {\n if (parent.tagName === \"svg\") {\n svg = parent;\n }\n parent = current.parentNode;\n }\n current = svg;\n }\n else {\n break;\n }\n }\n return inset;\n}\n//# sourceMappingURL=inset.js.map","import { warnOnce } from \"motion-utils\";\nimport { updateScrollInfo } from \"./info\";\nimport { resolveOffsets } from \"./offsets/index\";\nfunction measure(container, target = container, info) {\n /**\n * Find inset of target within scrollable container\n */\n info.x.targetOffset = 0;\n info.y.targetOffset = 0;\n if (target !== container) {\n let node = target;\n while (node && node !== container) {\n info.x.targetOffset += node.offsetLeft;\n info.y.targetOffset += node.offsetTop;\n node = node.offsetParent;\n }\n }\n info.x.targetLength =\n target === container ? target.scrollWidth : target.clientWidth;\n info.y.targetLength =\n target === container ? target.scrollHeight : target.clientHeight;\n info.x.containerLength = container.clientWidth;\n info.y.containerLength = container.clientHeight;\n /**\n * In development mode ensure scroll containers aren't position: static as this makes\n * it difficult to measure their relative positions.\n */\n if (process.env.NODE_ENV !== \"production\") {\n if (container && target && target !== container) {\n warnOnce(getComputedStyle(container).position !== \"static\", \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\");\n }\n }\n}\nexport function createOnScrollHandler(element, onScroll, info, options = {}) {\n return {\n measure: (time) => {\n measure(element, options.target, info);\n updateScrollInfo(element, info, time);\n if (options.offset || options.target) {\n resolveOffsets(element, info, options);\n }\n },\n notify: () => onScroll(info),\n };\n}\n//# sourceMappingURL=on-scroll-handler.js.map","import { cancelFrame, frame, frameData, resize } from \"motion-dom\";\nimport { noop } from \"motion-utils\";\nimport { createScrollInfo } from \"./info\";\nimport { createOnScrollHandler } from \"./on-scroll-handler\";\nconst scrollListeners = new WeakMap();\nconst resizeListeners = new WeakMap();\nconst onScrollHandlers = new WeakMap();\nconst scrollSize = new WeakMap();\nconst dimensionCheckProcesses = new WeakMap();\nconst getEventTarget = (element) => element === document.scrollingElement ? window : element;\nexport function scrollInfo(onScroll, { container = document.scrollingElement, trackContentSize = false, ...options } = {}) {\n if (!container)\n return noop;\n let containerHandlers = onScrollHandlers.get(container);\n /**\n * Get the onScroll handlers for this container.\n * If one isn't found, create a new one.\n */\n if (!containerHandlers) {\n containerHandlers = new Set();\n onScrollHandlers.set(container, containerHandlers);\n }\n /**\n * Create a new onScroll handler for the provided callback.\n */\n const info = createScrollInfo();\n const containerHandler = createOnScrollHandler(container, onScroll, info, options);\n containerHandlers.add(containerHandler);\n /**\n * Check if there's a scroll event listener for this container.\n * If not, create one.\n */\n if (!scrollListeners.has(container)) {\n const measureAll = () => {\n for (const handler of containerHandlers) {\n handler.measure(frameData.timestamp);\n }\n frame.preUpdate(notifyAll);\n };\n const notifyAll = () => {\n for (const handler of containerHandlers) {\n handler.notify();\n }\n };\n const listener = () => frame.read(measureAll);\n scrollListeners.set(container, listener);\n const target = getEventTarget(container);\n window.addEventListener(\"resize\", listener, { passive: true });\n if (container !== document.documentElement) {\n resizeListeners.set(container, resize(container, listener));\n }\n target.addEventListener(\"scroll\", listener, { passive: true });\n listener();\n }\n /**\n * Enable content size tracking if requested and not already enabled.\n */\n if (trackContentSize && !dimensionCheckProcesses.has(container)) {\n const listener = scrollListeners.get(container);\n // Store initial scroll dimensions (object is reused to avoid allocation)\n const size = {\n width: container.scrollWidth,\n height: container.scrollHeight,\n };\n scrollSize.set(container, size);\n // Add frame-based scroll dimension checking to detect content changes\n const checkScrollDimensions = () => {\n const newWidth = container.scrollWidth;\n const newHeight = container.scrollHeight;\n if (size.width !== newWidth || size.height !== newHeight) {\n listener();\n size.width = newWidth;\n size.height = newHeight;\n }\n };\n // Schedule with keepAlive=true to run every frame\n const dimensionCheckProcess = frame.read(checkScrollDimensions, true);\n dimensionCheckProcesses.set(container, dimensionCheckProcess);\n }\n const listener = scrollListeners.get(container);\n frame.read(listener, false, true);\n return () => {\n cancelFrame(listener);\n /**\n * Check if we even have any handlers for this container.\n */\n const currentHandlers = onScrollHandlers.get(container);\n if (!currentHandlers)\n return;\n currentHandlers.delete(containerHandler);\n if (currentHandlers.size)\n return;\n /**\n * If no more handlers, remove the scroll listener too.\n */\n const scrollListener = scrollListeners.get(container);\n scrollListeners.delete(container);\n if (scrollListener) {\n getEventTarget(container).removeEventListener(\"scroll\", scrollListener);\n resizeListeners.get(container)?.();\n window.removeEventListener(\"resize\", scrollListener);\n }\n // Clean up scroll dimension checking\n const dimensionCheckProcess = dimensionCheckProcesses.get(container);\n if (dimensionCheckProcess) {\n cancelFrame(dimensionCheckProcess);\n dimensionCheckProcesses.delete(container);\n }\n scrollSize.delete(container);\n };\n}\n//# sourceMappingURL=track.js.map","import { resizeElement } from './handle-element.mjs';\nimport { resizeWindow } from './handle-window.mjs';\n\nfunction resize(a, b) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b);\n}\n\nexport { resize };\n//# sourceMappingURL=index.mjs.map\n","import { scrollInfo } from \"../track\";\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\";\nconst timelineCache = new Map();\nfunction scrollTimelineFallback(options) {\n const currentTime = { value: 0 };\n const cancel = scrollInfo((info) => {\n currentTime.value = info[options.axis].progress * 100;\n }, options);\n return { currentTime, cancel };\n}\nexport function getTimeline({ source, container, ...options }) {\n const { axis } = options;\n if (source)\n container = source;\n const containerCache = timelineCache.get(container) ?? new Map();\n timelineCache.set(container, containerCache);\n const targetKey = options.target ?? \"self\";\n const targetCache = containerCache.get(targetKey) ?? {};\n const axisKey = axis + (options.offset ?? []).join(\",\");\n if (!targetCache[axisKey]) {\n targetCache[axisKey] =\n canUseNativeTimeline(options.target)\n ? new ScrollTimeline({ source: container, axis })\n : scrollTimelineFallback({ container, ...options });\n }\n return targetCache[axisKey];\n}\n//# sourceMappingURL=get-timeline.js.map","import { supportsScrollTimeline } from \"motion-dom\";\nexport function canUseNativeTimeline(target) {\n return (typeof window !== \"undefined\" && !target && supportsScrollTimeline());\n}\n//# sourceMappingURL=can-use-native-timeline.js.map","import { noop } from \"motion-utils\";\nimport { attachToAnimation } from \"./attach-animation\";\nimport { attachToFunction } from \"./attach-function\";\nexport function scroll(onScroll, { axis = \"y\", container = document.scrollingElement, ...options } = {}) {\n if (!container)\n return noop;\n const optionsWithDefaults = { axis, container, ...options };\n return typeof onScroll === \"function\"\n ? attachToFunction(onScroll, optionsWithDefaults)\n : attachToAnimation(onScroll, optionsWithDefaults);\n}\n//# sourceMappingURL=index.js.map","import { observeTimeline } from \"motion-dom\";\nimport { scrollInfo } from \"./track\";\nimport { getTimeline } from \"./utils/get-timeline\";\n/**\n * If the onScroll function has two arguments, it's expecting\n * more specific information about the scroll from scrollInfo.\n */\nfunction isOnScrollWithInfo(onScroll) {\n return onScroll.length === 2;\n}\nexport function attachToFunction(onScroll, options) {\n if (isOnScrollWithInfo(onScroll)) {\n return scrollInfo((info) => {\n onScroll(info[options.axis].progress, info);\n }, options);\n }\n else {\n return observeTimeline(onScroll, getTimeline(options));\n }\n}\n//# sourceMappingURL=attach-function.js.map","import { observeTimeline } from \"motion-dom\";\nimport { getTimeline } from \"./utils/get-timeline\";\nexport function attachToAnimation(animation, options) {\n const timeline = getTimeline(options);\n return animation.attachTimeline({\n timeline: options.target ? undefined : timeline,\n observe: (valueAnimation) => {\n valueAnimation.pause();\n return observeTimeline((progress) => {\n valueAnimation.time =\n valueAnimation.iterationDuration * progress;\n }, timeline);\n },\n });\n}\n//# sourceMappingURL=attach-animation.js.map"],"names":["clamp","min","max","v","formatErrorMessage","message","errorCode","warning","invariant","process","env","NODE_ENV","check","console","warn","Error","MotionGlobalConfig","isObject","value","noop","any","combineFunctions","a","b","pipe","transformers","reduce","progress","from","to","toFromDifference","stepsOrder","statsBuffer","addProjectionMetrics","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","acc","key","stepName","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","numCalls","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","add","cancel","delete","frameData","forEach","frameloop","push","clear","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","i","length","frame","cancelFrame","frameSteps","requestAnimationFrame","startsAsVariableToken","token","startsWith","checkStringStartsWith","singleCssVariableRegex","number","test","parse","parseFloat","transform","alpha","sanitize","round","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","c","match","undefined","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","percent","unit","endsWith","split","createUnitType","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","colorRegex","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","analyseComplexValue","originalValue","toString","values","indexes","var","types","replace","parsedValue","parseComplexValue","createTransformer","source","numSections","output","convertNumbersToZero","complex","isNaN","transformer","map","hueToRgb","p","q","t","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","mixNumber$1","getMixer","trim","mixComplex","Array","isArray","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","mix","mixer","interpolate","input","isClamp","ease","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","arr","offset","remaining","offsetProgress","fillOffset","supportsFlags","memoSupports","supportsFlag","memoized","result","memo","supportsScrollTimeline","window","ScrollTimeline","isHTMLElement","element","resizeHandlers","WeakMap","observer","getSize","borderBoxAxis","svgAxis","htmlAxis","borderBoxSize","getBBox","getWidth","getHeight","notifyTarget","get","handler","width","height","notifyAll","entries","resizeElement","ResizeObserver","elements","elementOrSelector","EventTarget","document","querySelectorAll","filter","resolveElements","elementHandlers","set","observe","size","unobserve","windowCallbacks","windowResizeHandler","resizeWindow","info","innerWidth","innerHeight","addEventListener","removeEventListener","observeTimeline","timeline","prevProgress","onFrame","currentTime","keys","x","position","y","updateAxisInfo","axisName","time","axis","prev","current","prevTime","scrollLength","elapsed","velocity","frameDuration","namedEdges","start","center","end","resolveEdge","edge","inset","asNumber","documentElement","clientWidth","clientHeight","resolveOffset","containerLength","targetLength","targetInset","offsetDefinition","targetPoint","containerPoint","includes","ScrollOffset","Enter","Exit","Any","All","point","resolveOffsets","container","options","lengthLabel","offsetLeft","offsetTop","offsetParent","tagName","svgBoundingBox","getBoundingClientRect","parentElement","parentBoundingBox","left","top","SVGGraphicsElement","svg","parent","parentNode","calcInset","targetSize","scrollWidth","scrollHeight","getTargetSize","containerSize","hasChanged","numOffsets","interpolatorOffsets","createOnScrollHandler","onScroll","measure","targetOffset","node","updateScrollInfo","notify","scrollListeners","resizeListeners","onScrollHandlers","scrollSize","dimensionCheckProcesses","getEventTarget","scrollingElement","scrollInfo","trackContentSize","containerHandlers","containerHandler","measureAll","listener","passive","checkScrollDimensions","newWidth","newHeight","dimensionCheckProcess","currentHandlers","scrollListener","timelineCache","Map","getTimeline","containerCache","targetKey","targetCache","axisKey","join","scrollTimelineFallback","scroll","optionsWithDefaults","isOnScrollWithInfo","attachToFunction","animation","attachTimeline","valueAnimation","pause","iterationDuration","attachToAnimation"],"mappings":"AAAA,MAAMA,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,SAASC,EAAmBC,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CCFA,IAAIE,EAAU,OACVC,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WACbJ,EAAU,CAACK,EAAOP,EAASC,KAClBM,GAA4B,oBAAZC,SACjBA,QAAQC,KAAKV,EAAmBC,EAASC,KAGjDE,EAAY,CAACI,EAAOP,EAASC,KACzB,IAAKM,EACD,MAAM,IAAIG,MAAMX,EAAmBC,EAASC,MCbxD,MAAMU,EAAqB,CAAE,ECA7B,SAASC,EAASC,GACd,MAAwB,iBAAVA,GAAgC,OAAVA,CACxC,CCDA,MAAMC,EAAQC,GAAQA,ECMhBC,EAAmB,CAACC,EAAGC,IAAOpB,GAAMoB,EAAED,EAAEnB,IACxCqB,EAAO,IAAIC,IAAiBA,EAAaC,OAAOL,GCKhDM,EAAW,CAACC,EAAMC,EAAIX,KACxB,MAAMY,EAAmBD,EAAKD,EAC9B,OAA4B,IAArBE,EAAyB,GAAKZ,EAAQU,GAAQE,GCfzD,MAAMC,EAAa,CACf,QACA,OACA,mBACA,YACA,SACA,YACA,SACA,cCREC,EAAc,CAChBd,MAAO,KACPe,qBAAsB,M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B,OAAOiE,EAAUC,eAAe,CAC5BhH,SAAU8C,EAAQnI,YAAS/E,EAAYoK,EACvCZ,QAAU6H,IACNA,EAAeC,QACRnH,GAAiBlQ,IACpBoX,EAAevG,KACXuG,EAAeE,kBAAoBtX,GACxCmQ,KAGf,CFLUoH,CAAkB5C,EAAUoC,EACtC"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js new file mode 100644 index 00000000..76ef0a8c --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js @@ -0,0 +1,2 @@ +let t=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const e=t=>t,n=t=>1e3*t,i=t=>t/1e3,s=t=>null!==t;class a{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function o(t){for(let e=1;et.startsWith("--");const l={};function u(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>l[e]??n()}const h=u(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),d=u(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),m=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,c={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:m([0,.65,.55,1]),circOut:m([.55,0,1,.45]),backIn:m([.31,.01,.66,-.59]),backOut:m([.33,1.53,.69,.99])};function p(t,e){return t?"function"==typeof t?d()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;eArray.isArray(t)&&"number"==typeof t[0])(t)?m(t):Array.isArray(t)?t.map(t=>p(t,e)||c.easeOut):c[t]:void 0}class f extends a{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:a,pseudoElement:o,allowFlatten:l=!1,finalKeyframe:u,onComplete:h}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=l,this.options=e,t("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const m=function({type:t,...e}){return function(t){return"function"==typeof t&&"applyToOptions"in t}(t)&&d()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(e);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const d=p(r,s);Array.isArray(d)&&(h.easing=d);const m={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};return u&&(m.pseudoElement=u),t.animate(h,m)}(n,i,a,m,o),!1===m.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,a=1){const o=t.filter(s),r=a<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}(a,this.options,u,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){r(e)?t.style.setProperty(e,n):t.style[e]=n}(n,i,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return i(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+i(t)}get time(){return i(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=n(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&h()?(this.animation.timeline=t,e):n(this)}}class g{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return y(this.animations,"duration")}get iterationDuration(){return y(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function y(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class T extends g{then(t,e){return this.finished.finally(t).then(()=>{})}}const b=new WeakMap,A=(t,e="")=>`${t}:${e}`;function S(t){const e=b.get(t)||new Map;return b.set(t,e),e}function E(t,e){const n=t?.[e]??t?.default??t;return n!==t?function(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}(n,t):n}const k=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function v(t,e){for(let n=0;nnull!=t)}(e,a),l=r.length;t(Boolean(l),"No valid elements provided.","no-valid-elements");const u=[];for(let t=0;te.delete(n)),h.push(s)}return h}const I=t=>function(e,n,i){return new T(B(e,n,i,t))},R=I();export{R as animateMini,I as createScopedWaapiAnimate}; +//# sourceMappingURL=size-rollup-waapi-animate.js.map diff --git a/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map new file mode 100644 index 00000000..6fac82dc --- /dev/null +++ b/node_modules/framer-motion/dist/size-rollup-waapi-animate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-waapi-animate.js","sources":["../../motion-utils/dist/es/errors.mjs","../../motion-utils/dist/es/format-error-message.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/animation/GroupAnimation.mjs","../../motion-dom/dist/es/animation/GroupAnimationWithThen.mjs","../../motion-dom/dist/es/animation/utils/active-animations.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/waapi/utils/px-values.mjs","../../motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs","../../motion-dom/dist/es/render/dom/style-computed.mjs","../lib/animation/animators/waapi/animate-elements.js","../../motion-dom/dist/es/utils/resolve-elements.mjs","../lib/animation/animators/waapi/animate-style.js"],"sourcesContent":["import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n//# sourceMappingURL=errors.mjs.map\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n//# sourceMappingURL=format-error-message.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\n\nexport { supportsScrollTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","class GroupAnimation {\n constructor(animations) {\n // Bound to accomadate common `return animation.stop` pattern\n this.stop = () => this.runAll(\"stop\");\n this.animations = animations.filter(Boolean);\n }\n get finished() {\n return Promise.all(this.animations.map((animation) => animation.finished));\n }\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n getAll(propName) {\n return this.animations[0][propName];\n }\n setAll(propName, newValue) {\n for (let i = 0; i < this.animations.length; i++) {\n this.animations[i][propName] = newValue;\n }\n }\n attachTimeline(timeline) {\n const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline));\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel();\n this.animations[i].stop();\n });\n };\n }\n get time() {\n return this.getAll(\"time\");\n }\n set time(time) {\n this.setAll(\"time\", time);\n }\n get speed() {\n return this.getAll(\"speed\");\n }\n set speed(speed) {\n this.setAll(\"speed\", speed);\n }\n get state() {\n return this.getAll(\"state\");\n }\n get startTime() {\n return this.getAll(\"startTime\");\n }\n get duration() {\n return getMax(this.animations, \"duration\");\n }\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\");\n }\n runAll(methodName) {\n this.animations.forEach((controls) => controls[methodName]());\n }\n play() {\n this.runAll(\"play\");\n }\n pause() {\n this.runAll(\"pause\");\n }\n cancel() {\n this.runAll(\"cancel\");\n }\n complete() {\n this.runAll(\"complete\");\n }\n}\nfunction getMax(animations, propName) {\n let max = 0;\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName];\n if (value !== null && value > max) {\n max = value;\n }\n }\n return max;\n}\n\nexport { GroupAnimation };\n//# sourceMappingURL=GroupAnimation.mjs.map\n","import { GroupAnimation } from './GroupAnimation.mjs';\n\nclass GroupAnimationWithThen extends GroupAnimation {\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n}\n\nexport { GroupAnimationWithThen };\n//# sourceMappingURL=GroupAnimationWithThen.mjs.map\n","const animationMaps = new WeakMap();\nconst animationMapKey = (name, pseudoElement = \"\") => `${name}:${pseudoElement}`;\nfunction getAnimationMap(element) {\n const map = animationMaps.get(element) || new Map();\n animationMaps.set(element, map);\n return map;\n}\n\nexport { animationMapKey, getAnimationMap };\n//# sourceMappingURL=active-animations.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n]);\n\nexport { pxValues };\n//# sourceMappingURL=px-values.mjs.map\n","import { pxValues } from '../../waapi/utils/px-values.mjs';\n\nfunction applyPxDefaults(keyframes, name) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\";\n }\n }\n}\n\nexport { applyPxDefaults };\n//# sourceMappingURL=apply-px-defaults.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction getComputedStyle(element, name) {\n const computedStyle = window.getComputedStyle(element);\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name];\n}\n\nexport { getComputedStyle };\n//# sourceMappingURL=style-computed.mjs.map\n","import { animationMapKey, applyPxDefaults, fillWildcards, getAnimationMap, getComputedStyle, getValueTransition, NativeAnimation, resolveElements, } from \"motion-dom\";\nimport { invariant, secondsToMilliseconds } from \"motion-utils\";\nexport function animateElements(elementOrSelector, keyframes, options, scope) {\n // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n if (elementOrSelector == null) {\n return [];\n }\n const elements = resolveElements(elementOrSelector, scope);\n const numElements = elements.length;\n invariant(Boolean(numElements), \"No valid elements provided.\", \"no-valid-elements\");\n /**\n * WAAPI doesn't support interrupting animations.\n *\n * Therefore, starting animations requires a three-step process:\n * 1. Stop existing animations (write styles to DOM)\n * 2. Resolve keyframes (read styles from DOM)\n * 3. Create new animations (write styles to DOM)\n *\n * The hybrid `animate()` function uses AsyncAnimation to resolve\n * keyframes before creating new animations, which removes style\n * thrashing. Here, we have much stricter filesize constraints.\n * Therefore we do this in a synchronous way that ensures that\n * at least within `animate()` calls there is no style thrashing.\n *\n * In the motion-native-animate-mini-interrupt benchmark this\n * was 80% faster than a single loop.\n */\n const animationDefinitions = [];\n /**\n * Step 1: Build options and stop existing animations (write)\n */\n for (let i = 0; i < numElements; i++) {\n const element = elements[i];\n const elementTransition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (typeof elementTransition.delay === \"function\") {\n elementTransition.delay = elementTransition.delay(i, numElements);\n }\n for (const valueName in keyframes) {\n let valueKeyframes = keyframes[valueName];\n if (!Array.isArray(valueKeyframes)) {\n valueKeyframes = [valueKeyframes];\n }\n const valueOptions = {\n ...getValueTransition(elementTransition, valueName),\n };\n valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));\n valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));\n /**\n * If there's an existing animation playing on this element then stop it\n * before creating a new one.\n */\n const map = getAnimationMap(element);\n const key = animationMapKey(valueName, valueOptions.pseudoElement || \"\");\n const currentAnimation = map.get(key);\n currentAnimation && currentAnimation.stop();\n animationDefinitions.push({\n map,\n key,\n unresolvedKeyframes: valueKeyframes,\n options: {\n ...valueOptions,\n element,\n name: valueName,\n allowFlatten: !elementTransition.type && !elementTransition.ease,\n },\n });\n }\n }\n /**\n * Step 2: Resolve keyframes (read)\n */\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { unresolvedKeyframes, options: animationOptions } = animationDefinitions[i];\n const { element, name, pseudoElement } = animationOptions;\n if (!pseudoElement && unresolvedKeyframes[0] === null) {\n unresolvedKeyframes[0] = getComputedStyle(element, name);\n }\n fillWildcards(unresolvedKeyframes);\n applyPxDefaults(unresolvedKeyframes, name);\n /**\n * If we only have one keyframe, explicitly read the initial keyframe\n * from the computed style. This is to ensure consistency with WAAPI behaviour\n * for restarting animations, for instance .play() after finish, when it\n * has one vs two keyframes.\n */\n if (!pseudoElement && unresolvedKeyframes.length < 2) {\n unresolvedKeyframes.unshift(getComputedStyle(element, name));\n }\n animationOptions.keyframes = unresolvedKeyframes;\n }\n /**\n * Step 3: Create new animations (write)\n */\n const animations = [];\n for (let i = 0; i < animationDefinitions.length; i++) {\n const { map, key, options: animationOptions } = animationDefinitions[i];\n const animation = new NativeAnimation(animationOptions);\n map.set(key, animation);\n animation.finished.finally(() => map.delete(key));\n animations.push(animation);\n }\n return animations;\n}\n//# sourceMappingURL=animate-elements.js.map","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","import { GroupAnimationWithThen, } from \"motion-dom\";\nimport { animateElements } from \"./animate-elements\";\nexport const createScopedWaapiAnimate = (scope) => {\n function scopedAnimate(elementOrSelector, keyframes, options) {\n return new GroupAnimationWithThen(animateElements(elementOrSelector, keyframes, options, scope));\n }\n return scopedAnimate;\n};\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate();\n//# sourceMappingURL=animate-style.js.map"],"names":["invariant","process","env","NODE_ENV","check","message","errorCode","Error","formatErrorMessage","noop","any","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","isNotNull","value","WithPromise","constructor","this","updateFinished","finished","_finished","Promise","resolve","notifyFinished","then","onResolve","onReject","fillWildcards","keyframes","i","length","isCSSVar","name","startsWith","supportsFlags","memoSupports","callback","supportsFlag","memoized","result","undefined","memo","supportsScrollTimeline","window","ScrollTimeline","supportsLinearEasing","document","createElement","animate","opacity","easing","e","cubicBezierAsString","a","b","c","d","supportedWaapiEasing","linear","ease","easeIn","easeOut","easeInOut","circIn","circOut","backIn","backOut","mapEasingToNativeEasing","duration","resolution","points","numPoints","Math","max","round","substring","generateLinearEasing","Array","isArray","isBezierDefinition","map","segmentEasing","NativeAnimation","options","super","finishedTime","isStopped","manualStartTime","element","pseudoElement","allowFlatten","finalKeyframe","onComplete","isPseudoElement","Boolean","type","transition","isGenerator","applyToOptions","applyGeneratorOptions","animation","valueName","delay","repeat","repeatType","times","keyframeOptions","offset","fill","iterations","direction","startWaapiAnimation","autoplay","pause","onfinish","time","keyframe","speed","resolvedKeyframes","filter","index","getFinalKeyframe","updateMotionValue","style","setProperty","setStyle","cancel","play","state","complete","finish","stop","commitStyles","isConnected","effect","getComputedTiming","Number","iterationDuration","currentTime","newTime","playbackRate","newSpeed","playState","startTime","newStartTime","attachTimeline","timeline","observe","updateTiming","GroupAnimation","animations","runAll","all","getAll","propName","setAll","newValue","subscriptions","forEach","getMax","methodName","controls","GroupAnimationWithThen","_onReject","finally","animationMaps","WeakMap","animationMapKey","getAnimationMap","get","Map","set","getValueTransition","key","valueTransition","parentTransition","inherit","_","rest","resolveTransition","pxValues","Set","applyPxDefaults","has","getComputedStyle","computedStyle","getPropertyValue","animateElements","elementOrSelector","scope","elements","EventTarget","root","current","querySelectorAll","from","resolveElements","numElements","animationDefinitions","elementTransition","valueKeyframes","valueOptions","currentAnimation","push","unresolvedKeyframes","animationOptions","unshift","delete","createScopedWaapiAnimate","animateMini"],"mappings":"AAGA,IAAIA,EAAY,OACO,oBAAZC,SACmB,eAA1BA,QAAQC,KAAKC,WAMbH,EAAY,CAACI,EAAOC,EAASC,KACzB,IAAKF,EACD,MAAM,IAAIG,MCbtB,SAA4BF,EAASC,GACjC,OAAOA,EACD,GAAGD,2FAAiGC,IACpGD,CACV,CDS4BG,CAAmBH,EAASC,MEZxD,MAAMG,EAAQC,GAAQA,ECMhBC,EAAyBC,GAAsB,IAAVA,EAErCC,EAAyBC,GAAiBA,EAAe,ICTzDC,EAAaC,GAAoB,OAAVA,ECA7B,MAAMC,EACF,WAAAC,GACIC,KAAKC,gBACR,CACD,YAAIC,GACA,OAAOF,KAAKG,SACf,CACD,cAAAF,GACID,KAAKG,UAAY,IAAIC,QAASC,IAC1BL,KAAKK,QAAUA,GAEtB,CACD,cAAAC,GACIN,KAAKK,SACR,CAMD,IAAAE,CAAKC,EAAWC,GACZ,OAAOT,KAAKE,SAASK,KAAKC,EAAWC,EACxC,ECtBL,SAASC,EAAcC,GACnB,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAUE,OAAQD,IAClCD,EAAUC,KAAOD,EAAUC,GAAKD,EAAUC,EAAI,GAEtD,CCJA,MAAME,EAAYC,GAASA,EAAKC,WAAW,MCI3C,MAAMC,EAAgB,CAAE,ECDxB,SAASC,EAAaC,EAAUC,GA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AmBhK,EAAWuD,EAAS0G,GAC5F,EAGQoB,EAA4BD"} \ No newline at end of file diff --git a/node_modules/framer-motion/dist/types.d-CQ4vRM6h.d.ts b/node_modules/framer-motion/dist/types.d-CQ4vRM6h.d.ts new file mode 100644 index 00000000..26f0c41b --- /dev/null +++ b/node_modules/framer-motion/dist/types.d-CQ4vRM6h.d.ts @@ -0,0 +1,223 @@ +import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react'; +import { TransformProperties, MotionNodeOptions, MotionValue, SVGPathProperties } from 'motion-dom'; + +/** + * Either a string, or array of strings, that reference variants defined via the `variants` prop. + * @public + */ +type VariantLabels = string | string[]; + +type MotionValueString = MotionValue; +type MotionValueNumber = MotionValue; +type MotionValueAny = MotionValue; +type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; +type MotionValueHelper = T | AnyMotionValue; +type MakeMotionHelper = { + [K in keyof T]: MotionValueHelper; +}; +type MakeCustomValueTypeHelper = MakeMotionHelper; +type MakeMotion = MakeCustomValueTypeHelper; +type MotionCSS = MakeMotion>; +/** + * @public + */ +type MotionTransform = MakeMotion; +type MotionSVGProps = MakeMotion; +/** + * @public + */ +interface MotionStyle extends MotionCSS, MotionTransform, MotionSVGProps { +} +/** + * Props for `motion` components. + * + * @public + */ +interface MotionProps extends MotionNodeOptions { + /** + * + * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * + * return + * } + * ``` + */ + style?: MotionStyle; + children?: React.ReactNode | MotionValueNumber | MotionValueString; +} + +interface HTMLElements { + a: HTMLAnchorElement; + abbr: HTMLElement; + address: HTMLElement; + area: HTMLAreaElement; + article: HTMLElement; + aside: HTMLElement; + audio: HTMLAudioElement; + b: HTMLElement; + base: HTMLBaseElement; + bdi: HTMLElement; + bdo: HTMLElement; + big: HTMLElement; + blockquote: HTMLQuoteElement; + body: HTMLBodyElement; + br: HTMLBRElement; + button: HTMLButtonElement; + canvas: HTMLCanvasElement; + caption: HTMLElement; + center: HTMLElement; + cite: HTMLElement; + code: HTMLElement; + col: HTMLTableColElement; + colgroup: HTMLTableColElement; + data: HTMLDataElement; + datalist: HTMLDataListElement; + dd: HTMLElement; + del: HTMLModElement; + details: HTMLDetailsElement; + dfn: HTMLElement; + dialog: HTMLDialogElement; + div: HTMLDivElement; + dl: HTMLDListElement; + dt: HTMLElement; + em: HTMLElement; + embed: HTMLEmbedElement; + fieldset: HTMLFieldSetElement; + figcaption: HTMLElement; + figure: HTMLElement; + footer: HTMLElement; + form: HTMLFormElement; + h1: HTMLHeadingElement; + h2: HTMLHeadingElement; + h3: HTMLHeadingElement; + h4: HTMLHeadingElement; + h5: HTMLHeadingElement; + h6: HTMLHeadingElement; + head: HTMLHeadElement; + header: HTMLElement; + hgroup: HTMLElement; + hr: HTMLHRElement; + html: HTMLHtmlElement; + i: HTMLElement; + iframe: HTMLIFrameElement; + img: HTMLImageElement; + input: HTMLInputElement; + ins: HTMLModElement; + kbd: HTMLElement; + keygen: HTMLElement; + label: HTMLLabelElement; + legend: HTMLLegendElement; + li: HTMLLIElement; + link: HTMLLinkElement; + main: HTMLElement; + map: HTMLMapElement; + mark: HTMLElement; + menu: HTMLElement; + menuitem: HTMLElement; + meta: HTMLMetaElement; + meter: HTMLMeterElement; + nav: HTMLElement; + noindex: HTMLElement; + noscript: HTMLElement; + object: HTMLObjectElement; + ol: HTMLOListElement; + optgroup: HTMLOptGroupElement; + option: HTMLOptionElement; + output: HTMLOutputElement; + p: HTMLParagraphElement; + param: HTMLParamElement; + picture: HTMLElement; + pre: HTMLPreElement; + progress: HTMLProgressElement; + q: HTMLQuoteElement; + rp: HTMLElement; + rt: HTMLElement; + ruby: HTMLElement; + s: HTMLElement; + samp: HTMLElement; + search: HTMLElement; + slot: HTMLSlotElement; + script: HTMLScriptElement; + section: HTMLElement; + select: HTMLSelectElement; + small: HTMLElement; + source: HTMLSourceElement; + span: HTMLSpanElement; + strong: HTMLElement; + style: HTMLStyleElement; + sub: HTMLElement; + summary: HTMLElement; + sup: HTMLElement; + table: HTMLTableElement; + template: HTMLTemplateElement; + tbody: HTMLTableSectionElement; + td: HTMLTableDataCellElement; + textarea: HTMLTextAreaElement; + tfoot: HTMLTableSectionElement; + th: HTMLTableHeaderCellElement; + thead: HTMLTableSectionElement; + time: HTMLTimeElement; + title: HTMLTitleElement; + tr: HTMLTableRowElement; + track: HTMLTrackElement; + u: HTMLElement; + ul: HTMLUListElement; + var: HTMLElement; + video: HTMLVideoElement; + wbr: HTMLElement; + webview: HTMLWebViewElement; +} + +/** + * @public + */ +type ForwardRefComponent = { + readonly $$typeof: symbol; +} & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); +type AttributesWithoutMotionProps = { + [K in Exclude]?: Attributes[K]; +}; +/** + * @public + */ +type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; +/** + * Motion-optimised versions of React's HTML components. + * + * @public + */ +type HTMLMotionComponents = { + [K in keyof HTMLElements]: ForwardRefComponent>; +}; + +type UnionStringArray> = T[number]; +declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"]; +type SVGElements = UnionStringArray; + +interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { +} +/** + * Blanket-accept any SVG attribute as a `MotionValue` + * @public + */ +type SVGAttributesAsMotionValues = MakeMotion>; +type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; +/** + * @public + */ +interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { +} +/** + * Motion-optimised versions of React's SVG components. + * + * @public + */ +type SVGMotionComponents = { + [K in SVGElements]: ForwardRefComponent, SVGMotionProps>>; +}; + +export type { ForwardRefComponent as F, HTMLMotionComponents as H, MotionProps as M, SVGMotionComponents as S, VariantLabels as V, HTMLElements as a, HTMLMotionProps as b, MotionStyle as c, MotionTransform as d, SVGAttributesAsMotionValues as e, SVGMotionProps as f }; diff --git a/node_modules/framer-motion/dist/types/client.d.ts b/node_modules/framer-motion/dist/types/client.d.ts new file mode 100644 index 00000000..fb85a879 --- /dev/null +++ b/node_modules/framer-motion/dist/types/client.d.ts @@ -0,0 +1,176 @@ +import { F as ForwardRefComponent, b as HTMLMotionProps, f as SVGMotionProps } from '../types.d-CQ4vRM6h.js'; +import 'react'; +import 'motion-dom'; + +/** + * HTML components + */ +declare const MotionA: ForwardRefComponent>; +declare const MotionAbbr: ForwardRefComponent>; +declare const MotionAddress: ForwardRefComponent>; +declare const MotionArea: ForwardRefComponent>; +declare const MotionArticle: ForwardRefComponent>; +declare const MotionAside: ForwardRefComponent>; +declare const MotionAudio: ForwardRefComponent>; +declare const MotionB: ForwardRefComponent>; +declare const MotionBase: ForwardRefComponent>; +declare const MotionBdi: ForwardRefComponent>; +declare const MotionBdo: ForwardRefComponent>; +declare const MotionBig: ForwardRefComponent>; +declare const MotionBlockquote: ForwardRefComponent>; +declare const MotionBody: ForwardRefComponent>; +declare const MotionButton: ForwardRefComponent>; +declare const MotionCanvas: ForwardRefComponent>; +declare const MotionCaption: ForwardRefComponent>; +declare const MotionCite: ForwardRefComponent>; +declare const MotionCode: ForwardRefComponent>; +declare const MotionCol: ForwardRefComponent>; +declare const MotionColgroup: ForwardRefComponent>; +declare const MotionData: ForwardRefComponent>; +declare const MotionDatalist: ForwardRefComponent>; +declare const MotionDd: ForwardRefComponent>; +declare const MotionDel: ForwardRefComponent>; +declare const MotionDetails: ForwardRefComponent>; +declare const MotionDfn: ForwardRefComponent>; +declare const MotionDialog: ForwardRefComponent>; +declare const MotionDiv: ForwardRefComponent>; +declare const MotionDl: ForwardRefComponent>; +declare const MotionDt: ForwardRefComponent>; +declare const MotionEm: ForwardRefComponent>; +declare const MotionEmbed: ForwardRefComponent>; +declare const MotionFieldset: ForwardRefComponent>; +declare const MotionFigcaption: ForwardRefComponent>; +declare const MotionFigure: ForwardRefComponent>; +declare const MotionFooter: ForwardRefComponent>; +declare const MotionForm: ForwardRefComponent>; +declare const MotionH1: ForwardRefComponent>; +declare const MotionH2: ForwardRefComponent>; +declare const MotionH3: ForwardRefComponent>; +declare const MotionH4: ForwardRefComponent>; +declare const MotionH5: ForwardRefComponent>; +declare const MotionH6: ForwardRefComponent>; +declare const MotionHead: ForwardRefComponent>; +declare const MotionHeader: ForwardRefComponent>; +declare const MotionHgroup: ForwardRefComponent>; +declare const MotionHr: ForwardRefComponent>; +declare const MotionHtml: ForwardRefComponent>; +declare const MotionI: ForwardRefComponent>; +declare const MotionIframe: ForwardRefComponent>; +declare const MotionImg: ForwardRefComponent>; +declare const MotionInput: ForwardRefComponent>; +declare const MotionIns: ForwardRefComponent>; +declare const MotionKbd: ForwardRefComponent>; +declare const MotionKeygen: ForwardRefComponent>; +declare const MotionLabel: ForwardRefComponent>; +declare const MotionLegend: ForwardRefComponent>; +declare const MotionLi: ForwardRefComponent>; +declare const MotionLink: ForwardRefComponent>; +declare const MotionMain: ForwardRefComponent>; +declare const MotionMap: ForwardRefComponent>; +declare const MotionMark: ForwardRefComponent>; +declare const MotionMenu: ForwardRefComponent>; +declare const MotionMenuitem: ForwardRefComponent>; +declare const MotionMeter: ForwardRefComponent>; +declare const MotionNav: ForwardRefComponent>; +declare const MotionObject: ForwardRefComponent>; +declare const MotionOl: ForwardRefComponent>; +declare const MotionOptgroup: ForwardRefComponent>; +declare const MotionOption: ForwardRefComponent>; +declare const MotionOutput: ForwardRefComponent>; +declare const MotionP: ForwardRefComponent>; +declare const MotionParam: ForwardRefComponent>; +declare const MotionPicture: ForwardRefComponent>; +declare const MotionPre: ForwardRefComponent>; +declare const MotionProgress: ForwardRefComponent>; +declare const MotionQ: ForwardRefComponent>; +declare const MotionRp: ForwardRefComponent>; +declare const MotionRt: ForwardRefComponent>; +declare const MotionRuby: ForwardRefComponent>; +declare const MotionS: ForwardRefComponent>; +declare const MotionSamp: ForwardRefComponent>; +declare const MotionScript: ForwardRefComponent>; +declare const MotionSection: ForwardRefComponent>; +declare const MotionSelect: ForwardRefComponent>; +declare const MotionSmall: ForwardRefComponent>; +declare const MotionSource: ForwardRefComponent>; +declare const MotionSpan: ForwardRefComponent>; +declare const MotionStrong: ForwardRefComponent>; +declare const MotionStyle: ForwardRefComponent>; +declare const MotionSub: ForwardRefComponent>; +declare const MotionSummary: ForwardRefComponent>; +declare const MotionSup: ForwardRefComponent>; +declare const MotionTable: ForwardRefComponent>; +declare const MotionTbody: ForwardRefComponent>; +declare const MotionTd: ForwardRefComponent>; +declare const MotionTextarea: ForwardRefComponent>; +declare const MotionTfoot: ForwardRefComponent>; +declare const MotionTh: ForwardRefComponent>; +declare const MotionThead: ForwardRefComponent>; +declare const MotionTime: ForwardRefComponent>; +declare const MotionTitle: ForwardRefComponent>; +declare const MotionTr: ForwardRefComponent>; +declare const MotionTrack: ForwardRefComponent>; +declare const MotionU: ForwardRefComponent>; +declare const MotionUl: ForwardRefComponent>; +declare const MotionVideo: ForwardRefComponent>; +declare const MotionWbr: ForwardRefComponent>; +declare const MotionWebview: ForwardRefComponent>; +/** + * SVG components + */ +declare const MotionAnimate: ForwardRefComponent>; +declare const MotionCircle: ForwardRefComponent>; +declare const MotionDefs: ForwardRefComponent>; +declare const MotionDesc: ForwardRefComponent>; +declare const MotionEllipse: ForwardRefComponent>; +declare const MotionG: ForwardRefComponent>; +declare const MotionImage: ForwardRefComponent>; +declare const MotionLine: ForwardRefComponent>; +declare const MotionFilter: ForwardRefComponent>; +declare const MotionMarker: ForwardRefComponent>; +declare const MotionMask: ForwardRefComponent>; +declare const MotionMetadata: ForwardRefComponent>; +declare const MotionPath: ForwardRefComponent>; +declare const MotionPattern: ForwardRefComponent>; +declare const MotionPolygon: ForwardRefComponent>; +declare const MotionPolyline: ForwardRefComponent>; +declare const MotionRect: ForwardRefComponent>; +declare const MotionStop: ForwardRefComponent>; +declare const MotionSvg: ForwardRefComponent>; +declare const MotionSymbol: ForwardRefComponent>; +declare const MotionText: ForwardRefComponent>; +declare const MotionTspan: ForwardRefComponent>; +declare const MotionUse: ForwardRefComponent>; +declare const MotionView: ForwardRefComponent>; +declare const MotionClipPath: ForwardRefComponent>; +declare const MotionFeBlend: ForwardRefComponent>; +declare const MotionFeColorMatrix: ForwardRefComponent>; +declare const MotionFeComponentTransfer: ForwardRefComponent>; +declare const MotionFeComposite: ForwardRefComponent>; +declare const MotionFeConvolveMatrix: ForwardRefComponent>; +declare const MotionFeDiffuseLighting: ForwardRefComponent>; +declare const MotionFeDisplacementMap: ForwardRefComponent>; +declare const MotionFeDistantLight: ForwardRefComponent>; +declare const MotionFeDropShadow: ForwardRefComponent>; +declare const MotionFeFlood: ForwardRefComponent>; +declare const MotionFeFuncA: ForwardRefComponent>; +declare const MotionFeFuncB: ForwardRefComponent>; +declare const MotionFeFuncG: ForwardRefComponent>; +declare const MotionFeFuncR: ForwardRefComponent>; +declare const MotionFeGaussianBlur: ForwardRefComponent>; +declare const MotionFeImage: ForwardRefComponent>; +declare const MotionFeMerge: ForwardRefComponent>; +declare const MotionFeMergeNode: ForwardRefComponent>; +declare const MotionFeMorphology: ForwardRefComponent>; +declare const MotionFeOffset: ForwardRefComponent>; +declare const MotionFePointLight: ForwardRefComponent>; +declare const MotionFeSpecularLighting: ForwardRefComponent>; +declare const MotionFeSpotLight: ForwardRefComponent>; +declare const MotionFeTile: ForwardRefComponent>; +declare const MotionFeTurbulence: ForwardRefComponent>; +declare const MotionForeignObject: ForwardRefComponent>; +declare const MotionLinearGradient: ForwardRefComponent>; +declare const MotionRadialGradient: ForwardRefComponent>; +declare const MotionTextPath: ForwardRefComponent>; + +export { MotionA as a, MotionAbbr as abbr, MotionAddress as address, MotionAnimate as animate, MotionArea as area, MotionArticle as article, MotionAside as aside, MotionAudio as audio, MotionB as b, MotionBase as base, MotionBdi as bdi, MotionBdo as bdo, MotionBig as big, MotionBlockquote as blockquote, MotionBody as body, MotionButton as button, MotionCanvas as canvas, MotionCaption as caption, MotionCircle as circle, MotionCite as cite, MotionClipPath as clipPath, MotionCode as code, MotionCol as col, MotionColgroup as colgroup, MotionData as data, MotionDatalist as datalist, MotionDd as dd, MotionDefs as defs, MotionDel as del, MotionDesc as desc, MotionDetails as details, MotionDfn as dfn, MotionDialog as dialog, MotionDiv as div, MotionDl as dl, MotionDt as dt, MotionEllipse as ellipse, MotionEm as em, MotionEmbed as embed, MotionFeBlend as feBlend, MotionFeColorMatrix as feColorMatrix, MotionFeComponentTransfer as feComponentTransfer, MotionFeComposite as feComposite, MotionFeConvolveMatrix as feConvolveMatrix, MotionFeDiffuseLighting as feDiffuseLighting, MotionFeDisplacementMap as feDisplacementMap, MotionFeDistantLight as feDistantLight, MotionFeDropShadow as feDropShadow, MotionFeFlood as feFlood, MotionFeFuncA as feFuncA, MotionFeFuncB as feFuncB, MotionFeFuncG as feFuncG, MotionFeFuncR as feFuncR, MotionFeGaussianBlur as feGaussianBlur, MotionFeImage as feImage, MotionFeMerge as feMerge, MotionFeMergeNode as feMergeNode, MotionFeMorphology as feMorphology, MotionFeOffset as feOffset, MotionFePointLight as fePointLight, MotionFeSpecularLighting as feSpecularLighting, MotionFeSpotLight as feSpotLight, MotionFeTile as feTile, MotionFeTurbulence as feTurbulence, MotionFieldset as fieldset, MotionFigcaption as figcaption, MotionFigure as figure, MotionFilter as filter, MotionFooter as footer, MotionForeignObject as foreignObject, MotionForm as form, MotionG as g, MotionH1 as h1, MotionH2 as h2, MotionH3 as h3, MotionH4 as h4, MotionH5 as h5, MotionH6 as h6, MotionHead as head, MotionHeader as header, MotionHgroup as hgroup, MotionHr as hr, MotionHtml as html, MotionI as i, MotionIframe as iframe, MotionImage as image, MotionImg as img, MotionInput as input, MotionIns as ins, MotionKbd as kbd, MotionKeygen as keygen, MotionLabel as label, MotionLegend as legend, MotionLi as li, MotionLine as line, MotionLinearGradient as linearGradient, MotionLink as link, MotionMain as main, MotionMap as map, MotionMark as mark, MotionMarker as marker, MotionMask as mask, MotionMenu as menu, MotionMenuitem as menuitem, MotionMetadata as metadata, MotionMeter as meter, MotionNav as nav, MotionObject as object, MotionOl as ol, MotionOptgroup as optgroup, MotionOption as option, MotionOutput as output, MotionP as p, MotionParam as param, MotionPath as path, MotionPattern as pattern, MotionPicture as picture, MotionPolygon as polygon, MotionPolyline as polyline, MotionPre as pre, MotionProgress as progress, MotionQ as q, MotionRadialGradient as radialGradient, MotionRect as rect, MotionRp as rp, MotionRt as rt, MotionRuby as ruby, MotionS as s, MotionSamp as samp, MotionScript as script, MotionSection as section, MotionSelect as select, MotionSmall as small, MotionSource as source, MotionSpan as span, MotionStop as stop, MotionStrong as strong, MotionStyle as style, MotionSub as sub, MotionSummary as summary, MotionSup as sup, MotionSvg as svg, MotionSymbol as symbol, MotionTable as table, MotionTbody as tbody, MotionTd as td, MotionText as text, MotionTextPath as textPath, MotionTextarea as textarea, MotionTfoot as tfoot, MotionTh as th, MotionThead as thead, MotionTime as time, MotionTitle as title, MotionTr as tr, MotionTrack as track, MotionTspan as tspan, MotionU as u, MotionUl as ul, MotionUse as use, MotionVideo as video, MotionView as view, MotionWbr as wbr, MotionWebview as webview }; diff --git a/node_modules/framer-motion/dist/types/index.d.ts b/node_modules/framer-motion/dist/types/index.d.ts new file mode 100644 index 00000000..84d7e13b --- /dev/null +++ b/node_modules/framer-motion/dist/types/index.d.ts @@ -0,0 +1,1465 @@ +/// +import * as motion_dom from 'motion-dom'; +import { AnyResolvedKeyframe, OnKeyframesResolved, KeyframeResolver, Transition, PresenceContextProps, ResolvedValues, VisualElement, MotionValue, Feature, UnresolvedValueKeyframe, ElementOrSelector, DOMKeyframesDefinition, AnimationOptions, AnimationPlaybackOptions, AnimationPlaybackControlsWithThen, ValueAnimationTransition, AnimationScope, AnimationPlaybackControls, EventInfo, MotionValueEventCallbacks, FollowValueOptions, SpringOptions, TransformOptions, WillChange, LegacyAnimationControls, NodeGroup, IProjectionNode } from 'motion-dom'; +export * from 'motion-dom'; +export { DelayedFunction, FlatTree, FollowValueOptions, IProjectionNode, ResolvedValues, VisualElement, addScaleCorrector, animateVisualElement, buildTransform, calcLength, createBox, delay, optimizedAppearDataAttribute, resolveMotionValue, visualElementStore } from 'motion-dom'; +import * as react_jsx_runtime from 'react/jsx-runtime'; +import * as React$1 from 'react'; +import { JSX, useEffect, RefObject } from 'react'; +import { V as VariantLabels, M as MotionProps, H as HTMLMotionComponents, S as SVGMotionComponents, a as HTMLElements, b as HTMLMotionProps } from '../types.d-CQ4vRM6h.js'; +export { F as ForwardRefComponent, c as MotionStyle, d as MotionTransform, e as SVGAttributesAsMotionValues, f as SVGMotionProps } from '../types.d-CQ4vRM6h.js'; +import { TransformPoint, Easing, EasingFunction, Point } from 'motion-utils'; +export * from 'motion-utils'; +export { MotionGlobalConfig } from 'motion-utils'; + +type ResolveKeyframes = (keyframes: V[], onComplete: OnKeyframesResolved, name?: string, motionValue?: any) => KeyframeResolver; + +/** + * @public + */ +interface AnimatePresenceProps { + /** + * By passing `initial={false}`, `AnimatePresence` will disable any initial animations on children + * that are present when the component is first rendered. + * + * ```jsx + * + * {isVisible && ( + * + * )} + * + * ``` + * + * @public + */ + initial?: boolean; + /** + * When a component is removed, there's no longer a chance to update its props. So if a component's `exit` + * prop is defined as a dynamic variant and you want to pass a new `custom` prop, you can do so via `AnimatePresence`. + * This will ensure all leaving components animate using the latest data. + * + * @public + */ + custom?: any; + /** + * Fires when all exiting nodes have completed animating out. + * + * @public + */ + onExitComplete?: () => void; + /** + * Determines how to handle entering and exiting elements. + * + * - `"sync"`: Default. Elements animate in and out as soon as they're added/removed. + * - `"popLayout"`: Exiting elements are "popped" from the page layout, allowing sibling + * elements to immediately occupy their new layouts. + * - `"wait"`: Only renders one component at a time. Wait for the exiting component to animate out + * before animating the next component in. + * + * @public + */ + mode?: "sync" | "popLayout" | "wait"; + /** + * Root element to use when injecting styles, used when mode === `"popLayout"`. + * This defaults to document.head but can be overridden e.g. for use in shadow DOM. + */ + root?: HTMLElement | ShadowRoot; + /** + * Internal. Used in Framer to flag that sibling children *shouldn't* re-render as a result of a + * child being removed. + */ + presenceAffectsLayout?: boolean; + /** + * If true, the `AnimatePresence` component will propagate parent exit animations + * to its children. + */ + propagate?: boolean; + /** + * Internal. Set whether to anchor the x position of the exiting element to the left or right + * when using `mode="popLayout"`. + */ + anchorX?: "left" | "right"; + /** + * Internal. Set whether to anchor the y position of the exiting element to the top or bottom + * when using `mode="popLayout"`. Use `"bottom"` for elements originally positioned with + * `bottom: 0` to prevent them from shifting during exit animations. + */ + anchorY?: "top" | "bottom"; +} + +/** + * `AnimatePresence` enables the animation of components that have been removed from the tree. + * + * When adding/removing more than a single child, every child **must** be given a unique `key` prop. + * + * Any `motion` components that have an `exit` property defined will animate out when removed from + * the tree. + * + * ```jsx + * import { motion, AnimatePresence } from 'framer-motion' + * + * export const Items = ({ items }) => ( + * + * {items.map(item => ( + * + * ))} + * + * ) + * ``` + * + * You can sequence exit animations throughout a tree using variants. + * + * If a child contains multiple `motion` components with `exit` props, it will only unmount the child + * once all `motion` components have finished animating out. Likewise, any components using + * `usePresence` all need to call `safeToRemove`. + * + * @public + */ +declare const AnimatePresence: ({ children, custom, initial, onExitComplete, presenceAffectsLayout, mode, propagate, anchorX, anchorY, root }: React$1.PropsWithChildren) => react_jsx_runtime.JSX.Element | null; + +interface Props$3 { + children: React$1.ReactElement; + isPresent: boolean; + anchorX?: "left" | "right"; + anchorY?: "top" | "bottom"; + root?: HTMLElement | ShadowRoot; + pop?: boolean; +} +declare function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props$3): react_jsx_runtime.JSX.Element; + +interface PresenceChildProps { + children: React$1.ReactElement; + isPresent: boolean; + onExitComplete?: () => void; + initial?: false | VariantLabels; + custom?: any; + presenceAffectsLayout: boolean; + mode: "sync" | "popLayout" | "wait"; + anchorX?: "left" | "right"; + anchorY?: "top" | "bottom"; + root?: HTMLElement | ShadowRoot; +} +declare const PresenceChild: ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, anchorY, root }: PresenceChildProps) => react_jsx_runtime.JSX.Element; + +type InheritOption = boolean | "id"; +interface Props$2 { + id?: string; + inherit?: InheritOption; +} +declare const LayoutGroup: React$1.FunctionComponent>; + +type ReducedMotionConfig = "always" | "never" | "user"; +/** + * @public + */ +interface MotionConfigContext { + /** + * Internal, exported only for usage in Framer + */ + transformPagePoint: TransformPoint; + /** + * Internal. Determines whether this is a static context ie the Framer canvas. If so, + * it'll disable all dynamic functionality. + */ + isStatic: boolean; + /** + * Defines a new default transition for the entire tree. + * + * @public + */ + transition?: Transition; + /** + * If true, will respect the device prefersReducedMotion setting by switching + * transform animations off. + * + * @public + */ + reducedMotion?: ReducedMotionConfig; + /** + * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP). + * For more details see: + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles + * + * @public + */ + nonce?: string; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + * + * @public + */ + skipAnimations?: boolean; +} +/** + * @public + */ +declare const MotionConfigContext: React$1.Context; + +/** + * @public + */ +declare const PresenceContext: React$1.Context; + +interface VisualState { + renderState: RenderState; + latestValues: ResolvedValues; + onMount?: (instance: Instance) => void; +} +type UseVisualState = (props: MotionProps, isStatic: boolean) => VisualState; +interface UseVisualStateConfig { + scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps; + createRenderState: () => RenderState; +} +declare const makeUseVisualState: (config: UseVisualStateConfig) => UseVisualState; + +type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents; + +type ScrapeMotionValuesFromProps = (props: MotionProps, prevProps: MotionProps, visualElement?: VisualElement) => { + [key: string]: MotionValue | AnyResolvedKeyframe; +}; +interface VisualElementOptions { + visualState: VisualState; + parent?: VisualElement; + variantParent?: VisualElement; + presenceContext: PresenceContextProps | null; + props: MotionProps; + blockInitialAnimation?: boolean; + reducedMotionConfig?: ReducedMotionConfig; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + */ + skipAnimations?: boolean; + /** + * Explicit override for SVG detection. When true, uses SVG rendering; + * when false, uses HTML rendering. If undefined, auto-detects. + */ + isSVG?: boolean; +} + +type CreateVisualElement = (Component: TagName | string | React.ComponentType, options: VisualElementOptions) => VisualElement; + +declare function MeasureLayout(props: MotionProps & { + visualElement: VisualElement; +}): react_jsx_runtime.JSX.Element; + +interface FeatureClass { + new (props: Props): Feature; +} +interface HydratedFeatureDefinition { + isEnabled: (props: MotionProps) => boolean; + Feature: FeatureClass; + ProjectionNode?: any; + MeasureLayout?: typeof MeasureLayout; +} +interface HydratedFeatureDefinitions { + animation?: HydratedFeatureDefinition; + exit?: HydratedFeatureDefinition; + drag?: HydratedFeatureDefinition; + tap?: HydratedFeatureDefinition; + focus?: HydratedFeatureDefinition; + hover?: HydratedFeatureDefinition; + pan?: HydratedFeatureDefinition; + inView?: HydratedFeatureDefinition; + layout?: HydratedFeatureDefinition; +} +interface FeatureDefinition { + isEnabled: HydratedFeatureDefinition["isEnabled"]; + Feature?: HydratedFeatureDefinition["Feature"]; + ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"]; + MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"]; +} +type FeatureDefinitions = { + [K in keyof HydratedFeatureDefinitions]: FeatureDefinition; +}; +interface FeaturePackage { + Feature?: HydratedFeatureDefinition["Feature"]; + ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"]; + MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"]; +} +type FeaturePackages = { + [K in keyof HydratedFeatureDefinitions]: FeaturePackage; +}; +interface FeatureBundle extends FeaturePackages { + renderer: CreateVisualElement; +} +type LazyFeatureBundle$1 = () => Promise; + +type LazyFeatureBundle = () => Promise; +/** + * @public + */ +interface LazyProps { + children?: React.ReactNode; + /** + * Can be used to provide a feature bundle synchronously or asynchronously. + * + * ```jsx + * // features.js + * import { domAnimation } from "framer-motion" + * export default domAnimation + * + * // index.js + * import { LazyMotion, m } from "framer-motion" + * + * const loadFeatures = () =>import("./features.js") + * .then(res => res.default) + * + * function Component() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ + features: FeatureBundle | LazyFeatureBundle; + /** + * If `true`, will throw an error if a `motion` component renders within + * a `LazyMotion` component. + * + * ```jsx + * // This component will throw an error that explains using a motion component + * // instead of the m component will break the benefits of code-splitting. + * function Component() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ + strict?: boolean; +} + +/** + * Used in conjunction with the `m` component to reduce bundle size. + * + * `m` is a version of the `motion` component that only loads functionality + * critical for the initial render. + * + * `LazyMotion` can then be used to either synchronously or asynchronously + * load animation and gesture support. + * + * ```jsx + * // Synchronous loading + * import { LazyMotion, m, domAnimation } from "framer-motion" + * + * function App() { + * return ( + * + * + * + * ) + * } + * + * // Asynchronous loading + * import { LazyMotion, m } from "framer-motion" + * + * function App() { + * return ( + * import('./path/to/domAnimation')}> + * + * + * ) + * } + * ``` + * + * @public + */ +declare function LazyMotion({ children, features, strict }: LazyProps): react_jsx_runtime.JSX.Element; + +type IsValidProp = (key: string) => boolean; +declare function filterProps(props: MotionProps, isDom: boolean, forwardMotionProps: boolean): MotionProps; + +interface MotionConfigProps extends Partial { + children?: React$1.ReactNode; + isValidProp?: IsValidProp; +} +/** + * `MotionConfig` is used to set configuration options for all children `motion` components. + * + * ```jsx + * import { motion, MotionConfig } from "framer-motion" + * + * export function App() { + * return ( + * + * + * + * ) + * } + * ``` + * + * @public + */ +declare function MotionConfig({ children, isValidProp, ...config }: MotionConfigProps): react_jsx_runtime.JSX.Element; + +type ObjectTarget = { + [K in keyof O]?: O[K] | UnresolvedValueKeyframe[]; +}; +type SequenceTime = number | "<" | `+${number}` | `-${number}` | `${string}`; +type SequenceLabel = string; +interface SequenceLabelWithTime { + name: SequenceLabel; + at: SequenceTime; +} +interface At { + at?: SequenceTime; +} +type MotionValueSegment = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[] +]; +type MotionValueSegmentWithTransition = [ + MotionValue, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + Transition & At +]; +type DOMSegment = [ElementOrSelector, DOMKeyframesDefinition]; +type DOMSegmentWithTransition = [ + ElementOrSelector, + DOMKeyframesDefinition, + AnimationOptions & At +]; +type ObjectSegment = [O, ObjectTarget]; +type ObjectSegmentWithTransition = [ + O, + ObjectTarget, + AnimationOptions & At +]; +type SequenceProgressCallback = (value: any) => void; +type FunctionSegment = [SequenceProgressCallback] | [SequenceProgressCallback, AnimationOptions & At] | [ + SequenceProgressCallback, + UnresolvedValueKeyframe | UnresolvedValueKeyframe[], + AnimationOptions & At +]; +type Segment = ObjectSegment | ObjectSegmentWithTransition | SequenceLabel | SequenceLabelWithTime | MotionValueSegment | MotionValueSegmentWithTransition | DOMSegment | DOMSegmentWithTransition | FunctionSegment; +type AnimationSequence = Segment[]; +interface SequenceOptions extends AnimationPlaybackOptions { + delay?: number; + duration?: number; + defaultTransition?: Transition; + reduceMotion?: boolean; +} +interface AbsoluteKeyframe { + value: AnyResolvedKeyframe | null; + at: number; + easing?: Easing; +} +type ValueSequence = AbsoluteKeyframe[]; +interface SequenceMap { + [key: string]: ValueSequence; +} +type ResolvedAnimationDefinition = { + keyframes: { + [key: string]: UnresolvedValueKeyframe[]; + }; + transition: { + [key: string]: Transition; + }; +}; +type ResolvedAnimationDefinitions = Map; + +interface ScopedAnimateOptions { + scope?: AnimationScope; + reduceMotion?: boolean; +} +/** + * Creates an animation function that is optionally scoped + * to a specific element. + */ +declare function createScopedAnimate(options?: ScopedAnimateOptions): { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; +declare const animate: { + (sequence: AnimationSequence, options?: SequenceOptions): AnimationPlaybackControlsWithThen; + (value: string | MotionValue, keyframes: string | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: number | MotionValue, keyframes: number | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (value: V | MotionValue, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + (element: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions): AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: AnimationOptions): AnimationPlaybackControlsWithThen; +}; + +declare const animateMini: (elementOrSelector: ElementOrSelector, keyframes: DOMKeyframesDefinition, options?: AnimationOptions) => AnimationPlaybackControlsWithThen; + +interface ScrollOptions { + source?: HTMLElement; + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; +} +type OnScrollProgress = (progress: number) => void; +type OnScrollWithInfo = (progress: number, info: ScrollInfo) => void; +type OnScroll = OnScrollProgress | OnScrollWithInfo; +interface AxisScrollInfo { + current: number; + offset: number[]; + progress: number; + scrollLength: number; + velocity: number; + targetOffset: number; + targetLength: number; + containerLength: number; + interpolatorOffsets?: number[]; + interpolate?: EasingFunction; +} +interface ScrollInfo { + time: number; + x: AxisScrollInfo; + y: AxisScrollInfo; +} +type OnScrollInfo = (info: ScrollInfo) => void; +type SupportedEdgeUnit = "px" | "vw" | "vh" | "%"; +type EdgeUnit = `${number}${SupportedEdgeUnit}`; +type NamedEdges = "start" | "end" | "center"; +type EdgeString = NamedEdges | EdgeUnit | `${number}`; +type Edge = EdgeString | number; +type ProgressIntersection = [number, number]; +type Intersection = `${Edge} ${Edge}`; +type ScrollOffset = Array; +interface ScrollInfoOptions { + container?: Element; + target?: Element; + axis?: "x" | "y"; + offset?: ScrollOffset; + /** + * When true, enables per-frame checking of scrollWidth/scrollHeight + * to detect content size changes and recalculate scroll progress. + * + * @default false + */ + trackContentSize?: boolean; +} + +declare function scroll(onScroll: OnScroll | AnimationPlaybackControls, { axis, container, ...options }?: ScrollOptions): VoidFunction; + +declare function scrollInfo(onScroll: OnScrollInfo, { container, trackContentSize, ...options }?: ScrollInfoOptions): VoidFunction; + +type ViewChangeHandler = (entry: IntersectionObserverEntry) => void; +type MarginValue = `${number}${"px" | "%"}`; +type MarginType = MarginValue | `${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue}` | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`; +interface InViewOptions { + root?: Element | Document; + margin?: MarginType; + amount?: "some" | "all" | number; +} +declare function inView(elementOrSelector: ElementOrSelector, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction; + +declare const distance: (a: number, b: number) => number; +declare function distance2D(a: Point, b: Point): number; + +type ReorderElementTag = keyof HTMLElements; +type DefaultGroupElement = "ul"; +type DefaultItemElement = "li"; + +interface Props$1 { + /** + * A HTML element to render this component as. Defaults to `"ul"`. + * + * @public + */ + as?: TagName; + /** + * The axis to reorder along. By default, items will be draggable on this axis. + * To make draggable on both axes, set `` + * + * @public + */ + axis?: "x" | "y"; + /** + * A callback to fire with the new value order. For instance, if the values + * are provided as a state from `useState`, this could be the set state function. + * + * @public + */ + onReorder: (newOrder: V[]) => void; + /** + * The latest values state. + * + * ```jsx + * function Component() { + * const [items, setItems] = useState([0, 1, 2]) + * + * return ( + * + * {items.map((item) => )} + * + * ) + * } + * ``` + * + * @public + */ + values: V[]; +} +type ReorderGroupProps = Props$1 & Omit, "values"> & React$1.PropsWithChildren<{}>; +declare function ReorderGroupComponent({ children, as, axis, onReorder, values, ...props }: ReorderGroupProps, externalRef?: React$1.ForwardedRef): JSX.Element; +declare const ReorderGroup: (props: ReorderGroupProps & { + ref?: React$1.ForwardedRef; +}) => ReturnType; + +interface Props { + /** + * A HTML element to render this component as. Defaults to `"li"`. + * + * @public + */ + as?: TagName; + /** + * The value in the list that this component represents. + * + * @public + */ + value: V; + /** + * A subset of layout options primarily used to disable layout="size" + * + * @public + * @default true + */ + layout?: true | "position"; +} +type ReorderItemProps = Props & Omit, "value" | "layout"> & React$1.PropsWithChildren<{}>; +declare function ReorderItemComponent({ children, style, value, as, onDrag, onDragEnd, layout, ...props }: ReorderItemProps, externalRef?: React$1.ForwardedRef): React$1.JSX.Element; +declare const ReorderItem: (props: ReorderItemProps & { + ref?: React$1.ForwardedRef; +}) => ReturnType; + +declare namespace namespace_d { + export { ReorderGroup as Group, ReorderItem as Item }; +} + +type MotionComponentProps = { + [K in Exclude]?: Props[K]; +} & MotionProps; +type MotionComponent = T extends keyof DOMMotionComponents ? DOMMotionComponents[T] : React$1.ComponentType, "children"> & { + children?: "children" extends keyof P ? P["children"] | MotionComponentProps

["children"] : MotionComponentProps

["children"]; +}>; +interface MotionComponentOptions { + forwardMotionProps?: boolean; + /** + * Specify whether the component renders an HTML or SVG element. + * This is useful when wrapping custom SVG components that need + * SVG-specific attribute handling (like viewBox animation). + * By default, Motion auto-detects based on the component name, + * but custom React components are always treated as HTML. + */ + type?: "html" | "svg"; +} +/** + * Create a `motion` component. + * + * This function accepts a Component argument, which can be either a string (ie "div" + * for `motion.div`), or an actual React component. + * + * Alongside this is a config option which provides a way of rendering the provided + * component "offline", or outside the React render cycle. + */ +declare function createMotionComponent(Component: TagName | string | React$1.ComponentType, { forwardMotionProps, type }?: MotionComponentOptions, preloadedFeatures?: FeaturePackages, createVisualElement?: CreateVisualElement): MotionComponent; + +declare const m: typeof createMotionComponent & HTMLMotionComponents & SVGMotionComponents & { + create: typeof createMotionComponent; +}; + +declare const motion: typeof createMotionComponent & HTMLMotionComponents & SVGMotionComponents & { + create: typeof createMotionComponent; +}; + +type EventListenerWithPointInfo = (e: PointerEvent, info: EventInfo) => void; +declare const addPointerInfo: (handler: EventListenerWithPointInfo) => EventListener; + +declare function addPointerEvent(target: EventTarget, eventName: string, handler: EventListenerWithPointInfo, options?: AddEventListenerOptions): () => void; + +declare const animations: FeaturePackages; + +type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit"; + +declare const isBrowser: boolean; + +/** + * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx + */ + +type PossibleRef = React$1.Ref | undefined; +/** + * A custom hook that composes multiple refs + * Accepts callback refs and RefObject(s) + */ +declare function useComposedRefs(...refs: PossibleRef[]): React$1.RefCallback; + +declare function useForceUpdate(): [VoidFunction, number]; + +declare const useIsomorphicLayoutEffect: typeof useEffect; + +declare function useUnmountEffect(callback: () => void): void; + +/** + * @public + */ +declare const domAnimation: FeatureBundle; + +/** + * @public + */ +declare const domMax: FeatureBundle; + +/** + * @public + */ +declare const domMin: FeatureBundle; + +declare function useMotionValueEvent>(value: MotionValue, event: EventName, callback: MotionValueEventCallbacks[EventName]): void; + +/** + * @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref }) + */ +declare function useElementScroll(ref: RefObject): { + scrollX: motion_dom.MotionValue; + scrollY: motion_dom.MotionValue; + scrollXProgress: motion_dom.MotionValue; + scrollYProgress: motion_dom.MotionValue; +}; + +/** + * @deprecated useViewportScroll is deprecated. Convert to useScroll() + */ +declare function useViewportScroll(): { + scrollX: motion_dom.MotionValue; + scrollY: motion_dom.MotionValue; + scrollXProgress: motion_dom.MotionValue; + scrollYProgress: motion_dom.MotionValue; +}; + +/** + * Combine multiple motion values into a new one using a string template literal. + * + * ```jsx + * import { + * motion, + * useSpring, + * useMotionValue, + * useMotionTemplate + * } from "framer-motion" + * + * function Component() { + * const shadowX = useSpring(0) + * const shadowY = useMotionValue(0) + * const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))` + * + * return + * } + * ``` + * + * @public + */ +declare function useMotionTemplate(fragments: TemplateStringsArray, ...values: Array): MotionValue; + +/** + * Creates a `MotionValue` to track the state and velocity of a value. + * + * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop. + * + * ```jsx + * export const MyComponent = () => { + * const scale = useMotionValue(1) + * + * return + * } + * ``` + * + * @param initial - The initial state. + * + * @public + */ +declare function useMotionValue(initial: T): MotionValue; + +interface UseScrollOptions extends Omit { + container?: RefObject; + target?: RefObject; +} +declare function useScroll({ container, target, ...options }?: UseScrollOptions): { + scrollX: motion_dom.MotionValue; + scrollY: motion_dom.MotionValue; + scrollXProgress: motion_dom.MotionValue; + scrollYProgress: motion_dom.MotionValue; +}; + +/** + * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state. + * + * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition + * including spring, tween, inertia, and keyframes. + * + * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber + * to another `MotionValue`. + * + * @remarks + * + * ```jsx + * // Spring animation (default) + * const x = useFollowValue(0, { stiffness: 300 }) + * + * // Tween animation + * const y = useFollowValue(0, { type: "tween", duration: 0.5, ease: "easeOut" }) + * + * // Track another MotionValue with spring + * const source = useMotionValue(0) + * const z = useFollowValue(source, { type: "spring", damping: 10 }) + * + * // Inertia animation + * const w = useFollowValue(0, { type: "inertia", velocity: 100 }) + * ``` + * + * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition. + * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes. + * @returns `MotionValue` + * + * @public + */ +declare function useFollowValue(source: MotionValue, options?: FollowValueOptions): MotionValue; +declare function useFollowValue(source: string, options?: FollowValueOptions): MotionValue; +declare function useFollowValue(source: MotionValue, options?: FollowValueOptions): MotionValue; +declare function useFollowValue(source: number, options?: FollowValueOptions): MotionValue; + +/** + * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state. + * + * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber + * to another `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useSpring(0, { stiffness: 300 }) + * const y = useSpring(x, { damping: 10 }) + * ``` + * + * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value. + * @param springConfig - Configuration options for the spring. + * @returns `MotionValue` + * + * @public + */ +declare function useSpring(source: MotionValue, options?: SpringOptions): MotionValue; +declare function useSpring(source: string, options?: SpringOptions): MotionValue; +declare function useSpring(source: MotionValue, options?: SpringOptions): MotionValue; +declare function useSpring(source: number, options?: SpringOptions): MotionValue; + +declare function useTime(): motion_dom.MotionValue; + +type InputRange = number[]; +type SingleTransformer = (input: I) => O; +type MultiTransformer = (input: I[]) => O; +/** + * Create multiple `MotionValue`s that transform the output of another `MotionValue` by mapping it from one range of values into multiple output ranges. + * + * @remarks + * + * This is useful when you want to derive multiple values from a single input value. + * The keys of the output map must remain constant across renders. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const { opacity, scale } = useTransform(x, [0, 100], { + * opacity: [0, 1], + * scale: [0.5, 1] + * }) + * + * return ( + * + * ) + * } + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputMap - An object where keys map to output ranges. Each output range must be the same length as `inputRange`. + * @param options - Transform options applied to all outputs + * + * @returns An object with the same keys as `outputMap`, where each value is a `MotionValue` + * + * @public + */ +declare function useTransform>(inputValue: MotionValue, inputRange: InputRange, outputMap: T, options?: TransformOptions): { + [K in keyof T]: MotionValue; +}; +/** + * Create a `MotionValue` that transforms the output of another `MotionValue` by mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = useTransform(x, xRange, opacityRange) + * + * return ( + * + * ) + * } + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +declare function useTransform(value: MotionValue, inputRange: InputRange, outputRange: O[], options?: TransformOptions): MotionValue; +/** + * Create a `MotionValue` that transforms the output of another `MotionValue` through a function. + * In this example, `y` will always be double `x`. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(10) + * const y = useTransform(x, value => value * 2) + * + * return + * } + * ``` + * + * @param input - A `MotionValue` that will pass its latest value through `transform` to update the returned `MotionValue`. + * @param transform - A function that accepts the latest value from `input` and returns a new value. + * @returns `MotionValue` + * + * @public + */ +declare function useTransform(input: MotionValue, transformer: SingleTransformer): MotionValue; +/** + * Pass an array of `MotionValue`s and a function to combine them. In this example, `z` will be the `x` multiplied by `y`. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const z = useTransform([x, y], ([latestX, latestY]) => latestX * latestY) + * + * return + * } + * ``` + * + * @param input - An array of `MotionValue`s that will pass their latest values through `transform` to update the returned `MotionValue`. + * @param transform - A function that accepts the latest values from `input` and returns a new value. + * @returns `MotionValue` + * + * @public + */ +declare function useTransform(input: MotionValue[] | MotionValue[] | MotionValue[], transformer: MultiTransformer): MotionValue; +declare function useTransform(transformer: () => O): MotionValue; + +/** + * Creates a `MotionValue` that updates when the velocity of the provided `MotionValue` changes. + * + * ```javascript + * const x = useMotionValue(0) + * const xVelocity = useVelocity(x) + * const xAcceleration = useVelocity(xVelocity) + * ``` + * + * @public + */ +declare function useVelocity(value: MotionValue): MotionValue; + +declare function useWillChange(): WillChange; + +declare class WillChangeMotionValue extends MotionValue implements WillChange { + private isEnabled; + add(name: string): void; + private update; +} + +/** + * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. + * + * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing + * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. + * + * It will actively respond to changes and re-render your components with the latest setting. + * + * ```jsx + * export function Sidebar({ isOpen }) { + * const shouldReduceMotion = useReducedMotion() + * const closedX = shouldReduceMotion ? 0 : "-100%" + * + * return ( + * + * ) + * } + * ``` + * + * @return boolean + * + * @public + */ +declare function useReducedMotion(): boolean | null; + +declare function useReducedMotionConfig(): boolean | null; + +/** + * @public + */ +declare function animationControls(): LegacyAnimationControls; + +declare function useAnimate(): [AnimationScope, { + (sequence: AnimationSequence, options?: SequenceOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (value: string | motion_dom.MotionValue, keyframes: string | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (value: number | motion_dom.MotionValue, keyframes: number | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (value: V | motion_dom.MotionValue, keyframes: V | motion_dom.UnresolvedValueKeyframe[], options?: motion_dom.ValueAnimationTransition | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (element: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; + (object: O | O[], keyframes: ObjectTarget, options?: motion_dom.AnimationOptions | undefined): motion_dom.AnimationPlaybackControlsWithThen; +}]; + +declare function useAnimateMini(): [AnimationScope, (elementOrSelector: motion_dom.ElementOrSelector, keyframes: motion_dom.DOMKeyframesDefinition, options?: motion_dom.AnimationOptions | undefined) => motion_dom.AnimationPlaybackControlsWithThen]; + +/** + * Creates `LegacyAnimationControls`, which can be used to manually start, stop + * and sequence animations on one or more components. + * + * The returned `LegacyAnimationControls` should be passed to the `animate` property + * of the components you want to animate. + * + * These components can then be animated with the `start` method. + * + * ```jsx + * import * as React from 'react' + * import { motion, useAnimation } from 'framer-motion' + * + * export function MyComponent(props) { + * const controls = useAnimation() + * + * controls.start({ + * x: 100, + * transition: { duration: 0.5 }, + * }) + * + * return + * } + * ``` + * + * @returns Animation controller with `start` and `stop` methods + * + * @public + */ +declare function useAnimationControls(): LegacyAnimationControls; +declare const useAnimation: typeof useAnimationControls; + +type SafeToRemove = () => void; +type AlwaysPresent = [true, null]; +type Present = [true]; +type NotPresent = [false, SafeToRemove]; +/** + * When a component is the child of `AnimatePresence`, it can use `usePresence` + * to access information about whether it's still present in the React tree. + * + * ```jsx + * import { usePresence } from "framer-motion" + * + * export const Component = () => { + * const [isPresent, safeToRemove] = usePresence() + * + * useEffect(() => { + * !isPresent && setTimeout(safeToRemove, 1000) + * }, [isPresent]) + * + * return

+ * } + * ``` + * + * If `isPresent` is `false`, it means that a component has been removed from the tree, + * but `AnimatePresence` won't really remove it until `safeToRemove` has been called. + * + * @public + */ +declare function usePresence(subscribe?: boolean): AlwaysPresent | Present | NotPresent; +/** + * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. + * There is no `safeToRemove` function. + * + * ```jsx + * import { useIsPresent } from "framer-motion" + * + * export const Component = () => { + * const isPresent = useIsPresent() + * + * useEffect(() => { + * !isPresent && console.log("I've been removed!") + * }, [isPresent]) + * + * return
+ * } + * ``` + * + * @public + */ +declare function useIsPresent(): boolean; + +declare function usePresenceData(): any; + +/** + * Attaches an event listener directly to the provided DOM element. + * + * Bypassing React's event system can be desirable, for instance when attaching non-passive + * event handlers. + * + * ```jsx + * const ref = useRef(null) + * + * useDomEvent(ref, 'wheel', onWheel, { passive: false }) + * + * return
+ * ``` + * + * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. + * @param eventName - Name of the event you want listen for. + * @param handler - Function to fire when receiving the event. + * @param options - Options to pass to `Event.addEventListener`. + * + * @public + */ +declare function useDomEvent(ref: RefObject, eventName: string, handler?: EventListener | undefined, options?: AddEventListenerOptions): void; + +interface DragControlOptions { + /** + * This distance after which dragging starts and a direction is locked in. + * + * @public + */ + distanceThreshold?: number; + /** + * Whether to immediately snap to the cursor when dragging starts. + * + * @public + */ + snapToCursor?: boolean; +} + +/** + * Can manually trigger a drag gesture on one or more `drag`-enabled `motion` components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +declare class DragControls { + private componentControls; + /** + * Start a drag gesture on every `motion` component that has this set of drag controls + * passed into it via the `dragControls` prop. + * + * ```jsx + * dragControls.start(e, { + * snapToCursor: true + * }) + * ``` + * + * @param event - PointerEvent + * @param options - Options + * + * @public + */ + start(event: React$1.PointerEvent | PointerEvent, options?: DragControlOptions): void; + /** + * Cancels a drag gesture. + * + * ```jsx + * dragControls.cancel() + * ``` + * + * @public + */ + cancel(): void; + /** + * Stops a drag gesture. + * + * ```jsx + * dragControls.stop() + * ``` + * + * @public + */ + stop(): void; +} +/** + * Usually, dragging is initiated by pressing down on a `motion` component with a `drag` prop + * and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate that dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + * + * @public + */ +declare function useDragControls(): DragControls; + +/** + * Checks if a component is a `motion` component. + */ +declare function isMotionComponent(component: React.ComponentType | string): boolean; + +/** + * Unwraps a `motion` component and returns either a string for `motion.div` or + * the React component for `motion(Component)`. + * + * If the component is not a `motion` component it returns undefined. + */ +declare function unwrapMotionComponent(component: React.ComponentType | string): React.ComponentType | string | undefined; + +/** + * Check whether a prop name is a valid `MotionProp` key. + * + * @param key - Name of the property to check + * @returns `true` is key is a valid `MotionProp`. + * + * @public + */ +declare function isValidMotionProp(key: string): boolean; + +declare function useInstantLayoutTransition(): (cb?: (() => void) | undefined) => void; + +declare function useResetProjection(): () => void; + +type FrameCallback = (timestamp: number, delta: number) => void; +declare function useAnimationFrame(callback: FrameCallback): void; + +type Cycle = (i?: number) => void; +type CycleState = [T, Cycle]; +/** + * Cycles through a series of visual properties. Can be used to toggle between or cycle through animations. It works similar to `useState` in React. It is provided an initial array of possible states, and returns an array of two arguments. + * + * An index value can be passed to the returned `cycle` function to cycle to a specific index. + * + * ```jsx + * import * as React from "react" + * import { motion, useCycle } from "framer-motion" + * + * export const MyComponent = () => { + * const [x, cycleX] = useCycle(0, 50, 100) + * + * return ( + * cycleX()} + * /> + * ) + * } + * ``` + * + * @param items - items to cycle through + * @returns [currentState, cycleState] + * + * @public + */ +declare function useCycle(...items: T[]): CycleState; + +interface UseInViewOptions extends Omit { + root?: RefObject; + once?: boolean; + amount?: "some" | "all" | number; + initial?: boolean; +} +declare function useInView(ref: RefObject, { root, margin, amount, once, initial, }?: UseInViewOptions): boolean; + +declare function useInstantTransition(): (callback: () => void) => void; +declare function disableInstantTransitions(): void; + +declare function usePageInView(): boolean; + +/** + * Creates a `transformPagePoint` function that accounts for SVG viewBox scaling. + * + * When dragging SVG elements inside an SVG with a viewBox that differs from + * the rendered dimensions (e.g., `viewBox="0 0 100 100"` but rendered at 500x500 pixels), + * pointer coordinates need to be transformed to match the SVG's coordinate system. + * + * @example + * ```jsx + * function App() { + * const svgRef = useRef(null) + * + * return ( + * + * + * + * + * + * ) + * } + * ``` + * + * @param svgRef - A React ref to the SVG element + * @returns A transformPagePoint function for use with MotionConfig + * + * @public + */ +declare function transformViewBoxPoint(svgRef: RefObject): TransformPoint; + +declare function startOptimizedAppearAnimation(element: HTMLElement, name: string, keyframes: string[] | number[], options: ValueAnimationTransition, onReady?: (animation: Animation) => void): void; + +interface LayoutGroupContextProps { + id?: string; + group?: NodeGroup; + forceRender?: VoidFunction; +} +declare const LayoutGroupContext: React$1.Context; + +interface MotionContextProps { + visualElement?: VisualElement; + initial?: false | string | string[]; + animate?: string | string[]; +} +declare const MotionContext: React$1.Context>; + +interface SwitchLayoutGroup { + register?: (member: IProjectionNode) => void; + deregister?: (member: IProjectionNode) => void; +} +type InitialPromotionConfig = { + /** + * The initial transition to use when the elements in this group mount (and automatically promoted). + * Subsequent updates should provide a transition in the promote method. + */ + transition?: Transition; + /** + * If the follow tree should preserve its opacity when the lead is promoted on mount + */ + shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean; +}; +type SwitchLayoutGroupContext = SwitchLayoutGroup & InitialPromotionConfig; +/** + * Internal, exported only for usage in Framer + */ +declare const SwitchLayoutGroupContext: React$1.Context; + +/** + * @public + */ +interface ScrollMotionValues { + scrollX: MotionValue; + scrollY: MotionValue; + scrollXProgress: MotionValue; + scrollYProgress: MotionValue; +} + +/** + * This is not an officially supported API and may be removed + * on any version. + */ +declare function useAnimatedState(initialState: any): any[]; + +declare const AnimateSharedLayout: React$1.FunctionComponent>; + +/** + * Note: Still used by components generated by old versions of Framer + * + * @deprecated + */ +declare const DeprecatedLayoutGroupContext: React$1.Context; + +interface ScaleMotionValues { + scaleX: MotionValue; + scaleY: MotionValue; +} +/** + * Returns a `MotionValue` each for `scaleX` and `scaleY` that update with the inverse + * of their respective parent scales. + * + * This is useful for undoing the distortion of content when scaling a parent component. + * + * By default, `useInvertedScale` will automatically fetch `scaleX` and `scaleY` from the nearest parent. + * By passing other `MotionValue`s in as `useInvertedScale({ scaleX, scaleY })`, it will invert the output + * of those instead. + * + * ```jsx + * const MyComponent = () => { + * const { scaleX, scaleY } = useInvertedScale() + * return + * } + * ``` + * + * @deprecated + */ +declare function useInvertedScale(scale?: Partial): ScaleMotionValues; + +export { type AbsoluteKeyframe, AnimatePresence, type AnimatePresenceProps, AnimateSharedLayout, type AnimationSequence, type AnimationType, type At, type CreateVisualElement, type Cycle, type CycleState, type DOMMotionComponents, type DOMSegment, type DOMSegmentWithTransition, DeprecatedLayoutGroupContext, DragControls, type FeatureBundle, type FeatureDefinition, type FeatureDefinitions, type FeaturePackage, type FeaturePackages, type FunctionSegment, HTMLElements, HTMLMotionProps, type HydratedFeatureDefinition, type HydratedFeatureDefinitions, LayoutGroup, LayoutGroupContext, type LazyFeatureBundle$1 as LazyFeatureBundle, LazyMotion, type LazyProps, MotionConfig, MotionConfigContext, type MotionConfigProps, MotionContext, MotionProps, type MotionValueSegment, type MotionValueSegmentWithTransition, type ObjectSegment, type ObjectSegmentWithTransition, type ObjectTarget, PopChild, PresenceChild, PresenceContext, namespace_d as Reorder, type ResolveKeyframes, type ResolvedAnimationDefinition, type ResolvedAnimationDefinitions, type ScrapeMotionValuesFromProps, type ScrollMotionValues, type Segment, type SequenceLabel, type SequenceLabelWithTime, type SequenceMap, type SequenceOptions, type SequenceProgressCallback, type SequenceTime, SwitchLayoutGroupContext, type UseInViewOptions, type UseScrollOptions, type ValueSequence, VariantLabels, type VisualState, WillChangeMotionValue, addPointerEvent, addPointerInfo, animate, animateMini, animationControls, animations, createScopedAnimate, disableInstantTransitions, distance, distance2D, domAnimation, domMax, domMin, filterProps, inView, isBrowser, isMotionComponent, isValidMotionProp, m, makeUseVisualState, motion, scroll, scrollInfo, startOptimizedAppearAnimation, transformViewBoxPoint, unwrapMotionComponent, useAnimate, useAnimateMini, useAnimation, useAnimationControls, useAnimationFrame, useComposedRefs, useCycle, useAnimatedState as useDeprecatedAnimatedState, useInvertedScale as useDeprecatedInvertedScale, useDomEvent, useDragControls, useElementScroll, useFollowValue, useForceUpdate, useInView, useInstantLayoutTransition, useInstantTransition, useIsPresent, useIsomorphicLayoutEffect, useMotionTemplate, useMotionValue, useMotionValueEvent, usePageInView, usePresence, usePresenceData, useReducedMotion, useReducedMotionConfig, useResetProjection, useScroll, useSpring, useTime, useTransform, useUnmountEffect, useVelocity, useViewportScroll, useWillChange }; diff --git a/node_modules/framer-motion/dom/README.md b/node_modules/framer-motion/dom/README.md new file mode 100644 index 00000000..9f4c437a --- /dev/null +++ b/node_modules/framer-motion/dom/README.md @@ -0,0 +1 @@ +This directory is a fallback for `exports["./dom"]` in the root `framer-motion` `package.json`. diff --git a/node_modules/framer-motion/dom/mini/package.json b/node_modules/framer-motion/dom/mini/package.json new file mode 100644 index 00000000..6d6ee8d7 --- /dev/null +++ b/node_modules/framer-motion/dom/mini/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../../dist/dom-mini.d.ts", + "main": "../../dist/cjs/dom-mini.js", + "module": "../../dist/es/dom-mini.mjs" +} diff --git a/node_modules/framer-motion/dom/package.json b/node_modules/framer-motion/dom/package.json new file mode 100644 index 00000000..c08f91cd --- /dev/null +++ b/node_modules/framer-motion/dom/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/dom.d.ts", + "main": "../dist/cjs/dom.js", + "module": "../dist/es/dom.mjs" +} diff --git a/node_modules/framer-motion/m/package.json b/node_modules/framer-motion/m/package.json new file mode 100644 index 00000000..5e76408c --- /dev/null +++ b/node_modules/framer-motion/m/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/m.d.ts", + "main": "../dist/cjs/m.js", + "module": "../dist/es/m.mjs" +} diff --git a/node_modules/framer-motion/mini/package.json b/node_modules/framer-motion/mini/package.json new file mode 100644 index 00000000..1ed44076 --- /dev/null +++ b/node_modules/framer-motion/mini/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "types": "../dist/mini.d.ts", + "main": "../dist/cjs/mini.js", + "module": "../dist/es/mini.mjs" +} diff --git a/node_modules/framer-motion/package.json b/node_modules/framer-motion/package.json new file mode 100644 index 00000000..008064f3 --- /dev/null +++ b/node_modules/framer-motion/package.json @@ -0,0 +1,148 @@ +{ + "name": "framer-motion", + "version": "12.34.2", + "description": "A simple and powerful JavaScript animation library", + "main": "dist/cjs/index.js", + "module": "dist/es/index.mjs", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/es/index.mjs", + "default": "./dist/cjs/index.js" + }, + "./debug": { + "types": "./dist/debug.d.ts", + "require": "./dist/cjs/debug.js", + "import": "./dist/es/debug.mjs", + "default": "./dist/cjs/debug.js" + }, + "./dom/mini": { + "types": "./dist/dom-mini.d.ts", + "require": "./dist/cjs/dom-mini.js", + "import": "./dist/es/dom-mini.mjs", + "default": "./dist/cjs/dom-mini.js" + }, + "./dom": { + "types": "./dist/dom.d.ts", + "require": "./dist/cjs/dom.js", + "import": "./dist/es/dom.mjs", + "default": "./dist/cjs/dom.js" + }, + "./client": { + "types": "./dist/types/client.d.ts", + "require": "./dist/cjs/client.js", + "import": "./dist/es/client.mjs", + "default": "./dist/cjs/client.js" + }, + "./m": { + "types": "./dist/m.d.ts", + "require": "./dist/cjs/m.js", + "import": "./dist/es/m.mjs", + "default": "./dist/cjs/m.js" + }, + "./mini": { + "types": "./dist/mini.d.ts", + "require": "./dist/cjs/mini.js", + "import": "./dist/es/mini.mjs", + "default": "./dist/cjs/mini.js" + }, + "./projection": { + "types": "./dist/projection.d.ts", + "import": "./dist/es/projection.mjs", + "default": "./dist/es/projection.mjs" + }, + "./package.json": "./package.json" + }, + "types": "dist/types/index.d.ts", + "author": "Matt Perry", + "license": "MIT", + "repository": "https://github.com/motiondivision/motion/", + "sideEffects": false, + "keywords": [ + "react animation", + "react", + "pose", + "react pose", + "animation", + "gestures", + "drag", + "spring", + "popmotion", + "framer", + "waapi" + ], + "scripts": { + "eslint": "yarn run lint", + "lint": "yarn eslint src/**/*.ts", + "build": "yarn clean && tsc --noEmitOnError -p . && rollup -c && node ./scripts/check-bundle.js", + "dev": "yarn watch", + "clean": "rm -rf types dist lib", + "test": "yarn test-server && yarn test-client", + "test-client": "jest --config jest.config.json --max-workers=2", + "test-server": "jest --config jest.config.ssr.json", + "prettier": "prettier ./src/* --write", + "watch": "concurrently -c blue,red -n tsc --noEmitOnError ,rollup --kill-others \"tsc --noEmitOnError --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", + "prepack": "yarn build && yarn measure", + "postpublish": "git push --tags", + "measure": "rollup -c ./rollup.size.config.mjs" + }, + "dependencies": { + "motion-dom": "^12.34.2", + "motion-utils": "^12.29.2", + "tslib": "^2.4.0" + }, + "devDependencies": { + "@radix-ui/react-dialog": "^1.1.15", + "@thednp/dommatrix": "^2.0.11", + "@types/three": "0.137.0", + "three": "0.137.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, + "bundlesize": [ + { + "path": "./dist/size-rollup-motion.js", + "maxSize": "34.9 kB" + }, + { + "path": "./dist/size-rollup-m.js", + "maxSize": "6 kB" + }, + { + "path": "./dist/size-rollup-dom-animation.js", + "maxSize": "17.85 kB" + }, + { + "path": "./dist/size-rollup-dom-max.js", + "maxSize": "29.8 kB" + }, + { + "path": "./dist/size-rollup-animate.js", + "maxSize": "19.1 kB" + }, + { + "path": "./dist/size-rollup-scroll.js", + "maxSize": "5.2 kB" + }, + { + "path": "./dist/size-rollup-waapi-animate.js", + "maxSize": "2.26 kB" + } + ], + "gitHead": "68283405093407c229adc25e4f939a8fc1a310da" +} diff --git a/node_modules/fsevents/LICENSE b/node_modules/fsevents/LICENSE new file mode 100644 index 00000000..5d70441c --- /dev/null +++ b/node_modules/fsevents/LICENSE @@ -0,0 +1,22 @@ +MIT License +----------- + +Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fsevents/README.md b/node_modules/fsevents/README.md new file mode 100644 index 00000000..50373a03 --- /dev/null +++ b/node_modules/fsevents/README.md @@ -0,0 +1,89 @@ +# fsevents + +Native access to MacOS FSEvents in [Node.js](https://nodejs.org/) + +The FSEvents API in MacOS allows applications to register for notifications of +changes to a given directory tree. It is a very fast and lightweight alternative +to kqueue. + +This is a low-level library. For a cross-platform file watching module that +uses fsevents, check out [Chokidar](https://github.com/paulmillr/chokidar). + +## Usage + +```sh +npm install fsevents +``` + +Supports only **Node.js v8.16 and higher**. + +```js +const fsevents = require('fsevents'); + +// To start observation +const stop = fsevents.watch(__dirname, (path, flags, id) => { + const info = fsevents.getInfo(path, flags); +}); + +// To end observation +stop(); +``` + +> **Important note:** The API behaviour is slightly different from typical JS APIs. The `stop` function **must** be +> retrieved and stored somewhere, even if you don't plan to stop the watcher. If you forget it, the garbage collector +> will eventually kick in, the watcher will be unregistered, and your callbacks won't be called anymore. + +The callback passed as the second parameter to `.watch` get's called whenever the operating system detects a +a change in the file system. It takes three arguments: + +###### `fsevents.watch(dirname: string, (path: string, flags: number, id: string) => void): () => Promise` + + * `path: string` - the item in the filesystem that have been changed + * `flags: number` - a numeric value describing what the change was + * `id: string` - an unique-id identifying this specific event + + Returns closer callback which when called returns a Promise resolving when the watcher process has been shut down. + +###### `fsevents.getInfo(path: string, flags: number, id: string): FsEventInfo` + +The `getInfo` function takes the `path`, `flags` and `id` arguments and converts those parameters into a structure +that is easier to digest to determine what the change was. + +The `FsEventsInfo` has the following shape: + +```js +/** + * @typedef {'created'|'modified'|'deleted'|'moved'|'root-changed'|'cloned'|'unknown'} FsEventsEvent + * @typedef {'file'|'directory'|'symlink'} FsEventsType + */ +{ + "event": "created", // {FsEventsEvent} + "path": "file.txt", + "type": "file", // {FsEventsType} + "changes": { + "inode": true, // Had iNode Meta-Information changed + "finder": false, // Had Finder Meta-Data changed + "access": false, // Had access permissions changed + "xattrs": false // Had xAttributes changed + }, + "flags": 0x100000000 +} +``` + +## Changelog + +- v2.3 supports Apple Silicon ARM CPUs +- v2 supports node 8.16+ and reduces package size massively +- v1.2.8 supports node 6+ +- v1.2.7 supports node 4+ + +## Troubleshooting + +- I'm getting `EBADPLATFORM` `Unsupported platform for fsevents` error. +- It's fine, nothing is broken. fsevents is macos-only. Other platforms are skipped. If you want to hide this warning, report a bug to NPM bugtracker asking them to hide ebadplatform warnings by default. + +## License + +The MIT License Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller — see LICENSE file. + +Visit our [GitHub page](https://github.com/fsevents/fsevents) and [NPM Page](https://npmjs.org/package/fsevents) diff --git a/node_modules/fsevents/fsevents.d.ts b/node_modules/fsevents/fsevents.d.ts new file mode 100644 index 00000000..2723c048 --- /dev/null +++ b/node_modules/fsevents/fsevents.d.ts @@ -0,0 +1,46 @@ +declare type Event = "created" | "cloned" | "modified" | "deleted" | "moved" | "root-changed" | "unknown"; +declare type Type = "file" | "directory" | "symlink"; +declare type FileChanges = { + inode: boolean; + finder: boolean; + access: boolean; + xattrs: boolean; +}; +declare type Info = { + event: Event; + path: string; + type: Type; + changes: FileChanges; + flags: number; +}; +declare type WatchHandler = (path: string, flags: number, id: string) => void; +export declare function watch(path: string, handler: WatchHandler): () => Promise; +export declare function watch(path: string, since: number, handler: WatchHandler): () => Promise; +export declare function getInfo(path: string, flags: number): Info; +export declare const constants: { + None: 0x00000000; + MustScanSubDirs: 0x00000001; + UserDropped: 0x00000002; + KernelDropped: 0x00000004; + EventIdsWrapped: 0x00000008; + HistoryDone: 0x00000010; + RootChanged: 0x00000020; + Mount: 0x00000040; + Unmount: 0x00000080; + ItemCreated: 0x00000100; + ItemRemoved: 0x00000200; + ItemInodeMetaMod: 0x00000400; + ItemRenamed: 0x00000800; + ItemModified: 0x00001000; + ItemFinderInfoMod: 0x00002000; + ItemChangeOwner: 0x00004000; + ItemXattrMod: 0x00008000; + ItemIsFile: 0x00010000; + ItemIsDir: 0x00020000; + ItemIsSymlink: 0x00040000; + ItemIsHardlink: 0x00100000; + ItemIsLastHardlink: 0x00200000; + OwnEvent: 0x00080000; + ItemCloned: 0x00400000; +}; +export {}; diff --git a/node_modules/fsevents/fsevents.js b/node_modules/fsevents/fsevents.js new file mode 100644 index 00000000..198da98e --- /dev/null +++ b/node_modules/fsevents/fsevents.js @@ -0,0 +1,83 @@ +/* + ** Ā© 2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller + ** Licensed under MIT License. + */ + +/* jshint node:true */ +"use strict"; + +if (process.platform !== "darwin") { + throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`); +} + +const Native = require("./fsevents.node"); +const events = Native.constants; + +function watch(path, since, handler) { + if (typeof path !== "string") { + throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path}`); + } + if ("function" === typeof since && "undefined" === typeof handler) { + handler = since; + since = Native.flags.SinceNow; + } + if (typeof since !== "number") { + throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof since}`); + } + if (typeof handler !== "function") { + throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`); + } + + let instance = Native.start(Native.global, path, since, handler); + if (!instance) throw new Error(`could not watch: ${path}`); + return () => { + const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(undefined); + instance = undefined; + return result; + }; +} + +function getInfo(path, flags) { + return { + path, + flags, + event: getEventType(flags), + type: getFileType(flags), + changes: getFileChanges(flags), + }; +} + +function getFileType(flags) { + if (events.ItemIsFile & flags) return "file"; + if (events.ItemIsDir & flags) return "directory"; + if (events.MustScanSubDirs & flags) return "directory"; + if (events.ItemIsSymlink & flags) return "symlink"; +} +function anyIsTrue(obj) { + for (let key in obj) { + if (obj[key]) return true; + } + return false; +} +function getEventType(flags) { + if (events.ItemRemoved & flags) return "deleted"; + if (events.ItemRenamed & flags) return "moved"; + if (events.ItemCreated & flags) return "created"; + if (events.ItemModified & flags) return "modified"; + if (events.RootChanged & flags) return "root-changed"; + if (events.ItemCloned & flags) return "cloned"; + if (anyIsTrue(flags)) return "modified"; + return "unknown"; +} +function getFileChanges(flags) { + return { + inode: !!(events.ItemInodeMetaMod & flags), + finder: !!(events.ItemFinderInfoMod & flags), + access: !!(events.ItemChangeOwner & flags), + xattrs: !!(events.ItemXattrMod & flags), + }; +} + +exports.watch = watch; +exports.getInfo = getInfo; +exports.constants = events; diff --git a/node_modules/fsevents/fsevents.node b/node_modules/fsevents/fsevents.node new file mode 100755 index 00000000..1cc3345e Binary files /dev/null and b/node_modules/fsevents/fsevents.node differ diff --git a/node_modules/fsevents/package.json b/node_modules/fsevents/package.json new file mode 100644 index 00000000..5d0ee15e --- /dev/null +++ b/node_modules/fsevents/package.json @@ -0,0 +1,62 @@ +{ + "name": "fsevents", + "version": "2.3.3", + "description": "Native Access to MacOS FSEvents", + "main": "fsevents.js", + "types": "fsevents.d.ts", + "os": [ + "darwin" + ], + "files": [ + "fsevents.d.ts", + "fsevents.js", + "fsevents.node" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + }, + "scripts": { + "clean": "node-gyp clean && rm -f fsevents.node", + "build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean", + "test": "/bin/bash ./test.sh 2>/dev/null", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "https://github.com/fsevents/fsevents.git" + }, + "keywords": [ + "fsevents", + "mac" + ], + "contributors": [ + { + "name": "Philipp Dunkel", + "email": "pip@pipobscure.com" + }, + { + "name": "Ben Noordhuis", + "email": "info@bnoordhuis.nl" + }, + { + "name": "Elan Shankar", + "email": "elan.shanker@gmail.com" + }, + { + "name": "Miroslav BajtoÅ”", + "email": "mbajtoss@gmail.com" + }, + { + "name": "Paul Miller", + "url": "https://paulmillr.com" + } + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/fsevents/fsevents/issues" + }, + "homepage": "https://github.com/fsevents/fsevents", + "devDependencies": { + "node-gyp": "^9.4.0" + } +} diff --git a/node_modules/motion-dom/LICENSE.md b/node_modules/motion-dom/LICENSE.md new file mode 100644 index 00000000..81110442 --- /dev/null +++ b/node_modules/motion-dom/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 [Motion](https://motion.dev) B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/motion-dom/dist/cjs/index.js b/node_modules/motion-dom/dist/cjs/index.js new file mode 100644 index 00000000..f87bab16 --- /dev/null +++ b/node_modules/motion-dom/dist/cjs/index.js @@ -0,0 +1,9777 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var motionUtils = require('motion-utils'); + +const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute +]; + +const statsBuffer = { + value: null, + addProjectionMetrics: null, +}; + +function createRenderStep(runNextFrame, stepName) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + let numCalls = 0; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + numCalls++; + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + if (!queue.has(callback)) + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + [thisFrame, nextFrame] = [nextFrame, thisFrame]; + // Execute this frame + thisFrame.forEach(triggerCallback); + /** + * If we're recording stats then + */ + if (stepName && statsBuffer.value) { + statsBuffer.value.frameloop[stepName].push(numCalls); + } + numCalls = 0; + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; +} + +const maxElapsed = 40; +function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const timestamp = motionUtils.MotionGlobalConfig.useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!motionUtils.MotionGlobalConfig.useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; +} + +const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : motionUtils.noop, true); + +let now; +function clearTime() { + now = undefined; +} +/** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ +const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || motionUtils.MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, +}; + +const activeAnimations = { + layout: 0, + mainThread: 0, + waapi: 0, +}; + +const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); +const isCSSVariableName = +/*@__PURE__*/ checkStringStartsWith("--"); +const startsAsVariableToken = +/*@__PURE__*/ checkStringStartsWith("var(--"); +const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); +}; +const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; +/** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ +function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); +} + +const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, +}; +const alpha = { + ...number, + transform: (v) => motionUtils.clamp(0, 1, v), +}; +const scale = { + ...number, + default: 1, +}; + +// If this number is a decimal, make it just five decimal places +// to avoid exponents +const sanitize = (v) => Math.round(v * 100000) / 100000; + +const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + +function isNullish(v) { + return v == null; +} + +const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + +/** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ +const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); +}; +const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; +}; + +const clampRgbUnit = (v) => motionUtils.clamp(0, 255, v); +const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), +}; +const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", +}; + +function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; +} +const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, +}; + +/*#__NO_SIDE_EFFECTS__*/ +const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, +}); +const degrees = /*@__PURE__*/ createUnitType("deg"); +const percent = /*@__PURE__*/ createUnitType("%"); +const px = /*@__PURE__*/ createUnitType("px"); +const vh = /*@__PURE__*/ createUnitType("vh"); +const vw = /*@__PURE__*/ createUnitType("vw"); +const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), +}))(); + +const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, +}; + +const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, +}; + +const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + +function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); +} +const NUMBER_TOKEN = "number"; +const COLOR_TOKEN = "color"; +const VAR_TOKEN = "var"; +const VAR_FUNCTION_TOKEN = "var("; +const SPLIT_TOKEN = "${}"; +// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` +const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; +function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; +} +function parseComplexValue(v) { + return analyseComplexValue(v).values; +} +function createTransformer(source) { + const { split, types } = analyseComplexValue(source); + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; +} +const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; +function getAnimatableNone$1(v) { + const parsed = parseComplexValue(v); + const transformer = createTransformer(v); + return transformer(parsed.map(convertNumbersToZero)); +} +const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone: getAnimatableNone$1, +}; + +// Adapted from https://gist.github.com/mjackson/5311256 +function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; +} +function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; +} + +function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); +} + +/* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) +*/ +const mixNumber$1 = (from, to, progress) => { + return from + (to - from) * progress; +}; + +// Linear color space blending +// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw +// Demonstrated http://codepen.io/osublake/pen/xGVVaN +const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); +}; +const colorTypes = [hex, rgba, hsla]; +const getColorType = (v) => colorTypes.find((type) => type.test(v)); +function asRGBA(color) { + const type = getColorType(color); + motionUtils.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; +} +const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; +}; + +const invisibleValues = new Set(["none", "hidden"]); +/** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ +function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } +} + +function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); +} +function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; +} +function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; +} +function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; +} +function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; +} +const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return motionUtils.pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + motionUtils.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } +}; + +function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber$1(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); +} + +const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; +}; + +const generateLinearEasing = (easing, duration, // as milliseconds +resolution = 10 // as milliseconds +) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; +}; + +/** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ +const maxGeneratorDuration = 20000; +function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; +} + +/** + * Create a progress => progress easing function from a generator. + */ +function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: motionUtils.millisecondsToSeconds(duration), + }; +} + +const velocitySampleDuration = 5; // ms +function calcGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return motionUtils.velocityPerSecond(current - resolveValue(prevT), t - prevT); +} + +const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, +}; + +const safeMin = 0.001; +function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + motionUtils.warning(duration <= motionUtils.secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = motionUtils.clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = motionUtils.clamp(springDefaults.minDuration, springDefaults.maxDuration, motionUtils.millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = motionUtils.secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } +} +const rootIterations = 12; +function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; +} +function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); +} + +const durationKeys = ["duration", "bounce"]; +const physicsKeys = ["stiffness", "damping", "mass"]; +function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); +} +function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + motionUtils.clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring(options); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; +} +function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -motionUtils.millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = motionUtils.millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + if (dampingRatio < 1) { + const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq) * + Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + next: (t) => { + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + let currentVelocity = t === 0 ? initialVelocity : 0.0; + /** + * We only need to calculate velocity for under-damped springs + * as over- and critically-damped springs can't overshoot, so + * checking only for displacement is enough. + */ + if (dampingRatio < 1) { + currentVelocity = + t === 0 + ? motionUtils.secondsToMilliseconds(initialVelocity) + : calcGeneratorVelocity(resolveSpring, t, current); + } + const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; + const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; + state.done = + isBelowVelocityThreshold && isBelowDisplacementThreshold; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; +} +spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = motionUtils.secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; +}; + +function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; +} + +function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || motionUtils.MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || motionUtils.noop : ease; + mixer = motionUtils.pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; +} +/** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ +function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + motionUtils.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = motionUtils.progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(motionUtils.clamp(input[0], input[inputLength - 1], v)) + : interpolator; +} + +function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = motionUtils.progress(0, remaining, i); + offset.push(mixNumber$1(min, 1, offsetProgress)); + } +} + +function defaultOffset(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; +} + +function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); +} + +function defaultEasing(values, easing) { + return values.map(() => easing || motionUtils.easeInOut).splice(0, values.length - 1); +} +function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = motionUtils.isEasingArray(ease) + ? ease.map(motionUtils.easingDefinitionToFunction) + : motionUtils.easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; +} + +const isNotNull$1 = (value) => value !== null; +function getFinalKeyframe$1(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull$1); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; +} + +const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, +}; +function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } +} + +class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } +} + +const percentToProgress = (percent) => percent / 100; +class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + activeAnimations.mainThread++; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (process.env.NODE_ENV !== "production" && + generatorFactory !== keyframes) { + motionUtils.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = motionUtils.pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = motionUtils.clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + const state = isInDelayPhase + ? { done: false, value: keyframes[0] } + : frameGenerator.next(elapsed); + if (mixKeyframes) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe$1(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return motionUtils.millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = motionUtils.secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + this.driver?.start(false); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + this.updateTime(time.now()); + const hasChanged = this.playbackSpeed !== newSpeed; + this.playbackSpeed = newSpeed; + if (hasChanged) { + this.time = motionUtils.millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + activeAnimations.mainThread--; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } +} +// Legacy function support +function animateValue(options) { + return new JSAnimation(options); +} + +function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } +} + +const radToDeg = (rad) => (rad * 180) / Math.PI; +const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); +}; +const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, +}; +const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; +}; +const rotateZ = rotate; +const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); +const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); +const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, +}; +function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; +} +function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; +} +const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); +}; +function convertTransformToNumber(value) { + return parseFloat(value.trim()); +} + +/** + * Generate a list of every possible transform key. + */ +const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", +]; +/** + * A quick lookup for transform props. + */ +const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))(); + +const isNumOrPxType = (v) => v === number || v === px; +const transformKeys = new Set(["x", "y", "z"]); +const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); +function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; +} +const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight), + height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom), + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), +}; +// Alias translate longform names +positionalValues.translateX = positionalValues.x; +positionalValues.translateY = positionalValues.y; + +const toResolve = new Set(); +let isScheduled = false; +let anyNeedsMeasurement = false; +let isForced = false; +function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); +} +function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); +} +function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; +} +class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } +} + +const isCSSVar = (name) => name.startsWith("--"); + +function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); +} + +/** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ +const supportsFlags = {}; + +function memoSupports(callback, supportsFlag) { + const memoized = motionUtils.memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); +} + +const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); + +const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; +}, "linearEasing"); + +const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + +const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), +}; + +function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (motionUtils.isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } +} + +function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + if (statsBuffer.value) { + activeAnimations.waapi++; + } + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + const animation = element.animate(keyframeOptions, options); + if (statsBuffer.value) { + animation.finished.finally(() => { + activeAnimations.waapi--; + }); + } + return animation; +} + +function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; +} + +function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; +} + +/** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ +class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + motionUtils.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe$1(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + else { + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + */ + setStyle(element, name, keyframe); + } + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return motionUtils.millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = motionUtils.secondsToMilliseconds(newTime); + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, observe }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + return motionUtils.noop; + } + else { + return observe(this); + } + } +} + +const unsupportedEasingFunctions = { + anticipate: motionUtils.anticipate, + backInOut: motionUtils.backInOut, + circInOut: motionUtils.circInOut, +}; +function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; +} +function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } +} + +/** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ +const sampleDelta = 10; //ms +class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + if (options.startTime !== undefined) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = motionUtils.clamp(0, sampleDelta, sampleTime - sampleDelta); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta); + sampleAnimation.stop(); + } +} + +/** + * Check if a value is animatable. Examples: + * + * āœ…: 100, "100px", "#fff" + * āŒ: "block", "url(2.jpg)" + * @param value + * + * @internal + */ +const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; +}; + +function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } +} +function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + motionUtils.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); +} + +function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; +} + +/** + * A list of values that can be hardware-accelerated. + */ +const acceleratedValues$1 = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Could be re-enabled now we have support for linear() easing + // "background-color" +]); +const supportsWaapi = /*@__PURE__*/ motionUtils.memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); +function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type } = options; + const subject = motionValue?.owner?.current; + /** + * We use this check instead of isHTMLElement() because we explicitly + * **don't** want elements in different timing contexts (i.e. popups) + * to be accelerated, as it's not possible to sync these animations + * properly with those driven from the main window frameloop. + */ + if (!(subject instanceof HTMLElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + acceleratedValues$1.has(name) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); +} + +/** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ +const MAX_RESOLVE_DELAY = 40; +class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + if (!canAnimate(keyframes, name, type, velocity)) { + if (motionUtils.MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe$1(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + */ + const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + const animation = useWaapi + ? new NativeAnimationExtended({ + ...resolvedOptions, + element, + }) + : new JSAnimation(resolvedOptions); + animation.finished.then(() => { + this.notifyFinished(); + }).catch(motionUtils.noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } +} + +class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } +} +function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; +} + +class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } +} + +class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } +} + +const animationMaps = new WeakMap(); +const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; +function getAnimationMap(element) { + const map = animationMaps.get(element) || new Map(); + animationMaps.set(element, map); + return map; +} + +function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; +} + +/** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ +const splitCSSVariableRegex = +// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words +/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; +function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; +} +const maxDepth = 4; +function getVariableValue(current, element, depth = 1) { + motionUtils.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return motionUtils.isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; +} + +const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, +}; +const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, +}); +const keyframesTransition = { + type: "keyframes", + duration: 0.8, +}; +/** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ +const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, +}; +const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; +}; + +const isNotNull = (value) => value !== null; +function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const index = repeat && repeatType !== "loop" && repeat % 2 === 1 + ? 0 + : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; +} + +/** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ +function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; +} + +function getValueTransition(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; +} + +/** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ +function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) { + return !!Object.keys(transition).length; +} + +const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - motionUtils.secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = motionUtils.secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = motionUtils.secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (motionUtils.MotionGlobalConfig.instantAnimations || + motionUtils.MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); +}; + +function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; +} +function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; +} + +function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); +} + +const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, +]); + +/** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ +const MAX_VELOCITY_DELTA = 30; +const isFloat = (value) => { + return !isNaN(parseFloat(value)); +}; +const collectMotionValues = { + current: undefined, +}; +/** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ +class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return motionUtils.velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } +} +function motionValue(init, options) { + return new MotionValue(init, options); +} + +const isKeyframesTarget = (v) => { + return Array.isArray(v); +}; + +/** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ +function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } +} +function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; +} +function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } +} + +const isMotionValue = (value) => Boolean(value && value.getVelocity); + +function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); +} + +function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && motionUtils.MotionGlobalConfig.WillChange) { + const newWillChange = new motionUtils.MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } +} + +function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); +} + +const optimizedAppearDataId = "framerAppearId"; +const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + +function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; +} + +/** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ +function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; +} +function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition(transition || {}, key), + }; + /** + * If the value is already at the defined target, skip the animation. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; +} + +function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } +} +function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); +} + +function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); +} + +/** + * ValueType for "auto" + */ +const auto = { + test: (v) => v === "auto", + parse: (v) => v, +}; + +/** + * Tests a provided value against a ValueType + */ +const testValueType = (v) => (type) => type.test(v); + +/** + * A list of value types commonly used for dimensions + */ +const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; +/** + * Tests a dimensional value against the list of dimension ValueTypes + */ +const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + +function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || motionUtils.isZeroValueString(value); + } + else { + return true; + } +} + +/** + * Properties that should default to 1 or 100% + */ +const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); +function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; +} +const functionRegex = /\b([a-z-]*)\(.*?\)/gu; +const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, +}; + +const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, +}; + +const int = { + ...number, + transform: Math.round, +}; + +const transformValueTypes = { + rotate: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, +}; + +const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, +}; + +/** + * A map of default value types for common values + */ +const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, +}; +/** + * Gets the default ValueType for the provided value key + */ +const getDefaultValueType = (key) => defaultValueTypes[key]; + +const customTypes = /*@__PURE__*/ new Set([filter, mask]); +function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; +} + +/** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ +const invalidTemplates = new Set(["auto", "none", "0"]); +function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } +} + +class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } +} + +const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", +]); + +function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } +} + +function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + motionUtils.isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); +} + +const supportsPartialKeyframes = /*@__PURE__*/ motionUtils.memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; +}); + +/** + * A list of values that can be hardware-accelerated. + */ +const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved + // or until we implement support for linear() easing. + // "background-color" +]); + +function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); +} + +function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; +} + +/** + * Provided a value and a ValueType, returns the value as that value type. + */ +const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; +}; + +class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } + destroy() { + for (const value of this.values.values()) { + value.onRemove(); + } + } +} + +function createEffect(addValue) { + const stateCache = new WeakMap(); + const subscriptions = []; + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; +} + +function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; +} +const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); +}; +const attrEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addAttrValue)); + +const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); +}); + +/** + * Checks if an element is an HTML element in a way + * that works across iframes + */ +function isHTMLElement(element) { + return motionUtils.isObject(element) && "offsetHeight" in element; +} + +const translateAlias$1 = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +function buildTransform$1(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias$1[key] || key; + const valueToRender = state.latest[key]; + transform += `${transformName}(${valueToRender}) `; + } + } + return transformIsDefault ? "none" : transform.trim(); +} + +const originProps = new Set(["originX", "originY", "originZ"]); +const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform$1(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); +}; +const styleEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addStyleValue)); + +function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } +} +const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); +}; +const svgEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addSVGValue)); +function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); +} + +const { schedule: microtask, cancel: cancelMicrotask } = +/* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + +const isDragging = { + x: false, + y: false, +}; +function isDragActive() { + return isDragging.x || isDragging.y; +} + +function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } +} + +function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; +} + +function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); +} +/** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ +function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; +} + +/** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ +const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } +}; + +const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } +}; + +const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", +]); +/** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ +function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); +} +const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); +/** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ +function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); +} + +const isPressing = new WeakSet(); + +/** + * Filter out events that are not "Enter" keys. + */ +function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; +} +function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); +} +const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); +}; + +/** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ +function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); +} +const claimedPointerDownEvents = new WeakSet(); +/** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ +function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerCancel); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerCancel, eventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; +} + +function getComputedStyle$2(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; +} + +/** + * Checks if an element is an SVG element in a way + * that works across iframes + */ +function isSVGElement(element) { + return motionUtils.isObject(element) && "ownerSVGElement" in element; +} + +const resizeHandlers = new WeakMap(); +let observer; +const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } +}; +const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); +const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); +function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); +} +function notifyAll(entries) { + entries.forEach(notifyTarget); +} +function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); +} +function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; +} + +const windowCallbacks = new Set(); +let windowResizeHandler; +function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); +} +function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; +} + +function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); +} + +function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); +} + +function record() { + const { value } = statsBuffer; + if (value === null) { + cancelFrame(record); + return; + } + value.frameloop.rate.push(frameData.delta); + value.animations.mainThread.push(activeAnimations.mainThread); + value.animations.waapi.push(activeAnimations.waapi); + value.animations.layout.push(activeAnimations.layout); +} +function mean(values) { + return values.reduce((acc, value) => acc + value, 0) / values.length; +} +function summarise(values, calcAverage = mean) { + if (values.length === 0) { + return { + min: 0, + max: 0, + avg: 0, + }; + } + return { + min: Math.min(...values), + max: Math.max(...values), + avg: calcAverage(values), + }; +} +const msToFps = (ms) => Math.round(1000 / ms); +function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; +} +function reportStats() { + const { value } = statsBuffer; + if (!value) { + throw new Error("Stats are not being measured"); + } + clearStatsBuffer(); + cancelFrame(record); + const summary = { + frameloop: { + setup: summarise(value.frameloop.setup), + rate: summarise(value.frameloop.rate), + read: summarise(value.frameloop.read), + resolveKeyframes: summarise(value.frameloop.resolveKeyframes), + preUpdate: summarise(value.frameloop.preUpdate), + update: summarise(value.frameloop.update), + preRender: summarise(value.frameloop.preRender), + render: summarise(value.frameloop.render), + postRender: summarise(value.frameloop.postRender), + }, + animations: { + mainThread: summarise(value.animations.mainThread), + waapi: summarise(value.animations.waapi), + layout: summarise(value.animations.layout), + }, + layoutProjection: { + nodes: summarise(value.layoutProjection.nodes), + calculatedTargetDeltas: summarise(value.layoutProjection.calculatedTargetDeltas), + calculatedProjections: summarise(value.layoutProjection.calculatedProjections), + }, + }; + /** + * Convert the rate to FPS + */ + const { rate } = summary.frameloop; + rate.min = msToFps(rate.min); + rate.max = msToFps(rate.max); + rate.avg = msToFps(rate.avg); + [rate.min, rate.max] = [rate.max, rate.min]; + return summary; +} +function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const newStatsBuffer = statsBuffer; + newStatsBuffer.value = { + frameloop: { + setup: [], + rate: [], + read: [], + resolveKeyframes: [], + preUpdate: [], + update: [], + preRender: [], + render: [], + postRender: [], + }, + animations: { + mainThread: [], + waapi: [], + layout: [], + }, + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + newStatsBuffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = newStatsBuffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; + frame.postRender(record, true); + return reportStats; +} + +/** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ +function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; +} + +function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } +} +function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = motionUtils.easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; +} + +function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; +} + +/** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ +function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; +} +/** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ +function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + }; + const startAnimation = () => { + stopAnimation(); + const currentValue = asNumber$1(value.get()); + const targetValue = asNumber$1(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + return; + } + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity: value.getVelocity(), + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(() => { + startAnimation(); + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value["events"].animationComplete?.notify(); + }); + }); + }, stopAnimation); + if (isMotionValue(source)) { + const removeSourceOnChange = source.on("change", (v) => value.set(parseValue(v, unit))); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; +} +function parseValue(v, unit) { + return unit ? v + unit : v; +} +function asNumber$1(v) { + return typeof v === "number" ? v : parseFloat(v); +} + +function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); +} + +/** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ +function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; +} + +/** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); +} + +/** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ +function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); +} +/** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ +function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); +} + +/** + * A list of all ValueTypes + */ +const valueTypes = [...dimensionValueTypes, color, complex]; +/** + * Tests a value against the list of ValueTypes + */ +const findValueType = (v) => valueTypes.find(testValueType(v)); + +function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + if (valueName === "exit" || valueName === "old") + return "old"; + return "group"; +} + +let pendingRules = {}; +let style = null; +const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, +}; + +function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; +} + +function filterViewAnimations(animation) { + const { effect } = animation; + if (!effect) + return false; + return (effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); +} +function getViewAnimations() { + return document.getAnimations().filter(filterViewAnimations); +} + +function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; +} + +const definitionNames = ["layout", "enter", "exit", "new", "old"]; +function startViewAnimation(builder) { + const { update, targets, options: defaultOptions } = builder; + if (!document.startViewTransition) { + return new Promise(async (resolve) => { + await update(); + resolve(new GroupAnimation([])); + }); + } + // TODO: Go over existing targets and ensure they all have ids + /** + * If we don't have any animations defined for the root target, + * remove it from being captured. + */ + if (!hasTarget("root", targets)) { + css.set(":root", { + "view-transition-name": "none", + }); + } + /** + * Set the timing curve to linear for all view transition layers. + * This gets baked into the keyframes, which can't be changed + * without breaking the generated animation. + * + * This allows us to set easing via updateTiming - which can be changed. + */ + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + css.commit(); // Write + const transition = document.startViewTransition(async () => { + await update(); + // TODO: Go over new targets and ensure they all have ids + }); + transition.finished.finally(() => { + css.remove(); // Write + }); + return new Promise((resolve) => { + transition.ready.then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + */ + targets.forEach((definition, target) => { + // TODO: If target is not "root", resolve elements + // and iterate over each + for (const key of definitionNames) { + if (!definition[key]) + continue; + const { keyframes, options } = definition[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + if (!valueKeyframes) + continue; + const valueOptions = { + ...getValueTransition(defaultOptions, valueName), + ...getValueTransition(options, valueName), + }; + const type = chooseLayerType(key); + /** + * If this is an opacity animation, and keyframes are not an array, + * we need to convert them into an array and set an initial value. + */ + if (valueName === "opacity" && + !Array.isArray(valueKeyframes)) { + const initialValue = type === "new" ? 0 : 1; + valueKeyframes = [initialValue, valueKeyframes]; + } + /** + * Resolve stagger function if provided. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(0, 1); + } + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + const animation = new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${target})`, + keyframes: valueKeyframes, + }); + animations.push(animation); + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = targets.get(name.layer); + if (!targetDefinition) { + /** + * If transition name is group then update the timing of the animation + * whereas if it's old or new then we could possibly replace it using + * the above method. + */ + const transitionName = name.type === "group" ? "layout" : ""; + let animationTransition = { + ...getValueTransition(defaultOptions, transitionName), + }; + animationTransition.duration && (animationTransition.duration = motionUtils.secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration); + effect.updateTiming({ + delay: motionUtils.secondsToMilliseconds(animationTransition.delay ?? 0), + duration: animationTransition.duration, + easing, + }); + animations.push(new NativeAnimationWrapper(animation)); + } + else if (hasOpacity(targetDefinition, "enter") && + hasOpacity(targetDefinition, "exit") && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + } + resolve(new GroupAnimation(animations)); + }); + }); +} +function hasOpacity(target, key) { + return target?.[key]?.keyframes.opacity; +} + +let builders = []; +let current = null; +function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); +} +function start(builder) { + motionUtils.removeItem(builders, builder); + current = builder; + startViewAnimation(builder).then((animation) => { + builder.notifyReady(animation); + animation.finished.finally(next); + }); +} +function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } +} +function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); +} + +class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + this.notifyReady = motionUtils.noop; + this.readyPromise = new Promise((resolve) => { + this.notifyReady = resolve; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + addToQueue(this); + } + get(subject) { + this.currentSubject = subject; + return this; + } + layout(keyframes, options) { + this.updateTarget("layout", keyframes, options); + return this; + } + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + crossfade(options) { + this.updateTarget("enter", { opacity: 1 }, options); + this.updateTarget("exit", { opacity: 0 }, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } +} +function animateView(update, defaultOptions = {}) { + return new ViewTransitionBuilder(update, defaultOptions); +} + +const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, +}); +const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), +}); +const createAxis = () => ({ min: 0, max: 0 }); +const createBox = () => ({ + x: createAxis(), + y: createAxis(), +}); + +const visualElementStore = new WeakMap(); + +function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); +} + +/** + * Decides if the supplied variable is variant label + */ +function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); +} + +const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", +]; +const variantProps = ["initial", ...variantPriorityOrder]; + +function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); +} +function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); +} + +/** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ +function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; +} + +// Does this device prefer reduced motion? Returns `null` server-side. +const prefersReducedMotion = { current: null }; +const hasReducedMotionListener = { current: false }; + +const isBrowser = typeof window !== "undefined"; +function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } +} + +const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", +]; +/** + * Static feature definitions - can be injected by framework layer + */ +let featureDefinitions = {}; +/** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ +function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; +} +/** + * Get the current feature definitions + */ +function getFeatureDefinitions() { + return featureDefinitions; +} +/** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ +class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + if (process.env.NODE_ENV !== "production") { + motionUtils.warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: motionUtils.secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + if (value.owner) + value.stop(); + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (motionUtils.isNumericalString(value) || motionUtils.isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } +} + +class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } +} + +/** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ +class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } +} + +/** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ +function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; +} +function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; +} +/** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ +function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; +} + +function isIdentityScale(scale) { + return scale === undefined || scale === 1; +} +function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); +} +function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); +} +function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); +} +function is2DTranslate(value) { + return value && value !== "0%"; +} + +/** + * Scales a point based on a factor and an originPoint + */ +function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; +} +/** + * Applies a translate/scale delta to a point + */ +function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; +} +/** + * Applies a translate/scale delta to an axis + */ +function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Applies a translate/scale delta to a box + */ +function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); +} +const TREE_SCALE_SNAP_MIN = 0.999999999999; +const TREE_SCALE_SNAP_MAX = 1.0000000000001; +/** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ +function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(box, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } +} +function translateAxis(axis, distance) { + axis.min = axis.min + distance; + axis.max = axis.max + distance; +} +/** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ +function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); +} +/** + * Apply a transform to a box from the latest resolved motion values. + */ +function transformBox(box, transform) { + transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY); +} + +function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); +} +function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; +} + +const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +const numTransforms = transformPropOrder.length; +/** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ +function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; +} + +function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } +} + +function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } +} + +function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; +} +/** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ +const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, +}; + +const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber$1(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, +}; + +const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomLeftRadius", + "borderBottomRightRadius", + ], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, +}; +function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } +} + +function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); +} + +function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; +} + +function getComputedStyle$1(element) { + return window.getComputedStyle(element); +} +class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle$1(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + } +} + +function isObjectKey(key, object) { + return key in object; +} +class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } +} + +const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", +}; +const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", +}; +/** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ +function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; +} + +/** + * CSS Motion Path properties that should remain as CSS styles on SVG elements. + */ +const cssMotionPathProperties = [ + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", +]; +/** + * Build SVG visual attributes, like cx and style.transform + */ +function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, +// This is object creation, which we try to avoid per-frame. +...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + /** + * However, we apply transforms as CSS transforms. + * So if we detect a transform, transformOrigin we take it from attrs and copy it into style. + */ + if (attrs.transform) { + style.transform = attrs.transform; + delete attrs.transform; + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + for (const key of cssMotionPathProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } +} + +/** + * A set of attribute names that are always read/written as camel case. + */ +const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", +]); + +const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + +function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } +} + +function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; +} + +class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } +} + +const numVariantProps = variantProps.length; +/** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; +} + +function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; +} + +const reversePriorityOrder = [...variantPriorityOrder].reverse(); +const numAnimationTypes = variantPriorityOrder.length; +function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; +} +function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + isInitialRender && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = !shallowCompare(next, prev); + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if (isInitialRender && visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + isInitialRender && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + /** + * Temporarily disabling resetting this flag as it prevents components + * with initial={false} from animating after being remounted, for instance + * as the child of an Activity component. + */ + // isInitialRender = true + }, + }; +} +function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; +} +function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; +} +function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; +} + +/** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; +} +/** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ +function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); +} +/** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; +} + +const SCALE_PRECISION = 0.0001; +const SCALE_MIN = 1 - SCALE_PRECISION; +const SCALE_MAX = 1 + SCALE_PRECISION; +const TRANSLATE_PRECISION = 0.01; +const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; +const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; +function calcLength(axis) { + return axis.max - axis.min; +} +function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; +} +function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } +} +function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); +} +function calcRelativeAxis(target, relative, parent) { + target.min = parent.min + relative.min; + target.max = target.min + calcLength(relative); +} +function calcRelativeBox(target, relative, parent) { + calcRelativeAxis(target.x, relative.x, parent.x); + calcRelativeAxis(target.y, relative.y, parent.y); +} +function calcRelativeAxisPosition(target, layout, parent) { + target.min = layout.min - parent.min; + target.max = target.min + calcLength(layout); +} +function calcRelativePosition(target, layout, parent) { + calcRelativeAxisPosition(target.x, layout.x, parent.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y); +} + +/** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ +function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; +} +/** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ +function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); +} +/** + * The names of the motion values we want to apply as translation, scale and origin. + */ +const xKeys = ["x", "scaleX", "originX"]; +const yKeys = ["y", "scaleY", "originY"]; +/** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); +} + +function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; +} +function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); +} +function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; +} +function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); +} +function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); +} +function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); +} +function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); +} +function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); +} + +function eachAxis(callback) { + return [callback("x"), callback("y")]; +} + +function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; +} + +const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; +const numBorders = borders.length; +const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; +const isPx = (value) => typeof value === "number" || px.test(value); +function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = `border${borders[i]}Radius`; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); + } +} +function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; +} +const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, motionUtils.circOut); +const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, motionUtils.noop); +function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(motionUtils.progress(min, max, p)); + }; +} + +function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; +} + +function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler); +} + +const compareByDepth = (a, b) => a.depth - b.depth; + +class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + motionUtils.addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + motionUtils.removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } +} + +/** + * Timeout defined in ms + */ +function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); +} +function delayInSeconds(callback, timeout) { + return delay(callback, motionUtils.secondsToMilliseconds(timeout)); +} + +/** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ +function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; +} + +class NodeStack { + constructor() { + this.members = []; + } + add(node) { + motionUtils.addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const m = this.members[i]; + if (m === node || m === this.lead || m === this.prevLead) + continue; + const inst = m.instance; + if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) { + motionUtils.removeItem(this.members, m); + } + } + node.scheduleRender(); + } + remove(node) { + motionUtils.removeItem(this.members, node); + if (node === this.prevLead) { + this.prevLead = undefined; + } + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) { + this.promote(prevLead); + } + } + } + relegate(node) { + const indexOfNode = this.members.findIndex((member) => node === member); + if (indexOfNode === 0) + return false; + /** + * Find the next projection node that is present + */ + let prevLead; + for (let i = indexOfNode; i >= 0; i--) { + const member = this.members[i]; + const inst = member.instance; + if (member.isPresent !== false && (!inst || inst.isConnected !== false)) { + prevLead = member; + break; + } + } + if (prevLead) { + this.promote(prevLead); + return true; + } + else { + return false; + } + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.instance && prevLead.scheduleRender(); + node.scheduleRender(); + /** + * If both the new and previous lead have the same defined layoutDependency, + * skip the shared layout animation. This allows components with layoutId + * to opt-out of animations when their layoutDependency hasn't changed, + * even when the component unmounts and remounts in a different location. + */ + const prevDep = prevLead.options.layoutDependency; + const nextDep = node.options.layoutDependency; + const dependencyMatches = prevDep !== undefined && + nextDep !== undefined && + prevDep === nextDep; + if (!dependencyMatches) { + const prevInstance = prevLead.instance; + const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot; + if (!isStale) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) { + node.resumeFrom.preserveOpacity = true; + } + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root && node.root.isUpdating) { + node.isLayoutDirty = true; + } + } + } + const { crossfade } = node.options; + if (crossfade === false) { + prevLead.hide(); + } + } + } + exitAnimationComplete() { + this.members.forEach((node) => { + const { options, resumingFrom } = node; + options.onExitComplete && options.onExitComplete(); + if (resumingFrom) { + resumingFrom.options.onExitComplete && + resumingFrom.options.onExitComplete(); + } + }); + } + scheduleRender() { + this.members.forEach((node) => { + node.instance && node.scheduleRender(false); + }); + } + /** + * Clear any leads that have been removed this render to prevent them from being + * used in future animations and to prevent memory leaks + */ + removeLeadSnapshot() { + if (this.lead && this.lead.snapshot) { + this.lead.snapshot = undefined; + } + } +} + +/** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ +const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, +}; + +const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, +}; +const transformAxes = ["", "X", "Y", "Z"]; +/** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ +const animationTarget = 1000; +let id = 0; +function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } +} +function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } +} +function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new motionUtils.SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + this.unblockUpdate(); + this.clearAllSnapshots(); + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false) { + const withTransforms = createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(withTransforms, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!node.instance) + continue; + if (!hasTransform(node.latestValues)) + continue; + hasScale(node.latestValues) && node.updateSnapshot(); + const sourceBox = createBox(); + const nodeBox = node.measurePageBox(); + copyBoxInto(sourceBox, nodeBox); + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (relativeParent && relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + // TODO: This is creating a new object every frame + this.target = this.applyTransform(this.layout.layoutBox); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + mixAxisDelta(targetDelta.x, delta.x, progress); + mixAxisDelta(targetDelta.y, delta.y, progress); + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + activeAnimations.layout++; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onStop: () => { + activeAnimations.layout--; + }, + onComplete: () => { + activeAnimations.layout--; + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; +} +function updateLayout(node) { + node.updateLayout(); +} +function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; +} +function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); +} +function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; +} +function clearSnapshot(node) { + node.clearSnapshot(); +} +function clearMeasurements(node) { + node.clearMeasurements(); +} +function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; +} +function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); +} +function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; +} +function resolveTargetDelta(node) { + node.resolveTargetDelta(); +} +function calcProjection(node) { + node.calcProjection(); +} +function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); +} +function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); +} +function mixAxisDelta(output, delta, p) { + output.translate = mixNumber$1(delta.translate, 0, p); + output.scale = mixNumber$1(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; +} +function mixAxis(output, from, to, p) { + output.min = mixNumber$1(from.min, to.min, p); + output.max = mixNumber$1(from.max, to.max, p); +} +function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); +} +function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); +} +const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], +}; +const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); +/** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ +const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : motionUtils.noop; +function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); +} +function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); +} +function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); +} +function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; +} + +const DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, +}); + +const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); +function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; +} + +const rootProjectionNode = { + current: undefined, +}; +const HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), +}); + +const layoutSelector = "[data-layout], [data-layout-id]"; +const noop = () => { }; +function snapshotFromTarget(projection) { + const target = projection.targetWithTransforms || projection.target; + if (!target) + return undefined; + const measuredBox = createBox(); + const layoutBox = createBox(); + copyBoxInto(measuredBox, target); + copyBoxInto(layoutBox, target); + return { + animationId: projection.root?.animationId ?? 0, + measuredBox, + layoutBox, + latestValues: projection.animationValues || projection.latestValues || {}, + source: projection.id, + }; +} +class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.sharedTransitions = new Map(); + this.notifyReady = noop; + this.rejectReady = noop; + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + frame.postRender(() => { + this.start().then(this.notifyReady).catch(this.rejectReady); + }); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + async start() { + const beforeElements = collectLayoutElements(this.scope); + const beforeRecords = this.buildRecords(beforeElements); + beforeRecords.forEach(({ projection }) => { + const hasCurrentAnimation = Boolean(projection.currentAnimation); + const isSharedLayout = Boolean(projection.options.layoutId); + if (hasCurrentAnimation && isSharedLayout) { + const snapshot = snapshotFromTarget(projection); + if (snapshot) { + projection.snapshot = snapshot; + } + else if (projection.snapshot) { + projection.snapshot = undefined; + } + } + else if (projection.snapshot && + (projection.currentAnimation || projection.isProjecting())) { + projection.snapshot = undefined; + } + projection.isPresent = true; + projection.willUpdate(); + }); + await this.updateDom(); + const afterElements = collectLayoutElements(this.scope); + const afterRecords = this.buildRecords(afterElements); + this.handleExitingElements(beforeRecords, afterRecords); + afterRecords.forEach(({ projection }) => { + const instance = projection.instance; + const resumeFromInstance = projection.resumeFrom + ?.instance; + if (!instance || !resumeFromInstance) + return; + if (!("style" in instance)) + return; + const currentTransform = instance.style.transform; + const resumeFromTransform = resumeFromInstance.style.transform; + if (currentTransform && + resumeFromTransform && + currentTransform === resumeFromTransform) { + instance.style.transform = ""; + instance.style.transformOrigin = ""; + } + }); + afterRecords.forEach(({ projection }) => { + projection.isPresent = true; + }); + const root = getProjectionRoot(afterRecords, beforeRecords); + root?.didUpdate(); + await new Promise((resolve) => { + frame.postRender(() => resolve()); + }); + const animations = collectAnimations(afterRecords); + const animation = new GroupAnimation(animations); + return animation; + } + buildRecords(elements) { + const records = []; + const recordMap = new Map(); + for (const element of elements) { + const parentRecord = findParentRecord(element, recordMap, this.scope); + const { layout, layoutId } = readLayoutAttributes(element); + const override = layoutId + ? this.sharedTransitions.get(layoutId) + : undefined; + const transition = override || this.defaultOptions; + const record = getOrCreateRecord(element, parentRecord?.projection, { + layout, + layoutId, + animationType: typeof layout === "string" ? layout : "both", + transition: transition, + }); + recordMap.set(element, record); + records.push(record); + } + return records; + } + handleExitingElements(beforeRecords, afterRecords) { + const afterElementsSet = new Set(afterRecords.map((record) => record.element)); + beforeRecords.forEach((record) => { + if (afterElementsSet.has(record.element)) + return; + // For shared layout elements, relegate to set up resumeFrom + // so the remaining element animates from this position + if (record.projection.options.layoutId) { + record.projection.isPresent = false; + record.projection.relegate(); + } + record.visualElement.unmount(); + visualElementStore.delete(record.element); + }); + // Clear resumeFrom on EXISTING nodes that point to unmounted projections + // This prevents crossfade animation when the source element was removed entirely + // But preserve resumeFrom for NEW nodes so they can animate from the old position + // Also preserve resumeFrom for lead nodes that were just promoted via relegate + const beforeElementsSet = new Set(beforeRecords.map((record) => record.element)); + afterRecords.forEach(({ element, projection }) => { + if (beforeElementsSet.has(element) && + projection.resumeFrom && + !projection.resumeFrom.instance && + !projection.isLead()) { + projection.resumeFrom = undefined; + projection.snapshot = undefined; + } + }); + } +} +function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + // animateLayout(updateDom) + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + // animateLayout(scope, updateDom, options?) + const elements = resolveElements(scopeOrUpdateDom); + const scope = elements[0] || document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; +} +function collectLayoutElements(scope) { + const elements = Array.from(scope.querySelectorAll(layoutSelector)); + if (scope instanceof Element && scope.matches(layoutSelector)) { + if (!elements.includes(scope)) { + elements.unshift(scope); + } + } + return elements; +} +function readLayoutAttributes(element) { + const layoutId = element.getAttribute("data-layout-id") || undefined; + const rawLayout = element.getAttribute("data-layout"); + let layout; + if (rawLayout === "" || rawLayout === "true") { + layout = true; + } + else if (rawLayout) { + layout = rawLayout; + } + return { + layout, + layoutId, + }; +} +function createVisualState() { + return { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }; +} +function getOrCreateRecord(element, parentProjection, projectionOptions) { + const existing = visualElementStore.get(element); + const visualElement = existing ?? + new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: createVisualState(), + }, { allowProjection: true }); + if (!existing || !visualElement.projection) { + visualElement.projection = new HTMLProjectionNode(visualElement.latestValues, parentProjection); + } + visualElement.projection.setOptions({ + ...projectionOptions, + visualElement, + }); + if (!visualElement.current) { + visualElement.mount(element); + } + else if (!visualElement.projection.instance) { + // Mount projection if VisualElement is already mounted but projection isn't + // This happens when animate() was called before animateLayout() + visualElement.projection.mount(element); + } + if (!existing) { + visualElementStore.set(element, visualElement); + } + return { + element, + visualElement, + projection: visualElement.projection, + }; +} +function findParentRecord(element, recordMap, scope) { + let parent = element.parentElement; + while (parent) { + const record = recordMap.get(parent); + if (record) + return record; + if (parent === scope) + break; + parent = parent.parentElement; + } + return undefined; +} +function getProjectionRoot(afterRecords, beforeRecords) { + const record = afterRecords[0] || beforeRecords[0]; + return record?.projection.root; +} +function collectAnimations(afterRecords) { + const animations = new Set(); + afterRecords.forEach((record) => { + const animation = record.projection.currentAnimation; + if (animation) + animations.add(animation); + }); + return Array.from(animations); +} + +/** + * @deprecated + * + * Import as `frame` instead. + */ +const sync = frame; +/** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ +const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; +}, {}); + +exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; +exports.DOMKeyframesResolver = DOMKeyframesResolver; +exports.DOMVisualElement = DOMVisualElement; +exports.DocumentProjectionNode = DocumentProjectionNode; +exports.Feature = Feature; +exports.FlatTree = FlatTree; +exports.GroupAnimation = GroupAnimation; +exports.GroupAnimationWithThen = GroupAnimationWithThen; +exports.HTMLProjectionNode = HTMLProjectionNode; +exports.HTMLVisualElement = HTMLVisualElement; +exports.JSAnimation = JSAnimation; +exports.KeyframeResolver = KeyframeResolver; +exports.LayoutAnimationBuilder = LayoutAnimationBuilder; +exports.MotionValue = MotionValue; +exports.NativeAnimation = NativeAnimation; +exports.NativeAnimationExtended = NativeAnimationExtended; +exports.NativeAnimationWrapper = NativeAnimationWrapper; +exports.NodeStack = NodeStack; +exports.ObjectVisualElement = ObjectVisualElement; +exports.SVGVisualElement = SVGVisualElement; +exports.ViewTransitionBuilder = ViewTransitionBuilder; +exports.VisualElement = VisualElement; +exports.acceleratedValues = acceleratedValues; +exports.activeAnimations = activeAnimations; +exports.addAttrValue = addAttrValue; +exports.addDomEvent = addDomEvent; +exports.addScaleCorrector = addScaleCorrector; +exports.addStyleValue = addStyleValue; +exports.addValueToWillChange = addValueToWillChange; +exports.alpha = alpha; +exports.analyseComplexValue = analyseComplexValue; +exports.animateMotionValue = animateMotionValue; +exports.animateSingleValue = animateSingleValue; +exports.animateTarget = animateTarget; +exports.animateValue = animateValue; +exports.animateVariant = animateVariant; +exports.animateView = animateView; +exports.animateVisualElement = animateVisualElement; +exports.animationMapKey = animationMapKey; +exports.applyAxisDelta = applyAxisDelta; +exports.applyBoxDelta = applyBoxDelta; +exports.applyGeneratorOptions = applyGeneratorOptions; +exports.applyPointDelta = applyPointDelta; +exports.applyPxDefaults = applyPxDefaults; +exports.applyTreeDeltas = applyTreeDeltas; +exports.aspectRatio = aspectRatio; +exports.attachFollow = attachFollow; +exports.attachSpring = attachSpring; +exports.attrEffect = attrEffect; +exports.axisDeltaEquals = axisDeltaEquals; +exports.axisEquals = axisEquals; +exports.axisEqualsRounded = axisEqualsRounded; +exports.boxEquals = boxEquals; +exports.boxEqualsRounded = boxEqualsRounded; +exports.buildHTMLStyles = buildHTMLStyles; +exports.buildProjectionTransform = buildProjectionTransform; +exports.buildSVGAttrs = buildSVGAttrs; +exports.buildSVGPath = buildSVGPath; +exports.buildTransform = buildTransform; +exports.calcAxisDelta = calcAxisDelta; +exports.calcBoxDelta = calcBoxDelta; +exports.calcChildStagger = calcChildStagger; +exports.calcGeneratorDuration = calcGeneratorDuration; +exports.calcLength = calcLength; +exports.calcRelativeAxis = calcRelativeAxis; +exports.calcRelativeAxisPosition = calcRelativeAxisPosition; +exports.calcRelativeBox = calcRelativeBox; +exports.calcRelativePosition = calcRelativePosition; +exports.camelCaseAttributes = camelCaseAttributes; +exports.camelToDash = camelToDash; +exports.cancelFrame = cancelFrame; +exports.cancelMicrotask = cancelMicrotask; +exports.cancelSync = cancelSync; +exports.checkVariantsDidChange = checkVariantsDidChange; +exports.cleanDirtyNodes = cleanDirtyNodes; +exports.collectMotionValues = collectMotionValues; +exports.color = color; +exports.compareByDepth = compareByDepth; +exports.complex = complex; +exports.containsCSSVariable = containsCSSVariable; +exports.convertBoundingBoxToBox = convertBoundingBoxToBox; +exports.convertBoxToBoundingBox = convertBoxToBoundingBox; +exports.convertOffsetToTimes = convertOffsetToTimes; +exports.copyAxisDeltaInto = copyAxisDeltaInto; +exports.copyAxisInto = copyAxisInto; +exports.copyBoxInto = copyBoxInto; +exports.correctBorderRadius = correctBorderRadius; +exports.correctBoxShadow = correctBoxShadow; +exports.createAnimationState = createAnimationState; +exports.createAxis = createAxis; +exports.createAxisDelta = createAxisDelta; +exports.createBox = createBox; +exports.createDelta = createDelta; +exports.createGeneratorEasing = createGeneratorEasing; +exports.createProjectionNode = createProjectionNode; +exports.createRenderBatcher = createRenderBatcher; +exports.cubicBezierAsString = cubicBezierAsString; +exports.defaultEasing = defaultEasing; +exports.defaultOffset = defaultOffset; +exports.defaultTransformValue = defaultTransformValue; +exports.defaultValueTypes = defaultValueTypes; +exports.degrees = degrees; +exports.delay = delay; +exports.delayInSeconds = delayInSeconds; +exports.dimensionValueTypes = dimensionValueTypes; +exports.eachAxis = eachAxis; +exports.fillOffset = fillOffset; +exports.fillWildcards = fillWildcards; +exports.findDimensionValueType = findDimensionValueType; +exports.findValueType = findValueType; +exports.flushKeyframeResolvers = flushKeyframeResolvers; +exports.followValue = followValue; +exports.frame = frame; +exports.frameData = frameData; +exports.frameSteps = frameSteps; +exports.generateLinearEasing = generateLinearEasing; +exports.getAnimatableNone = getAnimatableNone; +exports.getAnimationMap = getAnimationMap; +exports.getComputedStyle = getComputedStyle$2; +exports.getDefaultTransition = getDefaultTransition; +exports.getDefaultValueType = getDefaultValueType; +exports.getFeatureDefinitions = getFeatureDefinitions; +exports.getFinalKeyframe = getFinalKeyframe; +exports.getMixer = getMixer; +exports.getOptimisedAppearId = getOptimisedAppearId; +exports.getOriginIndex = getOriginIndex; +exports.getValueAsType = getValueAsType; +exports.getValueTransition = getValueTransition; +exports.getVariableValue = getVariableValue; +exports.getVariantContext = getVariantContext; +exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; +exports.getViewAnimations = getViewAnimations; +exports.globalProjectionState = globalProjectionState; +exports.has2DTranslate = has2DTranslate; +exports.hasReducedMotionListener = hasReducedMotionListener; +exports.hasScale = hasScale; +exports.hasTransform = hasTransform; +exports.hex = hex; +exports.hover = hover; +exports.hsla = hsla; +exports.hslaToRgba = hslaToRgba; +exports.inertia = inertia; +exports.initPrefersReducedMotion = initPrefersReducedMotion; +exports.interpolate = interpolate; +exports.invisibleValues = invisibleValues; +exports.isAnimationControls = isAnimationControls; +exports.isCSSVariableName = isCSSVariableName; +exports.isCSSVariableToken = isCSSVariableToken; +exports.isControllingVariants = isControllingVariants; +exports.isDeltaZero = isDeltaZero; +exports.isDragActive = isDragActive; +exports.isDragging = isDragging; +exports.isElementKeyboardAccessible = isElementKeyboardAccessible; +exports.isElementTextInput = isElementTextInput; +exports.isForcedMotionValue = isForcedMotionValue; +exports.isGenerator = isGenerator; +exports.isHTMLElement = isHTMLElement; +exports.isKeyframesTarget = isKeyframesTarget; +exports.isMotionValue = isMotionValue; +exports.isNear = isNear; +exports.isNodeOrChild = isNodeOrChild; +exports.isPrimaryPointer = isPrimaryPointer; +exports.isSVGElement = isSVGElement; +exports.isSVGSVGElement = isSVGSVGElement; +exports.isSVGTag = isSVGTag; +exports.isTransitionDefined = isTransitionDefined; +exports.isVariantLabel = isVariantLabel; +exports.isVariantNode = isVariantNode; +exports.isWaapiSupportedEasing = isWaapiSupportedEasing; +exports.isWillChangeMotionValue = isWillChangeMotionValue; +exports.keyframes = keyframes; +exports.makeAnimationInstant = makeAnimationInstant; +exports.mapEasingToNativeEasing = mapEasingToNativeEasing; +exports.mapValue = mapValue; +exports.maxGeneratorDuration = maxGeneratorDuration; +exports.measurePageBox = measurePageBox; +exports.measureViewportBox = measureViewportBox; +exports.microtask = microtask; +exports.mix = mix; +exports.mixArray = mixArray; +exports.mixColor = mixColor; +exports.mixComplex = mixComplex; +exports.mixImmediate = mixImmediate; +exports.mixLinearColor = mixLinearColor; +exports.mixNumber = mixNumber$1; +exports.mixObject = mixObject; +exports.mixValues = mixValues; +exports.mixVisibility = mixVisibility; +exports.motionValue = motionValue; +exports.nodeGroup = nodeGroup; +exports.number = number; +exports.numberValueTypes = numberValueTypes; +exports.observeTimeline = observeTimeline; +exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; +exports.optimizedAppearDataId = optimizedAppearDataId; +exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; +exports.parseCSSVariable = parseCSSVariable; +exports.parseValueFromTransform = parseValueFromTransform; +exports.percent = percent; +exports.pixelsToPercent = pixelsToPercent; +exports.positionalKeys = positionalKeys; +exports.prefersReducedMotion = prefersReducedMotion; +exports.press = press; +exports.progressPercentage = progressPercentage; +exports.propEffect = propEffect; +exports.propagateDirtyNodes = propagateDirtyNodes; +exports.px = px; +exports.readTransformValue = readTransformValue; +exports.recordStats = recordStats; +exports.removeAxisDelta = removeAxisDelta; +exports.removeAxisTransforms = removeAxisTransforms; +exports.removeBoxTransforms = removeBoxTransforms; +exports.removePointDelta = removePointDelta; +exports.renderHTML = renderHTML; +exports.renderSVG = renderSVG; +exports.resize = resize; +exports.resolveElements = resolveElements; +exports.resolveMotionValue = resolveMotionValue; +exports.resolveTransition = resolveTransition; +exports.resolveVariant = resolveVariant; +exports.resolveVariantFromProps = resolveVariantFromProps; +exports.rgbUnit = rgbUnit; +exports.rgba = rgba; +exports.rootProjectionNode = rootProjectionNode; +exports.scale = scale; +exports.scaleCorrectors = scaleCorrectors; +exports.scalePoint = scalePoint; +exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; +exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; +exports.setDragLock = setDragLock; +exports.setFeatureDefinitions = setFeatureDefinitions; +exports.setStyle = setStyle; +exports.setTarget = setTarget; +exports.spring = spring; +exports.springValue = springValue; +exports.stagger = stagger; +exports.startWaapiAnimation = startWaapiAnimation; +exports.statsBuffer = statsBuffer; +exports.styleEffect = styleEffect; +exports.supportedWaapiEasing = supportedWaapiEasing; +exports.supportsBrowserAnimation = supportsBrowserAnimation; +exports.supportsFlags = supportsFlags; +exports.supportsLinearEasing = supportsLinearEasing; +exports.supportsPartialKeyframes = supportsPartialKeyframes; +exports.supportsScrollTimeline = supportsScrollTimeline; +exports.svgEffect = svgEffect; +exports.sync = sync; +exports.testValueType = testValueType; +exports.time = time; +exports.transform = transform; +exports.transformAxis = transformAxis; +exports.transformBox = transformBox; +exports.transformBoxPoints = transformBoxPoints; +exports.transformPropOrder = transformPropOrder; +exports.transformProps = transformProps; +exports.transformValue = transformValue; +exports.transformValueTypes = transformValueTypes; +exports.translateAxis = translateAxis; +exports.updateMotionValuesFromProps = updateMotionValuesFromProps; +exports.variantPriorityOrder = variantPriorityOrder; +exports.variantProps = variantProps; +exports.vh = vh; +exports.visualElementStore = visualElementStore; +exports.vw = vw; +//# sourceMappingURL=index.js.map diff --git a/node_modules/motion-dom/dist/cjs/index.js.map b/node_modules/motion-dom/dist/cjs/index.js.map new file mode 100644 index 00000000..d222674f --- /dev/null +++ b/node_modules/motion-dom/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../src/frameloop/order.ts","../../src/stats/buffer.ts","../../src/frameloop/render-step.ts","../../src/frameloop/batcher.ts","../../src/frameloop/frame.ts","../../src/frameloop/sync-time.ts","../../src/stats/animation-count.ts","../../src/animation/utils/is-css-variable.ts","../../src/value/types/numbers/index.ts","../../src/value/types/utils/sanitize.ts","../../src/value/types/utils/float-regex.ts","../../src/value/types/utils/is-nullish.ts","../../src/value/types/utils/single-color-regex.ts","../../src/value/types/color/utils.ts","../../src/value/types/color/rgba.ts","../../src/value/types/color/hex.ts","../../src/value/types/numbers/units.ts","../../src/value/types/color/hsla.ts","../../src/value/types/color/index.ts","../../src/value/types/utils/color-regex.ts","../../src/value/types/complex/index.ts","../../src/value/types/color/hsla-to-rgba.ts","../../src/utils/mix/immediate.ts","../../src/utils/mix/number.ts","../../src/utils/mix/color.ts","../../src/utils/mix/visibility.ts","../../src/utils/mix/complex.ts","../../src/utils/mix/index.ts","../../src/animation/drivers/frame.ts","../../src/animation/waapi/utils/linear.ts","../../src/animation/generators/utils/calc-duration.ts","../../src/animation/generators/utils/create-generator-easing.ts","../../src/animation/generators/utils/velocity.ts","../../src/animation/generators/spring/defaults.ts","../../src/animation/generators/spring/find.ts","../../src/animation/generators/spring/index.ts","../../src/animation/generators/inertia.ts","../../src/utils/interpolate.ts","../../src/animation/keyframes/offsets/fill.ts","../../src/animation/keyframes/offsets/default.ts","../../src/animation/keyframes/offsets/time.ts","../../src/animation/generators/keyframes.ts","../../src/animation/keyframes/get-final.ts","../../src/animation/utils/replace-transition-type.ts","../../src/animation/utils/WithPromise.ts","../../src/animation/JSAnimation.ts","../../src/animation/keyframes/utils/fill-wildcards.ts","../../src/render/dom/parse-transform.ts","../../src/render/utils/keys-transform.ts","../../src/animation/keyframes/utils/unit-conversion.ts","../../src/animation/keyframes/KeyframesResolver.ts","../../src/render/dom/is-css-var.ts","../../src/render/dom/style-set.ts","../../src/utils/supports/flags.ts","../../src/utils/supports/memo.ts","../../src/utils/supports/scroll-timeline.ts","../../src/utils/supports/linear-easing.ts","../../src/animation/waapi/easing/cubic-bezier.ts","../../src/animation/waapi/easing/supported.ts","../../src/animation/waapi/easing/map-easing.ts","../../src/animation/waapi/start-waapi-animation.ts","../../src/animation/generators/utils/is-generator.ts","../../src/animation/waapi/utils/apply-generator.ts","../../src/animation/NativeAnimation.ts","../../src/animation/waapi/utils/unsupported-easing.ts","../../src/animation/NativeAnimationExtended.ts","../../src/animation/utils/is-animatable.ts","../../src/animation/utils/can-animate.ts","../../src/animation/utils/make-animation-instant.ts","../../src/animation/waapi/supports/waapi.ts","../../src/animation/AsyncMotionValueAnimation.ts","../../src/animation/GroupAnimation.ts","../../src/animation/GroupAnimationWithThen.ts","../../src/animation/NativeAnimationWrapper.ts","../../src/animation/utils/active-animations.ts","../../src/animation/utils/calc-child-stagger.ts","../../src/animation/utils/css-variables-conversion.ts","../../src/animation/utils/default-transitions.ts","../../src/animation/utils/get-final-keyframe.ts","../../src/animation/utils/resolve-transition.ts","../../src/animation/utils/get-value-transition.ts","../../src/animation/utils/is-transition-defined.ts","../../src/animation/interfaces/motion-value.ts","../../src/render/utils/resolve-variants.ts","../../src/render/utils/resolve-dynamic-variants.ts","../../src/render/utils/keys-position.ts","../../src/value/index.ts","../../src/render/utils/is-keyframes-target.ts","../../src/render/utils/setters.ts","../../src/value/utils/is-motion-value.ts","../../src/value/will-change/is.ts","../../src/value/will-change/add-will-change.ts","../../src/render/dom/utils/camel-to-dash.ts","../../src/animation/optimized-appear/data-id.ts","../../src/animation/optimized-appear/get-appear-id.ts","../../src/animation/interfaces/visual-element-target.ts","../../src/animation/interfaces/visual-element-variant.ts","../../src/animation/interfaces/visual-element.ts","../../src/value/types/auto.ts","../../src/value/types/test.ts","../../src/value/types/dimensions.ts","../../src/animation/keyframes/utils/is-none.ts","../../src/value/types/complex/filter.ts","../../src/value/types/complex/mask.ts","../../src/value/types/int.ts","../../src/value/types/maps/transform.ts","../../src/value/types/maps/number.ts","../../src/value/types/maps/defaults.ts","../../src/value/types/utils/animatable-none.ts","../../src/animation/keyframes/utils/make-none-animatable.ts","../../src/animation/keyframes/DOMKeyframesResolver.ts","../../src/animation/waapi/utils/px-values.ts","../../src/animation/keyframes/utils/apply-px-defaults.ts","../../src/animation/waapi/easing/is-supported.ts","../../src/animation/waapi/supports/partial-keyframes.ts","../../src/animation/waapi/utils/accelerated-values.ts","../../src/utils/resolve-elements.ts","../../src/effects/utils/create-dom-effect.ts","../../src/value/types/utils/get-as-type.ts","../../src/effects/MotionValueState.ts","../../src/effects/utils/create-effect.ts","../../src/effects/attr/index.ts","../../src/effects/prop/index.ts","../../src/utils/is-html-element.ts","../../src/effects/style/transform.ts","../../src/effects/style/index.ts","../../src/effects/svg/index.ts","../../src/frameloop/microtask.ts","../../src/gestures/drag/state/is-active.ts","../../src/gestures/drag/state/set-active.ts","../../src/gestures/utils/setup.ts","../../src/gestures/hover.ts","../../src/gestures/utils/is-node-or-child.ts","../../src/gestures/utils/is-primary-pointer.ts","../../src/gestures/press/utils/is-keyboard-accessible.ts","../../src/gestures/press/utils/state.ts","../../src/gestures/press/utils/keyboard.ts","../../src/gestures/press/index.ts","../../src/render/dom/style-computed.ts","../../src/utils/is-svg-element.ts","../../src/resize/handle-element.ts","../../src/resize/handle-window.ts","../../src/resize/index.ts","../../src/scroll/observe.ts","../../src/stats/index.ts","../../src/utils/is-svg-svg-element.ts","../../src/utils/stagger.ts","../../src/utils/transform.ts","../../src/value/follow-value.ts","../../src/value/subscribe-value.ts","../../src/value/transform-value.ts","../../src/value/map-value.ts","../../src/value/spring-value.ts","../../src/value/types/utils/find.ts","../../src/view/utils/choose-layer-type.ts","../../src/view/utils/css.ts","../../src/view/utils/get-layer-info.ts","../../src/view/utils/get-view-animations.ts","../../src/view/utils/has-target.ts","../../src/view/start.ts","../../src/view/queue.ts","../../src/view/index.ts","../../src/projection/geometry/models.ts","../../src/render/store.ts","../../src/render/utils/is-animation-controls.ts","../../src/render/utils/is-variant-label.ts","../../src/render/utils/variant-props.ts","../../src/render/utils/is-controlling-variants.ts","../../src/render/utils/motion-values.ts","../../src/render/utils/reduced-motion/state.ts","../../src/render/utils/reduced-motion/index.ts","../../src/render/VisualElement.ts","../../src/render/dom/DOMVisualElement.ts","../../src/render/Feature.ts","../../src/projection/geometry/conversion.ts","../../src/projection/utils/has-transform.ts","../../src/projection/geometry/delta-apply.ts","../../src/projection/utils/measure.ts","../../src/render/html/utils/build-transform.ts","../../src/render/html/utils/build-styles.ts","../../src/render/html/utils/render.ts","../../src/projection/styles/scale-border-radius.ts","../../src/projection/styles/scale-box-shadow.ts","../../src/projection/styles/scale-correction.ts","../../src/render/utils/is-forced-motion-value.ts","../../src/render/html/utils/scrape-motion-values.ts","../../src/render/html/HTMLVisualElement.ts","../../src/render/object/ObjectVisualElement.ts","../../src/render/svg/utils/path.ts","../../src/render/svg/utils/build-attrs.ts","../../src/render/svg/utils/camel-case-attrs.ts","../../src/render/svg/utils/is-svg-tag.ts","../../src/render/svg/utils/render.ts","../../src/render/svg/utils/scrape-motion-values.ts","../../src/render/svg/SVGVisualElement.ts","../../src/render/utils/get-variant-context.ts","../../src/render/utils/shallow-compare.ts","../../src/render/utils/animation-state.ts","../../src/projection/geometry/copy.ts","../../src/projection/geometry/delta-calc.ts","../../src/projection/geometry/delta-remove.ts","../../src/projection/geometry/utils.ts","../../src/projection/utils/each-axis.ts","../../src/projection/styles/transform.ts","../../src/projection/animation/mix-values.ts","../../src/animation/animate/single-value.ts","../../src/events/add-dom-event.ts","../../src/projection/utils/compare-by-depth.ts","../../src/projection/utils/flat-tree.ts","../../src/utils/delay.ts","../../src/value/utils/resolve-motion-value.ts","../../src/projection/shared/stack.ts","../../src/projection/node/state.ts","../../src/projection/node/create-projection-node.ts","../../src/projection/node/DocumentProjectionNode.ts","../../src/projection/node/group.ts","../../src/projection/node/HTMLProjectionNode.ts","../../src/layout/LayoutAnimationBuilder.ts","../../src/frameloop/index-legacy.ts"],"sourcesContent":["import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n","import type { StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: {\n nodes: number\n calculatedTargetDeltas: number\n calculatedProjections: number\n }) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n","import { statsBuffer } from \"../stats/buffer\"\nimport { StepNames } from \"./order\"\nimport { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(\n runNextFrame: () => void,\n stepName?: StepNames\n): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set()\n let nextFrame = new Set()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n let numCalls = 0\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n numCalls++\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n if (!queue.has(callback)) queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n ;[thisFrame, nextFrame] = [nextFrame, thisFrame]\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls)\n }\n numCalls = 0\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(\n flagRunNextFrame,\n allowKeepAlive ? key : undefined\n )\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n","import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n","export const activeAnimations = {\n layout: 0,\n mainThread: 0,\n waapi: 0,\n}\n","import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n (token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n","import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n","export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n","export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n","export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n","import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n (aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n","import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n","import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n","import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n","import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n","export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n const { split, types } = analyseComplexValue(source)\n\n const numSections = split.length\n return (v: Array) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const parsed = parseComplexValue(v)\n const transformer = createTransformer(v)\n return transformer(parsed.map(convertNumbersToZero))\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n","import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n","export function mixImmediate(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n","import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n","export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n","import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n","import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix(from: T, to: T): Mixer\nexport function mix(from: number, to: number, p: number): number\nexport function mix(from: T, to: T, p?: T): Mixer | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer\n}\n","import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n","import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n","import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator\n): number {\n let duration = 0\n const timeStep = 50\n let state = generator.next(duration)\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep\n state = generator.next(duration)\n }\n\n return duration >= maxGeneratorDuration ? Infinity : duration\n}\n","import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n","import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function calcGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n","export const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n}\n","import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport { SpringOptions } from \"../../types\"\nimport { springDefaults } from \"./defaults\"\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\n\ntype Resolver = (num: number) => number\n\nconst safeMin = 0.001\n\nexport function findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: Resolver\n let derivative: Resolver\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: Resolver,\n derivative: Resolver,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\nexport function calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n","import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../../types\"\nimport { generateLinearEasing } from \"../../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"../utils/calc-duration\"\nimport { createGeneratorEasing } from \"../utils/create-generator-easing\"\nimport { calcGeneratorVelocity } from \"../utils/velocity\"\nimport { springDefaults } from \"./defaults\"\nimport { calcAngularFreq, findSpring } from \"./find\"\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring(options)\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t: number) => {\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0\n\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current)\n }\n\n const isBelowVelocityThreshold =\n Math.abs(currentVelocity) <= restSpeed!\n const isBelowDisplacementThreshold =\n Math.abs(target - current) <= restDelta!\n\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n","import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { calcGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions): KeyframeGenerator {\n const origin = keyframes[0]\n\n const state: AnimationState = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n","import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory\n}\n\nfunction createMixers(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory\n) {\n const mixers: Array> = []\n const mixerFactory: MixerFactory =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n","import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n","import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n","export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n","import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions): KeyframeGenerator {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n","import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n","import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n","export class WithPromise {\n protected _finished: Promise\n\n resolve: VoidFunction\n\n constructor() {\n this.updateFinished()\n }\n\n get finished() {\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve\n })\n }\n\n protected notifyFinished() {\n this.resolve()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n","import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { activeAnimations } from \"../stats/animation-count\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer | undefined\n\n private mirroredGenerator: KeyframeGenerator | undefined\n\n constructor(options: ValueAnimationOptions) {\n super()\n activeAnimations.mainThread++\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed)\n\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n this.driver?.start(false)\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n this.updateTime(time.now())\n const hasChanged = this.playbackSpeed !== newSpeed\n this.playbackSpeed = newSpeed\n\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n activeAnimations.mainThread--\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue(\n options: ValueAnimationOptions\n) {\n return new JSAnimation(options)\n}\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n","import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set(transformPropOrder))()\n","import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) =>\n x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) =>\n y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n","import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes = Array\n\nexport type ResolvedKeyframes = Array\n\nconst toResolve = new Set()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved = (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes\n\n private motionValue?: MotionValue\n private onComplete: OnKeyframesResolved\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n","export const isCSSVar = (name: string) => name.startsWith(\"--\")\n","import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record = {}\n","import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n","import { ProgressTimeline } from \"../..\"\nimport { memoSupports } from \"./memo\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nexport const supportsScrollTimeline = /* @__PURE__ */ memoSupports(\n () => window.ScrollTimeline !== undefined,\n \"scrollTimeline\"\n)\n","import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n","import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n","import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n","import { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n if (statsBuffer.value) {\n activeAnimations.waapi++\n }\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n const animation = element.animate(keyframeOptions, options)\n\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--\n })\n }\n\n return animation\n}\n","import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n","import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n","import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions\n extends DOMValueAnimationOptions {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n } else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe)\n }\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n const element = this.options?.element\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n return noop\n } else {\n return observe(this)\n }\n }\n}\n","import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n","import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended =\n NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n options: NativeAnimationOptionsExtended\n\n constructor(options: NativeAnimationOptionsExtended) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n if (options.startTime !== undefined) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n sampleAnimation.sample(sampleTime).value,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n","import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * āœ…: 100, \"100px\", \"#fff\"\n * āŒ: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n","import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n","import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n","import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation(\n options: ValueAnimationOptionsWithRenderContext\n) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } =\n options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n","import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes = Omit<\n ValueAnimationOptions,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n const animation = useWaapi\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n : new JSAnimation(resolvedOptions)\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n","import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accomadate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n","import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n","import { NativeAnimation } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"./types\"\n\nexport class NativeAnimationWrapper<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n constructor(animation: Animation) {\n super()\n\n this.animation = animation\n animation.onfinish = () => {\n this.finishedTime = this.time\n this.notifyFinished()\n }\n }\n}\n","import { NativeAnimation } from \"../NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"../types\"\n\nconst animationMaps = new WeakMap<\n Element,\n Map>\n>()\nexport const animationMapKey = (name: string, pseudoElement: string = \"\") =>\n `${name}:${pseudoElement}`\n\nexport function getAnimationMap(element: Element) {\n const map = animationMaps.get(element) || new Map()\n animationMaps.set(element, map)\n\n return map\n}\n","import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set,\n child: VisualElement,\n delayChildren?: number | DynamicOption,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child)\n const numChildren = children.size\n const maxStaggerDuration = (numChildren - 1) * staggerChildren\n const delayIsFunction = typeof delayChildren === \"function\"\n\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n","import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n","import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n","import type { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const index =\n repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nexport function resolveTransition(\n transition: any,\n parentTransition?: any\n) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition\n return { ...parentTransition, ...rest }\n }\n\n return transition\n}\n","import { resolveTransition } from \"./resolve-transition\"\n\nexport function getValueTransition(transition: any, key: string) {\n const valueTransition =\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition)\n }\n\n return valueTransition\n}\n","import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined({\n when,\n delay: _delay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n repeat,\n repeatType,\n repeatDelay,\n from,\n elapsed,\n ...transition\n}: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }) {\n return !!Object.keys(transition).length\n}\n","import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../utils/get-final-keyframe\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n (\n name: string,\n value: MotionValue,\n target: V | UnresolvedKeyframes,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n","import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n","import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n","import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n on>(\n eventName: EventName,\n callback: MotionValueEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue(init: V, options?: MotionValueOptions) {\n return new MotionValue(init, options)\n}\n","import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n","import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n","import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n","import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n","export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n","import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n","import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { resolveTransition } from \"../utils/resolve-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition,\n transitionEnd,\n ...target\n } = targetAndTransition\n\n const defaultTransition = visualElement.getDefaultTransition()\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition\n\n const reduceMotion = (transition as { reduceMotion?: boolean })?.reduceMotion\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n const shouldReduceMotion =\n reduceMotion ?? visualElement.shouldReduceMotion\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd)\n } else {\n applyTransitionEnd()\n }\n }\n\n return animations\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise {\n const resolved = resolveVariant(\n visualElement,\n variant,\n options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n let { transition = visualElement.getDefaultTransition() || {} } =\n resolved || {}\n\n if (options.transitionOverride) {\n transition = options.transitionOverride\n }\n\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation: () => Promise = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve()\n\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations =\n visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n\n return animateChildren(\n visualElement,\n variant,\n forwardDelay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n options\n )\n }\n : () => Promise.resolve()\n\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition\n if (when) {\n const [first, last] =\n when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation]\n\n return first().then(() => last())\n } else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)])\n }\n}\n\nfunction animateChildren(\n visualElement: VisualElement,\n variant: string,\n delay: number = 0,\n delayChildren: number | DynamicOption = 0,\n staggerChildren = 0,\n staggerDirection = 1,\n options: VisualElementAnimationOptions\n) {\n const animations: Promise[] = []\n\n for (const child of visualElement.variantChildren!) {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(\n visualElement.variantChildren!,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n }\n\n return Promise.all(animations)\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n","import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n","import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n","import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n","import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n","import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n","import { complex } from \".\"\nimport { AnyResolvedKeyframe } from \"../../../animation/types\"\n\nexport const mask = {\n ...complex,\n getAnimatableNone: (v: AnyResolvedKeyframe) => {\n const parsed = complex.parse(v)\n const transformer = complex.createTransformer(v)\n return transformer(\n parsed.map((v) =>\n typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v\n )\n )\n },\n}\n","import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n","import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n","import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n","import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n","import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask])\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (!customTypes.has(defaultValueType as any)) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n","import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n","import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n","export const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\nimport { pxValues } from \"../../waapi/utils/px-values\"\n\nexport function applyPxDefaults(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[],\n name: string\n) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\"\n }\n }\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n","import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n","/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved\n // or until we implement support for linear() easing.\n // \"background-color\"\n])\n","export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\n\nexport function createSelectorEffect(\n subjectEffect: (\n subject: T,\n values: Record\n ) => VoidFunction\n) {\n return (\n subject: ElementOrSelector,\n values: Record\n ) => {\n const elements = resolveElements(subject)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n}\n","import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n","import { AnyResolvedKeyframe } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop/frame\"\nimport { MotionValue } from \"../value\"\nimport { numberValueTypes } from \"../value/types/maps/number\"\nimport { getValueAsType } from \"../value/types/utils/get-as-type\"\n\nexport class MotionValueState {\n latest: { [name: string]: AnyResolvedKeyframe } = {}\n\n private values = new Map<\n string,\n { value: MotionValue; onRemove: VoidFunction }\n >()\n\n set(\n name: string,\n value: MotionValue,\n render?: VoidFunction,\n computed?: MotionValue,\n useDefaultValueType = true\n ) {\n const existingValue = this.values.get(name)\n\n if (existingValue) {\n existingValue.onRemove()\n }\n\n const onChange = () => {\n const v = value.get()\n\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name])\n } else {\n this.latest[name] = v\n }\n\n render && frame.render(render)\n }\n\n onChange()\n\n const cancelOnChange = value.on(\"change\", onChange)\n\n computed && value.addDependent(computed)\n\n const remove = () => {\n cancelOnChange()\n render && cancelFrame(render)\n this.values.delete(name)\n computed && value.removeDependent(computed)\n }\n\n this.values.set(name, { value, onRemove: remove })\n\n return remove\n }\n\n get(name: string): MotionValue | undefined {\n return this.values.get(name)?.value\n }\n\n destroy() {\n for (const value of this.values.values()) {\n value.onRemove()\n }\n }\n}\n","import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nexport function createEffect(\n addValue: (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => VoidFunction\n) {\n const stateCache = new WeakMap()\n const subscriptions: VoidFunction[] = []\n\n return (\n subject: Subject,\n values: Record\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState()\n\n stateCache.set(subject, state)\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction canSetAsProperty(element: HTMLElement | SVGElement, name: string) {\n if (!(name in element)) return false\n\n const descriptor =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||\n Object.getOwnPropertyDescriptor(element, name)\n\n // Check if it has a setter\n return descriptor && typeof descriptor.set === \"function\"\n}\n\nexport const addAttrValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n const isProp = canSetAsProperty(element, key)\n const name = isProp\n ? key\n : key.startsWith(\"data\") || key.startsWith(\"aria\")\n ? camelToDash(key)\n : key\n\n /**\n * Set attribute directly via property if available\n */\n const render = isProp\n ? () => {\n ;(element as any)[name] = state.latest[key]\n }\n : () => {\n const v = state.latest[key]\n if (v === null || v === undefined) {\n element.removeAttribute(name)\n } else {\n element.setAttribute(name, String(v))\n }\n }\n\n return state.set(key, value, render)\n}\n\nexport const attrEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addAttrValue)\n)\n","import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createEffect } from \"../utils/create-effect\"\n\nexport const propEffect = /*@__PURE__*/ createEffect(\n (\n subject: { [key: string]: any },\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => {\n return state.set(\n key,\n value,\n () => {\n subject[key] = state.latest[key]\n },\n undefined,\n false\n )\n }\n)\n","import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return isObject(element) && \"offsetHeight\" in element\n}\n","import { transformPropOrder } from \"../../render/utils/keys-transform\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nexport function buildTransform(state: MotionValueState) {\n let transform = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = state.latest[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n const valueToRender = state.latest[key]\n transform += `${transformName}(${valueToRender}) `\n }\n }\n\n return transformIsDefault ? \"none\" : transform.trim()\n}\n","import { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { transformProps } from \"../../render/utils/keys-transform\"\nimport { isHTMLElement } from \"../../utils/is-html-element\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\nimport { buildTransform } from \"./transform\"\n\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"])\n\nexport const addStyleValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n let render: VoidFunction | undefined = undefined\n let computed: MotionValue | undefined = undefined\n\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(\n element,\n state,\n \"transformBox\",\n new MotionValue(\"fill-box\")\n )\n }\n\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state)\n })\n }\n\n computed = state.get(\"transform\")\n } else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\"\n const originY = state.latest.originY ?? \"50%\"\n const originZ = state.latest.originZ ?? 0\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`\n })\n }\n\n computed = state.get(\"transformOrigin\")\n } else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key] as string)\n }\n } else {\n render = () => {\n element.style[key as any] = state.latest[key] as string\n }\n }\n\n return state.set(key, value, render, computed)\n}\n\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addStyleValue)\n)\n","import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { addAttrValue } from \"../attr\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { addStyleValue } from \"../style\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction addSVGPathValue(\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) {\n frame.render(() => element.setAttribute(\"pathLength\", \"1\"))\n\n if (key === \"pathOffset\") {\n return state.set(key, value, () => {\n // Use unitless value to avoid Safari zoom bug\n const offset = state.latest[key]\n element.setAttribute(\"stroke-dashoffset\", `${-offset}`)\n })\n } else {\n if (!state.get(\"stroke-dasharray\")) {\n state.set(\"stroke-dasharray\", new MotionValue(\"1 1\"), () => {\n const { pathLength = 1, pathSpacing } = state.latest\n\n // Use unitless values to avoid Safari zoom bug\n element.setAttribute(\n \"stroke-dasharray\",\n `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`\n )\n })\n }\n\n return state.set(key, value, undefined, state.get(\"stroke-dasharray\"))\n }\n}\n\nconst addSVGValue = (\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n if (key.startsWith(\"path\")) {\n return addSVGPathValue(element, state, key, value)\n } else if (key.startsWith(\"attr\")) {\n return addAttrValue(element, state, convertAttrKey(key), value)\n }\n\n const handler = key in element.style ? addStyleValue : addAttrValue\n return handler(element, state, key, value)\n}\n\nexport const svgEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addSVGValue)\n)\n\nfunction convertAttrKey(key: string) {\n return key.replace(/^attr([A-Z])/, (_, firstChar) =>\n firstChar.toLowerCase()\n )\n}\n","import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n","export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n","import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nexport const isNodeOrChild = (\n parent: Element | null,\n child?: Element | null\n): boolean => {\n if (!child) {\n return false\n } else if (parent === child) {\n return true\n } else {\n return isNodeOrChild(parent, child.parentElement)\n }\n}\n","export const isPrimaryPointer = (event: PointerEvent) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0\n } else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false\n }\n}\n","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n","export const isPressing = new WeakSet()\n","import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n","import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\"pointerup\", onPointerUp)\n window.removeEventListener(\"pointercancel\", onPointerCancel)\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions)\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions)\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n","import { isCSSVar } from \"./is-css-var\"\n\nexport function getComputedStyle(\n element: HTMLElement | SVGElement,\n name: string\n) {\n const computedStyle = window.getComputedStyle(element)\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name as any]\n}\n","import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n","import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if (!elementHandlers?.size) {\n observer?.unobserve(element)\n }\n })\n }\n}\n","import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { resizeElement } from \"./handle-element\"\nimport { resizeWindow } from \"./handle-window\"\nimport { ResizeHandler, WindowResizeHandler } from \"./types\"\n\nexport function resize(onResize: WindowResizeHandler): VoidFunction\nexport function resize(\n target: ElementOrSelector,\n onResize: ResizeHandler\n): VoidFunction\nexport function resize(\n a: WindowResizeHandler | ElementOrSelector,\n b?: ResizeHandler\n) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b!)\n}\n","import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n","import { cancelFrame, frame, frameData } from \"../frameloop\"\nimport { activeAnimations } from \"./animation-count\"\nimport { ActiveStatsBuffer, statsBuffer } from \"./buffer\"\nimport { StatsSummary, Summary } from \"./types\"\n\nfunction record() {\n const { value } = statsBuffer\n\n if (value === null) {\n cancelFrame(record)\n return\n }\n\n value.frameloop.rate.push(frameData.delta)\n value.animations.mainThread.push(activeAnimations.mainThread)\n value.animations.waapi.push(activeAnimations.waapi)\n value.animations.layout.push(activeAnimations.layout)\n}\n\nfunction mean(values: number[]) {\n return values.reduce((acc, value) => acc + value, 0) / values.length\n}\n\nfunction summarise(\n values: number[],\n calcAverage: (allValues: number[]) => number = mean\n): Summary {\n if (values.length === 0) {\n return {\n min: 0,\n max: 0,\n avg: 0,\n }\n }\n\n return {\n min: Math.min(...values),\n max: Math.max(...values),\n avg: calcAverage(values),\n }\n}\n\nconst msToFps = (ms: number) => Math.round(1000 / ms)\n\nfunction clearStatsBuffer() {\n statsBuffer.value = null\n statsBuffer.addProjectionMetrics = null\n}\n\nfunction reportStats(): StatsSummary {\n const { value } = statsBuffer\n\n if (!value) {\n throw new Error(\"Stats are not being measured\")\n }\n\n clearStatsBuffer()\n cancelFrame(record)\n\n const summary = {\n frameloop: {\n setup: summarise(value.frameloop.setup),\n rate: summarise(value.frameloop.rate),\n read: summarise(value.frameloop.read),\n resolveKeyframes: summarise(value.frameloop.resolveKeyframes),\n preUpdate: summarise(value.frameloop.preUpdate),\n update: summarise(value.frameloop.update),\n preRender: summarise(value.frameloop.preRender),\n render: summarise(value.frameloop.render),\n postRender: summarise(value.frameloop.postRender),\n },\n animations: {\n mainThread: summarise(value.animations.mainThread),\n waapi: summarise(value.animations.waapi),\n layout: summarise(value.animations.layout),\n },\n layoutProjection: {\n nodes: summarise(value.layoutProjection.nodes),\n calculatedTargetDeltas: summarise(\n value.layoutProjection.calculatedTargetDeltas\n ),\n calculatedProjections: summarise(\n value.layoutProjection.calculatedProjections\n ),\n },\n }\n\n /**\n * Convert the rate to FPS\n */\n const { rate } = summary.frameloop\n rate.min = msToFps(rate.min)\n rate.max = msToFps(rate.max)\n rate.avg = msToFps(rate.avg)\n // Swap these as the min and max are inverted when converted to FPS\n ;[rate.min, rate.max] = [rate.max, rate.min]\n\n return summary\n}\n\nexport function recordStats() {\n if (statsBuffer.value) {\n clearStatsBuffer()\n throw new Error(\"Stats are already being measured\")\n }\n\n const newStatsBuffer = statsBuffer as unknown as ActiveStatsBuffer\n\n newStatsBuffer.value = {\n frameloop: {\n setup: [],\n rate: [],\n read: [],\n resolveKeyframes: [],\n preUpdate: [],\n update: [],\n preRender: [],\n render: [],\n postRender: [],\n },\n animations: {\n mainThread: [],\n waapi: [],\n layout: [],\n },\n layoutProjection: {\n nodes: [],\n calculatedTargetDeltas: [],\n calculatedProjections: [],\n },\n }\n\n newStatsBuffer.addProjectionMetrics = (metrics) => {\n const { layoutProjection } = newStatsBuffer.value\n layoutProjection.nodes.push(metrics.nodes)\n layoutProjection.calculatedTargetDeltas.push(\n metrics.calculatedTargetDeltas\n )\n layoutProjection.calculatedProjections.push(\n metrics.calculatedProjections\n )\n }\n\n frame.postRender(record, true)\n\n return reportStats\n}\n","import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n","import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin = \"first\" | \"last\" | \"center\" | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease }: StaggerOptions = {}\n): DynamicOption {\n return (i: number, total: number) => {\n const fromIndex =\n typeof from === \"number\" ? from : getOriginIndex(from, total)\n const distance = Math.abs(fromIndex - i)\n let delay = duration * distance\n\n if (ease) {\n const maxDelay = total * duration\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n","import { EasingFunction } from \"motion-utils\"\nimport { interpolate } from \"./interpolate\"\n\n/**\n * @public\n */\nexport interface TransformOptions {\n /**\n * Clamp values to within the given range. Defaults to `true`\n *\n * @public\n */\n clamp?: boolean\n\n /**\n * Easing functions to use on the interpolations between each value in the input and output ranges.\n *\n * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.\n *\n * @public\n */\n ease?: EasingFunction | EasingFunction[]\n\n /**\n * Provide a function that can interpolate between any two values in the provided range.\n *\n * @public\n */\n mixer?: (from: T, to: T) => (v: number) => any\n}\n\n/**\n * Transforms numbers into other values by mapping them from an input range to an output range.\n * Returns the type of the input provided.\n *\n * @remarks\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [0, 200]\n * const outputRange = [0, 1]\n * const output = transform(100, inputRange, outputRange)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n * ```\n *\n * @param inputValue - A number to transform between the input and output ranges.\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.\n * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputValue: number,\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): T\n/**\n *\n * Transforms numbers into other values by mapping them from an input range to an output range.\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [-200, -100, 100, 200]\n * const outputRange = [0, 1, 1, 0]\n * const convertRange = transform(inputRange, outputRange)\n * const output = convertRange(-150)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n *\n * ```\n *\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options - Clamp: clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): (inputValue: number) => T\nexport function transform(\n ...args:\n | [number, number[], T[], TransformOptions?]\n | [number[], T[], TransformOptions?]\n) {\n const useImmediate = !Array.isArray(args[0])\n const argOffset = useImmediate ? 0 : -1\n const inputValue = args[0 + argOffset] as number\n const inputRange = args[1 + argOffset] as number[]\n const outputRange = args[2 + argOffset] as T[]\n const options = args[3 + argOffset] as TransformOptions\n\n const interpolator = interpolate(inputRange, outputRange, options)\n\n return useImmediate ? interpolator(inputValue) : interpolator\n}\n","import { MotionValue, motionValue } from \".\"\nimport { JSAnimation } from \"../animation/JSAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationTransition } from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Options for useFollowValue hook, extending ValueAnimationTransition\n * but excluding lifecycle callbacks that don't make sense for the hook pattern.\n */\nexport type FollowValueOptions = Omit<\n ValueAnimationTransition,\n \"onUpdate\" | \"onComplete\" | \"onPlay\" | \"onRepeat\" | \"onStop\"\n>\n\n/**\n * Create a `MotionValue` that animates to its latest value using any transition type.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = followValue(x, { type: \"spring\", stiffness: 300 })\n * // or with tween\n * const z = followValue(x, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function followValue(\n source: T | MotionValue,\n options?: FollowValueOptions\n) {\n const initialValue = isMotionValue(source) ? source.get() : source\n const value = motionValue(initialValue)\n\n attachFollow(value, source, options)\n\n return value\n}\n\n/**\n * Attach an animation to a MotionValue that will animate whenever the value changes.\n * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.)\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachFollow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowValueOptions = {}\n): VoidFunction {\n const initialValue = value.get()\n\n let activeAnimation: JSAnimation | null = null\n let latestValue = initialValue\n let latestSetter: (v: T) => void\n\n const unit =\n typeof initialValue === \"string\"\n ? initialValue.replace(/[\\d.-]/g, \"\")\n : undefined\n\n const stopAnimation = () => {\n if (activeAnimation) {\n activeAnimation.stop()\n activeAnimation = null\n }\n }\n\n const startAnimation = () => {\n stopAnimation()\n\n const currentValue = asNumber(value.get())\n const targetValue = asNumber(latestValue)\n\n // Don't animate if we're already at the target\n if (currentValue === targetValue) {\n return\n }\n\n activeAnimation = new JSAnimation({\n keyframes: [currentValue, targetValue],\n velocity: value.getVelocity(),\n // Default to spring if no type specified (matches useSpring behavior)\n type: \"spring\",\n restDelta: 0.001,\n restSpeed: 0.01,\n ...options,\n onUpdate: latestSetter,\n })\n }\n\n value.attach((v, set) => {\n latestValue = v\n latestSetter = (latest) => set(parseValue(latest, unit) as T)\n\n frame.postRender(() => {\n startAnimation()\n value[\"events\"].animationStart?.notify()\n activeAnimation?.then(() => {\n value[\"events\"].animationComplete?.notify()\n })\n })\n }, stopAnimation)\n\n if (isMotionValue(source)) {\n const removeSourceOnChange = source.on(\"change\", (v) =>\n value.set(parseValue(v, unit) as T)\n )\n\n const removeValueOnDestroy = value.on(\"destroy\", removeSourceOnChange)\n\n return () => {\n removeSourceOnChange()\n removeValueOnDestroy()\n }\n }\n\n return stopAnimation\n}\n\nfunction parseValue(v: AnyResolvedKeyframe, unit?: string) {\n return unit ? v + unit : v\n}\n\nfunction asNumber(v: AnyResolvedKeyframe) {\n return typeof v === \"number\" ? v : parseFloat(v)\n}\n","import { MotionValue } from \".\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\nexport function subscribeValue(\n inputValues: MotionValue[],\n outputValue: MotionValue,\n getLatest: () => O\n) {\n const update = () => outputValue.set(getLatest())\n const scheduleUpdate = () => frame.preRender(update, false, true)\n\n const subscriptions = inputValues.map((v) => v.on(\"change\", scheduleUpdate))\n\n outputValue.on(\"destroy\", () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(update)\n })\n}\n","import { MotionValue, collectMotionValues, motionValue } from \".\"\nimport { subscribeValue } from \"./subscribe-value\"\n\nexport type TransformInputRange = number[]\nexport type SingleTransformer = (input: I) => O\nexport type MultiTransformer = (input: I[]) => O\nexport type ValueTransformer =\n | SingleTransformer\n | MultiTransformer\n\n/**\n * Create a `MotionValue` that transforms the output of other `MotionValue`s by\n * passing their latest values through a transform function.\n *\n * Whenever a `MotionValue` referred to in the provided function is updated,\n * it will be re-evaluated.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = transformValue(() => x.get() * 2) // double x\n * ```\n *\n * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function transformValue(transform: () => O): MotionValue {\n const collectedValues: MotionValue[] = []\n\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * inside transform will be saved into this array.\n */\n collectMotionValues.current = collectedValues\n const initialValue = transform()\n collectMotionValues.current = undefined\n\n const value = motionValue(initialValue)\n\n subscribeValue(collectedValues, value, transform)\n\n return value\n}\n","import { MotionValue } from \".\"\nimport { transform, TransformOptions } from \"../utils/transform\"\nimport { transformValue } from \"./transform-value\"\n\nexport type MapInputRange = number[]\n\n/**\n * Create a `MotionValue` that maps the output of another `MotionValue` by\n * mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * const x = motionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = mapValue(x, xRange, opacityRange)\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function mapValue(\n inputValue: MotionValue,\n inputRange: MapInputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue {\n const map = transform(inputRange, outputRange, options)\n return transformValue(() => map(inputValue.get()))\n}\n","import { MotionValue } from \".\"\nimport { AnyResolvedKeyframe, SpringOptions } from \"../animation/types\"\nimport { attachFollow, followValue } from \"./follow-value\"\n\n/**\n * Create a `MotionValue` that animates to its latest value using a spring.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = springValue(x, { stiffness: 300 })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function springValue(\n source: T | MotionValue,\n options?: SpringOptions\n) {\n return followValue(source, { type: \"spring\", ...options })\n}\n\n/**\n * Attach a spring animation to a MotionValue that will animate whenever the value changes.\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachSpring(\n value: MotionValue,\n source: T | MotionValue,\n options?: SpringOptions\n): VoidFunction {\n return attachFollow(value, source, { type: \"spring\", ...options })\n}\n","import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n","export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n if (valueName === \"exit\" || valueName === \"old\") return \"old\"\n\n return \"group\"\n}\n","let pendingRules: Record> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n","export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n /::view-transition-(old|new|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n","function filterViewAnimations(animation: Animation) {\n const { effect } = animation\n if (!effect) return false\n\n return (\n effect.target === document.documentElement &&\n effect.pseudoElement?.startsWith(\"::view-transition\")\n )\n}\n\nexport function getViewAnimations() {\n return document.getAnimations().filter(filterViewAnimations)\n}\n","import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n","import { secondsToMilliseconds } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget } from \"./types\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise {\n const { update, targets, options: defaultOptions } = builder\n\n if (!document.startViewTransition) {\n return new Promise(async (resolve) => {\n await update()\n resolve(new GroupAnimation([]))\n })\n }\n\n // TODO: Go over existing targets and ensure they all have ids\n\n /**\n * If we don't have any animations defined for the root target,\n * remove it from being captured.\n */\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", {\n \"view-transition-name\": \"none\",\n })\n }\n\n /**\n * Set the timing curve to linear for all view transition layers.\n * This gets baked into the keyframes, which can't be changed\n * without breaking the generated animation.\n *\n * This allows us to set easing via updateTiming - which can be changed.\n */\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n css.commit() // Write\n\n const transition = document.startViewTransition(async () => {\n await update()\n\n // TODO: Go over new targets and ensure they all have ids\n })\n\n transition.finished.finally(() => {\n css.remove() // Write\n })\n\n return new Promise((resolve) => {\n transition.ready.then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n */\n targets.forEach((definition, target) => {\n // TODO: If target is not \"root\", resolve elements\n // and iterate over each\n for (const key of definitionNames) {\n if (!definition[key]) continue\n const { keyframes, options } =\n definition[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n if (!valueKeyframes) continue\n\n const valueOptions = {\n ...getValueTransition(\n defaultOptions as any,\n valueName\n ),\n ...getValueTransition(options as any, valueName),\n }\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n\n /**\n * If this is an opacity animation, and keyframes are not an array,\n * we need to convert them into an array and set an initial value.\n */\n if (\n valueName === \"opacity\" &&\n !Array.isArray(valueKeyframes)\n ) {\n const initialValue = type === \"new\" ? 0 : 1\n valueKeyframes = [initialValue, valueKeyframes]\n }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(0, 1)\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n const animation = new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${target})`,\n keyframes: valueKeyframes,\n })\n\n animations.push(animation)\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = targets.get(name.layer)\n\n if (!targetDefinition) {\n /**\n * If transition name is group then update the timing of the animation\n * whereas if it's old or new then we could possibly replace it using\n * the above method.\n */\n const transitionName = name.type === \"group\" ? \"layout\" : \"\"\n let animationTransition = {\n ...getValueTransition(defaultOptions, transitionName),\n }\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n const easing = mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string\n\n effect.updateTiming({\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration: animationTransition.duration,\n easing,\n })\n\n animations.push(new NativeAnimationWrapper(animation))\n } else if (\n hasOpacity(targetDefinition, \"enter\") &&\n hasOpacity(targetDefinition, \"exit\") &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n }\n\n resolve(new GroupAnimation(animations))\n })\n })\n}\n\nfunction hasOpacity(\n target: ViewTransitionTarget | undefined,\n key: \"enter\" | \"exit\" | \"layout\"\n) {\n return target?.[key]?.keyframes.opacity\n}\n","import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder).then((animation) => {\n builder.notifyReady(animation)\n animation.finished.finally(next)\n })\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n","import { noop } from \"motion-utils\"\nimport type { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { AnimationOptions, DOMKeyframesDefinition } from \"../animation/types\"\nimport { addToQueue } from \"./queue\"\nimport {\n ViewTransitionOptions,\n ViewTransitionTarget,\n ViewTransitionTargetDefinition,\n} from \"./types\"\nimport \"./types.global\"\n\nexport class ViewTransitionBuilder {\n private currentSubject: ViewTransitionTargetDefinition = \"root\"\n\n targets = new Map()\n\n update: () => void | Promise\n\n options: ViewTransitionOptions\n\n notifyReady: (value: GroupAnimation) => void = noop\n\n private readyPromise = new Promise((resolve) => {\n this.notifyReady = resolve\n })\n\n constructor(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n ) {\n this.update = update\n this.options = {\n interrupt: \"wait\",\n ...options,\n }\n addToQueue(this)\n }\n\n get(subject: ViewTransitionTargetDefinition) {\n this.currentSubject = subject\n\n return this\n }\n\n layout(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"layout\", keyframes, options)\n\n return this\n }\n\n new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"new\", keyframes, options)\n\n return this\n }\n\n old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"old\", keyframes, options)\n\n return this\n }\n\n enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"enter\", keyframes, options)\n\n return this\n }\n\n exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"exit\", keyframes, options)\n\n return this\n }\n\n crossfade(options?: AnimationOptions) {\n this.updateTarget(\"enter\", { opacity: 1 }, options)\n this.updateTarget(\"exit\", { opacity: 0 }, options)\n\n return this\n }\n\n updateTarget(\n target: \"enter\" | \"exit\" | \"layout\" | \"new\" | \"old\",\n keyframes: DOMKeyframesDefinition,\n options: AnimationOptions = {}\n ) {\n const { currentSubject, targets } = this\n\n if (!targets.has(currentSubject)) {\n targets.set(currentSubject, {})\n }\n\n const targetData = targets.get(currentSubject)!\n\n targetData[target] = { keyframes, options }\n }\n\n then(resolve: () => void, reject?: () => void) {\n return this.readyPromise.then(resolve, reject)\n }\n}\n\nexport function animateView(\n update: () => void | Promise,\n defaultOptions: ViewTransitionOptions = {}\n) {\n return new ViewTransitionBuilder(update, defaultOptions)\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n","import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap()\n","import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n","/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n","import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n","import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n","import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n","interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n","import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n","import {\n Box,\n isNumericalString,\n isZeroValueString,\n secondsToMilliseconds,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { acceleratedValues } from \"../animation/waapi/utils/accelerated-values\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { complex } from \"../value/types/complex\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { Feature } from \"./Feature\"\nimport { visualElementStore } from \"./store\"\nimport {\n FeatureDefinitions,\n MotionConfigContextProps,\n PresenceContextProps,\n ReducedMotionConfig,\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(\n definitions: Partial\n) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n shouldSkipAnimations: boolean = false\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * A reference to the skipAnimations config passed to the VisualElement's host React component.\n */\n private skipAnimationsConfig: boolean | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n private hasBeenMounted = false\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n skipAnimations,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.skipAnimationsConfig = skipAnimations\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key])\n this.latestValues[key] = this.initialValues[key]\n }\n }\n\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n\n this.hasBeenMounted = true\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n if (\n value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement\n ) {\n const { factory, keyframes, times, ease, duration } =\n value.accelerate\n\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n })\n\n const cleanup = factory(animation)\n\n this.valueSubscriptions.set(key, () => {\n cleanup()\n animation.cancel()\n })\n return\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (\n typeof window !== \"undefined\" &&\n (window as any).MotionCheckAppearSync\n ) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(\n this,\n key,\n value\n )\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n if (value.owner) value.stop()\n })\n }\n\n sortNodePosition(other: VisualElement) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(\n props: MotionNodeOptions,\n presenceContext: PresenceContextProps | null\n ) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n","import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n","import type { VisualElement } from \"./VisualElement\"\n\n/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nexport abstract class Feature {\n isMounted = false\n\n node: VisualElement\n\n constructor(node: VisualElement) {\n this.node = node\n }\n\n abstract mount(): void\n\n abstract unmount(): void\n\n update(): void {}\n}\n","import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n","import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n","import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n })\n }\n\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min = axis.min + distance\n axis.max = axis.max + distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(box: Box, transform: ResolvedValues) {\n transformAxis(\n box.x,\n transform.x as number,\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n transform.y as number,\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n","import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n","import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n","import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n","import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n","import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n","import type { Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n","import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n","import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n","import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform\n delete attrs.transform\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n","export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n","import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n","export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set()\n\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity\n\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i]\n const typeState = state[type]\n const prop =\n props[type] !== undefined\n ? props[type]\n : context[type as keyof typeof context]\n const propIsVariant = isVariantLabel(prop)\n\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited =\n prop === context[type as keyof typeof context] &&\n prop !== props[type] &&\n propIsVariant\n\n if (\n isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount\n ) {\n isInherited = false\n }\n\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys }\n\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n continue\n }\n\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n }\n }\n continue\n }\n\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n\n let shouldAnimateType =\n variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant)\n\n let handledRemovedValues = false\n\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop]\n\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(\n buildResolvedTypeValues(type),\n {}\n )\n\n if (activeDelta === false) resolvedValues = {}\n\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState\n\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n }\n const markToAnimate = (key: string) => {\n shouldAnimateType = true\n if (removedKeys.has(key)) {\n handledRemovedValues = true\n removedKeys.delete(key)\n }\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n }\n\n for (const key in allKeys) {\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key)) continue\n\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev)\n } else {\n valueHasChanged = next !== prev\n }\n\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key)\n } else {\n // If it's undefined, it's been removed.\n removedKeys.add(key)\n }\n } else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key)\n } else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true\n }\n }\n\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false\n }\n\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange\n const needsAnimating = !willAnimateViaParent || handledRemovedValues\n if (shouldAnimateType && needsAnimating) {\n animations.push(\n ...definitionList.map((animation) => {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (\n typeof animation === \"string\" &&\n isInitialRender &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent\n ) {\n const { parent } = visualElement\n const parentVariant = resolveVariant(\n parent,\n animation\n )\n\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } =\n parentVariant.transition || {}\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n }\n\n return {\n animation: animation as AnimationDefinition,\n options,\n }\n })\n )\n }\n }\n\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation: TargetAndTransition = {}\n\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(\n visualElement,\n Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial\n )\n\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition\n }\n }\n\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key)\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n let shouldAnimate = Boolean(animations.length)\n\n if (\n isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount\n ) {\n shouldAnimate = false\n }\n\n isInitialRender = false\n return shouldAnimate ? animate(animations) : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive) return Promise.resolve()\n\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as keyof typeof state].protectedKeys = {}\n }\n\n return animations\n }\n\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState()\n /**\n * Temporarily disabling resetting this flag as it prevents components\n * with initial={false} from animating after being remounted, for instance\n * as the child of an Activity component.\n */\n // isInitialRender = true\n },\n }\n}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createTypeState(isActive = false): AnimationTypeState {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n}\n\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n }\n}\n","import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(target: Axis, relative: Axis, parent: Axis) {\n target.min = parent.min + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(target: Box, relative: Box, parent: Box) {\n calcRelativeAxis(target.x, relative.x, parent.x)\n calcRelativeAxis(target.y, relative.y, parent.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis\n) {\n target.min = layout.min - parent.min\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(target: Box, layout: Box, parent: Box) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y)\n}\n","import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n","type Callback = (axis: \"x\" | \"y\") => void\n\nexport function eachAxis(callback: Callback) {\n return [callback(\"x\"), callback(\"y\")]\n}\n","import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } =\n latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n","import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"]\nconst numBorders = borders.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n","import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue(\n value: MotionValue | V,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n","export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler)\n}\n","import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n","import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { FrameData } from \"../frameloop/types\"\nimport { secondsToMilliseconds } from \"motion-utils\"\n\nexport type DelayedFunction = (overshoot: number) => void\n\n/**\n * Timeout defined in ms\n */\nexport function delay(callback: DelayedFunction, timeout: number) {\n const start = time.now()\n\n const checkElapsed = ({ timestamp }: FrameData) => {\n const elapsed = timestamp - start\n\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed)\n callback(elapsed - timeout)\n }\n }\n\n frame.setup(checkElapsed, true)\n\n return () => cancelFrame(checkElapsed)\n}\n\nexport function delayInSeconds(callback: DelayedFunction, timeout: number) {\n return delay(callback, secondsToMilliseconds(timeout))\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isMotionValue } from \"./is-motion-value\"\nimport type { MotionValue } from \"../index\"\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nexport function resolveMotionValue(\n value?: AnyResolvedKeyframe | MotionValue\n): AnyResolvedKeyframe {\n return isMotionValue(value) ? value.get() : value\n}\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n\n for (let i = this.members.length - 1; i >= 0; i--) {\n const m = this.members[i]\n if (m === node || m === this.lead || m === this.prevLead) continue\n const inst = m.instance as HTMLElement | undefined\n if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) {\n removeItem(this.members, m)\n }\n }\n\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) {\n this.prevLead = undefined\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) {\n this.promote(prevLead)\n }\n }\n }\n\n relegate(node: IProjectionNode): boolean {\n const indexOfNode = this.members.findIndex((member) => node === member)\n if (indexOfNode === 0) return false\n\n /**\n * Find the next projection node that is present\n */\n let prevLead: IProjectionNode | undefined\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i]\n const inst = member.instance as HTMLElement | undefined\n if (member.isPresent !== false && (!inst || inst.isConnected !== false)) {\n prevLead = member\n break\n }\n }\n\n if (prevLead) {\n this.promote(prevLead)\n return true\n } else {\n return false\n }\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n\n node.show()\n\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender()\n node.scheduleRender()\n\n /**\n * If both the new and previous lead have the same defined layoutDependency,\n * skip the shared layout animation. This allows components with layoutId\n * to opt-out of animations when their layoutDependency hasn't changed,\n * even when the component unmounts and remounts in a different location.\n */\n const prevDep = prevLead.options.layoutDependency\n const nextDep = node.options.layoutDependency\n const dependencyMatches =\n prevDep !== undefined &&\n nextDep !== undefined &&\n prevDep === nextDep\n\n if (!dependencyMatches) {\n const prevInstance = prevLead.instance as HTMLElement | undefined\n const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot\n\n if (!isStale) {\n node.resumeFrom = prevLead\n\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true\n }\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true\n }\n }\n }\n\n const { crossfade } = node.options\n if (crossfade === false) {\n prevLead.hide()\n }\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node\n\n options.onExitComplete && options.onExitComplete()\n\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete()\n }\n })\n }\n\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false)\n })\n }\n\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined\n }\n }\n}\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n","import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport { Transition, ValueAnimationOptions } from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { copyAxisDeltaInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig) {\n return class ProjectionNode implements IProjectionNode {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n layoutVersion: number = 0\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n // Only register the handler if it requires layout animation\n if (\n this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)\n ) {\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(\n layoutTransition,\n \"layout\"\n ),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n isTreeAnimationBlocked() {\n return (\n this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false\n )\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate()\n this.clearAllSnapshots()\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n this.sharedNodes.forEach(removeLeadSnapshots)\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n this.layoutVersion++\n this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false): Box {\n const withTransforms = createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n })\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(withTransforms, node.latestValues)\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues)\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!node.instance) continue\n if (!hasTransform(node.latestValues)) continue\n\n hasScale(node.latestValues) && node.updateSnapshot()\n\n const sourceBox = createBox()\n const nodeBox = node.measurePageBox()\n copyBoxInto(sourceBox, nodeBox)\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot ? node.snapshot.layoutBox : undefined,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n if (\n relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot\n ) {\n this.removeRelativeTarget()\n }\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (relativeParent && relativeParent.layout) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox)\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n linkedParentVersion: number = 0\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.linkedParentVersion = relativeParent.layoutVersion\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n\n mixAxisDelta(targetDelta.x, delta.x, progress)\n mixAxisDelta(targetDelta.y, delta.y, progress)\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue\n startAnimation(options: ValueAnimationOptions) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n activeAnimations.layout++\n this.motionValue ||= motionValue(0)\n this.motionValue.jump(0, false)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onStop: () => {\n activeAnimations.layout--\n },\n onComplete: () => {\n activeAnimations.layout--\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n let { targetWithTransforms, target, layout, latestValues } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction removeLeadSnapshots(stack: NodeStack) {\n stack.removeLeadSnapshot()\n}\n\nexport function mixAxisDelta(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n","import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n","import { IProjectionNode } from \"./types\"\n\nconst notify = (node: IProjectionNode) =>\n !node.isLayoutDirty && node.willUpdate(false)\n\nexport interface NodeGroup {\n add: (node: IProjectionNode) => void\n remove: (node: IProjectionNode) => void\n dirty: VoidFunction\n}\n\nexport function nodeGroup(): NodeGroup {\n const nodes = new Set()\n const subscriptions = new WeakMap void>()\n\n const dirtyAll = () => nodes.forEach(notify)\n\n return {\n add: (node) => {\n nodes.add(node)\n subscriptions.set(\n node,\n node.addEventListener(\"willUpdate\", dirtyAll)\n )\n },\n remove: (node) => {\n nodes.delete(node)\n const unsubscribe = subscriptions.get(node)\n if (unsubscribe) {\n unsubscribe()\n subscriptions.delete(node)\n }\n dirtyAll()\n },\n dirty: dirtyAll,\n }\n}\n","import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n","import type { Box } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport type {\n AnimationOptions,\n AnimationPlaybackControls,\n Transition,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { copyBoxInto } from \"../projection/geometry/copy\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport type { IProjectionNode } from \"../projection/node/types\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { visualElementStore } from \"../render/store\"\nimport type { VisualElement } from \"../render/VisualElement\"\nimport { resolveElements, type ElementOrSelector } from \"../utils/resolve-elements\"\n\ntype LayoutAnimationScope = Element | Document\n\ninterface LayoutElementRecord {\n element: Element\n visualElement: VisualElement\n projection: IProjectionNode\n}\n\ninterface LayoutAttributes {\n layout?: boolean | \"position\" | \"size\" | \"preserve-aspect\"\n layoutId?: string\n}\n\ntype LayoutBuilderResolve = (animation: GroupAnimation) => void\ntype LayoutBuilderReject = (error: unknown) => void\n\ninterface ProjectionOptions {\n layout?: boolean | \"position\" | \"size\" | \"preserve-aspect\"\n layoutId?: string\n animationType?: \"size\" | \"position\" | \"both\" | \"preserve-aspect\"\n transition?: Transition\n crossfade?: boolean\n}\n\nconst layoutSelector = \"[data-layout], [data-layout-id]\"\nconst noop = () => {}\nfunction snapshotFromTarget(projection: IProjectionNode): LayoutElementRecord[\"projection\"][\"snapshot\"] {\n const target = projection.targetWithTransforms || projection.target\n if (!target) return undefined\n\n const measuredBox = createBox()\n const layoutBox = createBox()\n copyBoxInto(measuredBox, target as Box)\n copyBoxInto(layoutBox, target as Box)\n\n return {\n animationId: projection.root?.animationId ?? 0,\n measuredBox,\n layoutBox,\n latestValues: projection.animationValues || projection.latestValues || {},\n source: projection.id,\n }\n}\n\nexport class LayoutAnimationBuilder {\n private scope: LayoutAnimationScope\n private updateDom: () => void | Promise\n private defaultOptions?: AnimationOptions\n private sharedTransitions = new Map()\n private notifyReady: LayoutBuilderResolve = noop\n private rejectReady: LayoutBuilderReject = noop\n private readyPromise: Promise\n\n constructor(\n scope: LayoutAnimationScope,\n updateDom: () => void | Promise,\n defaultOptions?: AnimationOptions\n ) {\n this.scope = scope\n this.updateDom = updateDom\n this.defaultOptions = defaultOptions\n\n this.readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.rejectReady = reject\n })\n\n frame.postRender(() => {\n this.start().then(this.notifyReady).catch(this.rejectReady)\n })\n }\n\n shared(id: string, transition: AnimationOptions): this {\n this.sharedTransitions.set(id, transition)\n return this\n }\n\n then(\n resolve: LayoutBuilderResolve,\n reject?: LayoutBuilderReject\n ): Promise {\n return this.readyPromise.then(resolve, reject)\n }\n\n private async start(): Promise {\n const beforeElements = collectLayoutElements(this.scope)\n const beforeRecords = this.buildRecords(beforeElements)\n\n beforeRecords.forEach(({ projection }) => {\n const hasCurrentAnimation = Boolean(projection.currentAnimation)\n const isSharedLayout = Boolean(projection.options.layoutId)\n if (hasCurrentAnimation && isSharedLayout) {\n const snapshot = snapshotFromTarget(projection)\n if (snapshot) {\n projection.snapshot = snapshot\n } else if (projection.snapshot) {\n projection.snapshot = undefined\n }\n } else if (\n projection.snapshot &&\n (projection.currentAnimation || projection.isProjecting())\n ) {\n projection.snapshot = undefined\n }\n projection.isPresent = true\n projection.willUpdate()\n })\n\n await this.updateDom()\n\n const afterElements = collectLayoutElements(this.scope)\n const afterRecords = this.buildRecords(afterElements)\n this.handleExitingElements(beforeRecords, afterRecords)\n\n afterRecords.forEach(({ projection }) => {\n const instance = projection.instance as HTMLElement | undefined\n const resumeFromInstance = projection.resumeFrom\n ?.instance as HTMLElement | undefined\n if (!instance || !resumeFromInstance) return\n if (!(\"style\" in instance)) return\n\n const currentTransform = instance.style.transform\n const resumeFromTransform = resumeFromInstance.style.transform\n\n if (\n currentTransform &&\n resumeFromTransform &&\n currentTransform === resumeFromTransform\n ) {\n instance.style.transform = \"\"\n instance.style.transformOrigin = \"\"\n }\n })\n\n afterRecords.forEach(({ projection }) => {\n projection.isPresent = true\n })\n\n const root = getProjectionRoot(afterRecords, beforeRecords)\n root?.didUpdate()\n\n await new Promise((resolve) => {\n frame.postRender(() => resolve())\n })\n\n const animations = collectAnimations(afterRecords)\n const animation = new GroupAnimation(animations)\n\n return animation\n }\n\n private buildRecords(elements: Element[]): LayoutElementRecord[] {\n const records: LayoutElementRecord[] = []\n const recordMap = new Map()\n\n for (const element of elements) {\n const parentRecord = findParentRecord(element, recordMap, this.scope)\n const { layout, layoutId } = readLayoutAttributes(element)\n const override = layoutId\n ? this.sharedTransitions.get(layoutId)\n : undefined\n const transition = override || this.defaultOptions\n const record = getOrCreateRecord(element, parentRecord?.projection, {\n layout,\n layoutId,\n animationType: typeof layout === \"string\" ? layout : \"both\",\n transition: transition as Transition,\n })\n recordMap.set(element, record)\n records.push(record)\n }\n\n return records\n }\n\n private handleExitingElements(\n beforeRecords: LayoutElementRecord[],\n afterRecords: LayoutElementRecord[]\n ): void {\n const afterElementsSet = new Set(afterRecords.map((record) => record.element))\n\n beforeRecords.forEach((record) => {\n if (afterElementsSet.has(record.element)) return\n\n // For shared layout elements, relegate to set up resumeFrom\n // so the remaining element animates from this position\n if (record.projection.options.layoutId) {\n record.projection.isPresent = false\n record.projection.relegate()\n }\n\n record.visualElement.unmount()\n visualElementStore.delete(record.element)\n })\n\n // Clear resumeFrom on EXISTING nodes that point to unmounted projections\n // This prevents crossfade animation when the source element was removed entirely\n // But preserve resumeFrom for NEW nodes so they can animate from the old position\n // Also preserve resumeFrom for lead nodes that were just promoted via relegate\n const beforeElementsSet = new Set(beforeRecords.map((record) => record.element))\n afterRecords.forEach(({ element, projection }) => {\n if (\n beforeElementsSet.has(element) &&\n projection.resumeFrom &&\n !projection.resumeFrom.instance &&\n !projection.isLead()\n ) {\n projection.resumeFrom = undefined\n projection.snapshot = undefined\n }\n })\n }\n}\n\nexport function parseAnimateLayoutArgs(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): {\n scope: Element | Document\n updateDom: () => void\n defaultOptions?: AnimationOptions\n} {\n // animateLayout(updateDom)\n if (typeof scopeOrUpdateDom === \"function\") {\n return {\n scope: document,\n updateDom: scopeOrUpdateDom,\n defaultOptions: updateDomOrOptions as AnimationOptions | undefined,\n }\n }\n\n // animateLayout(scope, updateDom, options?)\n const elements = resolveElements(scopeOrUpdateDom)\n const scope = elements[0] || document\n\n return {\n scope,\n updateDom: updateDomOrOptions as () => void,\n defaultOptions: options,\n }\n}\n\nfunction collectLayoutElements(scope: LayoutAnimationScope): Element[] {\n const elements = Array.from(scope.querySelectorAll(layoutSelector))\n\n if (scope instanceof Element && scope.matches(layoutSelector)) {\n if (!elements.includes(scope)) {\n elements.unshift(scope)\n }\n }\n\n return elements\n}\n\nfunction readLayoutAttributes(element: Element): LayoutAttributes {\n const layoutId = element.getAttribute(\"data-layout-id\") || undefined\n const rawLayout = element.getAttribute(\"data-layout\")\n let layout: LayoutAttributes[\"layout\"]\n\n if (rawLayout === \"\" || rawLayout === \"true\") {\n layout = true\n } else if (rawLayout) {\n layout = rawLayout as LayoutAttributes[\"layout\"]\n }\n\n return {\n layout,\n layoutId,\n }\n}\n\nfunction createVisualState() {\n return {\n latestValues: {},\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n },\n }\n}\n\nfunction getOrCreateRecord(\n element: Element,\n parentProjection?: IProjectionNode,\n projectionOptions?: ProjectionOptions\n): LayoutElementRecord {\n const existing = visualElementStore.get(element) as VisualElement | undefined\n const visualElement =\n existing ??\n new HTMLVisualElement(\n {\n props: {},\n presenceContext: null,\n visualState: createVisualState(),\n },\n { allowProjection: true }\n )\n\n if (!existing || !visualElement.projection) {\n visualElement.projection = new HTMLProjectionNode(\n visualElement.latestValues,\n parentProjection\n )\n }\n\n visualElement.projection.setOptions({\n ...projectionOptions,\n visualElement,\n })\n\n if (!visualElement.current) {\n visualElement.mount(element as HTMLElement)\n } else if (!visualElement.projection.instance) {\n // Mount projection if VisualElement is already mounted but projection isn't\n // This happens when animate() was called before animateLayout()\n visualElement.projection.mount(element as HTMLElement)\n }\n\n if (!existing) {\n visualElementStore.set(element, visualElement)\n }\n\n return {\n element,\n visualElement,\n projection: visualElement.projection as IProjectionNode,\n }\n}\n\nfunction findParentRecord(\n element: Element,\n recordMap: Map,\n scope: LayoutAnimationScope\n) {\n let parent = element.parentElement\n\n while (parent) {\n const record = recordMap.get(parent)\n if (record) return record\n\n if (parent === scope) break\n parent = parent.parentElement\n }\n\n return undefined\n}\n\nfunction getProjectionRoot(\n afterRecords: LayoutElementRecord[],\n beforeRecords: LayoutElementRecord[]\n) {\n const record = afterRecords[0] || beforeRecords[0]\n return record?.projection.root\n}\n\nfunction collectAnimations(afterRecords: LayoutElementRecord[]) {\n const animations = new Set()\n\n afterRecords.forEach((record) => {\n const animation = record.projection.currentAnimation\n if (animation) animations.add(animation)\n })\n\n return Array.from(animations)\n}\n","import { cancelFrame, frame } from \".\"\nimport { stepsOrder } from \"./order\"\nimport { Process } from \"./types\"\n\n/**\n * @deprecated\n *\n * Import as `frame` instead.\n */\nexport const sync = frame\n\n/**\n * @deprecated\n *\n * Use cancelFrame(callback) instead.\n */\nexport const cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = (process: Process) => cancelFrame(process)\n return acc\n}, {} as Record void>)\n"],"names":["MotionGlobalConfig","noop","clamp","alpha","alphaType","getAnimatableNone","mixNumber","warning","mixNumberImmediate","pipe","millisecondsToSeconds","velocityPerSecond","secondsToMilliseconds","spring","createSpring","invariant","progress","easeInOut","isEasingArray","easingDefinitionToFunction","isNotNull","getFinalKeyframe","keyframesGenerator","keyframes","memo","isBezierDefinition","anticipate","backInOut","circInOut","acceleratedValues","KeyframeResolver","DefaultKeyframeResolver","isNumericalString","warnOnce","SubscriptionManager","isZeroValueString","isObject","translateAlias","buildTransform","getComputedStyle","asNumber","removeItem","checkIsControllingVariants","checkIsVariantNode","scrapeMotionValuesFromProps","scrapeHTMLMotionValuesFromProps","circOut","calcProgress","motionValue","createMotionValue","addUniqueItem"],"mappings":";;;;;;AAEO,MAAM,UAAU,GAAa;AAChC,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,kBAAkB;AAClB,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,YAAY;CACN;;ACKG,MAAA,WAAW,GAA4C;AAChE,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,oBAAoB,EAAE,IAAI;;;ACdd,SAAA,gBAAgB,CAC5B,YAAwB,EACxB,QAAoB,EAAA;AAEpB;;;AAGG;AACH,IAAA,IAAI,SAAS,GAAG,IAAI,GAAG,EAAW,CAAA;AAClC,IAAA,IAAI,SAAS,GAAG,IAAI,GAAG,EAAW,CAAA;AAElC;;;AAGG;IACH,IAAI,YAAY,GAAG,KAAK,CAAA;IAExB,IAAI,cAAc,GAAG,KAAK,CAAA;AAE1B;;AAEG;AACH,IAAA,MAAM,WAAW,GAAG,IAAI,OAAO,EAAW,CAAA;AAE1C,IAAA,IAAI,eAAe,GAAc;AAC7B,QAAA,KAAK,EAAE,GAAG;AACV,QAAA,SAAS,EAAE,GAAG;AACd,QAAA,YAAY,EAAE,KAAK;KACtB,CAAA;IAED,IAAI,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MAAM,UAAU,GAAG,IAAI,GAAG,EAA6B,CAAA;AAEvD,IAAA,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;AAC5B,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAA;AACpD,QAAA,IAAI,SAAS;AAAE,YAAA,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAC5C,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACjC;;AC5XA;;;;AAIG;AACI,MAAM,IAAI,GAAG,MAAK;AAEzB;;;;AAIG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACrD,IAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAgB,KAAK,WAAW,CAAC,OAAO,CAAC,CAAA;AACrD,IAAA,OAAO,GAAG,CAAA;AACd,CAAC,EAAE,EAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs new file mode 100644 index 00000000..3a557bea --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs @@ -0,0 +1,183 @@ +import { MotionGlobalConfig, noop } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { JSAnimation } from './JSAnimation.mjs'; +import { getFinalKeyframe } from './keyframes/get-final.mjs'; +import { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs'; +import { NativeAnimationExtended } from './NativeAnimationExtended.mjs'; +import { canAnimate } from './utils/can-animate.mjs'; +import { makeAnimationInstant } from './utils/make-animation-instant.mjs'; +import { WithPromise } from './utils/WithPromise.mjs'; +import { supportsBrowserAnimation } from './waapi/supports/waapi.mjs'; + +/** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ +const MAX_RESOLVE_DELAY = 40; +class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + if (!canAnimate(keyframes, name, type, velocity)) { + if (MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + */ + const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + const animation = useWaapi + ? new NativeAnimationExtended({ + ...resolvedOptions, + element, + }) + : new JSAnimation(resolvedOptions); + animation.finished.then(() => { + this.notifyFinished(); + }).catch(noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } +} + +export { AsyncMotionValueAnimation }; +//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map new file mode 100644 index 00000000..0d08c6e1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"AsyncMotionValueAnimation.mjs","sources":["../../../src/animation/AsyncMotionValueAnimation.ts"],"sourcesContent":["import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes = Omit<\n ValueAnimationOptions,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n const animation = useWaapi\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n : new JSAnimation(resolvedOptions)\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n"],"names":["KeyframeResolver","DefaultKeyframeResolver"],"mappings":";;;;;;;;;;;AAqBA;;;;;;;AAOG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAOtB,MAAO,yBACT,SAAQ,WAAW,CAAA;AAenB,IAAA,WAAA,CAAY,EACR,QAAQ,GAAG,IAAI,EACf,KAAK,GAAG,CAAC,EACT,IAAI,GAAG,WAAW,EAClB,MAAM,GAAG,CAAC,EACV,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,MAAM,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,OAAO,EACP,GAAG,OAAO,EACa,EAAA;AACvB,QAAA,KAAK,EAAE,CAAA;AA2MX;;AAEG;QACH,IAAI,CAAA,IAAA,GAAG,MAAK;AACR,YAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACjB,gBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;AACtB,gBAAA,IAAI,CAAC,YAAY,IAAI,CAAA;aACxB;AAED,YAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAA;AACnC,SAAC,CAAA;AAnNG,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AAE3B,QAAA,MAAM,mBAAmB,GAA+B;YACpD,QAAQ;YACR,KAAK;YACL,IAAI;YACJ,MAAM;YACN,WAAW;YACX,UAAU;YACV,IAAI;YACJ,WAAW;YACX,OAAO;AACP,YAAA,GAAG,OAAO;SACb,CAAA;AAED,QAAA,MAAMA,kBAAgB,GAClB,OAAO,EAAE,gBAAgB,IAAIC,gBAAuB,CAAA;AAExD,QAAA,IAAI,CAAC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,GAAA;AACA,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;KACxB;IAED,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAA;KACzB;IAED,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAA;KAC5B;IAED,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;AACjB,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAA;SAC1B;AAED,QAAA,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAA;KAClC;AAaJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs new file mode 100644 index 00000000..a959b955 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs @@ -0,0 +1,82 @@ +class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } +} +function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; +} + +export { GroupAnimation }; +//# sourceMappingURL=GroupAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map new file mode 100644 index 00000000..a874badc --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupAnimation.mjs","sources":["../../../src/animation/GroupAnimation.ts"],"sourcesContent":["import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accomadate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n"],"names":[],"mappings":"MAca,cAAc,CAAA;AAGvB,IAAA,WAAA,CAAY,UAAiD,EAAA;;QAsF7D,IAAI,CAAA,IAAA,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QArF5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAsB,CAAA;KACpE;AAED,IAAA,IAAI,QAAQ,GAAA;QACR,OAAO,OAAO,CAAC,GAAG,CACd,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,QAAQ,CAAC,CACzD,CAAA;KACJ;AAED;;AAEG;AACK,IAAA,MAAM,CAAC,QAAmB,EAAA;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAQ,CAAA;KAC7C;IAEO,MAAM,CAAC,QAAmB,EAAE,QAAa,EAAA;AAC7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R,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;KAC7C;AAED,IAAA,IAAI,iBAAiB,GAAA;QACjB,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAA;KACtD;AAEO,IAAA,MAAM,CACV,UAGC,EAAA;AAED,QAAA,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;KAChE;IAED,IAAI,GAAA;AACA,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;KACtB;IAED,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;KACvB;IAKD,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;KACxB;IAED,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;KAC1B;AACJ,CAAA;AAED,SAAS,MAAM,CACX,UAA6B,EAC7B,QAA0C,EAAA;IAE1C,IAAI,GAAG,GAAG,CAAC,CAAA;AAEX,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;QACrC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,GAAG,GAAG,EAAE;YAC/B,GAAG,GAAG,KAAK,CAAA;SACd;KACJ;AACD,IAAA,OAAO,GAAG,CAAA;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs new file mode 100644 index 00000000..7d8a536a --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs @@ -0,0 +1,10 @@ +import { GroupAnimation } from './GroupAnimation.mjs'; + +class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } +} + +export { GroupAnimationWithThen }; +//# sourceMappingURL=GroupAnimationWithThen.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map new file mode 100644 index 00000000..de947f07 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupAnimationWithThen.mjs","sources":["../../../src/animation/GroupAnimationWithThen.ts"],"sourcesContent":["import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n"],"names":[],"mappings":";;AAGM,MAAO,sBACT,SAAQ,cAAc,CAAA;IAGtB,IAAI,CAAC,SAAuB,EAAE,SAAwB,EAAA;AAClD,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,MAAO,GAAC,CAAC,CAAA;KACzD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs new file mode 100644 index 00000000..e6cc10a8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs @@ -0,0 +1,350 @@ +import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { activeAnimations } from '../stats/animation-count.mjs'; +import { mix } from '../utils/mix/index.mjs'; +import { frameloopDriver } from './drivers/frame.mjs'; +import { inertia } from './generators/inertia.mjs'; +import { keyframes } from './generators/keyframes.mjs'; +import { calcGeneratorDuration } from './generators/utils/calc-duration.mjs'; +import { getFinalKeyframe } from './keyframes/get-final.mjs'; +import { replaceTransitionType } from './utils/replace-transition-type.mjs'; +import { WithPromise } from './utils/WithPromise.mjs'; + +const percentToProgress = (percent) => percent / 100; +class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + activeAnimations.mainThread++; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (process.env.NODE_ENV !== "production" && + generatorFactory !== keyframes) { + invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + const state = isInDelayPhase + ? { done: false, value: keyframes[0] } + : frameGenerator.next(elapsed); + if (mixKeyframes) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + this.driver?.start(false); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + this.updateTime(time.now()); + const hasChanged = this.playbackSpeed !== newSpeed; + this.playbackSpeed = newSpeed; + if (hasChanged) { + this.time = millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + activeAnimations.mainThread--; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } +} +// Legacy function support +function animateValue(options) { + return new JSAnimation(options); +} + +export { JSAnimation, animateValue }; +//# sourceMappingURL=JSAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map new file mode 100644 index 00000000..3d4de626 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"JSAnimation.mjs","sources":["../../../src/animation/JSAnimation.ts"],"sourcesContent":["import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { activeAnimations } from \"../stats/animation-count\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer | undefined\n\n private mirroredGenerator: KeyframeGenerator | undefined\n\n constructor(options: ValueAnimationOptions) {\n super()\n activeAnimations.mainThread++\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed)\n\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n this.driver?.start(false)\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n this.updateTime(time.now())\n const hasChanged = this.playbackSpeed !== newSpeed\n this.playbackSpeed = newSpeed\n\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n activeAnimations.mainThread--\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue(\n options: ValueAnimationOptions\n) {\n return new JSAnimation(options)\n}\n"],"names":["keyframesGenerator","keyframes"],"mappings":";;;;;;;;;;;;AA4BA,MAAM,iBAAiB,GAAG,CAAC,OAAe,KAAK,OAAO,GAAG,GAAG,CAAA;AAEtD,MAAO,WACT,SAAQ,WAAW,CAAA;AAkDnB,IAAA,WAAA,CAAY,OAAiC,EAAA;AACzC,QAAA,KAAK,EAAE,CAAA;QAhDX,IAAK,CAAA,KAAA,GAAuB,MAAM,CAAA;QAElC,IAAS,CAAA,SAAA,GAAkB,IAAI,CAAA;QAQvB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;AAYzB;;AAEG;QACK,IAAW,CAAA,WAAA,GAAW,CAAC,CAAA;AAE/B;;AAEG;QACK,IAAQ,CAAA,QAAA,GAAkB,IAAI,CAAA;AAEtC;;AAEG;QACK,IAAa,CAAA,aAAA,GAAG,CAAC,CAAA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AA;AACnC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs new file mode 100644 index 00000000..da184285 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs @@ -0,0 +1,170 @@ +import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils'; +import { setStyle } from '../render/dom/style-set.mjs'; +import { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs'; +import { getFinalKeyframe } from './keyframes/get-final.mjs'; +import { WithPromise } from './utils/WithPromise.mjs'; +import { startWaapiAnimation } from './waapi/start-waapi-animation.mjs'; +import { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs'; + +/** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ +class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + else { + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + */ + setStyle(element, name, keyframe); + } + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + millisecondsToSeconds(delay); + } + get time() { + return millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = secondsToMilliseconds(newTime); + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, observe }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + return noop; + } + else { + return observe(this); + } + } +} + +export { NativeAnimation }; +//# sourceMappingURL=NativeAnimation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map new file mode 100644 index 00000000..26c59ec8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeAnimation.mjs","sources":["../../../src/animation/NativeAnimation.ts"],"sourcesContent":["import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions\n extends DOMValueAnimationOptions {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n } else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe)\n }\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n const element = this.options?.element\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n return noop\n } else {\n return observe(this)\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAyBA;;AAEG;AACG,MAAO,eACT,SAAQ,WAAW,CAAA;AAyBnB,IAAA,WAAA,CAAY,OAAgC,EAAA;AACxC,QAAA,KAAK,EAAE,CAAA;QAlBD,IAAY,CAAA,YAAA,GAAkB,IAAI,CAAA;QAMpC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;AAIzB;;;;AAIG;QACO,IAAe,CAAA,eAAA,GAAkB,IAAI,CAAA;AAK3C,QAAA,IAAI,CAAC,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C,YAAY,KAAK,IAAI;AAC7B,cAAE,UAAU;AACZ,cAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAA;KACjC;AAED,IAAA,IAAI,SAAS,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;KAClE;IAED,IAAI,SAAS,CAAC,YAAoB,EAAA;QAC9B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,YAAY,CAAA;KACjE;AAED;;AAEG;AACH,IAAA,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAwB,EAAA;AACtD,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACnB,YAAA,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;SAC5D;AAED,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAA;AAE9B,QAAA,IAAI,QAAQ,IAAI,sBAAsB,EAAE,EAAE;AACtC,YAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAe,CAAA;AAEzC,YAAA,OAAO,IAAU,CAAA;SACpB;aAAM;AACH,YAAA,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;SACvB;KACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs new file mode 100644 index 00000000..44286bbf --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs @@ -0,0 +1,73 @@ +import { clamp } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { JSAnimation } from './JSAnimation.mjs'; +import { NativeAnimation } from './NativeAnimation.mjs'; +import { replaceTransitionType } from './utils/replace-transition-type.mjs'; +import { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs'; + +/** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ +const sampleDelta = 10; //ms +class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + if (options.startTime !== undefined) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = clamp(0, sampleDelta, sampleTime - sampleDelta); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta); + sampleAnimation.stop(); + } +} + +export { NativeAnimationExtended }; +//# sourceMappingURL=NativeAnimationExtended.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map new file mode 100644 index 00000000..8249856f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeAnimationExtended.mjs","sources":["../../../src/animation/NativeAnimationExtended.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended =\n NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n options: NativeAnimationOptionsExtended\n\n constructor(options: NativeAnimationOptionsExtended) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n if (options.startTime !== undefined) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n sampleAnimation.sample(sampleTime).value,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n"],"names":[],"mappings":";;;;;;;AAWA;;;;AAIG;AACH,MAAM,WAAW,GAAG,EAAE,CAAA;AAEhB,MAAO,uBAEX,SAAQ,eAAkB,CAAA;AAGxB,IAAA,WAAA,CAAY,OAA0C,EAAA;AAClD;;;;;;;;AAQG;QACH,mBAAmB,CAAC,OAAO,CAAC,CAAA;AAE5B;;;;;;AAMG;QACH,qBAAqB,CAAC,OAAO,CAAC,CAAA;QAE9B,KAAK,CAAC,OAAO,CAAC,CAAA;AAEd,QAAA,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE;AACjC,YAAA,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;SACrC;AAED,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;KACzB;AAED;;;;;;;AAOG;AACH,IAAA,iBAAiB,CAAC,KAAS,EAAA;AACvB,QAAA,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAC5D,IAAI,CAAC,OAAO,CAAA;AAEhB,QAAA,IAAI,CAAC,WAAW;YAAE,OAAM;AAExB,QAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AACrB,YAAA,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACtB,OAAM;SACT;AAED,QAAA,MAAM,eAAe,GAAG,IAAI,WAAW,CAAC;AACpC,YAAA,GAAG,OAAO;AACV,YAAA,QAAQ,EAAE,KAAK;AAClB,SAAA,CAAC,CAAA;AAEF;;;;AAIG;AACH,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;AACrE,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,GAAG,WAAW,CAAC,CAAA;AAE7D,QAAA,WAAW,CAAC,eAAe,CACvB,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,EAC7D,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EACxC,KAAK,CACR,CAAA;QAED,eAAe,CAAC,IAAI,EAAE,CAAA;KACzB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs new file mode 100644 index 00000000..797a913d --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs @@ -0,0 +1,15 @@ +import { NativeAnimation } from './NativeAnimation.mjs'; + +class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } +} + +export { NativeAnimationWrapper }; +//# sourceMappingURL=NativeAnimationWrapper.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map new file mode 100644 index 00000000..711692b3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/NativeAnimationWrapper.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"NativeAnimationWrapper.mjs","sources":["../../../src/animation/NativeAnimationWrapper.ts"],"sourcesContent":["import { NativeAnimation } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"./types\"\n\nexport class NativeAnimationWrapper<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n constructor(animation: Animation) {\n super()\n\n this.animation = animation\n animation.onfinish = () => {\n this.finishedTime = this.time\n this.notifyFinished()\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,MAAO,sBAEX,SAAQ,eAAkB,CAAA;AACxB,IAAA,WAAA,CAAY,SAAoB,EAAA;AAC5B,QAAA,KAAK,EAAE,CAAA;AAEP,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;AAC1B,QAAA,SAAS,CAAC,QAAQ,GAAG,MAAK;AACtB,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAA;YAC7B,IAAI,CAAC,cAAc,EAAE,CAAA;AACzB,SAAC,CAAA;KACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs new file mode 100644 index 00000000..45767f14 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs @@ -0,0 +1,12 @@ +import { animateMotionValue } from '../interfaces/motion-value.mjs'; +import { motionValue } from '../../value/index.mjs'; +import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; + +function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; +} + +export { animateSingleValue }; +//# sourceMappingURL=single-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map new file mode 100644 index 00000000..fc0f7cad --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/animate/single-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"single-value.mjs","sources":["../../../../src/animation/animate/single-value.ts"],"sourcesContent":["import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue(\n value: MotionValue | V,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n"],"names":["motionValue","createMotionValue"],"mappings":";;;;SAagB,kBAAkB,CAC9B,KAAyB,EACzB,SAA2C,EAC3C,OAAkC,EAAA;AAElC,IAAA,MAAMA,aAAW,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,GAAGC,WAAiB,CAAC,KAAK,CAAC,CAAA;AAE3E,IAAAD,aAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,EAAEA,aAAW,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;IAE1E,OAAOA,aAAW,CAAC,SAAU,CAAA;AACjC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs new file mode 100644 index 00000000..600b55f9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs @@ -0,0 +1,18 @@ +import { time } from '../../frameloop/sync-time.mjs'; +import { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs'; + +const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; +}; + +export { frameloopDriver }; +//# sourceMappingURL=frame.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map new file mode 100644 index 00000000..0d26036d --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"frame.mjs","sources":["../../../../src/animation/drivers/frame.ts"],"sourcesContent":["import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n"],"names":[],"mappings":";;;AAKa,MAAA,eAAe,GAAW,CAAC,MAAM,KAAI;AAC9C,IAAA,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAa,KAAK,MAAM,CAAC,SAAS,CAAC,CAAA;IAErE,OAAO;AACH,QAAA,KAAK,EAAE,CAAC,SAAS,GAAG,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC;AACnE,QAAA,IAAI,EAAE,MAAM,WAAW,CAAC,aAAa,CAAC;AACtC;;;AAGG;QACH,GAAG,EAAE,OAAO,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;KACzE,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs new file mode 100644 index 00000000..c9f7154e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs @@ -0,0 +1,88 @@ +import { spring } from './spring/index.mjs'; +import { calcGeneratorVelocity } from './utils/velocity.mjs'; + +function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; +} + +export { inertia }; +//# sourceMappingURL=inertia.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map new file mode 100644 index 00000000..87c0cb5c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"inertia.mjs","sources":["../../../../src/animation/generators/inertia.ts"],"sourcesContent":["import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { calcGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions): KeyframeGenerator {\n const origin = keyframes[0]\n\n const state: AnimationState = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n"],"names":["spring","createSpring"],"mappings":";;;SAQgB,OAAO,CAAC,EACpB,SAAS,EACT,QAAQ,GAAG,GAAG,EACd,KAAK,GAAG,GAAG,EACX,YAAY,GAAG,GAAG,EAClB,aAAa,GAAG,EAAE,EAClB,eAAe,GAAG,GAAG,EACrB,YAAY,EACZ,GAAG,EACH,GAAG,EACH,SAAS,GAAG,GAAG,EACf,SAAS,GACmB,EAAA;AAC5B,IAAA,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;AAE3B,IAAA,MAAM,KAAK,GAA2B;AAClC,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,KAAK,EAAE,MAAM;KAChB,CAAA;IAED,MAAM,aAAa,GAAG,CAAC,CAAS,KAC5B,CAAC,GAAG,KAAK,SAAS,IAAI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AAO,KAAK,CAAA;aACf;SACJ;KACJ,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs new file mode 100644 index 00000000..aeca9164 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs @@ -0,0 +1,50 @@ +import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils'; +import { interpolate } from '../../utils/interpolate.mjs'; +import { defaultOffset } from '../keyframes/offsets/default.mjs'; +import { convertOffsetToTimes } from '../keyframes/offsets/time.mjs'; + +function defaultEasing(values, easing) { + return values.map(() => easing || easeInOut).splice(0, values.length - 1); +} +function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = isEasingArray(ease) + ? ease.map(easingDefinitionToFunction) + : easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; +} + +export { defaultEasing, keyframes }; +//# sourceMappingURL=keyframes.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map new file mode 100644 index 00000000..168c3e30 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keyframes.mjs","sources":["../../../../src/animation/generators/keyframes.ts"],"sourcesContent":["import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions): KeyframeGenerator {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n"],"names":[],"mappings":";;;;;AAgBgB,SAAA,aAAa,CACzB,MAAa,EACb,MAAuB,EAAA;IAEvB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,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/dist/es/animation/generators/spring/defaults.mjs b/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs new file mode 100644 index 00000000..0e5bfce6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs @@ -0,0 +1,28 @@ +const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, +}; + +export { springDefaults }; +//# sourceMappingURL=defaults.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs.map new file mode 100644 index 00000000..d8647ec3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"defaults.mjs","sources":["../../../../../src/animation/generators/spring/defaults.ts"],"sourcesContent":["export const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n}\n"],"names":[],"mappings":"AAAa,MAAA,cAAc,GAAG;;AAE1B,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,QAAQ,EAAE,GAAG;;IAGb,QAAQ,EAAE,GAAG;AACb,IAAA,MAAM,EAAE,GAAG;IACX,cAAc,EAAE,GAAG;;AAGnB,IAAA,SAAS,EAAE;AACP,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,OAAO,EAAE,CAAC;AACb,KAAA;AACD,IAAA,SAAS,EAAE;AACP,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,OAAO,EAAE,GAAG;AACf,KAAA;;IAGD,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,IAAI;AACjB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,UAAU,EAAE,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs b/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs new file mode 100644 index 00000000..b271964d --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs @@ -0,0 +1,85 @@ +import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils'; +import { springDefaults } from './defaults.mjs'; + +const safeMin = 0.001; +function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } +} +const rootIterations = 12; +function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; +} +function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); +} + +export { calcAngularFreq, findSpring }; +//# sourceMappingURL=find.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs.map new file mode 100644 index 00000000..eebc8ef3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"find.mjs","sources":["../../../../../src/animation/generators/spring/find.ts"],"sourcesContent":["import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport { SpringOptions } from \"../../types\"\nimport { springDefaults } from \"./defaults\"\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\n\ntype Resolver = (num: number) => number\n\nconst safeMin = 0.001\n\nexport function findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: Resolver\n let derivative: Resolver\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: Resolver,\n derivative: Resolver,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\nexport function calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n"],"names":[],"mappings":";;;AAeA,MAAM,OAAO,GAAG,KAAK,CAAA;AAEf,SAAU,UAAU,CAAC,EACvB,QAAQ,GAAG,cAAc,CAAC,QAAQ,EAClC,MAAM,GAAG,cAAc,CAAC,MAAM,EAC9B,QAAQ,GAAG,cAAc,CAAC,QAAQ,EAClC,IAAI,GAAG,cAAc,CAAC,IAAI,GACd,EAAA;AACZ,IAAA,IAAI,QAAkB,CAAA;AACtB,IAAA,IAAI,UAAoB,CAAA;AAExB,IAAA,OAAO,CACH,QAAQ,IAAI,qBAAqB,CAAC,cAAc,CAAC,WAAW,CAAC,EAC7D,4CAA4C,EAC5C,uBAAuB,CAC1B,CAAA;AAED,IAAA,IAAI,YAAY,GAAG,CAAC,GAAG,MAAM,CAAA;AAE7B;;AAEG;AACH,IAAA,YAAY,GAAG,KAAK,CAChB,cAAc,CAAC,UAAU,EACzB,cAAc,CAAC,UAAU,EACzB,YAAY,CACf,CAAA;AACD,IAAA,QAAQ,GAAG,KAAK,CACZ,cAAc,CAAC,WAAW,EAC1B,cAAc,CAAC,WAAW,EAC1B,qBAAqB,CAAC,QAAQ,CAAC,CAClC,CAAA;AAED,IAAA,IAAI,YAAY,GAAG,CAAC,EAAE;AAClB;;AAEG;AACH,QAAA,QAAQ,GAAG,CAAC,YAAY,KAAI;AAC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B,UAAoB,EACpB,YAAoB,EAAA;IAEpB,IAAI,MAAM,GAAG,YAAY,CAAA;AACzB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE;AACrC,QAAA,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;KAC1D;AACD,IAAA,OAAO,MAAM,CAAA;AACjB,CAAC;AAEe,SAAA,eAAe,CAAC,YAAoB,EAAE,YAAoB,EAAA;AACtE,IAAA,OAAO,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,GAAG,YAAY,CAAC,CAAA;AACpE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs b/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs new file mode 100644 index 00000000..01576ac5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs @@ -0,0 +1,176 @@ +import { millisecondsToSeconds, secondsToMilliseconds, clamp } from 'motion-utils'; +import { generateLinearEasing } from '../../waapi/utils/linear.mjs'; +import { calcGeneratorDuration, maxGeneratorDuration } from '../utils/calc-duration.mjs'; +import { createGeneratorEasing } from '../utils/create-generator-easing.mjs'; +import { calcGeneratorVelocity } from '../utils/velocity.mjs'; +import { springDefaults } from './defaults.mjs'; +import { findSpring, calcAngularFreq } from './find.mjs'; + +const durationKeys = ["duration", "bounce"]; +const physicsKeys = ["stiffness", "damping", "mass"]; +function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); +} +function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring(options); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; +} +function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + if (dampingRatio < 1) { + const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq) * + Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + next: (t) => { + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + let currentVelocity = t === 0 ? initialVelocity : 0.0; + /** + * We only need to calculate velocity for under-damped springs + * as over- and critically-damped springs can't overshoot, so + * checking only for displacement is enough. + */ + if (dampingRatio < 1) { + currentVelocity = + t === 0 + ? secondsToMilliseconds(initialVelocity) + : calcGeneratorVelocity(resolveSpring, t, current); + } + const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; + const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; + state.done = + isBelowVelocityThreshold && isBelowDisplacementThreshold; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; +} +spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; +}; + +export { spring }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs.map new file mode 100644 index 00000000..cd33cd75 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/animation/generators/spring/index.ts"],"sourcesContent":["import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../../types\"\nimport { generateLinearEasing } from \"../../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"../utils/calc-duration\"\nimport { createGeneratorEasing } from \"../utils/create-generator-easing\"\nimport { calcGeneratorVelocity } from \"../utils/velocity\"\nimport { springDefaults } from \"./defaults\"\nimport { calcAngularFreq, findSpring } from \"./find\"\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring(options)\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t: number) => {\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0\n\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current)\n }\n\n const isBelowVelocityThreshold =\n Math.abs(currentVelocity) <= restSpeed!\n const isBelowDisplacementThreshold =\n Math.abs(target - current) <= restDelta!\n\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n"],"names":[],"mappings":";;;;;;;;AAsBA,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;AAC3C,MAAM,WAAW,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;AAEpD,SAAS,YAAY,CAAC,OAAsB,EAAE,IAAc,EAAA;AACxD,IAAA,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,KAAM,OAAe,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAsB,EAAA;AAC5C,IAAA,IAAI,aAAa,GAAG;QAChB,QAAQ,EAAE,cAAc,CAAC,QAAQ;QACjC,SAAS,EAAE,cAAc,CAAC,SAAS;QACnC,OAAO,EAAE,cAAc,CAAC,OAAO;QAC/B,IAAI,EAAE,cAAc,CAAC,IAAI;AACzB,QAAA,sBAAsB,EAAE,KAAK;AAC7B,QAAA,GAAG,OAAO;KACb,CAAA;;AAED,IAAA,IACI,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC;AACnC,QAAA,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,EACrC;AACE,QAAA,IAAI,OAAO,CAAC,cAAc,EAAE;AACxB,YAAA,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAA;AAC7C,YAAA,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,KAAK,cAAc,GAAG,GAAG,CAAC,CAAA;AACnD,YAAA,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;YAC7B,MAAM,OAAO,GACT,CAAC;AACD,gBAAA,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,OAAO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7C;AACD,QAAA,YAAY,EAAE,MAAK,GAAG;KACzB,CAAA;AAED,IAAA,OAAO,SAAS,CAAA;AACpB,CAAC;AAED,MAAM,CAAC,cAAc,GAAG,CAAC,OAAmB,KAAI;IAC5C,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,OAAc,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;AAE3E,IAAA,OAAO,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAA;IACpC,OAAO,CAAC,QAAQ,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;AACnE,IAAA,OAAO,CAAC,IAAI,GAAG,WAAW,CAAA;AAC1B,IAAA,OAAO,OAAO,CAAA;AAClB,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs new file mode 100644 index 00000000..03d80777 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs @@ -0,0 +1,18 @@ +/** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ +const maxGeneratorDuration = 20000; +function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; +} + +export { calcGeneratorDuration, maxGeneratorDuration }; +//# sourceMappingURL=calc-duration.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map new file mode 100644 index 00000000..f444fa3f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-duration.mjs","sources":["../../../../../src/animation/generators/utils/calc-duration.ts"],"sourcesContent":["import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator\n): number {\n let duration = 0\n const timeStep = 50\n let state = generator.next(duration)\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep\n state = generator.next(duration)\n }\n\n return duration >= maxGeneratorDuration ? Infinity : duration\n}\n"],"names":[],"mappings":"AAEA;;;AAGG;AACI,MAAM,oBAAoB,GAAG,MAAM;AACpC,SAAU,qBAAqB,CACjC,SAAqC,EAAA;IAErC,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,MAAM,QAAQ,GAAG,EAAE,CAAA;IACnB,IAAI,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACpC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,QAAQ,GAAG,oBAAoB,EAAE;QACnD,QAAQ,IAAI,QAAQ,CAAA;AACpB,QAAA,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;KACnC;IAED,OAAO,QAAQ,IAAI,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,CAAA;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs new file mode 100644 index 00000000..7609efed --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs @@ -0,0 +1,20 @@ +import { millisecondsToSeconds } from 'motion-utils'; +import { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs'; + +/** + * Create a progress => progress easing function from a generator. + */ +function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: millisecondsToSeconds(duration), + }; +} + +export { createGeneratorEasing }; +//# sourceMappingURL=create-generator-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map new file mode 100644 index 00000000..c4610b5a --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-generator-easing.mjs","sources":["../../../../../src/animation/generators/utils/create-generator-easing.ts"],"sourcesContent":["import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n"],"names":[],"mappings":";;;AAIA;;AAEG;AACG,SAAU,qBAAqB,CACjC,OAAmB,EACnB,KAAK,GAAG,GAAG,EACX,eAAiC,EAAA;AAEjC,IAAA,MAAM,SAAS,GAAG,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;AACxE,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACrB,qBAAqB,CAAC,SAAS,CAAC,EAChC,oBAAoB,CACvB,CAAA;IAED,OAAO;AACH,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,IAAI,EAAE,CAAC,QAAgB,KAAI;AACvB,YAAA,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,KAAK,GAAG,KAAK,CAAA;SAC3D;AACD,QAAA,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,CAAC;KAC5C,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs new file mode 100644 index 00000000..e240fd24 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs @@ -0,0 +1,6 @@ +function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; +} + +export { isGenerator }; +//# sourceMappingURL=is-generator.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map new file mode 100644 index 00000000..ef952a22 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-generator.mjs","sources":["../../../../../src/animation/generators/utils/is-generator.ts"],"sourcesContent":["import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n"],"names":[],"mappings":"AAEM,SAAU,WAAW,CACvB,IAA6B,EAAA;IAE7B,OAAO,OAAO,IAAI,KAAK,UAAU,IAAI,gBAAgB,IAAI,IAAI,CAAA;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs new file mode 100644 index 00000000..e952df96 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs @@ -0,0 +1,10 @@ +import { velocityPerSecond } from 'motion-utils'; + +const velocitySampleDuration = 5; // ms +function calcGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return velocityPerSecond(current - resolveValue(prevT), t - prevT); +} + +export { calcGeneratorVelocity }; +//# sourceMappingURL=velocity.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map new file mode 100644 index 00000000..7c4dbd3b --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"velocity.mjs","sources":["../../../../../src/animation/generators/utils/velocity.ts"],"sourcesContent":["import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function calcGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n"],"names":[],"mappings":";;AAEA,MAAM,sBAAsB,GAAG,CAAC,CAAA;SAEhB,qBAAqB,CACjC,YAAmC,EACnC,CAAS,EACT,OAAe,EAAA;AAEf,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,sBAAsB,EAAE,CAAC,CAAC,CAAA;AACrD,IAAA,OAAO,iBAAiB,CAAC,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAA;AACtE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs new file mode 100644 index 00000000..3c9a5480 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs @@ -0,0 +1,104 @@ +import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils'; +import { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs'; +import { JSAnimation } from '../JSAnimation.mjs'; +import { getValueTransition } from '../utils/get-value-transition.mjs'; +import { makeAnimationInstant } from '../utils/make-animation-instant.mjs'; +import { getDefaultTransition } from '../utils/default-transitions.mjs'; +import { getFinalKeyframe } from '../utils/get-final-keyframe.mjs'; +import { isTransitionDefined } from '../utils/is-transition-defined.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (MotionGlobalConfig.instantAnimations || + MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); +}; + +export { animateMotionValue }; +//# sourceMappingURL=motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map new file mode 100644 index 00000000..7fd15147 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"motion-value.mjs","sources":["../../../../src/animation/interfaces/motion-value.ts"],"sourcesContent":["import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../utils/get-final-keyframe\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n (\n name: string,\n value: MotionValue,\n target: V | UnresolvedKeyframes,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n"],"names":[],"mappings":";;;;;;;;;;MAkBa,kBAAkB,GAC3B,CACI,IAAY,EACZ,KAAqB,EACrB,MAAkC,EAClC,aAAqD,EAAE,EACvD,OAA4B,EAC5B,SAAmB,KAEvB,CAAC,UAAU,KAAI;IACX,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,CAAA;AAElE;;;;AAIG;IACH,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,IAAI,CAAC,CAAA;AAE5D;;;AAGG;AACH,IAAA,IAAI,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,UAAU,CAAA;AAChC,IAAA,OAAO,GAAG,OAAO,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA;AAEhD,IAAA,MAAM,OAAO,GAA0B;AACnC,QAAA,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC;AAC1D,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE;AAC7B,QAAA,GAAG,eAAe;QAClB,KAAK,EAAE,CAAC,OAAO;AACf,QAAA,QAAQ,EAAE,CAAC,CAAC,KAAI;AACZ,YAAA,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;YACZ,eAAe,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,C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A;QACjB,oBAAoB,CAAC,OAAO,CAAC,CAAA;AAC7B,QAAA,OAAO,CAAC,KAAK,GAAG,CAAC,CAAA;KACpB;AAED;;;AAGG;AACH,IAAA,OAAO,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAA;AAErE;;;;AAIG;AACH,IAAA,IAAI,UAAU,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,GAAG,EAAE,KAAK,SAAS,EAAE;QACvD,MAAM,aAAa,GAAG,gBAAgB,CAClC,OAAO,CAAC,SAAgB,EACxB,eAAe,CAClB,CAAA;AAED,QAAA,IAAI,aAAa,KAAK,SAAS,EAAE;AAC7B,YAAA,KAAK,CAAC,MAAM,CAAC,MAAK;AACd,gBAAA,OAAO,CAAC,QAAS,CAAC,aAAa,CAAC,CAAA;gBAChC,OAAO,CAAC,UAAW,EAAE,CAAA;AACzB,aAAC,CAAC,CAAA;YAEF,OAAM;SACT;KACJ;IAED,OAAO,eAAe,CAAC,MAAM;AACzB,UAAE,IAAI,WAAW,CAAC,OAAO,CAAC;AAC1B,UAAE,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAA;AAChD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs new file mode 100644 index 00000000..735038e8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs @@ -0,0 +1,97 @@ +import { getValueTransition } from '../utils/get-value-transition.mjs'; +import { resolveTransition } from '../utils/resolve-transition.mjs'; +import { positionalKeys } from '../../render/utils/keys-position.mjs'; +import { setTarget } from '../../render/utils/setters.mjs'; +import { addValueToWillChange } from '../../value/will-change/add-will-change.mjs'; +import { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs'; +import { animateMotionValue } from './motion-value.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +/** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ +function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; +} +function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition(transition || {}, key), + }; + /** + * If the value is already at the defined target, skip the animation. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; +} + +export { animateTarget }; +//# sourceMappingURL=visual-element-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map new file mode 100644 index 00000000..556e6fbb --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visual-element-target.mjs","sources":["../../../../src/animation/interfaces/visual-element-target.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { resolveTransition } from \"../utils/resolve-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition,\n transitionEnd,\n ...target\n } = targetAndTransition\n\n const defaultTransition = visualElement.getDefaultTransition()\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition\n\n const reduceMotion = (transition as { reduceMotion?: boolean })?.reduceMotion\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n const shouldReduceMotion =\n reduceMotion ?? visualElement.shouldReduceMotion\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd)\n } else {\n applyTransitionEnd()\n }\n }\n\n return animations\n}\n"],"names":[],"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;cACf,eAAe,EACrB,aAAa,EACb,SAAS,CACZ,CACJ,CAAA;AAED,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;QAEjC,IAAI,SAAS,EAAE;AACX,YAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SAC7B;KACJ;IAED,IAAI,aAAa,EAAE;QACf,MAAM,kBAAkB,GAAG,MACvB,KAAK,CAAC,MAAM,CAAC,MAAK;AACd,YAAA,aAAa,IAAI,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;AAC5D,SAAC,CAAC,CAAA;AAEN,QAAA,IAAI,UAAU,CAAC,MAAM,EAAE;YACnB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;SACnD;aAAM;AACH,YAAA,kBAAkB,EAAE,CAAA;SACvB;KACJ;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs new file mode 100644 index 00000000..65af3724 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs @@ -0,0 +1,60 @@ +import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs'; +import { calcChildStagger } from '../utils/calc-child-stagger.mjs'; +import { animateTarget } from './visual-element-target.mjs'; + +function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } +} +function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); +} + +export { animateVariant }; +//# sourceMappingURL=visual-element-variant.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map new file mode 100644 index 00000000..52381ff6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visual-element-variant.mjs","sources":["../../../../src/animation/interfaces/visual-element-variant.ts"],"sourcesContent":["import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise {\n const resolved = resolveVariant(\n visualElement,\n variant,\n options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n let { transition = visualElement.getDefaultTransition() || {} } =\n resolved || {}\n\n if (options.transitionOverride) {\n transition = options.transitionOverride\n }\n\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation: () => Promise = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve()\n\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations =\n visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n\n return animateChildren(\n visualElement,\n variant,\n forwardDelay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n options\n )\n }\n : () => Promise.resolve()\n\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition\n if (when) {\n const [first, last] =\n when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation]\n\n return first().then(() => last())\n } else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)])\n }\n}\n\nfunction animateChildren(\n visualElement: VisualElement,\n variant: string,\n delay: number = 0,\n delayChildren: number | DynamicOption = 0,\n staggerChildren = 0,\n staggerDirection = 1,\n options: VisualElementAnimationOptions\n) {\n const animations: Promise[] = []\n\n for (const child of visualElement.variantChildren!) {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(\n visualElement.variantChildren!,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n }\n\n return Promise.all(animations)\n}\n"],"names":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CAAC;AACpC,cAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAA;QAE5C,OAAO,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAA;KACpC;SAAM;AACH,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KAC1E;AACL,CAAC;AAED,SAAS,eAAe,CACpB,aAA4B,EAC5B,OAAe,EACf,KAAA,GAAgB,CAAC,EACjB,aAAA,GAAgD,CAAC,EACjD,eAAe,GAAG,CAAC,EACnB,gBAAgB,GAAG,CAAC,EACpB,OAAsC,EAAA;IAEtC,MAAM,UAAU,GAAmB,EAAE,CAAA;AAErC,IAAA,KAAK,MAAM,KAAK,IAAI,aAAa,CAAC,eAAgB,EAAE;AAChD,QAAA,KAAK,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;QACvC,UAAU,CAAC,IAAI,CACX,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE;AAC3B,YAAA,GAAG,OAAO;AACV,YAAA,KAAK,EACD,KAAK;AACL,iBAAC,OAAO,aAAa,KAAK,UAAU,GAAG,CAAC,GAAG,aAAa,CAAC;AACzD,gBAAA,gBAAgB,CACZ,aAAa,CAAC,eAAgB,EAC9B,KAAK,EACL,aAAa,EACb,eAAe,EACf,gBAAgB,CACnB;AACR,SAAA,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,CAC5D,CAAA;KACJ;AAED,IAAA,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs new file mode 100644 index 00000000..ecf983b4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs @@ -0,0 +1,27 @@ +import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs'; +import { animateTarget } from './visual-element-target.mjs'; +import { animateVariant } from './visual-element-variant.mjs'; + +function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); +} + +export { animateVisualElement }; +//# sourceMappingURL=visual-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map new file mode 100644 index 00000000..9c00a912 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visual-element.mjs","sources":["../../../../src/animation/interfaces/visual-element.ts"],"sourcesContent":["import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n"],"names":[],"mappings":";;;;AAOM,SAAU,oBAAoB,CAChC,aAA4B,EAC5B,UAA+B,EAC/B,UAAyC,EAAE,EAAA;AAE3C,IAAA,aAAa,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;AAClD,IAAA,IAAI,SAAuB,CAAA;AAE3B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,KACtC,cAAc,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC,CAClD,CAAA;AACD,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;KACtC;AAAM,SAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QACvC,SAAS,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;KACjE;SAAM;AACH,QAAA,MAAM,kBAAkB,GACpB,OAAO,UAAU,KAAK,UAAU;cAC1B,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC;cACzD,UAAU,CAAA;AAEpB,QAAA,SAAS,GAAG,OAAO,CAAC,GAAG,CACnB,aAAa,CAAC,aAAa,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAC5D,CAAA;KACJ;AAED,IAAA,OAAO,SAAS,CAAC,IAAI,CAAC,MAAK;AACvB,QAAA,aAAa,CAAC,MAAM,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAA;AACzD,KAAC,CAAC,CAAA;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs new file mode 100644 index 00000000..efd2f776 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs @@ -0,0 +1,142 @@ +import { positionalKeys } from '../../render/utils/keys-position.mjs'; +import { findDimensionValueType } from '../../value/types/dimensions.mjs'; +import { getVariableValue } from '../utils/css-variables-conversion.mjs'; +import { isCSSVariableToken, containsCSSVariable } from '../utils/is-css-variable.mjs'; +import { KeyframeResolver } from './KeyframesResolver.mjs'; +import { isNone } from './utils/is-none.mjs'; +import { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs'; +import { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs'; + +class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } +} + +export { DOMKeyframesResolver }; +//# sourceMappingURL=DOMKeyframesResolver.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map new file mode 100644 index 00000000..a1d7a44f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DOMKeyframesResolver.mjs","sources":["../../../../src/animation/keyframes/DOMKeyframesResolver.ts"],"sourcesContent":["import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\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AK,CAAC,CAAA;SACvE;KACJ;IAED,eAAe,GAAA;QACX,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAA;AAEnD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAM;QAExC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QACpC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;AAE/C,QAAA,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAA;AACzD,QAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAA;QAE7D,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAC5D,OAAO,CAAC,kBAAkB,EAAE,EAC5B,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CACpC,CAAA;QAER,IAAI,aAAa,KAAK,IAAI,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE;AAC5D,YAAA,IAAI,CAAC,aAAa,GAAG,aAAkB,CAAA;SAC1C;;AAGD,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE;AAChC,YAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAC1B,CAAC,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,KAAI;gBAC1C,OAAO;qBACF,QAAQ,CAAC,kBAAkB,CAAE;qBAC7B,GAAG,CAAC,mBAAmB,CAAC,CAAA;AACjC,aAAC,CACJ,CAAA;SACJ;QAED,IAAI,CAAC,oBAAoB,EAAE,CAAA;KAC9B;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs new file mode 100644 index 00000000..262a2f3f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs @@ -0,0 +1,148 @@ +import { fillWildcards } from './utils/fill-wildcards.mjs'; +import { removeNonTranslationalTransform } from './utils/unit-conversion.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +const toResolve = new Set(); +let isScheduled = false; +let anyNeedsMeasurement = false; +let isForced = false; +function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); +} +function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); +} +function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; +} +class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } +} + +export { KeyframeResolver, flushKeyframeResolvers }; +//# sourceMappingURL=KeyframesResolver.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map new file mode 100644 index 00000000..3de52321 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"KeyframesResolver.mjs","sources":["../../../../src/animation/keyframes/KeyframesResolver.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes = Array\n\nexport type ResolvedKeyframes = Array\n\nconst toResolve = new Set()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved = (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes\n\n private motionValue?: MotionValue\n private onComplete: OnKeyframesResolved\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n"],"names":[],"mappings":";;;;AAWA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAA;AAC7C,IAAI,WAAW,GAAG,KAAK,CAAA;AACvB,IAAI,mBAAmB,GAAG,KAAK,CAAA;AAC/B,IAAI,QAAQ,GAAG,KAAK,CAAA;AAEpB,SAAS,mBAAmB,GAAA;IACxB,IAAI,mBAAmB,EAAE;QACrB,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CACnD,CAAC,QAA0B,KAAK,QAAQ,CAAC,gBAAgB,CAC5D,CAAA;AACD,QAAA,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC7B,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,CAAC,CACzD,CAAA;AACD,QAAA,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAGhC,CAAA;AAEH;;;AAGG;AACH,QAAA,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAmB,KAAI;AAC9C,YAAA,MAA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mB,CAAC,CAAA;KACrC;AAED,IAAA,gBAAgB,MAAK;AACrB,IAAA,mBAAmB,MAAK;AACxB,IAAA,eAAe,MAAK;AACpB,IAAA,eAAe,MAAK;IAEpB,QAAQ,CAAC,gBAAgB,GAAG,KAAK,EAAA;AAC7B,QAAA,IAAI,CAAC,KAAK,GAAG,UAAU,CAAA;AAEvB,QAAA,IAAI,CAAC,UAAU,CACX,IAAI,CAAC,mBAA2C,EAChD,IAAI,CAAC,aAAkB,EACvB,gBAAgB,CACnB,CAAA;AAED,QAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;KACzB;IAED,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;AAC5B,YAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AACtB,YAAA,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;SACzB;KACJ;IAED,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,eAAe,EAAE,CAAA;KACvD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs new file mode 100644 index 00000000..4306bd86 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs @@ -0,0 +1,12 @@ +const isNotNull = (value) => value !== null; +function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; +} + +export { getFinalKeyframe }; +//# sourceMappingURL=get-final.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map new file mode 100644 index 00000000..f9e330cf --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-final.mjs","sources":["../../../../src/animation/keyframes/get-final.ts"],"sourcesContent":["import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,CAAC,KAAc,KAAK,KAAK,KAAK,IAAI,CAAA;SAEpC,gBAAgB,CAC5B,SAAc,EACd,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,EAA4B,EACzD,aAAiB,EACjB,QAAgB,CAAC,EAAA;IAEjB,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AACrD,IAAA,MAAM,gBAAgB,GAClB,KAAK,GAAG,CAAC,KAAK,MAAM,IAAI,UAAU,KAAK,MAAM,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;AACtE,IAAA,MAAM,KAAK,GAAG,gBAAgB,GAAG,CAAC,GAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAA;AAEjE,IAAA,OAAO,CAAC,KAAK,IAAI,aAAa,KAAK,SAAS;AACxC,UAAE,iBAAiB,CAAC,KAAK,CAAC;UACxB,aAAa,CAAA;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs new file mode 100644 index 00000000..c2735fe9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs @@ -0,0 +1,10 @@ +import { fillOffset } from './fill.mjs'; + +function defaultOffset(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; +} + +export { defaultOffset }; +//# sourceMappingURL=default.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map new file mode 100644 index 00000000..71d29d16 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"default.mjs","sources":["../../../../../src/animation/keyframes/offsets/default.ts"],"sourcesContent":["import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n"],"names":[],"mappings":";;AAEM,SAAU,aAAa,CAAC,GAAU,EAAA;AACpC,IAAA,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;IAClB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAClC,IAAA,OAAO,MAAM,CAAA;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs new file mode 100644 index 00000000..9f1f783d --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs @@ -0,0 +1,13 @@ +import { progress } from 'motion-utils'; +import { mixNumber } from '../../../utils/mix/number.mjs'; + +function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = progress(0, remaining, i); + offset.push(mixNumber(min, 1, offsetProgress)); + } +} + +export { fillOffset }; +//# sourceMappingURL=fill.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map new file mode 100644 index 00000000..cbe8bcb7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"fill.mjs","sources":["../../../../../src/animation/keyframes/offsets/fill.ts"],"sourcesContent":["import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n"],"names":[],"mappings":";;;AAGgB,SAAA,UAAU,CAAC,MAAgB,EAAE,SAAiB,EAAA;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AACrC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,EAAE,EAAE;QACjC,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;AAChD,QAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC,CAAA;KACjD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs new file mode 100644 index 00000000..9c2a8cfd --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs @@ -0,0 +1,6 @@ +function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); +} + +export { convertOffsetToTimes }; +//# sourceMappingURL=time.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map new file mode 100644 index 00000000..5723e15c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"time.mjs","sources":["../../../../../src/animation/keyframes/offsets/time.ts"],"sourcesContent":["export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n"],"names":[],"mappings":"AAAgB,SAAA,oBAAoB,CAAC,MAAgB,EAAE,QAAgB,EAAA;AACnE,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,CAAA;AAC1C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs new file mode 100644 index 00000000..1f370359 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs @@ -0,0 +1,12 @@ +import { pxValues } from '../../waapi/utils/px-values.mjs'; + +function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } +} + +export { applyPxDefaults }; +//# sourceMappingURL=apply-px-defaults.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map new file mode 100644 index 00000000..eadbccdc --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"apply-px-defaults.mjs","sources":["../../../../../src/animation/keyframes/utils/apply-px-defaults.ts"],"sourcesContent":["import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\nimport { pxValues } from \"../../waapi/utils/px-values\"\n\nexport function applyPxDefaults(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[],\n name: string\n) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\"\n }\n }\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,eAAe,CAC3B,SAAsD,EACtD,IAAY,EAAA;AAEZ,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IAAI,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACxD,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;SACrC;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs new file mode 100644 index 00000000..38758530 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs @@ -0,0 +1,8 @@ +function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } +} + +export { fillWildcards }; +//# sourceMappingURL=fill-wildcards.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map new file mode 100644 index 00000000..c7500703 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"fill-wildcards.mjs","sources":["../../../../../src/animation/keyframes/utils/fill-wildcards.ts"],"sourcesContent":["import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n"],"names":[],"mappings":"AAEM,SAAU,aAAa,CACzB,SAAsD,EAAA;AAEtD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,SAAS,CAAC,CAAC,CAAX,KAAA,SAAS,CAAC,CAAC,CAAM,GAAA,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA,CAAA;KACpC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs new file mode 100644 index 00000000..70b75395 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs @@ -0,0 +1,16 @@ +import { isZeroValueString } from 'motion-utils'; + +function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || isZeroValueString(value); + } + else { + return true; + } +} + +export { isNone }; +//# sourceMappingURL=is-none.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map new file mode 100644 index 00000000..c76910ec --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-none.mjs","sources":["../../../../../src/animation/keyframes/utils/is-none.ts"],"sourcesContent":["import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,MAAM,CAAC,KAAiC,EAAA;AACpD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,OAAO,KAAK,KAAK,CAAC,CAAA;KACrB;AAAM,SAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AACvB,QAAA,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAA;KACvE;SAAM;AACH,QAAA,OAAO,IAAI,CAAA;KACd;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs new file mode 100644 index 00000000..878d19f6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs @@ -0,0 +1,31 @@ +import { analyseComplexValue } from '../../../value/types/complex/index.mjs'; +import { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs'; + +/** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ +const invalidTemplates = new Set(["auto", "none", "0"]); +function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } +} + +export { makeNoneKeyframesAnimatable }; +//# sourceMappingURL=make-none-animatable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map new file mode 100644 index 00000000..e0dee803 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"make-none-animatable.mjs","sources":["../../../../../src/animation/keyframes/utils/make-none-animatable.ts"],"sourcesContent":["import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n"],"names":[],"mappings":";;;AAKA;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;SAEvC,2BAA2B,CACvC,mBAA6D,EAC7D,mBAA6B,EAC7B,IAAa,EAAA;IAEb,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,IAAI,kBAAkB,GAAuB,SAAS,CAAA;IACtD,OAAO,CAAC,GAAG,mBAAmB,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE;AAC1D,QAAA,MAAM,QAAQ,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;QACvC,IACI,OAAO,QAAQ,KAAK,QAAQ;AAC5B,YAAA,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC/B,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,EAC7C;AACE,YAAA,kBAAkB,GAAG,mBAAmB,CAAC,CAAC,CAAW,CAAA;SACxD;AACD,QAAA,CAAC,EAAE,CAAA;KACN;AAED,IAAA,IAAI,kBAAkB,IAAI,IAAI,EAAE;AAC5B,QAAA,KAAK,MAAM,SAAS,IAAI,mBAAmB,EAAE;YACzC,mBAAmB,CAAC,SAAS,CAAC,GAAG,iBAAiB,CAC9C,IAAI,EACJ,kBAAkB,CACrB,CAAA;SACJ;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs new file mode 100644 index 00000000..1792f3b8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs @@ -0,0 +1,37 @@ +import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs'; +import { transformPropOrder } from '../../../render/utils/keys-transform.mjs'; +import { number } from '../../../value/types/numbers/index.mjs'; +import { px } from '../../../value/types/numbers/units.mjs'; + +const isNumOrPxType = (v) => v === number || v === px; +const transformKeys = new Set(["x", "y", "z"]); +const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); +function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; +} +const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight), + height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom), + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), +}; +// Alias translate longform names +positionalValues.translateX = positionalValues.x; +positionalValues.translateY = positionalValues.y; + +export { isNumOrPxType, positionalValues, removeNonTranslationalTransform }; +//# sourceMappingURL=unit-conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map new file mode 100644 index 00000000..44ff1d8f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"unit-conversion.mjs","sources":["../../../../../src/animation/keyframes/utils/unit-conversion.ts"],"sourcesContent":["import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) =>\n x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) =>\n y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n"],"names":[],"mappings":";;;;;AAUa,MAAA,aAAa,GAAG,CAAC,CAAa,KACvC,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,GAAE;AAO5B,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC9C,MAAM,6BAA6B,GAAG,kBAAkB,CAAC,MAAM,CAC3D,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CACnC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AE,GAAG,EAAE,KAAK,UAAU,CAAC,GAAa,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;IACvE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KACnB,UAAU,CAAC,IAAc,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;;AAGhD,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,uBAAuB,CAAC,SAAS,EAAE,GAAG,CAAC;AACpE,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,uBAAuB,CAAC,SAAS,EAAE,GAAG,CAAC;EACvE;AAEL;AACA,gBAAgB,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC,CAAA;AAChD,gBAAgB,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs new file mode 100644 index 00000000..a15a5112 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs @@ -0,0 +1,7 @@ +import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs'; + +const optimizedAppearDataId = "framerAppearId"; +const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + +export { optimizedAppearDataAttribute, optimizedAppearDataId }; +//# sourceMappingURL=data-id.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map new file mode 100644 index 00000000..bfea8806 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"data-id.mjs","sources":["../../../../src/animation/optimized-appear/data-id.ts"],"sourcesContent":["import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n"],"names":[],"mappings":";;AAEO,MAAM,qBAAqB,GAAG,iBAAgB;AAExC,MAAA,4BAA4B,GACrC,OAAO,GAAG,WAAW,CAAC,qBAAqB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs new file mode 100644 index 00000000..7026149e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs @@ -0,0 +1,8 @@ +import { optimizedAppearDataAttribute } from './data-id.mjs'; + +function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; +} + +export { getOptimisedAppearId }; +//# sourceMappingURL=get-appear-id.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map new file mode 100644 index 00000000..0c62751e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-appear-id.mjs","sources":["../../../../src/animation/optimized-appear/get-appear-id.ts"],"sourcesContent":["import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n"],"names":[],"mappings":";;AAGM,SAAU,oBAAoB,CAChC,aAA8B,EAAA;AAE9B,IAAA,OAAO,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAA;AAC5D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs new file mode 100644 index 00000000..54a42a1e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs @@ -0,0 +1,27 @@ +class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } +} + +export { WithPromise }; +//# sourceMappingURL=WithPromise.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map new file mode 100644 index 00000000..5fb94913 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"WithPromise.mjs","sources":["../../../../src/animation/utils/WithPromise.ts"],"sourcesContent":["export class WithPromise {\n protected _finished: Promise\n\n resolve: VoidFunction\n\n constructor() {\n this.updateFinished()\n }\n\n get finished() {\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve\n })\n }\n\n protected notifyFinished() {\n this.resolve()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n"],"names":[],"mappings":"MAAa,WAAW,CAAA;AAKpB,IAAA,WAAA,GAAA;QACI,IAAI,CAAC,cAAc,EAAE,CAAA;KACxB;AAED,IAAA,IAAI,QAAQ,GAAA;QACR,OAAO,IAAI,CAAC,SAAS,CAAA;KACxB;IAES,cAAc,GAAA;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AAC3C,YAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;AAC1B,SAAC,CAAC,CAAA;KACL;IAES,cAAc,GAAA;QACpB,IAAI,CAAC,OAAO,EAAE,CAAA;KACjB;AAED;;;;AAIG;IACH,IAAI,CAAC,SAAuB,EAAE,QAAuB,EAAA;QACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;KACjD;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs new file mode 100644 index 00000000..7d052fd9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs @@ -0,0 +1,10 @@ +const animationMaps = new WeakMap(); +const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; +function getAnimationMap(element) { + const map = animationMaps.get(element) || new Map(); + animationMaps.set(element, map); + return map; +} + +export { animationMapKey, getAnimationMap }; +//# sourceMappingURL=active-animations.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map new file mode 100644 index 00000000..c2716653 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/active-animations.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"active-animations.mjs","sources":["../../../../src/animation/utils/active-animations.ts"],"sourcesContent":["import { NativeAnimation } from \"../NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"../types\"\n\nconst animationMaps = new WeakMap<\n Element,\n Map>\n>()\nexport const animationMapKey = (name: string, pseudoElement: string = \"\") =>\n `${name}:${pseudoElement}`\n\nexport function getAnimationMap(element: Element) {\n const map = animationMaps.get(element) || new Map()\n animationMaps.set(element, map)\n\n return map\n}\n"],"names":[],"mappings":"AAGA,MAAM,aAAa,GAAG,IAAI,OAAO,EAG9B,CAAA;AACU,MAAA,eAAe,GAAG,CAAC,IAAY,EAAE,aAAA,GAAwB,EAAE,KACpE,CAAA,EAAG,IAAI,CAAI,CAAA,EAAA,aAAa,GAAE;AAExB,SAAU,eAAe,CAAC,OAAgB,EAAA;AAC5C,IAAA,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,EAAE,CAAA;AACnD,IAAA,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAE/B,IAAA,OAAO,GAAG,CAAA;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs new file mode 100644 index 00000000..4ddf789d --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs @@ -0,0 +1,16 @@ +function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; +} + +export { calcChildStagger }; +//# sourceMappingURL=calc-child-stagger.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map new file mode 100644 index 00000000..a07b2d7c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"calc-child-stagger.mjs","sources":["../../../../src/animation/utils/calc-child-stagger.ts"],"sourcesContent":["import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set,\n child: VisualElement,\n delayChildren?: number | DynamicOption,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child)\n const numChildren = children.size\n const maxStaggerDuration = (numChildren - 1) * staggerChildren\n const delayIsFunction = typeof delayChildren === \"function\"\n\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n"],"names":[],"mappings":"AAGgB,SAAA,gBAAgB,CAC5B,QAA4B,EAC5B,KAAoB,EACpB,aAA8C,EAC9C,eAAA,GAA0B,CAAC,EAC3B,mBAA2B,CAAC,EAAA;AAE5B,IAAA,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC7B,SAAA,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;SACrC,OAAO,CAAC,KAAK,CAAC,CAAA;AACnB,IAAA,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAA;IACjC,MAAM,kBAAkB,GAAG,CAAC,WAAW,GAAG,CAAC,IAAI,eAAe,CAAA;AAC9D,IAAA,MAAM,eAAe,GAAG,OAAO,aAAa,KAAK,UAAU,CAAA;AAE3D,IAAA,OAAO,eAAe;AAClB,UAAE,aAAa,CAAC,KAAK,EAAE,WAAW,CAAC;UACjC,gBAAgB,KAAK,CAAC;cACtB,KAAK,GAAG,eAAe;AACzB,cAAE,kBAAkB,GAAG,KAAK,GAAG,eAAe,CAAA;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs new file mode 100644 index 00000000..0df41720 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs @@ -0,0 +1,44 @@ +import { warning } from 'motion-utils'; +import { isGenerator } from '../generators/utils/is-generator.mjs'; +import { isAnimatable } from './is-animatable.mjs'; + +function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } +} +function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); +} + +export { canAnimate }; +//# sourceMappingURL=can-animate.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map new file mode 100644 index 00000000..ae6272a4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"can-animate.mjs","sources":["../../../../src/animation/utils/can-animate.ts"],"sourcesContent":["import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n"],"names":[],"mappings":";;;;AAMA,SAAS,mBAAmB,CAAC,SAAiC,EAAA;AAC1D,IAAA,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;AAC5B,IAAA,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI,CAAA;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,OAAO;AAAE,YAAA,OAAO,IAAI,CAAA;KAC5C;AACL,CAAC;AAEK,SAAU,UAAU,CACtB,SAAiC,EACjC,IAAa,EACb,IAA6B,EAC7B,QAAiB,EAAA;AAEjB;;;;AAIG;AACH,IAAA,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;AACnC,IAAA,IAAI,cAAc,KAAK,IAAI,EAAE;AACzB,QAAA,OAAO,KAAK,CAAA;KACf;AAED;;;;AAIG;AACH,IAAA,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,YAAY;AAAE,QAAA,OAAO,IAAI,CAAA;IAE5D,MAAM,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACtD,MAAM,kBAAkB,GAAG,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAC7D,MAAM,kBAAkB,GAAG,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,CAAA;IAE7D,OAAO,CACH,kBAAkB,KAAK,kBAAkB,EACzC,6BAA6B,IAAI,CAAA,OAAA,EAAU,cAAc,CAAA,MAAA,EAAS,cAAc,CAAA,IAAA,EAC5E,kBAAkB,GAAG,cAAc,GAAG,cAC1C,CAA+B,6BAAA,CAAA,EAC/B,sBAAsB,CACzB,CAAA;;AAGD,IAAA,IAAI,CAAC,kBAAkB,IAAI,CAAC,kBAAkB,EAAE;AAC5C,QAAA,OAAO,KAAK,CAAA;KACf;AAED,IAAA,QACI,mBAAmB,CAAC,SAAS,CAAC;AAC9B,SAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,EACzD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs new file mode 100644 index 00000000..78c8b404 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs @@ -0,0 +1,42 @@ +import { invariant, isNumericalString } from 'motion-utils'; +import { isCSSVariableToken } from './is-css-variable.mjs'; + +/** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ +const splitCSSVariableRegex = +// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words +/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; +function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; +} +const maxDepth = 4; +function getVariableValue(current, element, depth = 1) { + invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; +} + +export { getVariableValue, parseCSSVariable }; +//# sourceMappingURL=css-variables-conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map new file mode 100644 index 00000000..da7bb7dc --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"css-variables-conversion.mjs","sources":["../../../../src/animation/utils/css-variables-conversion.ts"],"sourcesContent":["import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n"],"names":[],"mappings":";;;AAIA;;;;;;;;AAQG;AAEH,MAAM,qBAAqB;AACvB;AACA,0DAA0D,CAAA;AACxD,SAAU,gBAAgB,CAAC,OAAe,EAAA;IAC5C,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AACjD,IAAA,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG,CAAA;IAEtB,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAA;IAC1C,OAAO,CAAC,KAAK,MAAM,IAAI,MAAM,CAAE,CAAA,EAAE,QAAQ,CAAC,CAAA;AAC9C,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,CAAA;AACZ,SAAU,gBAAgB,CAC5B,OAAyB,EACzB,OAAgB,EAChB,KAAK,GAAG,CAAC,EAAA;IAET,SAAS,CACL,KAAK,IAAI,QAAQ,EACjB,CAAyD,sDAAA,EAAA,OAAO,CAAsD,oDAAA,CAAA,EACtH,mBAAmB,CACtB,CAAA;IAED,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;;AAGnD,IAAA,IAAI,CAAC,KAAK;QAAE,OAAM;;AAGlB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;IAEzE,IAAI,QAAQ,EAAE;AACV,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAA;AAC/B,QAAA,OAAO,iBAAiB,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;KACpE;IAED,OAAO,kBAAkB,CAAC,QAAQ,CAAC;UAC7B,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC;UAC9C,QAAQ,CAAA;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs new file mode 100644 index 00000000..00ca169c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs @@ -0,0 +1,41 @@ +import { transformProps } from '../../render/utils/keys-transform.mjs'; + +const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, +}; +const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, +}); +const keyframesTransition = { + type: "keyframes", + duration: 0.8, +}; +/** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ +const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, +}; +const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; +}; + +export { getDefaultTransition }; +//# sourceMappingURL=default-transitions.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map new file mode 100644 index 00000000..0baf9d98 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/default-transitions.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"default-transitions.mjs","sources":["../../../../src/animation/utils/default-transitions.ts"],"sourcesContent":["import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n"],"names":[],"mappings":";;AAGA,MAAM,iBAAiB,GAAmC;AACtD,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE,EAAE;CAChB,CAAA;AAED,MAAM,sBAAsB,GAAG,CAC3B,MAAe,MACmB;AAClC,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,OAAO,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;AAC/C,IAAA,SAAS,EAAE,EAAE;AAChB,CAAA,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAmC;AACxD,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,QAAQ,EAAE,GAAG;CAChB,CAAA;AAED;;;AAGG;AACH,MAAM,IAAI,GAAmC;AACzC,IAAA,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1B,IAAA,QAAQ,EAAE,GAAG;CAChB,CAAA;AAEY,MAAA,oBAAoB,GAAG,CAChC,QAAgB,EAChB,EAAE,SAAS,EAAyB,KACJ;AAChC,IAAA,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,OAAO,mBAAmB,CAAA;KAC7B;AAAM,SAAA,IAAI,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;AACrC,QAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;AAC/B,cAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;cACpC,iBAAiB,CAAA;KAC1B;AAED,IAAA,OAAO,IAAI,CAAA;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.mjs b/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.mjs new file mode 100644 index 00000000..aeade46c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.mjs @@ -0,0 +1,13 @@ +const isNotNull = (value) => value !== null; +function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const index = repeat && repeatType !== "loop" && repeat % 2 === 1 + ? 0 + : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; +} + +export { getFinalKeyframe }; +//# sourceMappingURL=get-final-keyframe.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.mjs.map new file mode 100644 index 00000000..cbc84aaf --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/get-final-keyframe.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-final-keyframe.mjs","sources":["../../../../src/animation/utils/get-final-keyframe.ts"],"sourcesContent":["import type { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const index =\n repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,CAAC,KAAc,KAAK,KAAK,KAAK,IAAI,CAAA;AAEpC,SAAA,gBAAgB,CAC5B,SAAc,EACd,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,EAA4B,EACzD,aAAiB,EAAA;IAEjB,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AACrD,IAAA,MAAM,KAAK,GACP,MAAM,IAAI,UAAU,KAAK,MAAM,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC;AAC/C,UAAE,CAAC;AACH,UAAE,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAA;AAEtC,IAAA,OAAO,CAAC,KAAK,IAAI,aAAa,KAAK,SAAS;AACxC,UAAE,iBAAiB,CAAC,KAAK,CAAC;UACxB,aAAa,CAAA;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs new file mode 100644 index 00000000..d616d23c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs @@ -0,0 +1,14 @@ +import { resolveTransition } from './resolve-transition.mjs'; + +function getValueTransition(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; +} + +export { getValueTransition }; +//# sourceMappingURL=get-value-transition.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map new file mode 100644 index 00000000..06245390 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-value-transition.mjs","sources":["../../../../src/animation/utils/get-value-transition.ts"],"sourcesContent":["import { resolveTransition } from \"./resolve-transition\"\n\nexport function getValueTransition(transition: any, key: string) {\n const valueTransition =\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition)\n }\n\n return valueTransition\n}\n"],"names":[],"mappings":";;AAEgB,SAAA,kBAAkB,CAAC,UAAe,EAAE,GAAW,EAAA;AAC3D,IAAA,MAAM,eAAe,GACjB,UAAU,GAAG,GAA8B,CAAC;QAC5C,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,UAAU,CAAA;AAEd,IAAA,IAAI,eAAe,KAAK,UAAU,EAAE;AAChC,QAAA,OAAO,iBAAiB,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;KACxD;AAED,IAAA,OAAO,eAAe,CAAA;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs new file mode 100644 index 00000000..b1ca0dae --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs @@ -0,0 +1,31 @@ +import { complex } from '../../value/types/complex/index.mjs'; + +/** + * Check if a value is animatable. Examples: + * + * āœ…: 100, "100px", "#fff" + * āŒ: "block", "url(2.jpg)" + * @param value + * + * @internal + */ +const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; +}; + +export { isAnimatable }; +//# sourceMappingURL=is-animatable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map new file mode 100644 index 00000000..032878b8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-animatable.mjs","sources":["../../../../src/animation/utils/is-animatable.ts"],"sourcesContent":["import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * āœ…: 100, \"100px\", \"#fff\"\n * āŒ: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;;AAQG;MACU,YAAY,GAAG,CACxB,KAA+B,EAC/B,IAAa,KACb;;IAEA,IAAI,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;;;;IAKnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI,CAAA;AAElE,IAAA,IACI,OAAO,KAAK,KAAK,QAAQ;AACzB,SAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,CAAC;AACtC,QAAA,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;MAC3B;AACE,QAAA,OAAO,IAAI,CAAA;KACd;AAED,IAAA,OAAO,KAAK,CAAA;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs new file mode 100644 index 00000000..f0d36187 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs @@ -0,0 +1,27 @@ +const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); +const isCSSVariableName = +/*@__PURE__*/ checkStringStartsWith("--"); +const startsAsVariableToken = +/*@__PURE__*/ checkStringStartsWith("var(--"); +const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); +}; +const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; +/** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ +function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); +} + +export { containsCSSVariable, isCSSVariableName, isCSSVariableToken }; +//# sourceMappingURL=is-css-variable.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map new file mode 100644 index 00000000..05eef947 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-css-variable.mjs","sources":["../../../../src/animation/utils/is-css-variable.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n (token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n"],"names":[],"mappings":"AAMA,MAAM,qBAAqB,GACvB,CAAmB,KAAa,KAChC,CAAC,GAAgC,KAC7B,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;MAE3C,iBAAiB;AAC1B,cAAc,qBAAqB,CAAkB,IAAI,EAAC;AAE9D,MAAM,qBAAqB;AACvB,cAAc,qBAAqB,CAAmB,QAAQ,CAAC,CAAA;AACtD,MAAA,kBAAkB,GAAG,CAC9B,KAAc,KACa;AAC3B,IAAA,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA;AAEpD,IAAA,IAAI,CAAC,eAAe;AAAE,QAAA,OAAO,KAAK,CAAA;;AAGlC,IAAA,OAAO,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AACnE,EAAC;AAED,MAAM,sBAAsB,GACxB,qFAAqF,CAAA;AAEzF;;;;AAIG;AACG,SAAU,mBAAmB,CAC/B,KAAkC,EAAA;IAElC,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;;AAE3C,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAClD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs new file mode 100644 index 00000000..94d1a0d1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs @@ -0,0 +1,11 @@ +/** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ +function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) { + return !!Object.keys(transition).length; +} + +export { isTransitionDefined }; +//# sourceMappingURL=is-transition-defined.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map new file mode 100644 index 00000000..823df6b7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-transition-defined.mjs","sources":["../../../../src/animation/utils/is-transition-defined.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined({\n when,\n delay: _delay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n repeat,\n repeatType,\n repeatDelay,\n from,\n elapsed,\n ...transition\n}: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }) {\n return !!Object.keys(transition).length\n}\n"],"names":[],"mappings":"AAGA;;;;AAIG;AACa,SAAA,mBAAmB,CAAC,EAChC,IAAI,EACJ,KAAK,EAAE,MAAM,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,WAAW,EACX,IAAI,EACJ,OAAO,EACP,GAAG,UAAU,EAC+C,EAAA;IAC5D,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAA;AAC3C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs new file mode 100644 index 00000000..2c666153 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs @@ -0,0 +1,7 @@ +function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; +} + +export { makeAnimationInstant }; +//# sourceMappingURL=make-animation-instant.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map new file mode 100644 index 00000000..54f49075 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"make-animation-instant.mjs","sources":["../../../../src/animation/utils/make-animation-instant.ts"],"sourcesContent":["import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n"],"names":[],"mappings":"AAEM,SAAU,oBAAoB,CAChC,OAGE,EAAA;AAEF,IAAA,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;AACpB,IAAA,OAAO,CAAC,IAAI,GAAG,WAAW,CAAA;AAC9B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs new file mode 100644 index 00000000..2c09e6b4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs @@ -0,0 +1,19 @@ +import { inertia } from '../generators/inertia.mjs'; +import { keyframes } from '../generators/keyframes.mjs'; +import { spring } from '../generators/spring/index.mjs'; + +const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, +}; +function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } +} + +export { replaceTransitionType }; +//# sourceMappingURL=replace-transition-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map new file mode 100644 index 00000000..bfb5cf1f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"replace-transition-type.mjs","sources":["../../../../src/animation/utils/replace-transition-type.ts"],"sourcesContent":["import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,iBAAiB,GAAwC;AAC3D,IAAA,KAAK,EAAE,OAAO;IACd,OAAO;AACP,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,SAAS,EAAE,SAAS;IACpB,MAAM;CACT,CAAA;AAEK,SAAU,qBAAqB,CAAC,UAAoC,EAAA;AACtE,IAAA,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;QACrC,UAAU,CAAC,IAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;KACvD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs new file mode 100644 index 00000000..c49df0be --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs @@ -0,0 +1,15 @@ +/** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ +function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; +} + +export { resolveTransition }; +//# sourceMappingURL=resolve-transition.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map new file mode 100644 index 00000000..f43704c4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-transition.mjs","sources":["../../../../src/animation/utils/resolve-transition.ts"],"sourcesContent":["/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nexport function resolveTransition(\n transition: any,\n parentTransition?: any\n) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition\n return { ...parentTransition, ...rest }\n }\n\n return transition\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACa,SAAA,iBAAiB,CAC7B,UAAe,EACf,gBAAsB,EAAA;AAEtB,IAAA,IAAI,UAAU,EAAE,OAAO,IAAI,gBAAgB,EAAE;QACzC,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAA;AAC1C,QAAA,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,IAAI,EAAE,CAAA;KAC1C;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs new file mode 100644 index 00000000..3b9c6869 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs @@ -0,0 +1,4 @@ +const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + +export { cubicBezierAsString }; +//# sourceMappingURL=cubic-bezier.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map new file mode 100644 index 00000000..508c4174 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"cubic-bezier.mjs","sources":["../../../../../src/animation/waapi/easing/cubic-bezier.ts"],"sourcesContent":["import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n"],"names":[],"mappings":"AAEa,MAAA,mBAAmB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAmB,KAC9D,CAAA,aAAA,EAAgB,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs new file mode 100644 index 00000000..73ec4167 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs @@ -0,0 +1,15 @@ +import { isBezierDefinition } from 'motion-utils'; +import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; +import { supportedWaapiEasing } from './supported.mjs'; + +function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); +} + +export { isWaapiSupportedEasing }; +//# sourceMappingURL=is-supported.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map new file mode 100644 index 00000000..e57a2988 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/is-supported.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-supported.mjs","sources":["../../../../../src/animation/waapi/easing/is-supported.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n"],"names":[],"mappings":";;;;AAIM,SAAU,sBAAsB,CAAC,MAA0B,EAAA;IAC7D,OAAO,OAAO,CACV,CAAC,OAAO,MAAM,KAAK,UAAU,IAAI,oBAAoB,EAAE;AACnD,QAAA,CAAC,MAAM;SACN,OAAO,MAAM,KAAK,QAAQ;AACvB,aAAC,MAAM,IAAI,oBAAoB,IAAI,oBAAoB,EAAE,CAAC,CAAC;QAC/D,kBAAkB,CAAC,MAAM,CAAC;AAC1B,SAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CACtE,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs new file mode 100644 index 00000000..49286887 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs @@ -0,0 +1,29 @@ +import { isBezierDefinition } from 'motion-utils'; +import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; +import { generateLinearEasing } from '../utils/linear.mjs'; +import { cubicBezierAsString } from './cubic-bezier.mjs'; +import { supportedWaapiEasing } from './supported.mjs'; + +function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } +} + +export { mapEasingToNativeEasing }; +//# sourceMappingURL=map-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map new file mode 100644 index 00000000..04dce53f --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"map-easing.mjs","sources":["../../../../../src/animation/waapi/easing/map-easing.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n"],"names":[],"mappings":";;;;;;AAMgB,SAAA,uBAAuB,CACnC,MAAqC,EACrC,QAAgB,EAAA;IAEhB,IAAI,CAAC,MAAM,EAAE;AACT,QAAA,OAAO,SAAS,CAAA;KACnB;AAAM,SAAA,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;AACrC,QAAA,OAAO,oBAAoB,EAAE;AACzB,cAAE,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC;cACtC,UAAU,CAAA;KACnB;AAAM,SAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AACnC,QAAA,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAA;KACrC;AAAM,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,MAAM,CAAC,GAAG,CACb,CAAC,aAAa,KACT,uBAAuB,CAAC,aAAa,EAAE,QAAQ,CAAY;YAC5D,oBAAoB,CAAC,OAAO,CACnC,CAAA;KACJ;SAAM;AACH,QAAA,OAAO,oBAAoB,CAAC,MAA2C,CAAC,CAAA;KAC3E;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs new file mode 100644 index 00000000..ae315b0c --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs @@ -0,0 +1,16 @@ +import { cubicBezierAsString } from './cubic-bezier.mjs'; + +const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), +}; + +export { supportedWaapiEasing }; +//# sourceMappingURL=supported.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map new file mode 100644 index 00000000..0ce8dcf9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"supported.mjs","sources":["../../../../../src/animation/waapi/easing/supported.ts"],"sourcesContent":["import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n"],"names":[],"mappings":";;AAEa,MAAA,oBAAoB,GAAG;AAChC,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC9D,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;AACpE,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs new file mode 100644 index 00000000..f6448316 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs @@ -0,0 +1,40 @@ +import { activeAnimations } from '../../stats/animation-count.mjs'; +import { statsBuffer } from '../../stats/buffer.mjs'; +import { mapEasingToNativeEasing } from './easing/map-easing.mjs'; + +function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + if (statsBuffer.value) { + activeAnimations.waapi++; + } + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + const animation = element.animate(keyframeOptions, options); + if (statsBuffer.value) { + animation.finished.finally(() => { + activeAnimations.waapi--; + }); + } + return animation; +} + +export { startWaapiAnimation }; +//# sourceMappingURL=start-waapi-animation.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map new file mode 100644 index 00000000..f1b75607 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"start-waapi-animation.mjs","sources":["../../../../src/animation/waapi/start-waapi-animation.ts"],"sourcesContent":["import { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n if (statsBuffer.value) {\n activeAnimations.waapi++\n }\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n const animation = element.animate(keyframeOptions, options)\n\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--\n })\n }\n\n return animation\n}\n"],"names":[],"mappings":";;;;AAKgB,SAAA,mBAAmB,CAC/B,OAAgB,EAChB,SAAiB,EACjB,SAAmC,EACnC,EACI,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,MAAM,GAAG,CAAC,EACV,UAAU,GAAG,MAAM,EACnB,IAAI,GAAG,SAAS,EAChB,KAAK,GAAA,GACY,EAAE,EACvB,gBAAoC,SAAS,EAAA;AAE7C,IAAA,MAAM,eAAe,GAA6B;QAC9C,CAAC,SAAS,GAAG,SAAqB;KACrC,CAAA;AACD,IAAA,IAAI,KAAK;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,KAAK,CAAA;IAEzC,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAEtD;;AAEG;AACH,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,MAAM,CAAA;AAE1D,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;QACnB,gBAAgB,CAAC,KAAK,EAAE,CAAA;KAC3B;AAED,IAAA,MAAM,OAAO,GAA6B;QACtC,KAAK;QACL,QAAQ;AACR,QAAA,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,QAAQ;AAClD,QAAA,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM,GAAG,CAAC;QACtB,SAAS,EAAE,UAAU,KAAK,SAAS,GAAG,WAAW,GAAG,QAAQ;KAC/D,CAAA;AAED,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,CAAC,aAAa,GAAG,aAAa,CAAA;IAExD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;AAE3D,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;AACnB,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAK;YAC5B,gBAAgB,CAAC,KAAK,EAAE,CAAA;AAC5B,SAAC,CAAC,CAAA;KACL;AAED,IAAA,OAAO,SAAS,CAAA;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs new file mode 100644 index 00000000..8250ebb3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs @@ -0,0 +1,14 @@ +import { memo } from 'motion-utils'; + +const supportsPartialKeyframes = /*@__PURE__*/ memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; +}); + +export { supportsPartialKeyframes }; +//# sourceMappingURL=partial-keyframes.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map new file mode 100644 index 00000000..d70513a1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/partial-keyframes.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"partial-keyframes.mjs","sources":["../../../../../src/animation/waapi/supports/partial-keyframes.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n"],"names":[],"mappings":";;MAEa,wBAAwB,iBAAiB,IAAI,CAAC,MAAK;AAC5D,IAAA,IAAI;AACA,QAAA,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;KAC1D;IAAC,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK,CAAA;KACf;AACD,IAAA,OAAO,IAAI,CAAA;AACf,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs new file mode 100644 index 00000000..32e9bfb0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs @@ -0,0 +1,44 @@ +import { memo } from 'motion-utils'; + +/** + * A list of values that can be hardware-accelerated. + */ +const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Could be re-enabled now we have support for linear() easing + // "background-color" +]); +const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); +function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type } = options; + const subject = motionValue?.owner?.current; + /** + * We use this check instead of isHTMLElement() because we explicitly + * **don't** want elements in different timing contexts (i.e. popups) + * to be accelerated, as it's not possible to sync these animations + * properly with those driven from the main window frameloop. + */ + if (!(subject instanceof HTMLElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + acceleratedValues.has(name) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); +} + +export { supportsBrowserAnimation }; +//# sourceMappingURL=waapi.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map new file mode 100644 index 00000000..98038b45 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"waapi.mjs","sources":["../../../../../src/animation/waapi/supports/waapi.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation(\n options: ValueAnimationOptionsWithRenderContext\n) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } =\n options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n"],"names":[],"mappings":";;AAMA;;AAEG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS;IACtC,SAAS;IACT,UAAU;IACV,QAAQ;IACR,WAAW;;;AAGd,CAAA,CAAC,CAAA;AAEF,MAAM,aAAa,iBAAiB,IAAI,CAAC,MACrC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAC3D,CAAA;AAEK,SAAU,wBAAwB,CACpC,OAAkD,EAAA;AAElD,IAAA,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,GAC/D,OAAO,CAAA;AAEX,IAAA,MAAM,OAAO,GAAG,WAAW,EAAE,KAAK,EAAE,OAAO,CAAA;AAE3C;;;;;AAKG;AACH,IAAA,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;AACnC,QAAA,OAAO,KAAK,CAAA;KACf;AAED,IAAA,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,WAAY,CAAC,KAAM,CAAC,QAAQ,EAAE,CAAA;IAEtE,QACI,aAAa,EAAE;QACf,IAAI;AACJ,QAAA,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC;AAC3B,SAAC,IAAI,KAAK,WAAW,IAAI,CAAC,iBAAiB,CAAC;AAC5C;;;AAGG;AACH,QAAA,CAAC,QAAQ;AACT,QAAA,CAAC,WAAW;AACZ,QAAA,UAAU,KAAK,QAAQ;AACvB,QAAA,OAAO,KAAK,CAAC;QACb,IAAI,KAAK,SAAS,EACrB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs new file mode 100644 index 00000000..c61bf0e7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs @@ -0,0 +1,15 @@ +/** + * A list of values that can be hardware-accelerated. + */ +const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved + // or until we implement support for linear() easing. + // "background-color" +]); + +export { acceleratedValues }; +//# sourceMappingURL=accelerated-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map new file mode 100644 index 00000000..4a553d27 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"accelerated-values.mjs","sources":["../../../../../src/animation/waapi/utils/accelerated-values.ts"],"sourcesContent":["/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved\n // or until we implement support for linear() easing.\n // \"background-color\"\n])\n"],"names":[],"mappings":"AAAA;;AAEG;AACU,MAAA,iBAAiB,GAAG,IAAI,GAAG,CAAS;IAC7C,SAAS;IACT,UAAU;IACV,QAAQ;IACR,WAAW;;;;AAId,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs new file mode 100644 index 00000000..6a828d7e --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs @@ -0,0 +1,16 @@ +import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs'; +import { isGenerator } from '../../generators/utils/is-generator.mjs'; + +function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; +} + +export { applyGeneratorOptions }; +//# sourceMappingURL=apply-generator.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map new file mode 100644 index 00000000..e8e2a4a8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"apply-generator.mjs","sources":["../../../../../src/animation/waapi/utils/apply-generator.ts"],"sourcesContent":["import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,qBAAqB,CAAC,EAClC,IAAI,EACJ,GAAG,OAAO,EACI,EAAA;IACd,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,oBAAoB,EAAE,EAAE;AAC7C,QAAA,OAAO,IAAI,CAAC,cAAe,CAAC,OAAO,CAAC,CAAA;KACvC;SAAM;QACH,OAAO,CAAC,QAAQ,KAAhB,OAAO,CAAC,QAAQ,GAAK,GAAG,CAAA,CAAA;QACxB,OAAO,CAAC,IAAI,KAAZ,OAAO,CAAC,IAAI,GAAK,SAAS,CAAA,CAAA;KAC7B;AAED,IAAA,OAAO,OAAO,CAAA;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs new file mode 100644 index 00000000..7cb72e22 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs @@ -0,0 +1,13 @@ +const generateLinearEasing = (easing, duration, // as milliseconds +resolution = 10 // as milliseconds +) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; +}; + +export { generateLinearEasing }; +//# sourceMappingURL=linear.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map new file mode 100644 index 00000000..f01d0547 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"linear.mjs","sources":["../../../../../src/animation/waapi/utils/linear.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n"],"names":[],"mappings":"MAEa,oBAAoB,GAAG,CAChC,MAAsB,EACtB,QAAgB;AAChB,UAAqB,GAAA,EAAE;KACf;IACR,IAAI,MAAM,GAAG,EAAE,CAAA;AACf,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,CAAA;AAEhE,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,CAAA;KAC3E;AAED,IAAA,OAAO,CAAU,OAAA,EAAA,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAA;AAC9D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs new file mode 100644 index 00000000..16bce8d8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs @@ -0,0 +1,60 @@ +const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", +]); + +export { pxValues }; +//# sourceMappingURL=px-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map new file mode 100644 index 00000000..020ee965 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"px-values.mjs","sources":["../../../../../src/animation/waapi/utils/px-values.ts"],"sourcesContent":["export const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n"],"names":[],"mappings":"AAAa,MAAA,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAE5B,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,wBAAwB;;IAExB,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,gBAAgB;;IAEhB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,aAAa;IACb,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,iBAAiB;;IAEjB,UAAU;;IAEV,qBAAqB;IACrB,qBAAqB;AACxB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs new file mode 100644 index 00000000..02f62c26 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs @@ -0,0 +1,19 @@ +import { anticipate, backInOut, circInOut } from 'motion-utils'; + +const unsupportedEasingFunctions = { + anticipate, + backInOut, + circInOut, +}; +function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; +} +function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } +} + +export { replaceStringEasing }; +//# sourceMappingURL=unsupported-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map new file mode 100644 index 00000000..57e3ebe4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"unsupported-easing.mjs","sources":["../../../../../src/animation/waapi/utils/unsupported-easing.ts"],"sourcesContent":["import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n"],"names":[],"mappings":";;AAGA,MAAM,0BAA0B,GAAG;IAC/B,UAAU;IACV,SAAS;IACT,SAAS;CACZ,CAAA;AAED,SAAS,iBAAiB,CACtB,GAAW,EAAA;IAEX,OAAO,GAAG,IAAI,0BAA0B,CAAA;AAC5C,CAAC;AAEK,SAAU,mBAAmB,CAAC,UAAoC,EAAA;AACpE,IAAA,IACI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;AACnC,QAAA,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,EACpC;QACE,UAAU,CAAC,IAAI,GAAG,0BAA0B,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;KAChE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs new file mode 100644 index 00000000..d1815f3e --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs @@ -0,0 +1,48 @@ +import { frame, cancelFrame } from '../frameloop/frame.mjs'; +import { numberValueTypes } from '../value/types/maps/number.mjs'; +import { getValueAsType } from '../value/types/utils/get-as-type.mjs'; + +class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } + destroy() { + for (const value of this.values.values()) { + value.onRemove(); + } + } +} + +export { MotionValueState }; +//# sourceMappingURL=MotionValueState.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map new file mode 100644 index 00000000..eb9bcfbb --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/MotionValueState.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"MotionValueState.mjs","sources":["../../../src/effects/MotionValueState.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop/frame\"\nimport { MotionValue } from \"../value\"\nimport { numberValueTypes } from \"../value/types/maps/number\"\nimport { getValueAsType } from \"../value/types/utils/get-as-type\"\n\nexport class MotionValueState {\n latest: { [name: string]: AnyResolvedKeyframe } = {}\n\n private values = new Map<\n string,\n { value: MotionValue; onRemove: VoidFunction }\n >()\n\n set(\n name: string,\n value: MotionValue,\n render?: VoidFunction,\n computed?: MotionValue,\n useDefaultValueType = true\n ) {\n const existingValue = this.values.get(name)\n\n if (existingValue) {\n existingValue.onRemove()\n }\n\n const onChange = () => {\n const v = value.get()\n\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name])\n } else {\n this.latest[name] = v\n }\n\n render && frame.render(render)\n }\n\n onChange()\n\n const cancelOnChange = value.on(\"change\", onChange)\n\n computed && value.addDependent(computed)\n\n const remove = () => {\n cancelOnChange()\n render && cancelFrame(render)\n this.values.delete(name)\n computed && value.removeDependent(computed)\n }\n\n this.values.set(name, { value, onRemove: remove })\n\n return remove\n }\n\n get(name: string): MotionValue | undefined {\n return this.values.get(name)?.value\n }\n\n destroy() {\n for (const value of this.values.values()) {\n value.onRemove()\n }\n }\n}\n"],"names":[],"mappings":";;;;MAMa,gBAAgB,CAAA;AAA7B,IAAA,WAAA,GAAA;QACI,IAAM,CAAA,MAAA,GAA4C,EAAE,CAAA;AAE5C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,GAAG,EAGrB,CAAA;KAsDN;IApDG,GAAG,CACC,IAAY,EACZ,KAAkB,EAClB,MAAqB,EACrB,QAAsB,EACtB,mBAAmB,GAAG,IAAI,EAAA;QAE1B,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;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AAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;YACtC,KAAK,CAAC,QAAQ,EAAE,CAAA;SACnB;KACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/attr/index.mjs b/node_modules/motion-dom/dist/es/effects/attr/index.mjs new file mode 100644 index 00000000..08067fd3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/attr/index.mjs @@ -0,0 +1,42 @@ +import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs'; +import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; +import { createEffect } from '../utils/create-effect.mjs'; + +function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; +} +const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); +}; +const attrEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addAttrValue)); + +export { addAttrValue, attrEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map b/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map new file mode 100644 index 00000000..89313033 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/attr/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/attr/index.ts"],"sourcesContent":["import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction canSetAsProperty(element: HTMLElement | SVGElement, name: string) {\n if (!(name in element)) return false\n\n const descriptor =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||\n Object.getOwnPropertyDescriptor(element, name)\n\n // Check if it has a setter\n return descriptor && typeof descriptor.set === \"function\"\n}\n\nexport const addAttrValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n const isProp = canSetAsProperty(element, key)\n const name = isProp\n ? key\n : key.startsWith(\"data\") || key.startsWith(\"aria\")\n ? camelToDash(key)\n : key\n\n /**\n * Set attribute directly via property if available\n */\n const render = isProp\n ? () => {\n ;(element as any)[name] = state.latest[key]\n }\n : () => {\n const v = state.latest[key]\n if (v === null || v === undefined) {\n element.removeAttribute(name)\n } else {\n element.setAttribute(name, String(v))\n }\n }\n\n return state.set(key, value, render)\n}\n\nexport const attrEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addAttrValue)\n)\n"],"names":[],"mappings":";;;;AAMA,SAAS,gBAAgB,CAAC,OAAiC,EAAE,IAAY,EAAA;AACrE,IAAA,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC;AAAE,QAAA,OAAO,KAAK,CAAA;AAEpC,IAAA,MAAM,UAAU,GACZ,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;AACrE,QAAA,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;;IAGlD,OAAO,UAAU,IAAI,OAAO,UAAU,CAAC,GAAG,KAAK,UAAU,CAAA;AAC7D,CAAC;AAEM,MAAM,YAAY,GAAG,CACxB,OAAiC,EACjC,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;IACA,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IAC7C,MAAM,IAAI,GAAG,MAAM;AACf,UAAE,GAAG;AACL,UAAE,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;AAClD,cAAE,WAAW,CAAC,GAAG,CAAC;cAChB,GAAG,CAAA;AAET;;AAEG;IACH,MAAM,MAAM,GAAG,MAAM;UACf,MAAK;YACC,OAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;SAC9C;UACD,MAAK;YACD,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,EAAE;AAC/B,gBAAA,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;aAChC;iBAAM;gBACH,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;aACxC;AACL,SAAC,CAAA;IAEP,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AACxC,EAAC;AAEY,MAAA,UAAU,iBAAiB,oBAAoB;AACxD,cAAc,YAAY,CAAC,YAAY,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/prop/index.mjs b/node_modules/motion-dom/dist/es/effects/prop/index.mjs new file mode 100644 index 00000000..2b5e9884 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/prop/index.mjs @@ -0,0 +1,10 @@ +import { createEffect } from '../utils/create-effect.mjs'; + +const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); +}); + +export { propEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map b/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map new file mode 100644 index 00000000..3266aa4b --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/prop/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/prop/index.ts"],"sourcesContent":["import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createEffect } from \"../utils/create-effect\"\n\nexport const propEffect = /*@__PURE__*/ createEffect(\n (\n subject: { [key: string]: any },\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => {\n return state.set(\n key,\n value,\n () => {\n subject[key] = state.latest[key]\n },\n undefined,\n false\n )\n }\n)\n"],"names":[],"mappings":";;AAIa,MAAA,UAAU,iBAAiB,YAAY,CAChD,CACI,OAA+B,EAC/B,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;IACA,OAAO,KAAK,CAAC,GAAG,CACZ,GAAG,EACH,KAAK,EACL,MAAK;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AACpC,KAAC,EACD,SAAS,EACT,KAAK,CACR,CAAA;AACL,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/style/index.mjs b/node_modules/motion-dom/dist/es/effects/style/index.mjs new file mode 100644 index 00000000..a7e290c6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/index.mjs @@ -0,0 +1,53 @@ +import { isCSSVar } from '../../render/dom/is-css-var.mjs'; +import { transformProps } from '../../render/utils/keys-transform.mjs'; +import { isHTMLElement } from '../../utils/is-html-element.mjs'; +import { MotionValue } from '../../value/index.mjs'; +import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; +import { createEffect } from '../utils/create-effect.mjs'; +import { buildTransform } from './transform.mjs'; + +const originProps = new Set(["originX", "originY", "originZ"]); +const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); +}; +const styleEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addStyleValue)); + +export { addStyleValue, styleEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/style/index.mjs.map b/node_modules/motion-dom/dist/es/effects/style/index.mjs.map new file mode 100644 index 00000000..de9e1b4a --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/style/index.ts"],"sourcesContent":["import { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { transformProps } from \"../../render/utils/keys-transform\"\nimport { isHTMLElement } from \"../../utils/is-html-element\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\nimport { buildTransform } from \"./transform\"\n\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"])\n\nexport const addStyleValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n let render: VoidFunction | undefined = undefined\n let computed: MotionValue | undefined = undefined\n\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(\n element,\n state,\n \"transformBox\",\n new MotionValue(\"fill-box\")\n )\n }\n\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state)\n })\n }\n\n computed = state.get(\"transform\")\n } else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\"\n const originY = state.latest.originY ?? \"50%\"\n const originZ = state.latest.originZ ?? 0\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`\n })\n }\n\n computed = state.get(\"transformOrigin\")\n } else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key] as string)\n }\n } else {\n render = () => {\n element.style[key as any] = state.latest[key] as string\n }\n }\n\n return state.set(key, value, render, computed)\n}\n\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addStyleValue)\n)\n"],"names":[],"mappings":";;;;;;;;AASA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;AAEvD,MAAM,aAAa,GAAG,CACzB,OAAiC,EACjC,KAAuB,EACvB,GAAW,EACX,KAAkB,KAClB;IACA,IAAI,MAAM,GAA6B,SAAS,CAAA;IAChD,IAAI,QAAQ,GAA4B,SAAS,CAAA;AAEjD,IAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;;;AAGzB,YAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AACvD,gBAAA,aAAa,CACT,OAAO,EACP,KAAK,EACL,cAAc,EACd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YAAA,OAAO,CAAC,KAAK,CAAC,GAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAW,CAAA;AAC3D,SAAC,CAAA;KACJ;AAED,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;AAClD,EAAC;AAEY,MAAA,WAAW,iBAAiB,oBAAoB;AACzD,cAAc,YAAY,CAAC,aAAa,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/style/transform.mjs b/node_modules/motion-dom/dist/es/effects/style/transform.mjs new file mode 100644 index 00000000..3b5fffe5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/transform.mjs @@ -0,0 +1,40 @@ +import { transformPropOrder } from '../../render/utils/keys-transform.mjs'; + +const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +function buildTransform(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + const valueToRender = state.latest[key]; + transform += `${transformName}(${valueToRender}) `; + } + } + return transformIsDefault ? "none" : transform.trim(); +} + +export { buildTransform }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map b/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map new file mode 100644 index 00000000..417fd68a --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/style/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../../src/effects/style/transform.ts"],"sourcesContent":["import { transformPropOrder } from \"../../render/utils/keys-transform\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nexport function buildTransform(state: MotionValueState) {\n let transform = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = state.latest[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n const valueToRender = state.latest[key]\n transform += `${transformName}(${valueToRender}) `\n }\n }\n\n return transformIsDefault ? \"none\" : transform.trim()\n}\n"],"names":[],"mappings":";;AAGA,MAAM,cAAc,GAAG;AACnB,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,oBAAoB,EAAE,aAAa;CACtC,CAAA;AAEK,SAAU,cAAc,CAAC,KAAuB,EAAA;IAClD,IAAI,SAAS,GAAG,EAAE,CAAA;IAClB,IAAI,kBAAkB,GAAG,IAAI,CAAA;AAE7B;;;AAGG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAChD,QAAA,MAAM,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAgC,CAAA;QAChE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAE/B,IAAI,KAAK,KAAK,SAAS;YAAE,SAAQ;QAEjC,IAAI,cAAc,GAAG,IAAI,CAAA;AACzB,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,YAAA,cAAc,GAAG,KAAK,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;SAC/D;aAAM;AACH,YAAA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;AAChC,YAAA,cAAc,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC,CAAA;SACzE;QAED,IAAI,CAAC,cAAc,EAAE;YACjB,kBAAkB,GAAG,KAAK,CAAA;YAC1B,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;YAChD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AACvC,YAAA,SAAS,IAAI,CAAG,EAAA,aAAa,CAAI,CAAA,EAAA,aAAa,IAAI,CAAA;SACrD;KACJ;AAED,IAAA,OAAO,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,CAAA;AACzD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/svg/index.mjs b/node_modules/motion-dom/dist/es/effects/svg/index.mjs new file mode 100644 index 00000000..83bc656f --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/svg/index.mjs @@ -0,0 +1,45 @@ +import { MotionValue } from '../../value/index.mjs'; +import { addAttrValue } from '../attr/index.mjs'; +import { addStyleValue } from '../style/index.mjs'; +import { createSelectorEffect } from '../utils/create-dom-effect.mjs'; +import { createEffect } from '../utils/create-effect.mjs'; +import { frame } from '../../frameloop/frame.mjs'; + +function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } +} +const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); +}; +const svgEffect = /*@__PURE__*/ createSelectorEffect( +/*@__PURE__*/ createEffect(addSVGValue)); +function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); +} + +export { svgEffect }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map b/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map new file mode 100644 index 00000000..7d885957 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/svg/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/effects/svg/index.ts"],"sourcesContent":["import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { addAttrValue } from \"../attr\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { addStyleValue } from \"../style\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction addSVGPathValue(\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) {\n frame.render(() => element.setAttribute(\"pathLength\", \"1\"))\n\n if (key === \"pathOffset\") {\n return state.set(key, value, () => {\n // Use unitless value to avoid Safari zoom bug\n const offset = state.latest[key]\n element.setAttribute(\"stroke-dashoffset\", `${-offset}`)\n })\n } else {\n if (!state.get(\"stroke-dasharray\")) {\n state.set(\"stroke-dasharray\", new MotionValue(\"1 1\"), () => {\n const { pathLength = 1, pathSpacing } = state.latest\n\n // Use unitless values to avoid Safari zoom bug\n element.setAttribute(\n \"stroke-dasharray\",\n `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`\n )\n })\n }\n\n return state.set(key, value, undefined, state.get(\"stroke-dasharray\"))\n }\n}\n\nconst addSVGValue = (\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n if (key.startsWith(\"path\")) {\n return addSVGPathValue(element, state, key, value)\n } else if (key.startsWith(\"attr\")) {\n return addAttrValue(element, state, convertAttrKey(key), value)\n }\n\n const handler = key in element.style ? addStyleValue : addAttrValue\n return handler(element, state, key, value)\n}\n\nexport const svgEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addSVGValue)\n)\n\nfunction convertAttrKey(key: string) {\n return key.replace(/^attr([A-Z])/, (_, firstChar) =>\n firstChar.toLowerCase()\n )\n}\n"],"names":[],"mappings":";;;;;;;AAQA,SAAS,eAAe,CACpB,OAAmB,EACnB,KAAuB,EACvB,GAAW,EACX,KAAkB,EAAA;AAElB,IAAA,KAAK,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAA;AAE3D,IAAA,IAAI,GAAG,KAAK,YAAY,EAAE;QACtB,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,MAAK;;YAE9B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAChC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAE,CAAA,CAAC,CAAA;AAC3D,SAAC,CAAC,CAAA;KACL;SAAM;QACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;AAChC,YAAA,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AAC,cAAc,EAAE,CAAC,CAAC,EAAE,SAAS,KAC5C,SAAS,CAAC,WAAW,EAAE,CAC1B,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs new file mode 100644 index 00000000..ede6a43c --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs @@ -0,0 +1,19 @@ +import { resolveElements } from '../../utils/resolve-elements.mjs'; + +function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; +} + +export { createSelectorEffect }; +//# sourceMappingURL=create-dom-effect.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map new file mode 100644 index 00000000..6151ffc2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-dom-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-dom-effect.mjs","sources":["../../../../src/effects/utils/create-dom-effect.ts"],"sourcesContent":["import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\n\nexport function createSelectorEffect(\n subjectEffect: (\n subject: T,\n values: Record\n ) => VoidFunction\n) {\n return (\n subject: ElementOrSelector,\n values: Record\n ) => {\n const elements = resolveElements(subject)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n}\n"],"names":[],"mappings":";;AAMM,SAAU,oBAAoB,CAChC,aAGiB,EAAA;AAEjB,IAAA,OAAO,CACH,OAA0B,EAC1B,MAAmC,KACnC;AACA,QAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;QACzC,MAAM,aAAa,GAAmB,EAAE,CAAA;AAExC,QAAA,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,MAAM,MAAM,GAAG,aAAa,CAAC,OAAY,EAAE,MAAM,CAAC,CAAA;AAClD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SAC7B;AAED,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE,CAAA;AAChD,SAAC,CAAA;AACL,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs new file mode 100644 index 00000000..b2929f1a --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs @@ -0,0 +1,22 @@ +import { MotionValueState } from '../MotionValueState.mjs'; + +function createEffect(addValue) { + const stateCache = new WeakMap(); + const subscriptions = []; + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; +} + +export { createEffect }; +//# sourceMappingURL=create-effect.mjs.map diff --git a/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map new file mode 100644 index 00000000..f7cdfc15 --- /dev/null +++ b/node_modules/motion-dom/dist/es/effects/utils/create-effect.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-effect.mjs","sources":["../../../../src/effects/utils/create-effect.ts"],"sourcesContent":["import { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\nexport function createEffect(\n addValue: (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => VoidFunction\n) {\n const stateCache = new WeakMap()\n const subscriptions: VoidFunction[] = []\n\n return (\n subject: Subject,\n values: Record\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState()\n\n stateCache.set(subject, state)\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n}\n"],"names":[],"mappings":";;AAGM,SAAU,YAAY,CACxB,QAKiB,EAAA;AAEjB,IAAA,MAAM,UAAU,GAAG,IAAI,OAAO,EAA6B,CAAA;IAC3D,MAAM,aAAa,GAAmB,EAAE,CAAA;AAExC,IAAA,OAAO,CACH,OAAgB,EAChB,MAAmC,KACrB;AACd,QAAA,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,gBAAgB,EAAE,CAAA;AAE/D,QAAA,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;AAE9B,QAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AACtB,YAAA,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;AACzB,YAAA,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AACnD,YAAA,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SAC7B;AAED,QAAA,OAAO,MAAK;YACR,KAAK,MAAM,MAAM,IAAI,aAAa;AAAE,gBAAA,MAAM,EAAE,CAAA;AAChD,SAAC,CAAA;AACL,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs new file mode 100644 index 00000000..560139be --- /dev/null +++ b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs @@ -0,0 +1,7 @@ +function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler); +} + +export { addDomEvent }; +//# sourceMappingURL=add-dom-event.mjs.map diff --git a/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map new file mode 100644 index 00000000..8ca2383b --- /dev/null +++ b/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"add-dom-event.mjs","sources":["../../../src/events/add-dom-event.ts"],"sourcesContent":["export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler)\n}\n"],"names":[],"mappings":"AAAgB,SAAA,WAAW,CACvB,MAAmB,EACnB,SAAiB,EACjB,OAAsB,EACtB,OAAmC,GAAA,EAAE,OAAO,EAAE,IAAI,EAAE,EAAA;IAEpD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IAEpD,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC/D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs new file mode 100644 index 00000000..36f90cdf --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs @@ -0,0 +1,72 @@ +import { MotionGlobalConfig } from 'motion-utils'; +import { stepsOrder } from './order.mjs'; +import { createRenderStep } from './render-step.mjs'; + +const maxElapsed = 40; +function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const timestamp = MotionGlobalConfig.useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!MotionGlobalConfig.useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; +} + +export { createRenderBatcher }; +//# sourceMappingURL=batcher.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map new file mode 100644 index 00000000..0b43bda9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"batcher.mjs","sources":["../../../src/frameloop/batcher.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(\n flagRunNextFrame,\n allowKeepAlive ? key : undefined\n )\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,UAAU,GAAG,EAAE,CAAA;AAEL,SAAA,mBAAmB,CAC/B,iBAA+C,EAC/C,cAAuB,EAAA;IAEvB,IAAI,YAAY,GAAG,KAAK,CAAA;IACxB,IAAI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I;AAChC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;SACvC;AACL,KAAC,CAAA;IAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AAC7C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/frame.mjs b/node_modules/motion-dom/dist/es/frameloop/frame.mjs new file mode 100644 index 00000000..fa001b18 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/frame.mjs @@ -0,0 +1,7 @@ +import { noop } from 'motion-utils'; +import { createRenderBatcher } from './batcher.mjs'; + +const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true); + +export { cancelFrame, frame, frameData, frameSteps }; +//# sourceMappingURL=frame.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map b/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map new file mode 100644 index 00000000..6a3250d6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/frame.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"frame.mjs","sources":["../../../src/frameloop/frame.ts"],"sourcesContent":["import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n"],"names":[],"mappings":";;;AAGa,MAAA,EACT,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,UAAU,GACpB,mBAAmB,mBAAmB,CACnC,OAAO,qBAAqB,KAAK,WAAW,GAAG,qBAAqB,GAAG,IAAI,EAC3E,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs new file mode 100644 index 00000000..aa3de452 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs @@ -0,0 +1,21 @@ +import { stepsOrder } from './order.mjs'; +import { frame, cancelFrame } from './frame.mjs'; + +/** + * @deprecated + * + * Import as `frame` instead. + */ +const sync = frame; +/** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ +const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; +}, {}); + +export { cancelSync, sync }; +//# sourceMappingURL=index-legacy.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map new file mode 100644 index 00000000..c5912997 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/index-legacy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index-legacy.mjs","sources":["../../../src/frameloop/index-legacy.ts"],"sourcesContent":["import { cancelFrame, frame } from \".\"\nimport { stepsOrder } from \"./order\"\nimport { Process } from \"./types\"\n\n/**\n * @deprecated\n *\n * Import as `frame` instead.\n */\nexport const sync = frame\n\n/**\n * @deprecated\n *\n * Use cancelFrame(callback) instead.\n */\nexport const cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = (process: Process) => cancelFrame(process)\n return acc\n}, {} as Record void>)\n"],"names":[],"mappings":";;;AAIA;;;;AAIG;AACI,MAAM,IAAI,GAAG,MAAK;AAEzB;;;;AAIG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAI;AACrD,IAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAgB,KAAK,WAAW,CAAC,OAAO,CAAC,CAAA;AACrD,IAAA,OAAO,GAAG,CAAA;AACd,CAAC,EAAE,EAAgD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs new file mode 100644 index 00000000..d81e76c1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs @@ -0,0 +1,7 @@ +import { createRenderBatcher } from './batcher.mjs'; + +const { schedule: microtask, cancel: cancelMicrotask } = +/* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + +export { cancelMicrotask, microtask }; +//# sourceMappingURL=microtask.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map new file mode 100644 index 00000000..2e20b7c0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/microtask.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"microtask.mjs","sources":["../../../src/frameloop/microtask.ts"],"sourcesContent":["import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n"],"names":[],"mappings":";;AAEa,MAAA,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE;AACzD,gBAAgB,mBAAmB,CAAC,cAAc,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/order.mjs b/node_modules/motion-dom/dist/es/frameloop/order.mjs new file mode 100644 index 00000000..f2fb09f7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/order.mjs @@ -0,0 +1,13 @@ +const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute +]; + +export { stepsOrder }; +//# sourceMappingURL=order.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/order.mjs.map b/node_modules/motion-dom/dist/es/frameloop/order.mjs.map new file mode 100644 index 00000000..685e8933 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/order.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"order.mjs","sources":["../../../src/frameloop/order.ts"],"sourcesContent":["import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n"],"names":[],"mappings":"AAEa,MAAA,UAAU,GAAa;AAChC,IAAA,OAAO;AACP,IAAA,MAAM;AACN,IAAA,kBAAkB;AAClB,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,YAAY;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs new file mode 100644 index 00000000..4c6606d6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs @@ -0,0 +1,93 @@ +import { statsBuffer } from '../stats/buffer.mjs'; + +function createRenderStep(runNextFrame, stepName) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + let numCalls = 0; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + numCalls++; + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + if (!queue.has(callback)) + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + [thisFrame, nextFrame] = [nextFrame, thisFrame]; + // Execute this frame + thisFrame.forEach(triggerCallback); + /** + * If we're recording stats then + */ + if (stepName && statsBuffer.value) { + statsBuffer.value.frameloop[stepName].push(numCalls); + } + numCalls = 0; + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; +} + +export { createRenderStep }; +//# sourceMappingURL=render-step.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map new file mode 100644 index 00000000..4a7605ff --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"render-step.mjs","sources":["../../../src/frameloop/render-step.ts"],"sourcesContent":["import { statsBuffer } from \"../stats/buffer\"\nimport { StepNames } from \"./order\"\nimport { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(\n runNextFrame: () => void,\n stepName?: StepNames\n): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set()\n let nextFrame = new Set()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n let numCalls = 0\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n numCalls++\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n if (!queue.has(callback)) queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n ;[thisFrame, nextFrame] = [nextFrame, thisFrame]\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls)\n }\n numCalls = 0\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n"],"names":[],"mappings":";;AAIgB,SAAA,gBAAgB,CAC5B,YAAwB,EAC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H,QAAA,MAAM,EAAE,CAAC,QAAQ,KAAI;AACjB,YAAA,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC1B,YAAA,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;SAC/B;AAED;;AAEG;AACH,QAAA,OAAO,EAAE,CAAC,SAAS,KAAI;YACnB,eAAe,GAAG,SAAS,CAAA;AAE3B;;;;AAIG;YACH,IAAI,YAAY,EAAE;gBACd,cAAc,GAAG,IAAI,CAAA;gBACrB,OAAM;aACT;YAED,YAAY,GAAG,IAAI,CAGlB;YAAA,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;;AAGhD,YAAA,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;AAElC;;AAEG;AACH,YAAA,IAAI,QAAQ,IAAI,WAAW,CAAC,KAAK,EAAE;AAC/B,gBAAA,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACvD;YACD,QAAQ,GAAG,CAAC,CAAA;;;YAIZ,SAAS,CAAC,KAAK,EAAE,CAAA;YAEjB,YAAY,GAAG,KAAK,CAAA;YAEpB,IAAI,cAAc,EAAE;gBAChB,cAAc,GAAG,KAAK,CAAA;AACtB,gBAAA,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;aAC1B;SACJ;KACJ,CAAA;AAED,IAAA,OAAO,IAAI,CAAA;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs new file mode 100644 index 00000000..e24804ce --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs @@ -0,0 +1,32 @@ +import { MotionGlobalConfig } from 'motion-utils'; +import { frameData } from './frame.mjs'; + +let now; +function clearTime() { + now = undefined; +} +/** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ +const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, +}; + +export { time }; +//# sourceMappingURL=sync-time.mjs.map diff --git a/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map new file mode 100644 index 00000000..fa5e2aec --- /dev/null +++ b/node_modules/motion-dom/dist/es/frameloop/sync-time.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sync-time.mjs","sources":["../../../src/frameloop/sync-time.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n"],"names":[],"mappings":";;;AAGA,IAAI,GAAuB,CAAA;AAE3B,SAAS,SAAS,GAAA;IACd,GAAG,GAAG,SAAS,CAAA;AACnB,CAAC;AAED;;;;;;;AAOG;AACU,MAAA,IAAI,GAAG;IAChB,GAAG,EAAE,MAAa;AACd,QAAA,IAAI,GAAG,KAAK,SAAS,EAAE;YACnB,IAAI,CAAC,GAAG,CACJ,SAAS,CAAC,YAAY,IAAI,kBAAkB,CAAC,eAAe;kBACtD,SAAS,CAAC,SAAS;AACrB,kBAAE,WAAW,CAAC,GAAG,EAAE,CAC1B,CAAA;SACJ;AAED,QAAA,OAAO,GAAI,CAAA;KACd;AACD,IAAA,GAAG,EAAE,CAAC,OAAe,KAAI;QACrB,GAAG,GAAG,OAAO,CAAA;QACb,cAAc,CAAC,SAAS,CAAC,CAAA;KAC5B;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs new file mode 100644 index 00000000..f5bfa774 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs @@ -0,0 +1,10 @@ +const isDragging = { + x: false, + y: false, +}; +function isDragActive() { + return isDragging.x || isDragging.y; +} + +export { isDragActive, isDragging }; +//# sourceMappingURL=is-active.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map new file mode 100644 index 00000000..cfb83c8c --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-active.mjs","sources":["../../../../../src/gestures/drag/state/is-active.ts"],"sourcesContent":["export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n"],"names":[],"mappings":"AAAa,MAAA,UAAU,GAAG;AACtB,IAAA,CAAC,EAAE,KAAK;AACR,IAAA,CAAC,EAAE,KAAK;EACX;SAEe,YAAY,GAAA;AACxB,IAAA,OAAO,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAA;AACvC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs new file mode 100644 index 00000000..78e2661b --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs @@ -0,0 +1,29 @@ +import { isDragging } from './is-active.mjs'; + +function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } +} + +export { setDragLock }; +//# sourceMappingURL=set-active.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map new file mode 100644 index 00000000..27a9240e --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"set-active.mjs","sources":["../../../../../src/gestures/drag/state/set-active.ts"],"sourcesContent":["import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n"],"names":[],"mappings":";;AAEM,SAAU,WAAW,CAAC,IAA2C,EAAA;IACnE,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE;AAC9B,QAAA,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;AAClB,YAAA,OAAO,IAAI,CAAA;SACd;aAAM;AACH,YAAA,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AACvB,YAAA,OAAO,MAAK;AACR,gBAAA,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;AAC5B,aAAC,CAAA;SACJ;KACJ;SAAM;QACH,IAAI,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE;AAC9B,YAAA,OAAO,IAAI,CAAA;SACd;aAAM;YACH,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,IAAI,CAAA;AAClC,YAAA,OAAO,MAAK;gBACR,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,KAAK,CAAA;AACvC,aAAC,CAAA;SACJ;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/hover.mjs b/node_modules/motion-dom/dist/es/gestures/hover.mjs new file mode 100644 index 00000000..2d540e94 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/hover.mjs @@ -0,0 +1,70 @@ +import { isDragActive } from './drag/state/is-active.mjs'; +import { setupGesture } from './utils/setup.mjs'; + +function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); +} +/** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ +function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; +} + +export { hover }; +//# sourceMappingURL=hover.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/hover.mjs.map b/node_modules/motion-dom/dist/es/gestures/hover.mjs.map new file mode 100644 index 00000000..2660def2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/hover.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,YAAY,CAAC,KAAmB,EAAA;IACrC,OAAO,EAAE,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,YAAY,EAAE,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;AAMG;AACG,SAAU,KAAK,CACjB,iBAAoC,EACpC,YAA+B,EAC/B,UAAwB,EAAE,EAAA;AAE1B,IAAA,MAAM,CAAC,QAA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AE,OAAM;YAE9C,IAAI,SAAS,EAAE;gBACX,gBAAgB,GAAG,IAAI,CAAA;gBACvB,OAAM;aACT;YAED,QAAQ,CAAC,UAAU,CAAC,CAAA;AACxB,SAAC,CAAA;AAED,QAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,YAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;gBAAE,OAAM;YAErC,gBAAgB,GAAG,KAAK,CAAA;YAExB,MAAM,UAAU,GAAG,YAAY,CAC3B,OAAkB,EAClB,UAAU,CACb,CAAA;YAED,IAAI,OAAO,UAAU,KAAK,UAAU;gBAAE,OAAM;YAE5C,gBAAgB,GAAG,UAAU,CAAA;YAE7B,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf,CAAA;AACL,SAAC,CAAA;QAED,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf,CAAA;QACD,OAAO,CAAC,gBAAgB,CACpB,aAAa,EACb,aAA8B,EAC9B,YAAY,CACf,CAAA;AACL,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,MAAM,CAAA;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/index.mjs b/node_modules/motion-dom/dist/es/gestures/press/index.mjs new file mode 100644 index 00000000..c50422af --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/index.mjs @@ -0,0 +1,90 @@ +import { isHTMLElement } from '../../utils/is-html-element.mjs'; +import { isDragActive } from '../drag/state/is-active.mjs'; +import { isNodeOrChild } from '../utils/is-node-or-child.mjs'; +import { isPrimaryPointer } from '../utils/is-primary-pointer.mjs'; +import { setupGesture } from '../utils/setup.mjs'; +import { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs'; +import { enableKeyboardPress } from './utils/keyboard.mjs'; +import { isPressing } from './utils/state.mjs'; + +/** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ +function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); +} +const claimedPointerDownEvents = new WeakSet(); +/** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ +function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerCancel); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerCancel, eventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; +} + +export { press }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map new file mode 100644 index 00000000..409f4ed7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/gestures/press/index.ts"],"sourcesContent":["import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\"pointerup\", onPointerUp)\n window.removeEventListener(\"pointercancel\", onPointerCancel)\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions)\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions)\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n"],"names":[],"mappings":";;;;;;;;;AAYA;;;AAGG;AACH,SAAS,iBAAiB,CAAC,KAAmB,EAAA;IAC1C,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAA;AACrD,CAAC;AAED,MAAM,wBAAw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ard-accessible.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs new file mode 100644 index 00000000..defa4bfc --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs @@ -0,0 +1,34 @@ +const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", +]); +/** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ +function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); +} +const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); +/** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ +function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); +} + +export { isElementKeyboardAccessible, isElementTextInput }; +//# sourceMappingURL=is-keyboard-accessible.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map new file mode 100644 index 00000000..f5968d19 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-keyboard-accessible.mjs","sources":["../../../../../src/gestures/press/utils/is-keyboard-accessible.ts"],"sourcesContent":["const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n"],"names":[],"mappings":"AAAA,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACvC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,GAAG;AACN,CAAA,CAAC,CAAA;AAEF;;;AAGG;AACG,SAAU,2BAA2B,CAAC,OAAgB,EAAA;IACxD,QACI,0BAA0B,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AAC9C,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI,EACtD;AACL,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAA;AAElE;;;;;;;;;;AAUG;AACG,SAAU,kBAAkB,CAAC,OAAgB,EAAA;IAC/C,QACI,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AACrC,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI,EACtD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs new file mode 100644 index 00000000..81865998 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs @@ -0,0 +1,39 @@ +import { isPressing } from './state.mjs'; + +/** + * Filter out events that are not "Enter" keys. + */ +function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; +} +function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); +} +const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); +}; + +export { enableKeyboardPress }; +//# sourceMappingURL=keyboard.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map new file mode 100644 index 00000000..90f4e94b --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keyboard.mjs","sources":["../../../../../src/gestures/press/utils/keyboard.ts"],"sourcesContent":["import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n"],"names":[],"mappings":";;AAEA;;AAEG;AACH,SAAS,YAAY,CAAC,QAAwC,EAAA;IAC1D,OAAO,CAAC,KAAoB,KAAI;AAC5B,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO;YAAE,OAAM;QACjC,QAAQ,CAAC,KAAK,CAAC,CAAA;AACnB,KAAC,CAAA;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAmB,EAAE,IAA8B,EAAA;IACzE,MAAM,CAAC,aAAa,CAChB,IAAI,YAAY,CAAC,SAAS,GAAG,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CACzE,CAAA;AACL,CAAC;MAEY,mBAAmB,GAAG,CAC/B,UAAsB,EACtB,YAAqC,KACrC;AACA,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,aAA4B,CAAA;AACvD,IAAA,IAAI,CAAC,OAAO;QAAE,OAAM;AAEpB,IAAA,MAAM,aAAa,GAAG,YAAY,CAAC,MAAK;AACpC,QAAA,IAAI,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,OAAM;AAEnC,QAAA,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;AAEjC,QAAA,MAAM,WAAW,GAAG,YAAY,CAAC,MAAK;AAClC,YAAA,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACnC,SAAC,CAAC,CAAA;QAEF,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAE5D,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;QAC5D,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AAC9D,KAAC,CAAC,CAAA;IAEF,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,CAAC,CAAA;AAEhE;;AAEG;AACH,IAAA,OAAO,CAAC,gBAAgB,CACpB,MAAM,EACN,MAAM,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,EAC3D,YAAY,CACf,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs new file mode 100644 index 00000000..ac86eab4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs @@ -0,0 +1,4 @@ +const isPressing = new WeakSet(); + +export { isPressing }; +//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map new file mode 100644 index 00000000..731b876c --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"state.mjs","sources":["../../../../../src/gestures/press/utils/state.ts"],"sourcesContent":["export const isPressing = new WeakSet()\n"],"names":[],"mappings":"AAAa,MAAA,UAAU,GAAG,IAAI,OAAO;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs new file mode 100644 index 00000000..7cc1da69 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs @@ -0,0 +1,21 @@ +/** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ +const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } +}; + +export { isNodeOrChild }; +//# sourceMappingURL=is-node-or-child.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map new file mode 100644 index 00000000..1a6b95b3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-node-or-child.mjs","sources":["../../../../src/gestures/utils/is-node-or-child.ts"],"sourcesContent":["/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nexport const isNodeOrChild = (\n parent: Element | null,\n child?: Element | null\n): boolean => {\n if (!child) {\n return false\n } else if (parent === child) {\n return true\n } else {\n return isNodeOrChild(parent, child.parentElement)\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;MACU,aAAa,GAAG,CACzB,MAAsB,EACtB,KAAsB,KACb;IACT,IAAI,CAAC,KAAK,EAAE;AACR,QAAA,OAAO,KAAK,CAAA;KACf;AAAM,SAAA,IAAI,MAAM,KAAK,KAAK,EAAE;AACzB,QAAA,OAAO,IAAI,CAAA;KACd;SAAM;QACH,OAAO,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;KACpD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs new file mode 100644 index 00000000..c013d7ee --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs @@ -0,0 +1,19 @@ +const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } +}; + +export { isPrimaryPointer }; +//# sourceMappingURL=is-primary-pointer.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map new file mode 100644 index 00000000..9a5b95ca --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-primary-pointer.mjs","sources":["../../../../src/gestures/utils/is-primary-pointer.ts"],"sourcesContent":["export const isPrimaryPointer = (event: PointerEvent) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0\n } else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false\n }\n}\n"],"names":[],"mappings":"AAAa,MAAA,gBAAgB,GAAG,CAAC,KAAmB,KAAI;AACpD,IAAA,IAAI,KAAK,CAAC,WAAW,KAAK,OAAO,EAAE;AAC/B,QAAA,OAAO,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,CAAA;KAC/D;SAAM;AACH;;;;;;;AAOG;AACH,QAAA,OAAO,KAAK,CAAC,SAAS,KAAK,KAAK,CAAA;KACnC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs new file mode 100644 index 00000000..9505c062 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs @@ -0,0 +1,16 @@ +import { resolveElements } from '../../utils/resolve-elements.mjs'; + +function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; +} + +export { setupGesture }; +//# sourceMappingURL=setup.mjs.map diff --git a/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map new file mode 100644 index 00000000..9b9ea502 --- /dev/null +++ b/node_modules/motion-dom/dist/es/gestures/utils/setup.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"setup.mjs","sources":["../../../../src/gestures/utils/setup.ts"],"sourcesContent":["import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n"],"names":[],"mappings":";;AAMgB,SAAA,YAAY,CACxB,iBAAoC,EACpC,OAAqB,EAAA;AAErB,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAA;AAEnD,IAAA,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAE,CAAA;AAEpD,IAAA,MAAM,YAAY,GAAG;AACjB,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,GAAG,OAAO;QACV,MAAM,EAAE,sBAAsB,CAAC,MAAM;KACxC,CAAA;IAED,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,KAAK,EAAE,CAAA;AAEnD,IAAA,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,CAAA;AAC3C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/index.mjs b/node_modules/motion-dom/dist/es/index.mjs new file mode 100644 index 00000000..1aa66ce6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/index.mjs @@ -0,0 +1,176 @@ +export { AsyncMotionValueAnimation } from './animation/AsyncMotionValueAnimation.mjs'; +export { GroupAnimation } from './animation/GroupAnimation.mjs'; +export { GroupAnimationWithThen } from './animation/GroupAnimationWithThen.mjs'; +export { JSAnimation, animateValue } from './animation/JSAnimation.mjs'; +export { NativeAnimation } from './animation/NativeAnimation.mjs'; +export { NativeAnimationExtended } from './animation/NativeAnimationExtended.mjs'; +export { NativeAnimationWrapper } from './animation/NativeAnimationWrapper.mjs'; +export { animationMapKey, getAnimationMap } from './animation/utils/active-animations.mjs'; +export { calcChildStagger } from './animation/utils/calc-child-stagger.mjs'; +export { getVariableValue, parseCSSVariable } from './animation/utils/css-variables-conversion.mjs'; +export { getDefaultTransition } from './animation/utils/default-transitions.mjs'; +export { getFinalKeyframe } from './animation/utils/get-final-keyframe.mjs'; +export { getValueTransition } from './animation/utils/get-value-transition.mjs'; +export { resolveTransition } from './animation/utils/resolve-transition.mjs'; +export { containsCSSVariable, isCSSVariableName, isCSSVariableToken } from './animation/utils/is-css-variable.mjs'; +export { isTransitionDefined } from './animation/utils/is-transition-defined.mjs'; +export { makeAnimationInstant } from './animation/utils/make-animation-instant.mjs'; +export { animateMotionValue } from './animation/interfaces/motion-value.mjs'; +export { animateVisualElement } from './animation/interfaces/visual-element.mjs'; +export { animateTarget } from './animation/interfaces/visual-element-target.mjs'; +export { animateVariant } from './animation/interfaces/visual-element-variant.mjs'; +export { optimizedAppearDataAttribute, optimizedAppearDataId } from './animation/optimized-appear/data-id.mjs'; +export { getOptimisedAppearId } from './animation/optimized-appear/get-appear-id.mjs'; +export { inertia } from './animation/generators/inertia.mjs'; +export { defaultEasing, keyframes } from './animation/generators/keyframes.mjs'; +export { spring } from './animation/generators/spring/index.mjs'; +export { calcGeneratorDuration, maxGeneratorDuration } from './animation/generators/utils/calc-duration.mjs'; +export { createGeneratorEasing } from './animation/generators/utils/create-generator-easing.mjs'; +export { isGenerator } from './animation/generators/utils/is-generator.mjs'; +export { DOMKeyframesResolver } from './animation/keyframes/DOMKeyframesResolver.mjs'; +export { KeyframeResolver, flushKeyframeResolvers } from './animation/keyframes/KeyframesResolver.mjs'; +export { defaultOffset } from './animation/keyframes/offsets/default.mjs'; +export { fillOffset } from './animation/keyframes/offsets/fill.mjs'; +export { convertOffsetToTimes } from './animation/keyframes/offsets/time.mjs'; +export { applyPxDefaults } from './animation/keyframes/utils/apply-px-defaults.mjs'; +export { fillWildcards } from './animation/keyframes/utils/fill-wildcards.mjs'; +export { cubicBezierAsString } from './animation/waapi/easing/cubic-bezier.mjs'; +export { isWaapiSupportedEasing } from './animation/waapi/easing/is-supported.mjs'; +export { mapEasingToNativeEasing } from './animation/waapi/easing/map-easing.mjs'; +export { supportedWaapiEasing } from './animation/waapi/easing/supported.mjs'; +export { startWaapiAnimation } from './animation/waapi/start-waapi-animation.mjs'; +export { supportsPartialKeyframes } from './animation/waapi/supports/partial-keyframes.mjs'; +export { supportsBrowserAnimation } from './animation/waapi/supports/waapi.mjs'; +export { acceleratedValues } from './animation/waapi/utils/accelerated-values.mjs'; +export { applyGeneratorOptions } from './animation/waapi/utils/apply-generator.mjs'; +export { generateLinearEasing } from './animation/waapi/utils/linear.mjs'; +export { addAttrValue, attrEffect } from './effects/attr/index.mjs'; +export { propEffect } from './effects/prop/index.mjs'; +export { addStyleValue, styleEffect } from './effects/style/index.mjs'; +export { svgEffect } from './effects/svg/index.mjs'; +export { createRenderBatcher } from './frameloop/batcher.mjs'; +export { cancelMicrotask, microtask } from './frameloop/microtask.mjs'; +export { time } from './frameloop/sync-time.mjs'; +export { isDragActive, isDragging } from './gestures/drag/state/is-active.mjs'; +export { setDragLock } from './gestures/drag/state/set-active.mjs'; +export { hover } from './gestures/hover.mjs'; +export { press } from './gestures/press/index.mjs'; +export { isElementKeyboardAccessible, isElementTextInput } from './gestures/press/utils/is-keyboard-accessible.mjs'; +export { isNodeOrChild } from './gestures/utils/is-node-or-child.mjs'; +export { isPrimaryPointer } from './gestures/utils/is-primary-pointer.mjs'; +export { defaultTransformValue, parseValueFromTransform, readTransformValue } from './render/dom/parse-transform.mjs'; +export { getComputedStyle } from './render/dom/style-computed.mjs'; +export { setStyle } from './render/dom/style-set.mjs'; +export { isKeyframesTarget } from './render/utils/is-keyframes-target.mjs'; +export { positionalKeys } from './render/utils/keys-position.mjs'; +export { transformPropOrder, transformProps } from './render/utils/keys-transform.mjs'; +export { resize } from './resize/index.mjs'; +export { observeTimeline } from './scroll/observe.mjs'; +export { recordStats } from './stats/index.mjs'; +export { activeAnimations } from './stats/animation-count.mjs'; +export { statsBuffer } from './stats/buffer.mjs'; +export { interpolate } from './utils/interpolate.mjs'; +export { isHTMLElement } from './utils/is-html-element.mjs'; +export { isSVGElement } from './utils/is-svg-element.mjs'; +export { isSVGSVGElement } from './utils/is-svg-svg-element.mjs'; +export { mix } from './utils/mix/index.mjs'; +export { mixColor, mixLinearColor } from './utils/mix/color.mjs'; +export { getMixer, mixArray, mixComplex, mixObject } from './utils/mix/complex.mjs'; +export { mixImmediate } from './utils/mix/immediate.mjs'; +export { mixNumber } from './utils/mix/number.mjs'; +export { invisibleValues, mixVisibility } from './utils/mix/visibility.mjs'; +export { resolveElements } from './utils/resolve-elements.mjs'; +export { getOriginIndex, stagger } from './utils/stagger.mjs'; +export { supportsFlags } from './utils/supports/flags.mjs'; +export { supportsLinearEasing } from './utils/supports/linear-easing.mjs'; +export { supportsScrollTimeline } from './utils/supports/scroll-timeline.mjs'; +export { transform } from './utils/transform.mjs'; +export { MotionValue, collectMotionValues, motionValue } from './value/index.mjs'; +export { attachFollow, followValue } from './value/follow-value.mjs'; +export { mapValue } from './value/map-value.mjs'; +export { attachSpring, springValue } from './value/spring-value.mjs'; +export { transformValue } from './value/transform-value.mjs'; +export { color } from './value/types/color/index.mjs'; +export { hex } from './value/types/color/hex.mjs'; +export { hsla } from './value/types/color/hsla.mjs'; +export { hslaToRgba } from './value/types/color/hsla-to-rgba.mjs'; +export { rgbUnit, rgba } from './value/types/color/rgba.mjs'; +export { analyseComplexValue, complex } from './value/types/complex/index.mjs'; +export { dimensionValueTypes, findDimensionValueType } from './value/types/dimensions.mjs'; +export { defaultValueTypes, getDefaultValueType } from './value/types/maps/defaults.mjs'; +export { numberValueTypes } from './value/types/maps/number.mjs'; +export { transformValueTypes } from './value/types/maps/transform.mjs'; +export { alpha, number, scale } from './value/types/numbers/index.mjs'; +export { degrees, percent, progressPercentage, px, vh, vw } from './value/types/numbers/units.mjs'; +export { testValueType } from './value/types/test.mjs'; +export { getAnimatableNone } from './value/types/utils/animatable-none.mjs'; +export { findValueType } from './value/types/utils/find.mjs'; +export { getValueAsType } from './value/types/utils/get-as-type.mjs'; +export { isMotionValue } from './value/utils/is-motion-value.mjs'; +export { addValueToWillChange } from './value/will-change/add-will-change.mjs'; +export { isWillChangeMotionValue } from './value/will-change/is.mjs'; +export { ViewTransitionBuilder, animateView } from './view/index.mjs'; +export { getViewAnimationLayerInfo } from './view/utils/get-layer-info.mjs'; +export { getViewAnimations } from './view/utils/get-view-animations.mjs'; +export { DOMVisualElement } from './render/dom/DOMVisualElement.mjs'; +export { Feature } from './render/Feature.mjs'; +export { HTMLVisualElement } from './render/html/HTMLVisualElement.mjs'; +export { ObjectVisualElement } from './render/object/ObjectVisualElement.mjs'; +export { visualElementStore } from './render/store.mjs'; +export { SVGVisualElement } from './render/svg/SVGVisualElement.mjs'; +export { VisualElement, getFeatureDefinitions, setFeatureDefinitions } from './render/VisualElement.mjs'; +export { checkVariantsDidChange, createAnimationState } from './render/utils/animation-state.mjs'; +export { getVariantContext } from './render/utils/get-variant-context.mjs'; +export { isAnimationControls } from './render/utils/is-animation-controls.mjs'; +export { isControllingVariants, isVariantNode } from './render/utils/is-controlling-variants.mjs'; +export { isForcedMotionValue } from './render/utils/is-forced-motion-value.mjs'; +export { isVariantLabel } from './render/utils/is-variant-label.mjs'; +export { updateMotionValuesFromProps } from './render/utils/motion-values.mjs'; +export { resolveVariant } from './render/utils/resolve-dynamic-variants.mjs'; +export { resolveVariantFromProps } from './render/utils/resolve-variants.mjs'; +export { setTarget } from './render/utils/setters.mjs'; +export { variantPriorityOrder, variantProps } from './render/utils/variant-props.mjs'; +export { initPrefersReducedMotion } from './render/utils/reduced-motion/index.mjs'; +export { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints } from './projection/geometry/conversion.mjs'; +export { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from './projection/geometry/copy.mjs'; +export { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis } from './projection/geometry/delta-apply.mjs'; +export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear } from './projection/geometry/delta-calc.mjs'; +export { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta } from './projection/geometry/delta-remove.mjs'; +export { createAxis, createAxisDelta, createBox, createDelta } from './projection/geometry/models.mjs'; +export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero } from './projection/geometry/utils.mjs'; +export { eachAxis } from './projection/utils/each-axis.mjs'; +export { has2DTranslate, hasScale, hasTransform } from './projection/utils/has-transform.mjs'; +export { measurePageBox, measureViewportBox } from './projection/utils/measure.mjs'; +export { correctBorderRadius, pixelsToPercent } from './projection/styles/scale-border-radius.mjs'; +export { correctBoxShadow } from './projection/styles/scale-box-shadow.mjs'; +export { buildProjectionTransform } from './projection/styles/transform.mjs'; +export { mixValues } from './projection/animation/mix-values.mjs'; +export { animateSingleValue } from './animation/animate/single-value.mjs'; +export { addDomEvent } from './events/add-dom-event.mjs'; +export { compareByDepth } from './projection/utils/compare-by-depth.mjs'; +export { FlatTree } from './projection/utils/flat-tree.mjs'; +export { delay, delayInSeconds } from './utils/delay.mjs'; +export { resolveMotionValue } from './value/utils/resolve-motion-value.mjs'; +export { cleanDirtyNodes, createProjectionNode, propagateDirtyNodes } from './projection/node/create-projection-node.mjs'; +export { DocumentProjectionNode } from './projection/node/DocumentProjectionNode.mjs'; +export { nodeGroup } from './projection/node/group.mjs'; +export { HTMLProjectionNode, rootProjectionNode } from './projection/node/HTMLProjectionNode.mjs'; +export { globalProjectionState } from './projection/node/state.mjs'; +export { NodeStack } from './projection/shared/stack.mjs'; +export { camelToDash } from './render/dom/utils/camel-to-dash.mjs'; +export { buildHTMLStyles } from './render/html/utils/build-styles.mjs'; +export { buildTransform } from './render/html/utils/build-transform.mjs'; +export { renderHTML } from './render/html/utils/render.mjs'; +export { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from './render/html/utils/scrape-motion-values.mjs'; +export { buildSVGAttrs } from './render/svg/utils/build-attrs.mjs'; +export { camelCaseAttributes } from './render/svg/utils/camel-case-attrs.mjs'; +export { isSVGTag } from './render/svg/utils/is-svg-tag.mjs'; +export { buildSVGPath } from './render/svg/utils/path.mjs'; +export { renderSVG } from './render/svg/utils/render.mjs'; +export { scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps } from './render/svg/utils/scrape-motion-values.mjs'; +export { LayoutAnimationBuilder, parseAnimateLayoutArgs } from './layout/LayoutAnimationBuilder.mjs'; +export { cancelSync, sync } from './frameloop/index-legacy.mjs'; +export { addScaleCorrector, scaleCorrectors } from './projection/styles/scale-correction.mjs'; +export { hasReducedMotionListener, prefersReducedMotion } from './render/utils/reduced-motion/state.mjs'; +export { cancelFrame, frame, frameData, frameSteps } from './frameloop/frame.mjs'; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/index.mjs.map b/node_modules/motion-dom/dist/es/index.mjs.map new file mode 100644 index 00000000..0dd9c365 --- /dev/null +++ b/node_modules/motion-dom/dist/es/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs new file mode 100644 index 00000000..701b6445 --- /dev/null +++ b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs @@ -0,0 +1,269 @@ +import { GroupAnimation } from '../animation/GroupAnimation.mjs'; +import { copyBoxInto } from '../projection/geometry/copy.mjs'; +import { createBox } from '../projection/geometry/models.mjs'; +import { HTMLProjectionNode } from '../projection/node/HTMLProjectionNode.mjs'; +import { HTMLVisualElement } from '../render/html/HTMLVisualElement.mjs'; +import { visualElementStore } from '../render/store.mjs'; +import { resolveElements } from '../utils/resolve-elements.mjs'; +import { frame } from '../frameloop/frame.mjs'; + +const layoutSelector = "[data-layout], [data-layout-id]"; +const noop = () => { }; +function snapshotFromTarget(projection) { + const target = projection.targetWithTransforms || projection.target; + if (!target) + return undefined; + const measuredBox = createBox(); + const layoutBox = createBox(); + copyBoxInto(measuredBox, target); + copyBoxInto(layoutBox, target); + return { + animationId: projection.root?.animationId ?? 0, + measuredBox, + layoutBox, + latestValues: projection.animationValues || projection.latestValues || {}, + source: projection.id, + }; +} +class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.sharedTransitions = new Map(); + this.notifyReady = noop; + this.rejectReady = noop; + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + frame.postRender(() => { + this.start().then(this.notifyReady).catch(this.rejectReady); + }); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + async start() { + const beforeElements = collectLayoutElements(this.scope); + const beforeRecords = this.buildRecords(beforeElements); + beforeRecords.forEach(({ projection }) => { + const hasCurrentAnimation = Boolean(projection.currentAnimation); + const isSharedLayout = Boolean(projection.options.layoutId); + if (hasCurrentAnimation && isSharedLayout) { + const snapshot = snapshotFromTarget(projection); + if (snapshot) { + projection.snapshot = snapshot; + } + else if (projection.snapshot) { + projection.snapshot = undefined; + } + } + else if (projection.snapshot && + (projection.currentAnimation || projection.isProjecting())) { + projection.snapshot = undefined; + } + projection.isPresent = true; + projection.willUpdate(); + }); + await this.updateDom(); + const afterElements = collectLayoutElements(this.scope); + const afterRecords = this.buildRecords(afterElements); + this.handleExitingElements(beforeRecords, afterRecords); + afterRecords.forEach(({ projection }) => { + const instance = projection.instance; + const resumeFromInstance = projection.resumeFrom + ?.instance; + if (!instance || !resumeFromInstance) + return; + if (!("style" in instance)) + return; + const currentTransform = instance.style.transform; + const resumeFromTransform = resumeFromInstance.style.transform; + if (currentTransform && + resumeFromTransform && + currentTransform === resumeFromTransform) { + instance.style.transform = ""; + instance.style.transformOrigin = ""; + } + }); + afterRecords.forEach(({ projection }) => { + projection.isPresent = true; + }); + const root = getProjectionRoot(afterRecords, beforeRecords); + root?.didUpdate(); + await new Promise((resolve) => { + frame.postRender(() => resolve()); + }); + const animations = collectAnimations(afterRecords); + const animation = new GroupAnimation(animations); + return animation; + } + buildRecords(elements) { + const records = []; + const recordMap = new Map(); + for (const element of elements) { + const parentRecord = findParentRecord(element, recordMap, this.scope); + const { layout, layoutId } = readLayoutAttributes(element); + const override = layoutId + ? this.sharedTransitions.get(layoutId) + : undefined; + const transition = override || this.defaultOptions; + const record = getOrCreateRecord(element, parentRecord?.projection, { + layout, + layoutId, + animationType: typeof layout === "string" ? layout : "both", + transition: transition, + }); + recordMap.set(element, record); + records.push(record); + } + return records; + } + handleExitingElements(beforeRecords, afterRecords) { + const afterElementsSet = new Set(afterRecords.map((record) => record.element)); + beforeRecords.forEach((record) => { + if (afterElementsSet.has(record.element)) + return; + // For shared layout elements, relegate to set up resumeFrom + // so the remaining element animates from this position + if (record.projection.options.layoutId) { + record.projection.isPresent = false; + record.projection.relegate(); + } + record.visualElement.unmount(); + visualElementStore.delete(record.element); + }); + // Clear resumeFrom on EXISTING nodes that point to unmounted projections + // This prevents crossfade animation when the source element was removed entirely + // But preserve resumeFrom for NEW nodes so they can animate from the old position + // Also preserve resumeFrom for lead nodes that were just promoted via relegate + const beforeElementsSet = new Set(beforeRecords.map((record) => record.element)); + afterRecords.forEach(({ element, projection }) => { + if (beforeElementsSet.has(element) && + projection.resumeFrom && + !projection.resumeFrom.instance && + !projection.isLead()) { + projection.resumeFrom = undefined; + projection.snapshot = undefined; + } + }); + } +} +function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + // animateLayout(updateDom) + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + // animateLayout(scope, updateDom, options?) + const elements = resolveElements(scopeOrUpdateDom); + const scope = elements[0] || document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; +} +function collectLayoutElements(scope) { + const elements = Array.from(scope.querySelectorAll(layoutSelector)); + if (scope instanceof Element && scope.matches(layoutSelector)) { + if (!elements.includes(scope)) { + elements.unshift(scope); + } + } + return elements; +} +function readLayoutAttributes(element) { + const layoutId = element.getAttribute("data-layout-id") || undefined; + const rawLayout = element.getAttribute("data-layout"); + let layout; + if (rawLayout === "" || rawLayout === "true") { + layout = true; + } + else if (rawLayout) { + layout = rawLayout; + } + return { + layout, + layoutId, + }; +} +function createVisualState() { + return { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }; +} +function getOrCreateRecord(element, parentProjection, projectionOptions) { + const existing = visualElementStore.get(element); + const visualElement = existing ?? + new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: createVisualState(), + }, { allowProjection: true }); + if (!existing || !visualElement.projection) { + visualElement.projection = new HTMLProjectionNode(visualElement.latestValues, parentProjection); + } + visualElement.projection.setOptions({ + ...projectionOptions, + visualElement, + }); + if (!visualElement.current) { + visualElement.mount(element); + } + else if (!visualElement.projection.instance) { + // Mount projection if VisualElement is already mounted but projection isn't + // This happens when animate() was called before animateLayout() + visualElement.projection.mount(element); + } + if (!existing) { + visualElementStore.set(element, visualElement); + } + return { + element, + visualElement, + projection: visualElement.projection, + }; +} +function findParentRecord(element, recordMap, scope) { + let parent = element.parentElement; + while (parent) { + const record = recordMap.get(parent); + if (record) + return record; + if (parent === scope) + break; + parent = parent.parentElement; + } + return undefined; +} +function getProjectionRoot(afterRecords, beforeRecords) { + const record = afterRecords[0] || beforeRecords[0]; + return record?.projection.root; +} +function collectAnimations(afterRecords) { + const animations = new Set(); + afterRecords.forEach((record) => { + const animation = record.projection.currentAnimation; + if (animation) + animations.add(animation); + }); + return Array.from(animations); +} + +export { LayoutAnimationBuilder, parseAnimateLayoutArgs }; +//# sourceMappingURL=LayoutAnimationBuilder.mjs.map diff --git a/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map new file mode 100644 index 00000000..5dd23462 --- /dev/null +++ b/node_modules/motion-dom/dist/es/layout/LayoutAnimationBuilder.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"LayoutAnimationBuilder.mjs","sources":["../../../src/layout/LayoutAnimationBuilder.ts"],"sourcesContent":["import type { Box } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport type {\n AnimationOptions,\n AnimationPlaybackControls,\n Transition,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { copyBoxInto } from \"../projection/geometry/copy\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport type { IProjectionNode } from \"../projection/node/types\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { visualElementStore } from \"../render/store\"\nimport type { VisualElement } from \"../render/VisualElement\"\nimport { resolveElements, type ElementOrSelector } from \"../utils/resolve-elements\"\n\ntype LayoutAnimationScope = Element | Document\n\ninterface LayoutElementRecord {\n element: Element\n visualElement: VisualElement\n projection: IProjectionNode\n}\n\ninterface LayoutAttributes {\n layout?: boolean | \"position\" | \"size\" | \"preserve-aspect\"\n layoutId?: string\n}\n\ntype LayoutBuilderResolve = (animation: GroupAnimation) => void\ntype LayoutBuilderReject = (error: unknown) => void\n\ninterface ProjectionOptions {\n layout?: boolean | \"position\" | \"size\" | \"preserve-aspect\"\n layoutId?: string\n animationType?: \"size\" | \"position\" | \"both\" | \"preserve-aspect\"\n transition?: Transition\n crossfade?: boolean\n}\n\nconst layoutSelector = \"[data-layout], [data-layout-id]\"\nconst noop = () => {}\nfunction snapshotFromTarget(projection: IProjectionNode): LayoutElementRecord[\"projection\"][\"snapshot\"] {\n const target = projection.targetWithTransforms || projection.target\n if (!target) return undefined\n\n const measuredBox = createBox()\n const layoutBox = createBox()\n copyBoxInto(measuredBox, target as Box)\n copyBoxInto(layoutBox, target as Box)\n\n return {\n animationId: projection.root?.animationId ?? 0,\n measuredBox,\n layoutBox,\n latestValues: projection.animationValues || projection.latestValues || {},\n source: projection.id,\n }\n}\n\nexport class LayoutAnimationBuilder {\n private scope: LayoutAnimationScope\n private updateDom: () => void | Promise\n private defaultOptions?: AnimationOptions\n private sharedTransitions = new Map()\n private notifyReady: LayoutBuilderResolve = noop\n private rejectReady: LayoutBuilderReject = noop\n private readyPromise: Promise\n\n constructor(\n scope: LayoutAnimationScope,\n updateDom: () => void | Promise,\n defaultOptions?: AnimationOptions\n ) {\n this.scope = scope\n this.updateDom = updateDom\n this.defaultOptions = defaultOptions\n\n this.readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.rejectReady = reject\n })\n\n frame.postRender(() => {\n this.start().then(this.notifyReady).catch(this.rejectReady)\n })\n }\n\n shared(id: string, transition: AnimationOptions): this {\n this.sharedTransitions.set(id, transition)\n return this\n }\n\n then(\n resolve: LayoutBuilderResolve,\n reject?: LayoutBuilderReject\n ): Promise {\n return this.readyPromise.then(resolve, reject)\n }\n\n private async start(): Promise {\n const beforeElements = collectLayoutElements(this.scope)\n const beforeRecords = this.buildRecords(beforeElements)\n\n beforeRecords.forEach(({ projection }) => {\n const hasCurrentAnimation = Boolean(projection.currentAnimation)\n const isSharedLayout = Boolean(projection.options.layoutId)\n if (hasCurrentAnimation && isSharedLayout) {\n const snapshot = snapshotFromTarget(projection)\n if (snapshot) {\n projection.snapshot = snapshot\n } else if (projection.snapshot) {\n projection.snapshot = undefined\n }\n } else if (\n projection.snapshot &&\n (projection.currentAnimation || projection.isProjecting())\n ) {\n projection.snapshot = undefined\n }\n projection.isPresent = true\n projection.willUpdate()\n })\n\n await this.updateDom()\n\n const afterElements = collectLayoutElements(this.scope)\n const afterRecords = this.buildRecords(afterElements)\n this.handleExitingElements(beforeRecords, afterRecords)\n\n afterRecords.forEach(({ projection }) => {\n const instance = projection.instance as HTMLElement | undefined\n const resumeFromInstance = projection.resumeFrom\n ?.instance as HTMLElement | undefined\n if (!instance || !resumeFromInstance) return\n if (!(\"style\" in instance)) return\n\n const currentTransform = instance.style.transform\n const resumeFromTransform = resumeFromInstance.style.transform\n\n if (\n currentTransform &&\n resumeFromTransform &&\n currentTransform === resumeFromTransform\n ) {\n instance.style.transform = \"\"\n instance.style.transformOrigin = \"\"\n }\n })\n\n afterRecords.forEach(({ projection }) => {\n projection.isPresent = true\n })\n\n const root = getProjectionRoot(afterRecords, beforeRecords)\n root?.didUpdate()\n\n await new Promise((resolve) => {\n frame.postRender(() => resolve())\n })\n\n const animations = collectAnimations(afterRecords)\n const animation = new GroupAnimation(animations)\n\n return animation\n }\n\n private buildRecords(elements: Element[]): LayoutElementRecord[] {\n const records: LayoutElementRecord[] = []\n const recordMap = new Map()\n\n for (const element of elements) {\n const parentRecord = findParentRecord(element, recordMap, this.scope)\n const { layout, layoutId } = readLayoutAttributes(element)\n const override = layoutId\n ? this.sharedTransitions.get(layoutId)\n : undefined\n const transition = override || this.defaultOptions\n const record = getOrCreateRecord(element, parentRecord?.projection, {\n layout,\n layoutId,\n animationType: typeof layout === \"string\" ? layout : \"both\",\n transition: transition as Transition,\n })\n recordMap.set(element, record)\n records.push(record)\n }\n\n return records\n }\n\n private handleExitingElements(\n beforeRecords: LayoutElementRecord[],\n afterRecords: LayoutElementRecord[]\n ): void {\n const afterElementsSet = new Set(afterRecords.map((record) => record.element))\n\n beforeRecords.forEach((record) => {\n if (afterElementsSet.has(record.element)) return\n\n // For shared layout elements, relegate to set up resumeFrom\n // so the remaining element animates from this position\n if (record.projection.options.layoutId) {\n record.projection.isPresent = false\n record.projection.relegate()\n }\n\n record.visualElement.unmount()\n visualElementStore.delete(record.element)\n })\n\n // Clear resumeFrom on EXISTING nodes that point to unmounted projections\n // This prevents crossfade animation when the source element was removed entirely\n // But preserve resumeFrom for NEW nodes so they can animate from the old position\n // Also preserve resumeFrom for lead nodes that were just promoted via relegate\n const beforeElementsSet = new Set(beforeRecords.map((record) => record.element))\n afterRecords.forEach(({ element, projection }) => {\n if (\n beforeElementsSet.has(element) &&\n projection.resumeFrom &&\n !projection.resumeFrom.instance &&\n !projection.isLead()\n ) {\n projection.resumeFrom = undefined\n projection.snapshot = undefined\n }\n })\n }\n}\n\nexport function parseAnimateLayoutArgs(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): {\n scope: Element | Document\n updateDom: () => void\n defaultOptions?: AnimationOptions\n} {\n // animateLayout(updateDom)\n if (typeof scopeOrUpdateDom === \"function\") {\n return {\n scope: document,\n updateDom: scopeOrUpdateDom,\n defaultOptions: updateDomOrOptions as AnimationOptions | undefined,\n }\n }\n\n // animateLayout(scope, updateDom, options?)\n const elements = resolveElements(scopeOrUpdateDom)\n const scope = elements[0] || document\n\n return {\n scope,\n updateDom: updateDomOrOptions as () => void,\n defaultOptions: options,\n }\n}\n\nfunction collectLayoutElements(scope: LayoutAnimationScope): Element[] {\n const elements = Array.from(scope.querySelectorAll(layoutSelector))\n\n if (scope instanceof Element && scope.matches(layoutSelector)) {\n if (!elements.includes(scope)) {\n elements.unshift(scope)\n }\n }\n\n return elements\n}\n\nfunction readLayoutAttributes(element: Element): LayoutAttributes {\n const layoutId = element.getAttribute(\"data-layout-id\") || undefined\n const rawLayout = element.getAttribute(\"data-layout\")\n let layout: LayoutAttributes[\"layout\"]\n\n if (rawLayout === \"\" || rawLayout === \"true\") {\n layout = true\n } else if (rawLayout) {\n layout = rawLayout as LayoutAttributes[\"layout\"]\n }\n\n return {\n layout,\n layoutId,\n }\n}\n\nfunction createVisualState() {\n return {\n latestValues: {},\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n },\n }\n}\n\nfunction getOrCreateRecord(\n element: Element,\n parentProjection?: IProjectionNode,\n projectionOptions?: ProjectionOptions\n): LayoutElementRecord {\n const existing = visualElementStore.get(element) as VisualElement | undefined\n const visualElement =\n existing ??\n new HTMLVisualElement(\n {\n props: {},\n presenceContext: null,\n visualState: createVisualState(),\n },\n { allowProjection: true }\n )\n\n if (!existing || !visualElement.projection) {\n visualElement.projection = new HTMLProjectionNode(\n visualElement.latestValues,\n parentProjection\n )\n }\n\n visualElement.projection.setOptions({\n ...projectionOptions,\n visualElement,\n })\n\n if (!visualElement.current) {\n visualElement.mount(element as HTMLElement)\n } else if (!visualElement.projection.instance) {\n // Mount projection if VisualElement is already mounted but projection isn't\n // This happens when animate() was called before animateLayout()\n visualElement.projection.mount(element as HTMLElement)\n }\n\n if (!existing) {\n visualElementStore.set(element, visualElement)\n }\n\n return {\n element,\n visualElement,\n projection: visualElement.projection as IProjectionNode,\n }\n}\n\nfunction findParentRecord(\n element: Element,\n recordMap: Map,\n scope: LayoutAnimationScope\n) {\n let parent = element.parentElement\n\n while (parent) {\n const record = recordMap.get(parent)\n if (record) return record\n\n if (parent === scope) break\n parent = parent.parentElement\n }\n\n return undefined\n}\n\nfunction getProjectionRoot(\n afterRecords: LayoutElementRecord[],\n beforeRecords: LayoutElementRecord[]\n) {\n const record = afterRecords[0] || beforeRecords[0]\n return record?.projection.root\n}\n\nfunction collectAnimations(afterRecords: LayoutElementRecord[]) {\n const animations = new Set()\n\n afterRecords.forEach((record) => {\n const animation = record.projection.currentAnimation\n if (animation) animations.add(animation)\n })\n\n return Array.from(animations)\n}\n"],"names":[],"mappings":";;;;;;;;;AAyCA,MAAM,cAAc,GAAG,iCAAiC,CAAA;AACxD,MAAM,IAAI,GAAG,MAAK,GAAG,CAAA;AACrB,SAAS,kBAAkB,CAAC,UAA2B,EAAA;IACnD,MAAM,MAAM,GAAG,UAAU,CAAC,oBAAoB,IAAI,UAAU,CAAC,MAAM,CAAA;AACnE,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,SAAS,CAAA;AAE7B,IAAA,MAAM,WAAW,GAAG,SAAS,EAAE,CAAA;AAC/B,IAAA,MAAM,SAAS,GAAG,SAAS,EAAE,CAAA;AAC7B,IAAA,WAAW,CAAC,WAAW,EAAE,MAAa,CAAC,CAAA;AACvC,IAAA,WAAW,CAAC,SAAS,EAAE,MAAa,CAAC,CAAA;IAErC,OAAO;AACH,QAAA,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,WAAW,IAAI,CAAC;QAC9C,WAAW;QACX,SAAS;QACT,YAAY,EAAE,UAAU,CAAC,eAAe,IAAI,UAAU,CAAC,YAAY,IAAI,EAAE;QACzE,MAAM,EAAE,UAAU,CAAC,EAAE;KACxB,CAAA;AACL,CAAC;MAEY,sBAAsB,CAAA;AAS/B,IAAA,WAAA,CACI,KAA2B,EAC3B,SAAqC,EACrC,cAAiC,EAAA;AAR7B,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nC,aAAoC,EAAA;IAEpC,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,CAAA;AAClD,IAAA,OAAO,MAAM,EAAE,UAAU,CAAC,IAAI,CAAA;AAClC,CAAC;AAED,SAAS,iBAAiB,CAAC,YAAmC,EAAA;AAC1D,IAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAA6B,CAAA;AAEvD,IAAA,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;AAC5B,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAA;AACpD,QAAA,IAAI,SAAS;AAAE,YAAA,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAC5C,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACjC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs new file mode 100644 index 00000000..a3c6d54a --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs @@ -0,0 +1,67 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; +import { percent, px } from '../../value/types/numbers/units.mjs'; +import { progress, circOut, noop } from 'motion-utils'; + +const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; +const numBorders = borders.length; +const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; +const isPx = (value) => typeof value === "number" || px.test(value); +function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = `border${borders[i]}Radius`; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress); + } +} +function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; +} +const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut); +const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop); +function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(progress(min, max, p)); + }; +} + +export { mixValues }; +//# sourceMappingURL=mix-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map new file mode 100644 index 00000000..d5531d40 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mix-values.mjs","sources":["../../../../src/projection/animation/mix-values.ts"],"sourcesContent":["import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"]\nconst numBorders = borders.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n"],"names":["calcProgress"],"mappings":";;;;AAWA,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAA;AACpE,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAA;AAEjC,MAAM,QAAQ,GAAG,CAAC,KAA0B,KACxC,OAAO,KAAK,KAAK,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,KAAK,CAAA;AAEzD,MAAM,IAAI,GAAG,CAAC,KAA0B,KACpC,OAAO,KAAK,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAE/B,SAAA,SAAS,CACrB,MAAsB,EACtB,MAAsB,EACtB,IAAoB,EACpB,QAAgB,EAChB,sBAA+B,EAC/B,YAAqB,EAAA;IAErB,IAAI,sBAAsB,EAAE;AACxB,QAAA,MAAM,CAAC,OAAO,GAAG,SAAS,CACtB,CAAC,EACA,IAAI,CAAC,OAAkB,IAAI,CAAC,EAC7B,eAAe,CAAC,QAAQ,CAAC,CAC5B,CAAA;AACD,QAAA,MAAM,CAAC,WAAW,GAAG,SAAS,CACzB,MAAM,CAAC,OAAkB,IAAI,CAAC,EAC/B,CAAC,EACD,gBAAgB,CAAC,QAAQ,CAAC,CAC7B,CAAA;KACJ;SAAM,IAAI,YAAY,EAAE;AACrB,QAAA,MAAM,CAAC,OAAO,GAAG,SAAS,CACrB,MAAM,CAAC,OAAkB,IAAI,CAAC,EAC9B,IAAI,CAAC,OAAkB,IAAI,CAAC,EAC7B,QAAQ,CACX,CAAA;KACJ;AAED;;AAEG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;QACjC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B,EAAE,UAAkB,EAAA;AACzD,IAAA,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,SAAS;AACnC,UAAE,MAAM,CAAC,UAAU,CAAC;AACpB,UAAE,MAAM,CAAC,YAAY,CAAA;AAC7B,CAAC;AAED,MAAM,eAAe,iBAAiB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;AAC/D,MAAM,gBAAgB,iBAAiB,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEhE,SAAS,QAAQ,CACb,GAAW,EACX,GAAW,EACX,MAAsB,EAAA;IAEtB,OAAO,CAAC,CAAS,KAAI;;QAEjB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC,CAAA;QACrB,IAAI,CAAC,GAAG,GAAG;AAAE,YAAA,OAAO,CAAC,CAAA;QACrB,OAAO,MAAM,CAACA,QAAY,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;AAC5C,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs new file mode 100644 index 00000000..fa9b9a06 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs @@ -0,0 +1,34 @@ +/** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ +function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; +} +function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; +} +/** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ +function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; +} + +export { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints }; +//# sourceMappingURL=conversion.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map new file mode 100644 index 00000000..b7db650f --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"conversion.mjs","sources":["../../../../src/projection/geometry/conversion.ts"],"sourcesContent":["import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;AACG,SAAU,uBAAuB,CAAC,EACpC,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,GACI,EAAA;IACV,OAAO;QACH,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE;QAC5B,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE;KAC/B,CAAA;AACL,CAAC;SAEe,uBAAuB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAO,EAAA;IACjD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAA;AACnE,CAAC;AAED;;;;AAIG;AACa,SAAA,kBAAkB,CAC9B,KAAkB,EAClB,cAA+B,EAAA;AAE/B,IAAA,IAAI,CAAC,cAAc;AAAE,QAAA,OAAO,KAAK,CAAA;AACjC,IAAA,MAAM,OAAO,GAAG,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAA;AAC/D,IAAA,MAAM,WAAW,GAAG,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;IAEvE,OAAO;QACH,GAAG,EAAE,OAAO,CAAC,CAAC;QACd,IAAI,EAAE,OAAO,CAAC,CAAC;QACf,MAAM,EAAE,WAAW,CAAC,CAAC;QACrB,KAAK,EAAE,WAAW,CAAC,CAAC;KACvB,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs new file mode 100644 index 00000000..5269ba1e --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs @@ -0,0 +1,32 @@ +/** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; +} +/** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ +function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); +} +/** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ +function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; +} + +export { copyAxisDeltaInto, copyAxisInto, copyBoxInto }; +//# sourceMappingURL=copy.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map new file mode 100644 index 00000000..17dc7b4d --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/copy.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"copy.mjs","sources":["../../../../src/projection/geometry/copy.ts"],"sourcesContent":["import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;AACa,SAAA,YAAY,CAAC,IAAU,EAAE,UAAgB,EAAA;AACrD,IAAA,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAA;AACzB,IAAA,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAA;AAC7B,CAAC;AAED;;;;AAIG;AACa,SAAA,WAAW,CAAC,GAAQ,EAAE,SAAc,EAAA;IAChD,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAChC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;AACpC,CAAC;AAED;;;;AAIG;AACa,SAAA,iBAAiB,CAAC,KAAgB,EAAE,WAAsB,EAAA;AACtE,IAAA,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAA;AACvC,IAAA,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAA;AAC/B,IAAA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAA;AAC3C,IAAA,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;AACrC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs new file mode 100644 index 00000000..54862753 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs @@ -0,0 +1,120 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; +import { hasTransform } from '../utils/has-transform.mjs'; + +/** + * Scales a point based on a factor and an originPoint + */ +function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; +} +/** + * Applies a translate/scale delta to a point + */ +function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; +} +/** + * Applies a translate/scale delta to an axis + */ +function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Applies a translate/scale delta to a box + */ +function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); +} +const TREE_SCALE_SNAP_MIN = 0.999999999999; +const TREE_SCALE_SNAP_MAX = 1.0000000000001; +/** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ +function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(box, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } +} +function translateAxis(axis, distance) { + axis.min = axis.min + distance; + axis.max = axis.max + distance; +} +/** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ +function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); +} +/** + * Apply a transform to a box from the latest resolved motion values. + */ +function transformBox(box, transform) { + transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY); +} + +export { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis }; +//# sourceMappingURL=delta-apply.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map new file mode 100644 index 00000000..59b4ecfe --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delta-apply.mjs","sources":["../../../../src/projection/geometry/delta-apply.ts"],"sourcesContent":["import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n })\n }\n\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min = axis.min + distance\n axis.max = axis.max + distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(box: Box, transform: ResolvedValues) {\n transformAxis(\n box.x,\n transform.x as number,\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n transform.y as number,\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n"],"names":[],"mappings":";;;AAKA;;AAEG;SACa,UAAU,CAAC,KAAa,EAAE,KAAa,EAAE,WAAmB,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAAG,KAAK,GAAG,WAAW,CAAA;AAC9C,IAAA,MAAM,MAAM,GAAG,KAAK,GAAG,kBAAkB,CAAA;IACzC,OAAO,WAAW,GAAG,MAAM,CAAA;AAC/B,CAAC;AAED;;AAEG;AACG,SAAU,eAAe,CAC3B,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,WAAmB,EACnB,QAAiB,EAAA;AAEjB,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;QACxB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;KACnD;IAED,OAAO,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,SAAS,CAAA;AAC5D,CA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AmB;AACjC,QAAA,SAAS,CAAC,CAAC,GAAG,mBAAmB,EACnC;AACE,QAAA,SAAS,CAAC,CAAC,GAAG,GAAG,CAAA;KACpB;AACL,CAAC;AAEe,SAAA,aAAa,CAAC,IAAU,EAAE,QAAgB,EAAA;IACtD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAA;IAC9B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAA;AAClC,CAAC;AAED;;;;AAIG;AACa,SAAA,aAAa,CACzB,IAAU,EACV,aAAsB,EACtB,SAAkB,EAClB,QAAiB,EACjB,UAAA,GAAqB,GAAG,EAAA;AAExB,IAAA,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;;IAG7D,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAA;AACzE,CAAC;AAED;;AAEG;AACa,SAAA,YAAY,CAAC,GAAQ,EAAE,SAAyB,EAAA;IAC5D,aAAa,CACT,GAAG,CAAC,CAAC,EACL,SAAS,CAAC,CAAW,EACrB,SAAS,CAAC,MAAgB,EAC1B,SAAS,CAAC,KAAe,EACzB,SAAS,CAAC,OAAiB,CAC9B,CAAA;IACD,aAAa,CACT,GAAG,CAAC,CAAC,EACL,SAAS,CAAC,CAAW,EACrB,SAAS,CAAC,MAAgB,EAC1B,SAAS,CAAC,KAAe,EACzB,SAAS,CAAC,OAAiB,CAC9B,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs new file mode 100644 index 00000000..e8eda138 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs @@ -0,0 +1,53 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; + +const SCALE_PRECISION = 0.0001; +const SCALE_MIN = 1 - SCALE_PRECISION; +const SCALE_MAX = 1 + SCALE_PRECISION; +const TRANSLATE_PRECISION = 0.01; +const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; +const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; +function calcLength(axis) { + return axis.max - axis.min; +} +function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; +} +function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } +} +function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); +} +function calcRelativeAxis(target, relative, parent) { + target.min = parent.min + relative.min; + target.max = target.min + calcLength(relative); +} +function calcRelativeBox(target, relative, parent) { + calcRelativeAxis(target.x, relative.x, parent.x); + calcRelativeAxis(target.y, relative.y, parent.y); +} +function calcRelativeAxisPosition(target, layout, parent) { + target.min = layout.min - parent.min; + target.max = target.min + calcLength(layout); +} +function calcRelativePosition(target, layout, parent) { + calcRelativeAxisPosition(target.x, layout.x, parent.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y); +} + +export { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear }; +//# sourceMappingURL=delta-calc.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map new file mode 100644 index 00000000..4b6df93c --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delta-calc.mjs","sources":["../../../../src/projection/geometry/delta-calc.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(target: Axis, relative: Axis, parent: Axis) {\n target.min = parent.min + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(target: Box, relative: Box, parent: Box) {\n calcRelativeAxis(target.x, relative.x, parent.x)\n calcRelativeAxis(target.y, relative.y, parent.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis\n) {\n target.min = layout.min - parent.min\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(target: Box, layout: Box, parent: Box) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y)\n}\n"],"names":[],"mappings":";;AAIA,MAAM,eAAe,GAAG,MAAM,CAAA;AAC9B,MAAM,SAAS,GAAG,CAAC,GAAG,eAAe,CAAA;AACrC,MAAM,SAAS,GAAG,CAAC,GAAG,eAAe,CAAA;AACrC,MAAM,mBAAmB,GAAG,IAAI,CAAA;AAChC,MAAM,aAAa,GAAG,CAAC,GAAG,mBAAmB,CAAA;AAC7C,MAAM,aAAa,GAAG,CAAC,GAAG,mBAAmB,CAAA;AAEvC,SAAU,UAAU,CAAC,IAAU,EAAA;AACjC,IAAA,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;AAC9B,CAAC;SAEe,MAAM,CAClB,KAAa,EACb,MAAc,EACd,WAAmB,EAAA;IAEnB,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,WAAW,CAAA;AAClD,CAAC;AAEK,SAAU,aAAa,CACzB,KAAgB,EAChB,MAAY,EACZ,MAAY,EACZ,MAAA,GAAiB,GAAG,EAAA;AAEpB,IAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAA;AACrB,IAAA,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;AACnE,IAAA,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,C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,IAAA,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAChD,IAAA,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AACpD,CAAC;SAEe,wBAAwB,CACpC,MAAY,EACZ,MAAY,EACZ,MAAY,EAAA;IAEZ,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA;IACpC,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;AAChD,CAAC;SAEe,oBAAoB,CAAC,MAAW,EAAE,MAAW,EAAE,MAAW,EAAA;AACtE,IAAA,wBAAwB,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AACtD,IAAA,wBAAwB,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs new file mode 100644 index 00000000..59915adb --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs @@ -0,0 +1,55 @@ +import { mixNumber } from '../../utils/mix/number.mjs'; +import { percent } from '../../value/types/numbers/units.mjs'; +import { scalePoint } from './delta-apply.mjs'; + +/** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ +function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; +} +/** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ +function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); +} +/** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); +} +/** + * The names of the motion values we want to apply as translation, scale and origin. + */ +const xKeys = ["x", "scaleX", "originX"]; +const yKeys = ["y", "scaleY", "originY"]; +/** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); +} + +export { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta }; +//# sourceMappingURL=delta-remove.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map new file mode 100644 index 00000000..e763cfec --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delta-remove.mjs","sources":["../../../../src/projection/geometry/delta-remove.ts"],"sourcesContent":["import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n"],"names":[],"mappings":";;;;AAMA;;AAEG;AACG,SAAU,gBAAgB,CAC5B,KAAa,EACb,SAAiB,EACjB,KAAa,EACb,WAAmB,EACnB,QAAiB,EAAA;IAEjB,KAAK,IAAI,SAAS,CAAA;IAClB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,WAAW,CAAC,CAAA;AAEjD,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;QACxB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,QAAQ,EAAE,WAAW,CAAC,CAAA;KACvD;AAED,IAAA,OAAO,KAAK,CAAA;AAChB,CAAC;AAED;;AAEG;AACG,SAAU,eAAe,CAC3B,IAAU,EACV,SAA6B,GAAA,CAAC,EAC9B,KAAgB,GAAA,CAAC,EACjB,MAAiB,GAAA,GAAG,EACpB,QAAiB,EACjB,aAAmB,IAAI,EACvB,aAAmB,IAAI,EAAA;AAEvB,IAAA,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AACzB,QAAA,SAAS,GAAG,UAAU,CAAC,SAAmB,CAAC,CAAA;AAC3C,QAAA,MAAM,gBAAgB,GAAG,SAAS,CAC9B,UAAU,CAAC,GAAG,EACd,UAAU,CAAC,GAAG,EACd,SAAS,GAAG,GAAG,CAClB,CAAA;AACD,QAAA,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAC,GAAG,CAAA;KACh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AAoB,CAChB,GAAG,CAAC,CAAC,EACL,UAAU,EACV,KAAK,EACL,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,EACnC,SAAS,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CACtC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs new file mode 100644 index 00000000..f6ca4f0a --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs @@ -0,0 +1,18 @@ +const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, +}); +const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), +}); +const createAxis = () => ({ min: 0, max: 0 }); +const createBox = () => ({ + x: createAxis(), + y: createAxis(), +}); + +export { createAxis, createAxisDelta, createBox, createDelta }; +//# sourceMappingURL=models.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map new file mode 100644 index 00000000..29448442 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/models.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"models.mjs","sources":["../../../../src/projection/geometry/models.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n"],"names":[],"mappings":"AAEa,MAAA,eAAe,GAAG,OAAkB;AAC7C,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,WAAW,EAAE,CAAC;AACjB,CAAA,EAAC;AAEW,MAAA,WAAW,GAAG,OAAc;IACrC,CAAC,EAAE,eAAe,EAAE;IACpB,CAAC,EAAE,eAAe,EAAE;AACvB,CAAA,EAAC;AAEW,MAAA,UAAU,GAAG,OAAa,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAC;AAE7C,MAAA,SAAS,GAAG,OAAY;IACjC,CAAC,EAAE,UAAU,EAAE;IACf,CAAC,EAAE,UAAU,EAAE;AAClB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs new file mode 100644 index 00000000..807d96d4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs @@ -0,0 +1,32 @@ +import { calcLength } from './delta-calc.mjs'; + +function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; +} +function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); +} +function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; +} +function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); +} +function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); +} +function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); +} +function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); +} +function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); +} + +export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map new file mode 100644 index 00000000..8d9f8283 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../src/projection/geometry/utils.ts"],"sourcesContent":["import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n"],"names":[],"mappings":";;AAGA,SAAS,eAAe,CAAC,KAAgB,EAAA;IACrC,OAAO,KAAK,CAAC,SAAS,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,CAAC,CAAA;AACrD,CAAC;AAEK,SAAU,WAAW,CAAC,KAAY,EAAA;AACpC,IAAA,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC/D,CAAC;AAEe,SAAA,UAAU,CAAC,CAAO,EAAE,CAAO,EAAA;AACvC,IAAA,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAA;AAC7C,CAAC;AAEe,SAAA,SAAS,CAAC,CAAM,EAAE,CAAM,EAAA;IACpC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACvD,CAAC;AAEe,SAAA,iBAAiB,CAAC,CAAO,EAAE,CAAO,EAAA;AAC9C,IAAA,QACI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;AACvC,QAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAC1C;AACL,CAAC;AAEe,SAAA,gBAAgB,CAAC,CAAM,EAAE,CAAM,EAAA;IAC3C,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AACrE,CAAC;AAEK,SAAU,WAAW,CAAC,GAAQ,EAAA;AAChC,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAChD,CAAC;AAEe,SAAA,eAAe,CAAC,CAAY,EAAE,CAAY,EAAA;AACtD,IAAA,QACI,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS;AAC3B,QAAA,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK;AACnB,QAAA,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,EAClC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs new file mode 100644 index 00000000..e6755c84 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs @@ -0,0 +1,14 @@ +import { addDomEvent } from '../../events/add-dom-event.mjs'; +import { createProjectionNode } from './create-projection-node.mjs'; + +const DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, +}); + +export { DocumentProjectionNode }; +//# sourceMappingURL=DocumentProjectionNode.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map new file mode 100644 index 00000000..aaa5c4d2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DocumentProjectionNode.mjs","sources":["../../../../src/projection/node/DocumentProjectionNode.ts"],"sourcesContent":["import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,GAAG,oBAAoB,CAAS;AAC/D,IAAA,oBAAoB,EAAE,CAClB,GAAqB,EACrB,MAAoB,KACL,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC;AACrD,IAAA,aAAa,EAAE,OAAO;AAClB,QAAA,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,IAAI,QAAQ,CAAC,IAAI,EAAE,UAAU,IAAI,CAAC;AACxE,QAAA,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC;KACzE,CAAC;AACF,IAAA,iBAAiB,EAAE,MAAM,IAAI;AAChC,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs new file mode 100644 index 00000000..2fb7f4c9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs @@ -0,0 +1,28 @@ +import { createProjectionNode } from './create-projection-node.mjs'; +import { DocumentProjectionNode } from './DocumentProjectionNode.mjs'; + +const rootProjectionNode = { + current: undefined, +}; +const HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), +}); + +export { HTMLProjectionNode, rootProjectionNode }; +//# sourceMappingURL=HTMLProjectionNode.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map new file mode 100644 index 00000000..13a18e91 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"HTMLProjectionNode.mjs","sources":["../../../../src/projection/node/HTMLProjectionNode.ts"],"sourcesContent":["import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n"],"names":[],"mappings":";;;AAIa,MAAA,kBAAkB,GAA6C;AACxE,IAAA,OAAO,EAAE,SAAS;EACrB;AAEM,MAAM,kBAAkB,GAAG,oBAAoB,CAAc;AAChE,IAAA,aAAa,EAAE,CAAC,QAAQ,MAAM;QAC1B,CAAC,EAAE,QAAQ,CAAC,UAAU;QACtB,CAAC,EAAE,QAAQ,CAAC,SAAS;KACxB,CAAC;IACF,aAAa,EAAE,MAAK;AAChB,QAAA,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;AAC7B,YAAA,MAAM,YAAY,GAAG,IAAI,sBAAsB,CAAC,EAAE,CAAC,CAAA;AACnD,YAAA,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAC1B,YAAY,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAA;AAC/C,YAAA,kBAAkB,CAAC,OAAO,GAAG,YAAY,CAAA;SAC5C;QACD,OAAO,kBAAkB,CAAC,OAAO,CAAA;KACpC;AACD,IAAA,cAAc,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAI;AAChC,QAAA,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,KAAK,SAAS,GAAG,KAAK,GAAG,MAAM,CAAA;KAClE;AACD,IAAA,iBAAiB,EAAE,CAAC,QAAQ,KACxB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC;AACtE,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs new file mode 100644 index 00000000..6bfbdd02 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs @@ -0,0 +1,1630 @@ +import { SubscriptionManager, clamp, noop } from 'motion-utils'; +import { animateSingleValue } from '../../animation/animate/single-value.mjs'; +import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs'; +import { getValueTransition } from '../../animation/utils/get-value-transition.mjs'; +import { microtask } from '../../frameloop/microtask.mjs'; +import { time } from '../../frameloop/sync-time.mjs'; +import { scaleCorrectors } from '../styles/scale-correction.mjs'; +import { activeAnimations } from '../../stats/animation-count.mjs'; +import { statsBuffer } from '../../stats/buffer.mjs'; +import { delay } from '../../utils/delay.mjs'; +import { isSVGElement } from '../../utils/is-svg-element.mjs'; +import { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs'; +import { mixNumber } from '../../utils/mix/number.mjs'; +import { motionValue } from '../../value/index.mjs'; +import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs'; +import { mixValues } from '../animation/mix-values.mjs'; +import { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs'; +import { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs'; +import { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs'; +import { removeBoxTransforms } from '../geometry/delta-remove.mjs'; +import { createBox, createDelta } from '../geometry/models.mjs'; +import { boxEqualsRounded, isDeltaZero, axisDeltaEquals, aspectRatio, boxEquals } from '../geometry/utils.mjs'; +import { NodeStack } from '../shared/stack.mjs'; +import { buildProjectionTransform } from '../styles/transform.mjs'; +import { eachAxis } from '../utils/each-axis.mjs'; +import { FlatTree } from '../utils/flat-tree.mjs'; +import { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs'; +import { globalProjectionState } from './state.mjs'; +import { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs'; + +const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, +}; +const transformAxes = ["", "X", "Y", "Z"]; +/** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ +const animationTarget = 1000; +let id = 0; +function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } +} +function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } +} +function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + this.unblockUpdate(); + this.clearAllSnapshots(); + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false) { + const withTransforms = createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(withTransforms, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!node.instance) + continue; + if (!hasTransform(node.latestValues)) + continue; + hasScale(node.latestValues) && node.updateSnapshot(); + const sourceBox = createBox(); + const nodeBox = node.measurePageBox(); + copyBoxInto(sourceBox, nodeBox); + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (relativeParent && relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + // TODO: This is creating a new object every frame + this.target = this.applyTransform(this.layout.layoutBox); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + mixAxisDelta(targetDelta.x, delta.x, progress); + mixAxisDelta(targetDelta.y, delta.y, progress); + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + activeAnimations.layout++; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onStop: () => { + activeAnimations.layout--; + }, + onComplete: () => { + activeAnimations.layout--; + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; +} +function updateLayout(node) { + node.updateLayout(); +} +function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; +} +function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); +} +function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; +} +function clearSnapshot(node) { + node.clearSnapshot(); +} +function clearMeasurements(node) { + node.clearMeasurements(); +} +function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; +} +function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); +} +function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; +} +function resolveTargetDelta(node) { + node.resolveTargetDelta(); +} +function calcProjection(node) { + node.calcProjection(); +} +function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); +} +function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); +} +function mixAxisDelta(output, delta, p) { + output.translate = mixNumber(delta.translate, 0, p); + output.scale = mixNumber(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; +} +function mixAxis(output, from, to, p) { + output.min = mixNumber(from.min, to.min, p); + output.max = mixNumber(from.max, to.max, p); +} +function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); +} +function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); +} +const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], +}; +const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); +/** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ +const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : noop; +function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); +} +function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); +} +function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); +} +function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; +} + +export { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes }; +//# sourceMappingURL=create-projection-node.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map new file mode 100644 index 00000000..d7c4f763 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"create-projection-node.mjs","sources":["../../../../src/projection/node/create-projection-node.ts"],"sourcesContent":["import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport { Transition, ValueAnimationOptions } from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { copyAxisDeltaInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig) {\n return class ProjectionNode implements IProjectionNode {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n layoutVersion: number = 0\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n // Only register the handler if it requires layout animation\n if (\n this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)\n ) {\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(\n layoutTransition,\n \"layout\"\n ),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n isTreeAnimationBlocked() {\n return (\n this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false\n )\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate()\n this.clearAllSnapshots()\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n this.sharedNodes.forEach(removeLeadSnapshots)\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n this.layoutVersion++\n this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false): Box {\n const withTransforms = createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n })\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(withTransforms, node.latestValues)\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues)\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!node.instance) continue\n if (!hasTransform(node.latestValues)) continue\n\n hasScale(node.latestValues) && node.updateSnapshot()\n\n const sourceBox = createBox()\n const nodeBox = node.measurePageBox()\n copyBoxInto(sourceBox, nodeBox)\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot ? node.snapshot.layoutBox : undefined,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n if (\n relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot\n ) {\n this.removeRelativeTarget()\n }\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (relativeParent && relativeParent.layout) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox)\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n linkedParentVersion: number = 0\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.linkedParentVersion = relativeParent.layoutVersion\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n\n mixAxisDelta(targetDelta.x, delta.x, progress)\n mixAxisDelta(targetDelta.y, delta.y, progress)\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue\n startAnimation(options: ValueAnimationOptions) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n activeAnimations.layout++\n this.motionValue ||= motionValue(0)\n this.motionValue.jump(0, false)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onStop: () => {\n activeAnimations.layout--\n },\n onComplete: () => {\n activeAnimations.layout--\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n let { targetWithTransforms, target, layout, latestValues } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction removeLeadSnapshots(stack: NodeStack) {\n stack.removeLeadSnapshot()\n}\n\nexport function mixAxisDelta(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,MAAM,OAAO,GAAG;AACZ,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,sBAAsB,EAAE,CAAC;AACzB,IAAA,qBAAqB,EAAE,CAAC;CAC3B,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAEzC;;;AAGG;AACH,MAAM,eAAe,GAAG,IAAI,CAAA;AAE5B,IAAI,EAAE,GAAG,CAAC,CAAA;AAEV,SAAS,wBAAwB,CAC7B,GAAW,EACX,aAA4B,EAC5B,MAAsB,EACtB,qBAAsC,EAAA;AAEtC,I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UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACnC,CAAC;AAED,SAAS,QAAQ,CAAC,GAAQ,EAAA;AACtB,IAAA,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAChB,IAAA,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACpB,CAAC;AAED,SAAS,yBAAyB,CAC9B,aAAiC,EACjC,QAAa,EACb,MAAW,EAAA;IAEX,QACI,aAAa,KAAK,UAAU;SAC3B,aAAa,KAAK,iBAAiB;AAChC,YAAA,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,EAChE;AACL,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAqB,EAAA;IACjD,OAAO,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,OAAO,CAAA;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/group.mjs b/node_modules/motion-dom/dist/es/projection/node/group.mjs new file mode 100644 index 00000000..ad789a50 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/group.mjs @@ -0,0 +1,25 @@ +const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); +function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; +} + +export { nodeGroup }; +//# sourceMappingURL=group.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/group.mjs.map b/node_modules/motion-dom/dist/es/projection/node/group.mjs.map new file mode 100644 index 00000000..e314e75e --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/group.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"group.mjs","sources":["../../../../src/projection/node/group.ts"],"sourcesContent":["import { IProjectionNode } from \"./types\"\n\nconst notify = (node: IProjectionNode) =>\n !node.isLayoutDirty && node.willUpdate(false)\n\nexport interface NodeGroup {\n add: (node: IProjectionNode) => void\n remove: (node: IProjectionNode) => void\n dirty: VoidFunction\n}\n\nexport function nodeGroup(): NodeGroup {\n const nodes = new Set()\n const subscriptions = new WeakMap void>()\n\n const dirtyAll = () => nodes.forEach(notify)\n\n return {\n add: (node) => {\n nodes.add(node)\n subscriptions.set(\n node,\n node.addEventListener(\"willUpdate\", dirtyAll)\n )\n },\n remove: (node) => {\n nodes.delete(node)\n const unsubscribe = subscriptions.get(node)\n if (unsubscribe) {\n unsubscribe()\n subscriptions.delete(node)\n }\n dirtyAll()\n },\n dirty: dirtyAll,\n }\n}\n"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,IAAqB,KACjC,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;SAQjC,SAAS,GAAA;AACrB,IAAA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAA;AACxC,IAAA,MAAM,aAAa,GAAG,IAAI,OAAO,EAA+B,CAAA;IAEhE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAE5C,OAAO;AACH,QAAA,GAAG,EAAE,CAAC,IAAI,KAAI;AACV,YAAA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACf,YAAA,aAAa,CAAC,GAAG,CACb,IAAI,EACJ,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAChD,CAAA;SACJ;AACD,QAAA,MAAM,EAAE,CAAC,IAAI,KAAI;AACb,YAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAClB,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAC3C,IAAI,WAAW,EAAE;AACb,gBAAA,WAAW,EAAE,CAAA;AACb,gBAAA,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;aAC7B;AACD,YAAA,QAAQ,EAAE,CAAA;SACb;AACD,QAAA,KAAK,EAAE,QAAQ;KAClB,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/node/state.mjs b/node_modules/motion-dom/dist/es/projection/node/state.mjs new file mode 100644 index 00000000..5ad856c0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/state.mjs @@ -0,0 +1,20 @@ +/** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ +const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, +}; + +export { globalProjectionState }; +//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/node/state.mjs.map b/node_modules/motion-dom/dist/es/projection/node/state.mjs.map new file mode 100644 index 00000000..434ba3e8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/node/state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"state.mjs","sources":["../../../../src/projection/node/state.ts"],"sourcesContent":["/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n"],"names":[],"mappings":"AAAA;;;;AAIG;AACU,MAAA,qBAAqB,GAAG;AACjC;;;AAGG;AACH,IAAA,sBAAsB,EAAE,IAAI;AAE5B;;;AAGG;AACH,IAAA,cAAc,EAAE,KAAK;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs new file mode 100644 index 00000000..2d5ce9b7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs @@ -0,0 +1,128 @@ +import { addUniqueItem, removeItem } from 'motion-utils'; + +class NodeStack { + constructor() { + this.members = []; + } + add(node) { + addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const m = this.members[i]; + if (m === node || m === this.lead || m === this.prevLead) + continue; + const inst = m.instance; + if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) { + removeItem(this.members, m); + } + } + node.scheduleRender(); + } + remove(node) { + removeItem(this.members, node); + if (node === this.prevLead) { + this.prevLead = undefined; + } + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) { + this.promote(prevLead); + } + } + } + relegate(node) { + const indexOfNode = this.members.findIndex((member) => node === member); + if (indexOfNode === 0) + return false; + /** + * Find the next projection node that is present + */ + let prevLead; + for (let i = indexOfNode; i >= 0; i--) { + const member = this.members[i]; + const inst = member.instance; + if (member.isPresent !== false && (!inst || inst.isConnected !== false)) { + prevLead = member; + break; + } + } + if (prevLead) { + this.promote(prevLead); + return true; + } + else { + return false; + } + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.instance && prevLead.scheduleRender(); + node.scheduleRender(); + /** + * If both the new and previous lead have the same defined layoutDependency, + * skip the shared layout animation. This allows components with layoutId + * to opt-out of animations when their layoutDependency hasn't changed, + * even when the component unmounts and remounts in a different location. + */ + const prevDep = prevLead.options.layoutDependency; + const nextDep = node.options.layoutDependency; + const dependencyMatches = prevDep !== undefined && + nextDep !== undefined && + prevDep === nextDep; + if (!dependencyMatches) { + const prevInstance = prevLead.instance; + const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot; + if (!isStale) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) { + node.resumeFrom.preserveOpacity = true; + } + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root && node.root.isUpdating) { + node.isLayoutDirty = true; + } + } + } + const { crossfade } = node.options; + if (crossfade === false) { + prevLead.hide(); + } + } + } + exitAnimationComplete() { + this.members.forEach((node) => { + const { options, resumingFrom } = node; + options.onExitComplete && options.onExitComplete(); + if (resumingFrom) { + resumingFrom.options.onExitComplete && + resumingFrom.options.onExitComplete(); + } + }); + } + scheduleRender() { + this.members.forEach((node) => { + node.instance && node.scheduleRender(false); + }); + } + /** + * Clear any leads that have been removed this render to prevent them from being + * used in future animations and to prevent memory leaks + */ + removeLeadSnapshot() { + if (this.lead && this.lead.snapshot) { + this.lead.snapshot = undefined; + } + } +} + +export { NodeStack }; +//# sourceMappingURL=stack.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map new file mode 100644 index 00000000..58f46971 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/shared/stack.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"stack.mjs","sources":["../../../../src/projection/shared/stack.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n\n for (let i = this.members.length - 1; i >= 0; i--) {\n const m = this.members[i]\n if (m === node || m === this.lead || m === this.prevLead) continue\n const inst = m.instance as HTMLElement | undefined\n if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) {\n removeItem(this.members, m)\n }\n }\n\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) {\n this.prevLead = undefined\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) {\n this.promote(prevLead)\n }\n }\n }\n\n relegate(node: IProjectionNode): boolean {\n const indexOfNode = this.members.findIndex((member) => node === member)\n if (indexOfNode === 0) return false\n\n /**\n * Find the next projection node that is present\n */\n let prevLead: IProjectionNode | undefined\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i]\n const inst = member.instance as HTMLElement | undefined\n if (member.isPresent !== false && (!inst || inst.isConnected !== false)) {\n prevLead = member\n break\n }\n }\n\n if (prevLead) {\n this.promote(prevLead)\n return true\n } else {\n return false\n }\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n\n node.show()\n\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender()\n node.scheduleRender()\n\n /**\n * If both the new and previous lead have the same defined layoutDependency,\n * skip the shared layout animation. This allows components with layoutId\n * to opt-out of animations when their layoutDependency hasn't changed,\n * even when the component unmounts and remounts in a different location.\n */\n const prevDep = prevLead.options.layoutDependency\n const nextDep = node.options.layoutDependency\n const dependencyMatches =\n prevDep !== undefined &&\n nextDep !== undefined &&\n prevDep === nextDep\n\n if (!dependencyMatches) {\n const prevInstance = prevLead.instance as HTMLElement | undefined\n const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot\n\n if (!isStale) {\n node.resumeFrom = prevLead\n\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true\n }\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true\n }\n }\n }\n\n const { crossfade } = node.options\n if (crossfade === false) {\n prevLead.hide()\n }\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node\n\n options.onExitComplete && options.onExitComplete()\n\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete()\n }\n })\n }\n\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false)\n })\n }\n\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined\n }\n }\n}\n"],"names":[],"mappings":";;MAGa,SAAS,CAAA;AAAtB,IAAA,WAAA,GAAA;QAGI,IAAO,CAAA,OAAA,GAAsB,EAAE,CAAA;KA4IlC;AA1IG,IAAA,GAAG,CAAC,IAAqB,EAAA;AACrB,QAAA,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AAEjC,QAAA,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC/C,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACzB,YAAA,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ;gBAAE,SAAQ;AAClE,YAAA,MAAM,IAAI,GAAG,CAAC,CAAC,QAAmC,CAAA;AAClD,YAAA,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,IAAI,CAAC,CAAC,SAAS,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE;AAC5E,gBAAA,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;aAC9B;SACJ;QAED,IAAI,CAAC,cAAc,EAAE,CAAA;KACxB;AAED,IAAA,MAAM,CAAC,IAAqB,EAAA;AACxB,QAAA,UAAU,CAAC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AI,QAAQ,CAAC,YAAY,CAAA;qBACxD;oBAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AACnC,wBAAA,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA;qBAC5B;iBACJ;aACJ;AAED,YAAA,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;AAClC,YAAA,IAAI,SAAS,KAAK,KAAK,EAAE;gBACrB,QAAQ,CAAC,IAAI,EAAE,CAAA;aAClB;SACJ;KACJ;IAED,qBAAqB,GAAA;QACjB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AAC1B,YAAA,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;AAEtC,YAAA,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,EAAE,CAAA;YAElD,IAAI,YAAY,EAAE;gBACd,YAAY,CAAC,OAAO,CAAC,cAAc;AAC/B,oBAAA,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE,CAAA;aAC5C;AACL,SAAC,CAAC,CAAA;KACL;IAED,cAAc,GAAA;QACV,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;YAC1B,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;AAC/C,SAAC,CAAC,CAAA;KACL;AAED;;;AAGG;IACH,kBAAkB,GAAA;QACd,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AACjC,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAA;SACjC;KACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs new file mode 100644 index 00000000..769cd506 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs @@ -0,0 +1,42 @@ +import { px } from '../../value/types/numbers/units.mjs'; + +function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; +} +/** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ +const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, +}; + +export { correctBorderRadius, pixelsToPercent }; +//# sourceMappingURL=scale-border-radius.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map new file mode 100644 index 00000000..3e252af8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scale-border-radius.mjs","sources":["../../../../src/projection/styles/scale-border-radius.ts"],"sourcesContent":["import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n"],"names":[],"mappings":";;AAIgB,SAAA,eAAe,CAAC,MAAc,EAAE,IAAU,EAAA;AACtD,IAAA,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,CAAC,CAAA;AACnC,IAAA,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;AACjD,CAAC;AAED;;;;;;AAMG;AACU,MAAA,mBAAmB,GAA6B;AACzD,IAAA,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,KAAI;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,MAAM,CAAA;AAE/B;;;AAGG;AACH,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5B,YAAA,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACjB,gBAAA,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;aAC9B;iBAAM;AACH,gBAAA,OAAO,MAAM,CAAA;aAChB;SACJ;AAED;;;AAGG;AACH,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAChD,QAAA,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAEhD,QAAA,OAAO,CAAG,EAAA,CAAC,CAAK,EAAA,EAAA,CAAC,GAAG,CAAA;KACvB;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs new file mode 100644 index 00000000..8d6464f4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs @@ -0,0 +1,36 @@ +import { complex } from '../../value/types/complex/index.mjs'; +import { mixNumber } from '../../utils/mix/number.mjs'; + +const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, +}; + +export { correctBoxShadow }; +//# sourceMappingURL=scale-box-shadow.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map new file mode 100644 index 00000000..e1642228 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scale-box-shadow.mjs","sources":["../../../../src/projection/styles/scale-box-shadow.ts"],"sourcesContent":["import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,gBAAgB,GAA6B;IACtD,OAAO,EAAE,CAAC,MAAc,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,KAAI;QACxD,MAAM,QAAQ,GAAG,MAAM,CAAA;QACvB,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;;AAGpC,QAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;AAAE,YAAA,OAAO,QAAQ,CAAA;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAA;AAClD,QAAA,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAA;;QAGpD,MAAM,MAAM,GAAG,eAAgB,CAAC,CAAC,CAAC,KAAK,GAAG,SAAU,CAAC,CAAC,CAAA;QACtD,MAAM,MAAM,GAAG,eAAgB,CAAC,CAAC,CAAC,KAAK,GAAG,SAAU,CAAC,CAAC,CAGrD;AAAC,QAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,MAAM,CACxC;AAAC,QAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,MAAM,CAAA;AAEzC;;;;;AAKG;QACH,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;;QAGnD,IAAI,OAAO,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ;AACrC,YAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,YAAY,CAAA;;QAGlD,IAAI,OAAO,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ;AACrC,YAAA,MAAM,CAAC,CAAC,GAAG,MAAM,CAAY,IAAI,YAAY,CAAA;AAElD,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAA;KAC1B;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs new file mode 100644 index 00000000..fa9dd860 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs @@ -0,0 +1,31 @@ +import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs'; +import { correctBorderRadius } from './scale-border-radius.mjs'; +import { correctBoxShadow } from './scale-box-shadow.mjs'; + +const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomLeftRadius", + "borderBottomRightRadius", + ], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, +}; +function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } +} + +export { addScaleCorrector, scaleCorrectors }; +//# sourceMappingURL=scale-correction.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map new file mode 100644 index 00000000..d78ac83e --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scale-correction.mjs","sources":["../../../../src/projection/styles/scale-correction.ts"],"sourcesContent":["import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n"],"names":[],"mappings":";;;;AAKa,MAAA,eAAe,GAAsB;AAC9C,IAAA,YAAY,EAAE;AACV,QAAA,GAAG,mBAAmB;AACtB,QAAA,OAAO,EAAE;YACL,qBAAqB;YACrB,sBAAsB;YACtB,wBAAwB;YACxB,yBAAyB;AAC5B,SAAA;AACJ,KAAA;AACD,IAAA,mBAAmB,EAAE,mBAAmB;AACxC,IAAA,oBAAoB,EAAE,mBAAmB;AACzC,IAAA,sBAAsB,EAAE,mBAAmB;AAC3C,IAAA,uBAAuB,EAAE,mBAAmB;AAC5C,IAAA,SAAS,EAAE,gBAAgB;EAC9B;AAEK,SAAU,iBAAiB,CAAC,UAA6B,EAAA;AAC3D,IAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QAC1B,eAAe,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAA;AACtC,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;AACxB,YAAA,eAAe,CAAC,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI,CAAA;SAC5C;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs new file mode 100644 index 00000000..b43c9933 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs @@ -0,0 +1,50 @@ +function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; +} + +export { buildProjectionTransform }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map new file mode 100644 index 00000000..c8e70cb9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/styles/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../../src/projection/styles/transform.ts"],"sourcesContent":["import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } =\n latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n"],"names":[],"mappings":"SAGgB,wBAAwB,CACpC,KAAY,EACZ,SAAgB,EAChB,eAAgC,EAAA;IAEhC,IAAI,SAAS,GAAG,EAAE,CAAA;AAElB;;;;;AAKG;IACH,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAA;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAA;AAClD,IAAA,MAAM,UAAU,GAAG,eAAe,EAAE,CAAC,IAAI,CAAC,CAAA;AAC1C,IAAA,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,EAAE;QACxC,SAAS,GAAG,eAAe,UAAU,CAAA,IAAA,EAAO,UAAU,CAAO,IAAA,EAAA,UAAU,MAAM,CAAA;KAChF;AAED;;;AAGG;AACH,IAAA,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,EAAE;AACxC,QAAA,SAAS,IAAI,CAAA,MAAA,EAAS,CAAC,GAAG,SAAS,CAAC,CAAC,CAAK,EAAA,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js b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs new file mode 100644 index 00000000..463a1842 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs @@ -0,0 +1,4 @@ +const compareByDepth = (a, b) => a.depth - b.depth; + +export { compareByDepth }; +//# sourceMappingURL=compare-by-depth.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map new file mode 100644 index 00000000..aea6de7e --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"compare-by-depth.mjs","sources":["../../../../src/projection/utils/compare-by-depth.ts"],"sourcesContent":["import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n"],"names":[],"mappings":"AAMa,MAAA,cAAc,GAAG,CAAC,CAAgB,EAAE,CAAgB,KAC7D,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs new file mode 100644 index 00000000..00e4c669 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs @@ -0,0 +1,6 @@ +function eachAxis(callback) { + return [callback("x"), callback("y")]; +} + +export { eachAxis }; +//# sourceMappingURL=each-axis.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map new file mode 100644 index 00000000..d92ae39c --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/each-axis.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"each-axis.mjs","sources":["../../../../src/projection/utils/each-axis.ts"],"sourcesContent":["type Callback = (axis: \"x\" | \"y\") => void\n\nexport function eachAxis(callback: Callback) {\n return [callback(\"x\"), callback(\"y\")]\n}\n"],"names":[],"mappings":"AAEM,SAAU,QAAQ,CAAC,QAAkB,EAAA;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAA;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs new file mode 100644 index 00000000..d9d6817e --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs @@ -0,0 +1,25 @@ +import { addUniqueItem, removeItem } from 'motion-utils'; +import { compareByDepth } from './compare-by-depth.mjs'; + +class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } +} + +export { FlatTree }; +//# sourceMappingURL=flat-tree.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map new file mode 100644 index 00000000..05430703 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/flat-tree.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"flat-tree.mjs","sources":["../../../../src/projection/utils/flat-tree.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n"],"names":[],"mappings":";;;MAGa,QAAQ,CAAA;AAArB,IAAA,WAAA,GAAA;QACY,IAAQ,CAAA,QAAA,GAAgB,EAAE,CAAA;QAE1B,IAAO,CAAA,OAAA,GAAY,KAAK,CAAA;KAiBnC;AAfG,IAAA,GAAG,CAAC,KAAgB,EAAA;AAChB,QAAA,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AACnC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;KACtB;AAED,IAAA,MAAM,CAAC,KAAgB,EAAA;AACnB,QAAA,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AAChC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;KACtB;AAED,IAAA,OAAO,CAAC,QAAoC,EAAA;QACxC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;AAClD,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;KAClC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs new file mode 100644 index 00000000..bf5d3246 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs @@ -0,0 +1,27 @@ +function isIdentityScale(scale) { + return scale === undefined || scale === 1; +} +function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); +} +function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); +} +function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); +} +function is2DTranslate(value) { + return value && value !== "0%"; +} + +export { has2DTranslate, hasScale, hasTransform }; +//# sourceMappingURL=has-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map new file mode 100644 index 00000000..2fc5ce59 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/has-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"has-transform.mjs","sources":["../../../../src/projection/utils/has-transform.ts"],"sourcesContent":["import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n"],"names":[],"mappings":"AAGA,SAAS,eAAe,CAAC,KAAsC,EAAA;AAC3D,IAAA,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC,CAAA;AAC7C,CAAC;AAEK,SAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAkB,EAAA;AAC9D,IAAA,QACI,CAAC,eAAe,CAAC,KAAK,CAAC;QACvB,CAAC,eAAe,CAAC,MAAM,CAAC;AACxB,QAAA,CAAC,eAAe,CAAC,MAAM,CAAC,EAC3B;AACL,CAAC;AAEK,SAAU,YAAY,CAAC,MAAsB,EAAA;AAC/C,IAAA,QACI,QAAQ,CAAC,MAAM,CAAC;QAChB,cAAc,CAAC,MAAM,CAAC;AACtB,QAAA,MAAM,CAAC,CAAC;AACR,QAAA,MAAM,CAAC,MAAM;AACb,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,OAAO;AACd,QAAA,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,KAAK,EACf;AACL,CAAC;AAEK,SAAU,cAAc,CAAC,MAAsB,EAAA;AACjD,IAAA,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAC7D,CAAC;AAED,SAAS,aAAa,CAAC,KAAsC,EAAA;AACzD,IAAA,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,CAAA;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs new file mode 100644 index 00000000..33e0a656 --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs @@ -0,0 +1,18 @@ +import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs'; +import { translateAxis } from '../geometry/delta-apply.mjs'; + +function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); +} +function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; +} + +export { measurePageBox, measureViewportBox }; +//# sourceMappingURL=measure.mjs.map diff --git a/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map new file mode 100644 index 00000000..4e5d03dc --- /dev/null +++ b/node_modules/motion-dom/dist/es/projection/utils/measure.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"measure.mjs","sources":["../../../../src/projection/utils/measure.ts"],"sourcesContent":["import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n"],"names":[],"mappings":";;;AAOgB,SAAA,kBAAkB,CAC9B,QAAqB,EACrB,cAA+B,EAAA;AAE/B,IAAA,OAAO,uBAAuB,CAC1B,kBAAkB,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,cAAc,CAAC,CACvE,CAAA;AACL,CAAC;SAEe,cAAc,CAC1B,OAAoB,EACpB,kBAAuB,EACvB,kBAAmC,EAAA;IAEnC,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;AACnE,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,CAAA;IAErC,IAAI,MAAM,EAAE;QACR,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAC7C,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;KAChD;AAED,IAAA,OAAO,WAAW,CAAA;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/Feature.mjs b/node_modules/motion-dom/dist/es/render/Feature.mjs new file mode 100644 index 00000000..d614c3c7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/Feature.mjs @@ -0,0 +1,15 @@ +/** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ +class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } +} + +export { Feature }; +//# sourceMappingURL=Feature.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/Feature.mjs.map b/node_modules/motion-dom/dist/es/render/Feature.mjs.map new file mode 100644 index 00000000..e6bdbe77 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/Feature.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"Feature.mjs","sources":["../../../src/render/Feature.ts"],"sourcesContent":["import type { VisualElement } from \"./VisualElement\"\n\n/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nexport abstract class Feature {\n isMounted = false\n\n node: VisualElement\n\n constructor(node: VisualElement) {\n this.node = node\n }\n\n abstract mount(): void\n\n abstract unmount(): void\n\n update(): void {}\n}\n"],"names":[],"mappings":"AAEA;;;;AAIG;MACmB,OAAO,CAAA;AAKzB,IAAA,WAAA,CAAY,IAAsB,EAAA;QAJlC,IAAS,CAAA,SAAA,GAAG,KAAK,CAAA;AAKb,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;KACnB;AAMD,IAAA,MAAM,MAAW;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/VisualElement.mjs b/node_modules/motion-dom/dist/es/render/VisualElement.mjs new file mode 100644 index 00000000..6e1ea993 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/VisualElement.mjs @@ -0,0 +1,560 @@ +import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils'; +import { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs'; +import { NativeAnimation } from '../animation/NativeAnimation.mjs'; +import { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs'; +import { microtask } from '../frameloop/microtask.mjs'; +import { time } from '../frameloop/sync-time.mjs'; +import { createBox } from '../projection/geometry/models.mjs'; +import { motionValue } from '../value/index.mjs'; +import { complex } from '../value/types/complex/index.mjs'; +import { getAnimatableNone } from '../value/types/utils/animatable-none.mjs'; +import { findValueType } from '../value/types/utils/find.mjs'; +import { isMotionValue } from '../value/utils/is-motion-value.mjs'; +import { visualElementStore } from './store.mjs'; +import { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs'; +import { transformProps } from './utils/keys-transform.mjs'; +import { updateMotionValuesFromProps } from './utils/motion-values.mjs'; +import { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs'; +import { resolveVariantFromProps } from './utils/resolve-variants.mjs'; +import { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs'; +import { frame, cancelFrame } from '../frameloop/frame.mjs'; + +const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", +]; +/** + * Static feature definitions - can be injected by framework layer + */ +let featureDefinitions = {}; +/** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ +function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; +} +/** + * Get the current feature definitions + */ +function getFeatureDefinitions() { + return featureDefinitions; +} +/** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ +class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + if (process.env.NODE_ENV !== "production") { + warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + if (value.owner) + value.stop(); + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (isNumericalString(value) || isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } +} + +export { VisualElement, getFeatureDefinitions, setFeatureDefinitions }; +//# sourceMappingURL=VisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map new file mode 100644 index 00000000..777bfb3a --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/VisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"VisualElement.mjs","sources":["../../../src/render/VisualElement.ts"],"sourcesContent":["import {\n Box,\n isNumericalString,\n isZeroValueString,\n secondsToMilliseconds,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { acceleratedValues } from \"../animation/waapi/utils/accelerated-values\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { complex } from \"../value/types/complex\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { Feature } from \"./Feature\"\nimport { visualElementStore } from \"./store\"\nimport {\n FeatureDefinitions,\n MotionConfigContextProps,\n PresenceContextProps,\n ReducedMotionConfig,\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(\n definitions: Partial\n) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n shouldSkipAnimations: boolean = false\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * A reference to the skipAnimations config passed to the VisualElement's host React component.\n */\n private skipAnimationsConfig: boolean | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n private hasBeenMounted = false\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n skipAnimations,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.skipAnimationsConfig = skipAnimations\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key])\n this.latestValues[key] = this.initialValues[key]\n }\n }\n\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n\n this.hasBeenMounted = true\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n if (\n value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement\n ) {\n const { factory, keyframes, times, ease, duration } =\n value.accelerate\n\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n })\n\n const cleanup = factory(animation)\n\n this.valueSubscriptions.set(key, () => {\n cleanup()\n animation.cancel()\n })\n return\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (\n typeof window !== \"undefined\" &&\n (window as any).MotionCheckAppearSync\n ) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(\n this,\n key,\n value\n )\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n if (value.owner) value.stop()\n })\n }\n\n sortNodePosition(other: VisualElement) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(\n props: MotionNodeOptions,\n presenceContext: PresenceContextProps | null\n ) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n"],"names":["checkIsControllingVariants","checkIsVariantNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,iBAAiB,GAAG;IACtB,gBAAgB;IAChB,mBAAmB;IACnB,QAAQ;IACR,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,yBAAyB;CACnB,CAAA;AAEV;;AAEG;AACH,IAAI,kBAAkB,GAAgC,EAAE,CAAA;AAExD;;;AAGG;AACG,SAAU,qBAAqB,CACjC,WAAwC,EAAA;IAExC,kBAAkB,GAAG,WAAW,CAAA;AACpC,CAAC;AAED;;AAEG;SACa,qBAAqB,GAAA;AACjC,IAAA,OAAO,kBAAkB,CAAA;AAC7B,CAAC;AASD;;;AAGG;MACmB,aAAa,CAAA;AA2F/B;;;;;;AAMG;AACH,IAAA,2BAA2B,CACvB,MAAyB,EACzB,UAA6B,EAC7B,cAA6B,EAAA;AAI7B,QAAA,OAAO,EAAE,CAAA;KACZ;AA4LD,IAAA,WAAA,CACI,EACI,MAAM,EACN,KAAK,EACL,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,WAAW,GAC+B,EAC9C,UAAmB,EAAS,EAAA;AApMhC;;;AAGG;QACH,IAAO,CAAA,OAAA,GAAoB,IAAI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AAG,CAAC,CAAA;KAC7B;IAED,EAAE,CACE,SAAoB,EACpB,QAAgD,EAAA;QAEhD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,mBAAmB,EAAE,CAAA;SACrD;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;KAC9C;AAED,IAAA,MAAM,CACF,SAAoB,EACpB,GAAG,IAAS,EAAA;AAEZ,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YACxB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;SACzC;KACJ;IAED,uBAAuB,GAAA;AACnB,QAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KAChC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs new file mode 100644 index 00000000..ee72b5e5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs @@ -0,0 +1,43 @@ +import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; +import { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs'; +import { VisualElement } from '../VisualElement.mjs'; + +class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } +} + +export { DOMVisualElement }; +//# sourceMappingURL=DOMVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map new file mode 100644 index 00000000..c4d96d91 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"DOMVisualElement.mjs","sources":["../../../../src/render/dom/DOMVisualElement.ts"],"sourcesContent":["import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n"],"names":[],"mappings":";;;;AASM,MAAgB,gBAIpB,SAAQ,aAAuC,CAAA;AAJjD,IAAA,WAAA,GAAA;;QA8BI,IAAgB,CAAA,gBAAA,GAAG,oBAAoB,CAAA;KAkB1C;IA3CG,wBAAwB,CAAC,CAAW,EAAE,CAAW,EAAA;AAC7C;;;;AAIG;AACH,QAAA,OAAO,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;KACnD;IAED,sBAAsB,CAClB,KAAwB,EACxB,GAAW,EAAA;AAEX,QAAA,MAAM,KAAK,GAAI,KAAqD,CAAC,KAAK,CAAA;AAC1E,QAAA,OAAO,KAAK,GAAI,KAAK,CAAC,GAAG,CAAY,GAAG,SAAS,CAAA;KACpD;AAED,IAAA,0BAA0B,CACtB,GAAW,EACX,EAAE,IAAI,EAAE,KAAK,EAAmB,EAAA;AAEhC,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;AAChB,QAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAA;KACpB;IAKD,sBAAsB,GAAA;AAClB,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,EAAE,CAAA;YACxB,OAAO,IAAI,CAAC,iBAAiB,CAAA;SAChC;AAED,QAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAA6D,CAAA;AACvF,QAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;AACzB,YAAA,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,KAAI;AACtD,gBAAA,IAAI,IAAI,CAAC,OAAO,EAAE;oBACd,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,CAAG,EAAA,MAAM,EAAE,CAAA;iBACzC;AACL,aAAC,CAAC,CAAA;SACL;KACJ;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs new file mode 100644 index 00000000..7ee34f47 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs @@ -0,0 +1,4 @@ +const isCSSVar = (name) => name.startsWith("--"); + +export { isCSSVar }; +//# sourceMappingURL=is-css-var.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map new file mode 100644 index 00000000..55eaadbe --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-css-var.mjs","sources":["../../../../src/render/dom/is-css-var.ts"],"sourcesContent":["export const isCSSVar = (name: string) => name.startsWith(\"--\")\n"],"names":[],"mappings":"AAAO,MAAM,QAAQ,GAAG,CAAC,IAAY,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs new file mode 100644 index 00000000..414bdf38 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs @@ -0,0 +1,84 @@ +const radToDeg = (rad) => (rad * 180) / Math.PI; +const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); +}; +const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, +}; +const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; +}; +const rotateZ = rotate; +const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); +const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); +const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, +}; +function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; +} +function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; +} +const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); +}; +function convertTransformToNumber(value) { + return parseFloat(value.trim()); +} + +export { defaultTransformValue, parseValueFromTransform, readTransformValue }; +//# sourceMappingURL=parse-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map new file mode 100644 index 00000000..7c774923 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-transform.mjs","sources":["../../../../src/render/dom/parse-transform.ts"],"sourcesContent":["import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,EAAE,CAAA;AASvD,MAAM,MAAM,GAAG,CAAC,CAAW,KAAI;AAC3B,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9C,IAAA,OAAO,WAAW,CAAC,KAAK,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED,MAAM,eAAe,GAAkB;AACnC,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,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,CAAA;AACzD,IAAA,OAAO,uBAAuB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;AACnD,EAAC;AAED,SAAS,wBAAwB,CAAC,KAAa,EAAA;AAC3C,IAAA,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;AACnC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs new file mode 100644 index 00000000..73002fbd --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs @@ -0,0 +1,11 @@ +import { isCSSVar } from './is-css-var.mjs'; + +function getComputedStyle(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; +} + +export { getComputedStyle }; +//# sourceMappingURL=style-computed.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map new file mode 100644 index 00000000..ec1632f6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-computed.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"style-computed.mjs","sources":["../../../../src/render/dom/style-computed.ts"],"sourcesContent":["import { isCSSVar } from \"./is-css-var\"\n\nexport function getComputedStyle(\n element: HTMLElement | SVGElement,\n name: string\n) {\n const computedStyle = window.getComputedStyle(element)\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name as any]\n}\n"],"names":[],"mappings":";;AAEgB,SAAA,gBAAgB,CAC5B,OAAiC,EACjC,IAAY,EAAA;IAEZ,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;IACtD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACjB,UAAE,aAAa,CAAC,gBAAgB,CAAC,IAAI,CAAC;AACtC,UAAE,aAAa,CAAC,IAAW,CAAC,CAAA;AACpC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs new file mode 100644 index 00000000..e4389cca --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs @@ -0,0 +1,10 @@ +import { isCSSVar } from './is-css-var.mjs'; + +function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); +} + +export { setStyle }; +//# sourceMappingURL=style-set.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map new file mode 100644 index 00000000..9da7bac4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/style-set.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"style-set.mjs","sources":["../../../../src/render/dom/style-set.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n"],"names":[],"mappings":";;SAGgB,QAAQ,CACpB,OAAiC,EACjC,IAAY,EACZ,KAA0B,EAAA;IAE1B,QAAQ,CAAC,IAAI,CAAC;UACR,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAe,CAAC;WAC/C,OAAO,CAAC,KAAK,CAAC,IAAW,CAAC,GAAG,KAAe,CAAC,CAAA;AACxD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs new file mode 100644 index 00000000..aa8caef7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs @@ -0,0 +1,6 @@ +function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); +} + +export { camelToDash }; +//# sourceMappingURL=camel-to-dash.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map new file mode 100644 index 00000000..ac3ae465 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"camel-to-dash.mjs","sources":["../../../../../src/render/dom/utils/camel-to-dash.ts"],"sourcesContent":["export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n"],"names":[],"mappings":"AAAM,SAAU,WAAW,CAAC,GAAW,EAAA;AACnC,IAAA,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE,CAAA,CAAE,CAAC,CAAA;AACxE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs new file mode 100644 index 00000000..9af18228 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs @@ -0,0 +1,45 @@ +import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs'; +import { transformProps } from '../utils/keys-transform.mjs'; +import { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs'; +import { measureViewportBox } from '../../projection/utils/measure.mjs'; +import { DOMVisualElement } from '../dom/DOMVisualElement.mjs'; +import { buildHTMLStyles } from './utils/build-styles.mjs'; +import { renderHTML } from './utils/render.mjs'; +import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs'; + +function getComputedStyle(element) { + return window.getComputedStyle(element); +} +class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } +} + +export { HTMLVisualElement, getComputedStyle }; +//# sourceMappingURL=HTMLVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map new file mode 100644 index 00000000..c84ac3d6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"HTMLVisualElement.mjs","sources":["../../../../src/render/html/HTMLVisualElement.ts"],"sourcesContent":["import type { Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n"],"names":[],"mappings":";;;;;;;;;AAmBM,SAAU,gBAAgB,CAAC,OAAoB,EAAA;AACjD,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;AAC3C,CAAC;AAEK,MAAO,iBAAkB,SAAQ,gBAItC,CAAA;AAJD,IAAA,WAAA,GAAA;;QAKI,IAAI,CAAA,IAAA,GAAG,MAAM,CAAA;QA4Cb,IAAc,CAAA,cAAA,GAAG,UAAU,CAAA;KAC9B;IA3CG,qBAAqB,CACjB,QAAqB,EACrB,GAAW,EAAA;AAEX,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AACzB,YAAA,OAAO,IAAI,CAAC,UAAU,EAAE,YAAY;AAChC,kBAAE,qBAAqB,CAAC,GAAG,CAAC;AAC5B,kBAAE,kBAAkB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;SAC1C;aAAM;AACH,YAAA,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;AAChD,YAAA,MAAM,KAAK,GACP,CAAC,iBAAiB,CAAC,GAAG,CAAC;AACnB,kBAAE,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC;kBACnC,aAAa,CAAC,GAAiC,CAAC,KAAK,CAAC,CAAA;AAEhE,YAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,GAAI,KAAgB,CAAA;SACtE;KACJ;AAED,IAAA,0BAA0B,CACtB,QAAqB,EACrB,EAAE,kBAAkB,EAAyD,EAAA;AAE7E,QAAA,OAAO,kBAAkB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;KAC1D;AAED,IAAA,KAAK,CACD,WAA4B,EAC5B,YAA4B,EAC5B,KAAwB,EAAA;QAExB,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAA;KACtE;AAED,IAAA,2BAA2B,CACvB,KAAwB,EACxB,SAA4B,EAC5B,aAA4B,EAAA;QAE5B,OAAO,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,CAAA;KACtE;AAGJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs new file mode 100644 index 00000000..bd068f2b --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs @@ -0,0 +1,66 @@ +import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs'; +import { numberValueTypes } from '../../../value/types/maps/number.mjs'; +import { transformProps } from '../../utils/keys-transform.mjs'; +import { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs'; +import { buildTransform } from './build-transform.mjs'; + +function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } +} + +export { buildHTMLStyles }; +//# sourceMappingURL=build-styles.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map new file mode 100644 index 00000000..077ba072 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-styles.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"build-styles.mjs","sources":["../../../../../src/render/html/utils/build-styles.ts"],"sourcesContent":["import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n"],"names":[],"mappings":";;;;;;SASgB,eAAe,CAC3B,KAAsB,EACtB,YAA4B,EAC5B,iBAA0D,EAAA;IAE1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,KAAK,CAAA;;IAG9C,IAAI,YAAY,GAAG,KAAK,CAAA;IACxB,IAAI,kBAAkB,GAAG,KAAK,CAA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A,CAAA,EAAI,OAAO,CAAA,CAAE,CAAA;KAC7D;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs new file mode 100644 index 00000000..218c072a --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs @@ -0,0 +1,64 @@ +import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs'; +import { numberValueTypes } from '../../../value/types/maps/number.mjs'; +import { transformPropOrder } from '../../utils/keys-transform.mjs'; + +const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", +}; +const numTransforms = transformPropOrder.length; +/** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ +function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; +} + +export { buildTransform }; +//# sourceMappingURL=build-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map new file mode 100644 index 00000000..b45f29a3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/build-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"build-transform.mjs","sources":["../../../../../src/render/html/utils/build-transform.ts"],"sourcesContent":["import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n"],"names":[],"mappings":";;;;AAOA,MAAM,cAAc,GAAG;AACnB,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,CAAC,EAAE,YAAY;AACf,IAAA,oBAAoB,EAAE,aAAa;CACtC,CAAA;AAED,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,CAAA;AAE/C;;;;;AAKG;SACa,cAAc,CAC1B,YAA4B,EAC5B,SAAuC,EACvC,iBAA0D,EAAA;;IAG1D,IAAI,eAAe,GAAG,EAAE,CAAA;IACxB,IAAI,kBAAkB,GAAG,IAAI,CAAA;AAE7B;;;AAGG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE,EAAE;AACpC,QAAA,MAAM,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAgC,CAAA;AAChE,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;QAE/B,IAAI,KAAK,KAAK,SAAS;YAAE,SAAQ;QAEjC,IAAI,cAAc,GAAG,IAAI,CAAA;AACzB,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC3B,YAAA,cAAc,GAAG,KAAK,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;SAC/D;aAAM;AACH,YAAA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;AAChC,YAAA,cAAc,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,KAAK,CAAC,CAAA;SACzE;AAED,QAAA,IAAI,CAAC,cAAc,IAAI,iBAAiB,EAAE;YACtC,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAA;YAEhE,IAAI,CAAC,cAAc,EAAE;gBACjB,kBAAkB,GAAG,KAAK,CAAA;gBAC1B,MAAM,aAAa,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;AAChD,gBAAA,eAAe,IAAI,CAAG,EAAA,aAAa,CAAI,CAAA,EAAA,WAAW,IAAI,CAAA;aACzD;YAED,IAAI,iBAAiB,EAAE;AACnB,gBAAA,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAA;aAC/B;SACJ;KACJ;AAED,IAAA,eAAe,GAAG,eAAe,CAAC,IAAI,EAAE,CAAA;;;IAIxC,IAAI,iBAAiB,EAAE;AACnB,QAAA,eAAe,GAAG,iBAAiB,CAC/B,SAAS,EACT,kBAAkB,GAAG,EAAE,GAAG,eAAe,CAC5C,CAAA;KACJ;SAAM,IAAI,kBAAkB,EAAE;QAC3B,eAAe,GAAG,MAAM,CAAA;KAC3B;AAED,IAAA,OAAO,eAAe,CAAA;AAC1B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs new file mode 100644 index 00000000..d5e52410 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs @@ -0,0 +1,18 @@ +function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } +} + +export { renderHTML }; +//# sourceMappingURL=render.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map new file mode 100644 index 00000000..ec255cf7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/render.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"render.mjs","sources":["../../../../../src/render/html/utils/render.ts"],"sourcesContent":["import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n"],"names":[],"mappings":"AAGgB,SAAA,UAAU,CACtB,OAAoB,EACpB,EAAE,KAAK,EAAE,IAAI,EAAmB,EAChC,SAAuB,EACvB,UAAgB,EAAA;AAEhB,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAA;AAElC,IAAA,IAAI,GAAW,CAAA;AACf,IAAA,KAAK,GAAG,IAAI,KAAK,EAAE;;QAEf,YAAY,CAAC,GAAwB,CAAC,GAAG,KAAK,CAAC,GAAG,CAAW,CAAA;KAChE;;AAGD,IAAA,UAAU,EAAE,qBAAqB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;AAE1D,IAAA,KAAK,GAAG,IAAI,IAAI,EAAE;;;QAGd,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAW,CAAC,CAAA;KACrD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs new file mode 100644 index 00000000..fa40038b --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs @@ -0,0 +1,22 @@ +import { isMotionValue } from '../../../value/utils/is-motion-value.mjs'; +import { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs'; + +function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; +} + +export { scrapeMotionValuesFromProps }; +//# sourceMappingURL=scrape-motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map new file mode 100644 index 00000000..688dc688 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scrape-motion-values.mjs","sources":["../../../../../src/render/html/utils/scrape-motion-values.ts"],"sourcesContent":["import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n"],"names":[],"mappings":";;;SAKgB,2BAA2B,CACvC,KAAwB,EACxB,SAA4B,EAC5B,aAA6B,EAAA;AAE7B,IAAA,MAAM,KAAK,GAAI,KAAa,CAAC,KAAK,CAAA;AAClC,IAAA,MAAM,SAAS,GAAI,SAAiB,EAAE,KAAK,CAAA;IAC3C,MAAM,SAAS,GAA2B,EAAE,CAAA;AAE5C,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,SAAS,CAAA;AAE5B,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB,QAAA,IACI,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACxB,SAAS,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,YAAA,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC;YAC/B,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,KAAK,SAAS,EACvD;YACE,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;SAC9B;KACJ;AAED,IAAA,OAAO,SAAS,CAAA;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs new file mode 100644 index 00000000..d2dedf7f --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs @@ -0,0 +1,42 @@ +import { createBox } from '../../projection/geometry/models.mjs'; +import { VisualElement } from '../VisualElement.mjs'; + +function isObjectKey(key, object) { + return key in object; +} +class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } +} + +export { ObjectVisualElement }; +//# sourceMappingURL=ObjectVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map new file mode 100644 index 00000000..b742e6b2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/object/ObjectVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjectVisualElement.mjs","sources":["../../../../src/render/object/ObjectVisualElement.ts"],"sourcesContent":["import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n"],"names":[],"mappings":";;;AAQA,SAAS,WAAW,CAAC,GAAW,EAAE,MAAc,EAAA;IAC5C,OAAO,GAAG,IAAI,MAAM,CAAA;AACxB,CAAC;AAEK,MAAO,mBAAoB,SAAQ,aAGxC,CAAA;AAHD,IAAA,WAAA,GAAA;;QAII,IAAI,CAAA,IAAA,GAAG,QAAQ,CAAA;KAuClB;IArCG,qBAAqB,CAAC,QAAgB,EAAE,GAAW,EAAA;AAC/C,QAAA,IAAI,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;AAC5B,YAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACxD,gBAAA,OAAO,KAAK,CAAA;aACf;SACJ;AAED,QAAA,OAAO,SAAS,CAAA;KACnB;IAED,sBAAsB,GAAA;AAClB,QAAA,OAAO,SAAS,CAAA;KACnB;IAED,0BAA0B,CACtB,GAAW,EACX,WAA8B,EAAA;AAE9B,QAAA,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;KACjC;IAED,0BAA0B,GAAA;QACtB,OAAO,SAAS,EAAE,CAAA;KACrB;IAED,KAAK,CAAC,WAA8B,EAAE,YAA4B,EAAA;QAC9D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;KAClD;AAED,IAAA,cAAc,CAAC,QAAgB,EAAE,EAAE,MAAM,EAAqB,EAAA;AAC1D,QAAA,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;KAClC;IAED,wBAAwB,GAAA;AACpB,QAAA,OAAO,CAAC,CAAA;KACX;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/store.mjs b/node_modules/motion-dom/dist/es/render/store.mjs new file mode 100644 index 00000000..9a65634f --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/store.mjs @@ -0,0 +1,4 @@ +const visualElementStore = new WeakMap(); + +export { visualElementStore }; +//# sourceMappingURL=store.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/store.mjs.map b/node_modules/motion-dom/dist/es/render/store.mjs.map new file mode 100644 index 00000000..55faaca8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/store.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"store.mjs","sources":["../../../src/render/store.ts"],"sourcesContent":["import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap()\n"],"names":[],"mappings":"AAEa,MAAA,kBAAkB,GAAG,IAAI,OAAO;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs new file mode 100644 index 00000000..18c5e682 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs @@ -0,0 +1,46 @@ +import { transformProps } from '../utils/keys-transform.mjs'; +import { getDefaultValueType } from '../../value/types/maps/defaults.mjs'; +import { createBox } from '../../projection/geometry/models.mjs'; +import { DOMVisualElement } from '../dom/DOMVisualElement.mjs'; +import { camelToDash } from '../dom/utils/camel-to-dash.mjs'; +import { buildSVGAttrs } from './utils/build-attrs.mjs'; +import { camelCaseAttributes } from './utils/camel-case-attrs.mjs'; +import { isSVGTag } from './utils/is-svg-tag.mjs'; +import { renderSVG } from './utils/render.mjs'; +import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs'; + +class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } +} + +export { SVGVisualElement }; +//# sourceMappingURL=SVGVisualElement.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map new file mode 100644 index 00000000..6e9e578c --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"SVGVisualElement.mjs","sources":["../../../../src/render/svg/SVGVisualElement.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAiBM,MAAO,gBAAiB,SAAQ,gBAIrC,CAAA;AAJD,IAAA,WAAA,GAAA;;QAKI,IAAI,CAAA,IAAA,GAAG,KAAK,CAAA;QAEZ,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAA;QAkBhB,IAA0B,CAAA,0BAAA,GAAG,SAAS,CAAA;KAqCzC;IArDG,sBAAsB,CAClB,KAAwB,EACxB,GAAW,EAAA;AAEX,QAAA,OAAO,KAAK,CAAC,GAA8B,CAAC,CAAA;KAC/C;IAED,qBAAqB,CAAC,QAAoB,EAAE,GAAW,EAAA;AACnD,QAAA,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AACzB,YAAA,MAAM,WAAW,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAA;AAC5C,YAAA,OAAO,WAAW,GAAG,WAAW,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;SACpD;AACD,QAAA,GAAG,GAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,CAAA;AAC5D,QAAA,OAAO,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;KACpC;AAID,IAAA,2BAA2B,CACvB,KAAwB,EACxB,SAA4B,EAC5B,aAA4B,EAAA;QAE5B,OAAO,2BAA2B,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,CAAA;KACtE;AAED,IAAA,KAAK,CACD,WAA2B,EAC3B,YAA4B,EAC5B,KAAwB,EAAA;AAExB,QAAA,aAAa,CACT,WAAW,EACX,YAAY,EACZ,IAAI,CAAC,QAAQ,EACb,KAAK,CAAC,iBAAiB,EACtB,KAAa,CAAC,KAAK,CACvB,CAAA;KACJ;AAED,IAAA,cAAc,CACV,QAAoB,EACpB,WAA2B,EAC3B,SAAmC,EACnC,UAAgB,EAAA;QAEhB,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;KAC1D;AAED,IAAA,KAAK,CAAC,QAAoB,EAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAC1C,QAAA,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;KACxB;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs new file mode 100644 index 00000000..6783b45d --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs @@ -0,0 +1,73 @@ +import { buildHTMLStyles } from '../../html/utils/build-styles.mjs'; +import { buildSVGPath } from './path.mjs'; + +/** + * CSS Motion Path properties that should remain as CSS styles on SVG elements. + */ +const cssMotionPathProperties = [ + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", +]; +/** + * Build SVG visual attributes, like cx and style.transform + */ +function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, +// This is object creation, which we try to avoid per-frame. +...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + /** + * However, we apply transforms as CSS transforms. + * So if we detect a transform, transformOrigin we take it from attrs and copy it into style. + */ + if (attrs.transform) { + style.transform = attrs.transform; + delete attrs.transform; + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + for (const key of cssMotionPathProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } +} + +export { buildSVGAttrs }; +//# sourceMappingURL=build-attrs.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map new file mode 100644 index 00000000..333c2b31 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"build-attrs.mjs","sources":["../../../../../src/render/svg/utils/build-attrs.ts"],"sourcesContent":["import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform\n delete attrs.transform\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n"],"names":[],"mappings":";;;AAMA;;AAEG;AACH,M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AA,KAAK,MAAM,GAAG,IAAI,uBAAuB,EAAE;AACvC,QAAA,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;YAC1B,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;AACvB,YAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAA;SACpB;KACJ;;IAGD,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,CAAC,GAAG,KAAK,CAAA;IACxC,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,CAAC,GAAG,KAAK,CAAA;IACxC,IAAI,SAAS,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,KAAK,GAAG,SAAS,CAAA;;AAGpD,IAAA,IAAI,UAAU,KAAK,SAAS,EAAE;QAC1B,YAAY,CACR,KAAK,EACL,UAAoB,EACpB,WAAqB,EACrB,UAAoB,EACpB,KAAK,CACR,CAAA;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs new file mode 100644 index 00000000..4885a9bf --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs @@ -0,0 +1,31 @@ +/** + * A set of attribute names that are always read/written as camel case. + */ +const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", +]); + +export { camelCaseAttributes }; +//# sourceMappingURL=camel-case-attrs.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map new file mode 100644 index 00000000..562df0c4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"camel-case-attrs.mjs","sources":["../../../../../src/render/svg/utils/camel-case-attrs.ts"],"sourcesContent":["/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n"],"names":[],"mappings":"AAAA;;AAEG;AACU,MAAA,mBAAmB,GAAG,IAAI,GAAG,CAAC;IACvC,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,UAAU;IACV,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,YAAY;IACZ,SAAS;IACT,SAAS;IACT,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,aAAa;IACb,SAAS;IACT,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,cAAc;AACjB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs new file mode 100644 index 00000000..37ab4489 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs @@ -0,0 +1,4 @@ +const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + +export { isSVGTag }; +//# sourceMappingURL=is-svg-tag.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map new file mode 100644 index 00000000..ce8c3acb --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-tag.mjs","sources":["../../../../../src/render/svg/utils/is-svg-tag.ts"],"sourcesContent":["export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n"],"names":[],"mappings":"MAAa,QAAQ,GAAG,CAAC,GAAY,KACjC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs new file mode 100644 index 00000000..02aff410 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs @@ -0,0 +1,32 @@ +const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", +}; +const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", +}; +/** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ +function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; +} + +export { buildSVGPath }; +//# sourceMappingURL=path.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map new file mode 100644 index 00000000..a6d0fd54 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/path.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"path.mjs","sources":["../../../../../src/render/svg/utils/path.ts"],"sourcesContent":["import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG;AACb,IAAA,MAAM,EAAE,mBAAmB;AAC3B,IAAA,KAAK,EAAE,kBAAkB;CAC5B,CAAA;AAED,MAAM,SAAS,GAAG;AACd,IAAA,MAAM,EAAE,kBAAkB;AAC1B,IAAA,KAAK,EAAE,iBAAiB;CAC3B,CAAA;AAED;;;;;;;;;AASG;SACa,YAAY,CACxB,KAAqB,EACrB,MAAc,EACd,OAAO,GAAG,CAAC,EACX,MAAM,GAAG,CAAC,EACV,cAAuB,IAAI,EAAA;;AAG3B,IAAA,KAAK,CAAC,UAAU,GAAG,CAAC,CAAA;;;IAIpB,MAAM,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;;IAG/C,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAG,EAAA,CAAC,MAAM,CAAA,CAAE,CAAA;;IAGjC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE,CAAA;AAC9C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs new file mode 100644 index 00000000..81713615 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs @@ -0,0 +1,13 @@ +import { camelToDash } from '../../dom/utils/camel-to-dash.mjs'; +import { renderHTML } from '../../html/utils/render.mjs'; +import { camelCaseAttributes } from './camel-case-attrs.mjs'; + +function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } +} + +export { renderSVG }; +//# sourceMappingURL=render.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map new file mode 100644 index 00000000..d4e37900 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/render.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"render.mjs","sources":["../../../../../src/render/svg/utils/render.ts"],"sourcesContent":["import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n"],"names":[],"mappings":";;;;AAMM,SAAU,SAAS,CACrB,OAAmB,EACnB,WAA2B,EAC3B,UAAwB,EACxB,UAAgB,EAAA;IAEhB,UAAU,CAAC,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;AAE9D,IAAA,KAAK,MAAM,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE;AACjC,QAAA,OAAO,CAAC,YAAY,CAChB,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,GAAG,EACtD,WAAW,CAAC,KAAK,CAAC,GAAG,CAAW,CACnC,CAAA;KACJ;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs new file mode 100644 index 00000000..9c83e3d6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs @@ -0,0 +1,20 @@ +import { isMotionValue } from '../../../value/utils/is-motion-value.mjs'; +import { transformPropOrder } from '../../utils/keys-transform.mjs'; +import { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs'; + +function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; +} + +export { scrapeMotionValuesFromProps }; +//# sourceMappingURL=scrape-motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map new file mode 100644 index 00000000..234d6cee --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scrape-motion-values.mjs","sources":["../../../../../src/render/svg/utils/scrape-motion-values.ts"],"sourcesContent":["import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n"],"names":["scrapeHTMLMotionValuesFromProps"],"mappings":";;;;SAMgB,2BAA2B,CACvC,KAAwB,EACxB,SAA4B,EAC5B,aAA6B,EAAA;IAE7B,MAAM,SAAS,GAAGA,6BAA+B,CAC7C,KAAK,EACL,SAAS,EACT,aAAa,CAChB,CAAA;AAED,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB,QAAA,IACI,aAAa,CAAC,KAAK,CAAC,GAAyB,CAAC,CAAC;AAC/C,YAAA,aAAa,CAAC,SAAS,CAAC,GAA6B,CAAC,CAAC,EACzD;YACE,MAAM,SAAS,GACX,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAClC,kBAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;kBACvD,GAAG,CAAA;YAEb,SAAS,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,GAAyB,CAAC,CAAA;SAC1D;KACJ;AAED,IAAA,OAAO,SAAS,CAAA;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs new file mode 100644 index 00000000..89f28a47 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs @@ -0,0 +1,381 @@ +import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs'; +import { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs'; +import { getVariantContext } from './get-variant-context.mjs'; +import { isAnimationControls } from './is-animation-controls.mjs'; +import { isKeyframesTarget } from './is-keyframes-target.mjs'; +import { isVariantLabel } from './is-variant-label.mjs'; +import { resolveVariant } from './resolve-dynamic-variants.mjs'; +import { shallowCompare } from './shallow-compare.mjs'; +import { variantPriorityOrder } from './variant-props.mjs'; + +const reversePriorityOrder = [...variantPriorityOrder].reverse(); +const numAnimationTypes = variantPriorityOrder.length; +function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; +} +function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + isInitialRender && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = !shallowCompare(next, prev); + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if (isInitialRender && visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + isInitialRender && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + /** + * Temporarily disabling resetting this flag as it prevents components + * with initial={false} from animating after being remounted, for instance + * as the child of an Activity component. + */ + // isInitialRender = true + }, + }; +} +function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; +} +function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; +} +function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; +} + +export { checkVariantsDidChange, createAnimationState }; +//# sourceMappingURL=animation-state.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map new file mode 100644 index 00000000..f14a43be --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/animation-state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animation-state.mjs","sources":["../../../../src/render/utils/animation-state.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set()\n\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity\n\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i]\n const typeState = state[type]\n const prop =\n props[type] !== undefined\n ? props[type]\n : context[type as keyof typeof context]\n const propIsVariant = isVariantLabel(prop)\n\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited =\n prop === context[type as keyof typeof context] &&\n prop !== props[type] &&\n propIsVariant\n\n if (\n isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount\n ) {\n isInherited = false\n }\n\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys }\n\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n continue\n }\n\n /**\n * If exit is already active and wasn't just activated, skip\n * re-processing to prevent interrupting running exit animations.\n * Re-resolving exit with a changed custom value can start new\n * value animations that stop the originals, leaving the exit\n * animation promise unresolved and the component stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n if (typeState.prevResolvedValues) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n }\n }\n continue\n }\n\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n\n let shouldAnimateType =\n variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant)\n\n let handledRemovedValues = false\n\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop]\n\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(\n buildResolvedTypeValues(type),\n {}\n )\n\n if (activeDelta === false) resolvedValues = {}\n\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState\n\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n }\n const markToAnimate = (key: string) => {\n shouldAnimateType = true\n if (removedKeys.has(key)) {\n handledRemovedValues = true\n removedKeys.delete(key)\n }\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n }\n\n for (const key in allKeys) {\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key)) continue\n\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev)\n } else {\n valueHasChanged = next !== prev\n }\n\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key)\n } else {\n // If it's undefined, it's been removed.\n removedKeys.add(key)\n }\n } else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key)\n } else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true\n }\n }\n\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false\n }\n\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange\n const needsAnimating = !willAnimateViaParent || handledRemovedValues\n if (shouldAnimateType && needsAnimating) {\n animations.push(\n ...definitionList.map((animation) => {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (\n typeof animation === \"string\" &&\n isInitialRender &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent\n ) {\n const { parent } = visualElement\n const parentVariant = resolveVariant(\n parent,\n animation\n )\n\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } =\n parentVariant.transition || {}\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n }\n\n return {\n animation: animation as AnimationDefinition,\n options,\n }\n })\n )\n }\n }\n\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation: TargetAndTransition = {}\n\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(\n visualElement,\n Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial\n )\n\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition\n }\n }\n\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key)\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n let shouldAnimate = Boolean(animations.length)\n\n if (\n isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount\n ) {\n shouldAnimate = false\n }\n\n isInitialRender = false\n return shouldAnimate ? animate(animations) : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive) return Promise.resolve()\n\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as keyof typeof state].protectedKeys = {}\n }\n\n return animations\n }\n\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState()\n /**\n * Temporarily disabling resetting this flag as it prevents components\n * with initial={false} from animating after being remounted, for instance\n * as the child of an Activity component.\n */\n // isInitialRender = true\n },\n }\n}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createTypeState(isActive = false): AnimationTypeState {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n}\n\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAsCA,MAAM,oBAAoB,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC,OAAO,EAAE,CAAA;AAChE,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,CAAA;AAQrD,SAAS,qBAAqB,CAAC,aAAkB,EAAA;IAC7C,OAAO,CAAC,UAAkC,KAAI;QAC1C,OAAO,OAAO,CAAC,GAAG,CACd,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAClC,oBAAoB,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAC1D,CACJ,CAAA;AACL,KAAC,CAAA;AACL,CAAC;AAEK,SAAU,oBAAoB,CAAC,aAAkB,EAAA;AACnD,IAAA,IAAI,OAAO,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAA;AAClD,IAAA,IAAI,KAAK,GAAG,WAAW,EAAE,CAAA;IACzB,IAAI,eAAe,GAAG,IAAI,CAAA;AAE1B;;;AAGG;AACH,IAAA,MAAM,uBAAuB,GACzB,CAAC,IAAmB,KACpB,CACI,GAA2B,EAC3B,UAAoD,KACpD;QACA,MAAM,QAAQ,GAAG,cAAc,CAC3B,aAAa,EACb,UAAU,EACV,IAAI,KAAK,MAAM;AACX,cAAE,aAAa,CAAC,eAAe,EAAE,MAAM;cACrC,S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S,EAAE,eAAe,EAAE;QAC5B,UAAU,EAAE,eAAe,EAAE;QAC7B,IAAI,EAAE,eAAe,EAAE;KAC1B,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs new file mode 100644 index 00000000..6866d117 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs @@ -0,0 +1,33 @@ +import { isVariantLabel } from './is-variant-label.mjs'; +import { variantProps } from './variant-props.mjs'; + +const numVariantProps = variantProps.length; +/** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; +} + +export { getVariantContext }; +//# sourceMappingURL=get-variant-context.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map new file mode 100644 index 00000000..8bf4bd51 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/get-variant-context.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-variant-context.mjs","sources":["../../../../src/render/utils/get-variant-context.ts"],"sourcesContent":["import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,CAAA;AAY3C;;;AAGG;AACG,SAAU,iBAAiB,CAC7B,aAAmB,EAAA;AAEnB,IAAA,IAAI,CAAC,aAAa;AAAE,QAAA,OAAO,SAAS,CAAA;AAEpC,IAAA,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE;AACtC,QAAA,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM;cAC9B,iBAAiB,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE;cAC7C,EAAE,CAAA;QACR,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE;YAC3C,OAAO,CAAC,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,OAAc,CAAA;SACvD;AACD,QAAA,OAAO,OAAO,CAAA;KACjB;IAED,MAAM,OAAO,GAAwB,EAAE,CAAA;AACvC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE;AACtC,QAAA,MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAyB,CAAA;QACpD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEtC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,KAAK,EAAE;AACtC,YAAA,OAAe,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;SACjC;KACJ;AAED,IAAA,OAAO,OAAO,CAAA;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs new file mode 100644 index 00000000..17f587f1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs @@ -0,0 +1,8 @@ +function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); +} + +export { isAnimationControls }; +//# sourceMappingURL=is-animation-controls.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map new file mode 100644 index 00000000..dc3207bb --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-animation-controls.mjs","sources":["../../../../src/render/utils/is-animation-controls.ts"],"sourcesContent":["import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n"],"names":[],"mappings":"AAEM,SAAU,mBAAmB,CAAC,CAAW,EAAA;IAC3C,QACI,CAAC,KAAK,IAAI;QACV,OAAO,CAAC,KAAK,QAAQ;AACrB,QAAA,OAAQ,CAA6B,CAAC,KAAK,KAAK,UAAU,EAC7D;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs new file mode 100644 index 00000000..724ace7d --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs @@ -0,0 +1,14 @@ +import { isAnimationControls } from './is-animation-controls.mjs'; +import { isVariantLabel } from './is-variant-label.mjs'; +import { variantProps } from './variant-props.mjs'; + +function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); +} +function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); +} + +export { isControllingVariants, isVariantNode }; +//# sourceMappingURL=is-controlling-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map new file mode 100644 index 00000000..8c05ba05 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-controlling-variants.mjs","sources":["../../../../src/render/utils/is-controlling-variants.ts"],"sourcesContent":["import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,qBAAqB,CAAC,KAAwB,EAAA;AAC1D,IAAA,QACI,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,QAAA,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,KACnB,cAAc,CAAC,KAAK,CAAC,IAA0B,CAAC,CAAC,CACpD,EACJ;AACL,CAAC;AAEK,SAAU,aAAa,CAAC,KAAwB,EAAA;IAClD,OAAO,OAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAA;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs new file mode 100644 index 00000000..e9bb0bd9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs @@ -0,0 +1,13 @@ +import { transformProps } from './keys-transform.mjs'; +import { scaleCorrectors } from '../../projection/styles/scale-correction.mjs'; +export { addScaleCorrector } from '../../projection/styles/scale-correction.mjs'; + +function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); +} + +export { isForcedMotionValue, scaleCorrectors }; +//# sourceMappingURL=is-forced-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map new file mode 100644 index 00000000..ad5ea6cf --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-forced-motion-value.mjs","sources":["../../../../src/render/utils/is-forced-motion-value.ts"],"sourcesContent":["import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n"],"names":[],"mappings":";;;;AASM,SAAU,mBAAmB,CAC/B,GAAW,EACX,EAAE,MAAM,EAAE,QAAQ,EAAqB,EAAA;AAEvC,IAAA,QACI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;AACvB,QAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;AACxB,SAAC,CAAC,MAAM,IAAI,QAAQ,KAAK,SAAS;AAC9B,aAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,SAAS,CAAC,CAAC,EACrD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs new file mode 100644 index 00000000..9e01dbef --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs @@ -0,0 +1,6 @@ +const isKeyframesTarget = (v) => { + return Array.isArray(v); +}; + +export { isKeyframesTarget }; +//# sourceMappingURL=is-keyframes-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map new file mode 100644 index 00000000..3b72fd7b --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-keyframes-target.mjs","sources":["../../../../src/render/utils/is-keyframes-target.ts"],"sourcesContent":["import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n"],"names":[],"mappings":"AAEa,MAAA,iBAAiB,GAAG,CAC7B,CAA2B,KACK;AAChC,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC3B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs new file mode 100644 index 00000000..1064983a --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs @@ -0,0 +1,9 @@ +/** + * Decides if the supplied variable is variant label + */ +function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); +} + +export { isVariantLabel }; +//# sourceMappingURL=is-variant-label.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map new file mode 100644 index 00000000..be06e855 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-variant-label.mjs","sources":["../../../../src/render/utils/is-variant-label.ts"],"sourcesContent":["/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n"],"names":[],"mappings":"AAAA;;AAEG;AACG,SAAU,cAAc,CAAC,CAAU,EAAA;IACrC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs new file mode 100644 index 00000000..d000529c --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs @@ -0,0 +1,14 @@ +import { transformPropOrder } from './keys-transform.mjs'; + +const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, +]); + +export { positionalKeys }; +//# sourceMappingURL=keys-position.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map new file mode 100644 index 00000000..52e2a612 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-position.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keys-position.mjs","sources":["../../../../src/render/utils/keys-position.ts"],"sourcesContent":["import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n"],"names":[],"mappings":";;AAEa,MAAA,cAAc,GAAG,IAAI,GAAG,CAAC;IAClC,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;AACR,IAAA,GAAG,kBAAkB;AACxB,CAAA;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs new file mode 100644 index 00000000..b09d96aa --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs @@ -0,0 +1,29 @@ +/** + * Generate a list of every possible transform key. + */ +const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", +]; +/** + * A quick lookup for transform props. + */ +const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))(); + +export { transformPropOrder, transformProps }; +//# sourceMappingURL=keys-transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map new file mode 100644 index 00000000..4b371c8a --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"keys-transform.mjs","sources":["../../../../src/render/utils/keys-transform.ts"],"sourcesContent":["/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set(transformPropOrder))()\n"],"names":[],"mappings":"AAAA;;AAEG;AACU,MAAA,kBAAkB,GAAG;IAC9B,sBAAsB;IACtB,GAAG;IACH,GAAG;IACH,GAAG;IACH,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;IACP,OAAO;EACV;AAED;;AAEG;AACU,MAAA,cAAc,iBAAiB,CAAC,MACzC,IAAI,GAAG,CAAC,kBAAkB,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs new file mode 100644 index 00000000..be01fdf5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs @@ -0,0 +1,56 @@ +import { motionValue } from '../../value/index.mjs'; +import { isMotionValue } from '../../value/utils/is-motion-value.mjs'; + +/** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ +function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; +} + +export { updateMotionValuesFromProps }; +//# sourceMappingURL=motion-values.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map new file mode 100644 index 00000000..95f5c5c9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/motion-values.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"motion-values.mjs","sources":["../../../../src/render/utils/motion-values.ts"],"sourcesContent":["import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n"],"names":[],"mappings":";;;AAKA;;;AAGG;SACa,2BAA2B,CACvC,OAAY,EACZ,IAAqB,EACrB,IAAqB,EAAA;AAErB,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AACpB,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;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AO,IAAI,CAAA;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs new file mode 100644 index 00000000..a9550a25 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs @@ -0,0 +1,20 @@ +import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs'; + +const isBrowser = typeof window !== "undefined"; +function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } +} + +export { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map new file mode 100644 index 00000000..0f889152 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/render/utils/reduced-motion/index.ts"],"sourcesContent":["import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAA;SAE/B,wBAAwB,GAAA;AACpC,IAAA,wBAAwB,CAAC,OAAO,GAAG,IAAI,CAAA;AACvC,IAAA,IAAI,CAAC,SAAS;QAAE,OAAM;AAEtB,IAAA,IAAI,MAAM,CAAC,UAAU,EAAE;QACnB,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAA;AAEtE,QAAA,MAAM,2BAA2B,GAAG,OAC/B,oBAAoB,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;AAE7D,QAAA,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAA;AAExE,QAAA,2BAA2B,EAAE,CAAA;KAChC;SAAM;AACH,QAAA,oBAAoB,CAAC,OAAO,GAAG,KAAK,CAAA;KACvC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs new file mode 100644 index 00000000..c846f8fc --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs @@ -0,0 +1,6 @@ +// Does this device prefer reduced motion? Returns `null` server-side. +const prefersReducedMotion = { current: null }; +const hasReducedMotionListener = { current: false }; + +export { hasReducedMotionListener, prefersReducedMotion }; +//# sourceMappingURL=state.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map new file mode 100644 index 00000000..7f1832a0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"state.mjs","sources":["../../../../../src/render/utils/reduced-motion/state.ts"],"sourcesContent":["interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n"],"names":[],"mappings":"AAIA;MACa,oBAAoB,GAAuB,EAAE,OAAO,EAAE,IAAI,GAAE;MAE5D,wBAAwB,GAAG,EAAE,OAAO,EAAE,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs new file mode 100644 index 00000000..e7b6fc40 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs @@ -0,0 +1,9 @@ +import { resolveVariantFromProps } from './resolve-variants.mjs'; + +function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); +} + +export { resolveVariant }; +//# sourceMappingURL=resolve-dynamic-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map new file mode 100644 index 00000000..a4d9b7ac --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-dynamic-variants.mjs","sources":["../../../../src/render/utils/resolve-dynamic-variants.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n"],"names":[],"mappings":";;SAqBgB,cAAc,CAC1B,aAAkB,EAClB,UAAgC,EAChC,MAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAA;IACtC,OAAO,uBAAuB,CAC1B,KAAK,EACL,UAAU,EACV,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,aAAa,CAChB,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs new file mode 100644 index 00000000..61756dd9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs @@ -0,0 +1,37 @@ +function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; +} +function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; +} + +export { resolveVariantFromProps }; +//# sourceMappingURL=resolve-variants.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map new file mode 100644 index 00000000..d1757c2e --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/resolve-variants.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-variants.mjs","sources":["../../../../src/render/utils/resolve-variants.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n"],"names":[],"mappings":"AAQA,SAAS,aAAa,CAAC,aAAmB,EAAA;AACtC,IAAA,MAAM,KAAK,GAAqC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAExD,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU,EAAE,GAAW,KAAI;QACtD,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;QAC3B,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAA;AACvC,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,KAAK,CAAA;AAChB,CAAC;AAcK,SAAU,uBAAuB,CACnC,KAAwB,EACxB,UAAgC,EAChC,MAAY,EACZ,aAAmB,EAAA;AAEnB;;AAEG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QAClC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,aAAa,CAAC,aAAa,CAAC,CAAA;QACxD,UAAU,GAAG,UAAU,CACnB,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,OAAO,EACP,QAAQ,CACX,CAAA;KACJ;AAED;;;AAGG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;QAChC,UAAU,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;KAC5D;AAED;;;;AAIG;AACH,IAAA,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QAClC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,aAAa,CAAC,aAAa,CAAC,CAAA;QACxD,UAAU,GAAG,UAAU,CACnB,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAC5C,OAAO,EACP,QAAQ,CACX,CAAA;KACJ;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/setters.mjs b/node_modules/motion-dom/dist/es/render/utils/setters.mjs new file mode 100644 index 00000000..9c94d6eb --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/setters.mjs @@ -0,0 +1,32 @@ +import { motionValue } from '../../value/index.mjs'; +import { resolveVariant } from './resolve-dynamic-variants.mjs'; +import { isKeyframesTarget } from './is-keyframes-target.mjs'; + +/** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ +function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } +} +function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; +} +function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } +} + +export { setTarget }; +//# sourceMappingURL=setters.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map b/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map new file mode 100644 index 00000000..7161880e --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/setters.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"setters.mjs","sources":["../../../../src/render/utils/setters.ts"],"sourcesContent":["import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n"],"names":[],"mappings":";;;;AAWA;;;AAGG;AACH,SAAS,cAAc,CACnB,aAA4B,EAC5B,GAAW,EACX,KAA0B,EAAA;AAE1B,IAAA,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC7B,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;KAC1C;SAAM;QACH,aAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;KAClD;AACL,CAAC;AAED,SAAS,4BAA4B,CACjC,CAA2B,EAAA;;IAG3B,OAAO,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1D,CAAC;AAEe,SAAA,SAAS,CACrB,aAA4B,EAC5B,UAA+B,EAAA;IAE/B,MAAM,QAAQ,GAAG,cAAc,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;AAC1D,IAAA,IAAI,EAAE,aAAa,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,QAAQ,IAAI,EAAE,CAAA;IAEvE,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;AAExC,IAAA,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACtB,MAAM,KAAK,GAAG,4BAA4B,CACtC,MAAM,CAAC,GAA0B,CAAQ,CAC5C,CAAA;AACD,QAAA,cAAc,CAAC,aAAa,EAAE,GAAG,EAAE,KAA4B,CAAC,CAAA;KACnE;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs new file mode 100644 index 00000000..a6bf3088 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs @@ -0,0 +1,15 @@ +function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; +} + +export { shallowCompare }; +//# sourceMappingURL=shallow-compare.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map new file mode 100644 index 00000000..a9863673 --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/shallow-compare.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"shallow-compare.mjs","sources":["../../../../src/render/utils/shallow-compare.ts"],"sourcesContent":["export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n"],"names":[],"mappings":"AAAgB,SAAA,cAAc,CAAC,IAAW,EAAE,IAAkB,EAAA;AAC1D,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,KAAK,CAAA;AAEtC,IAAA,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAA;AAE9B,IAAA,IAAI,UAAU,KAAK,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK,CAAA;AAE5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK,CAAA;KACxC;AAED,IAAA,OAAO,IAAI,CAAA;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs new file mode 100644 index 00000000..56a3899f --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs @@ -0,0 +1,13 @@ +const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", +]; +const variantProps = ["initial", ...variantPriorityOrder]; + +export { variantPriorityOrder, variantProps }; +//# sourceMappingURL=variant-props.mjs.map diff --git a/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map new file mode 100644 index 00000000..59d3455a --- /dev/null +++ b/node_modules/motion-dom/dist/es/render/utils/variant-props.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"variant-props.mjs","sources":["../../../../src/render/utils/variant-props.ts"],"sourcesContent":["import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n"],"names":[],"mappings":"AAEa,MAAA,oBAAoB,GAAoB;IACjD,SAAS;IACT,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,WAAW;IACX,MAAM;EACT;AAEY,MAAA,YAAY,GAAG,CAAC,SAAS,EAAE,GAAG,oBAAoB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/handle-element.mjs b/node_modules/motion-dom/dist/es/resize/handle-element.mjs new file mode 100644 index 00000000..7b4abe3b --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-element.mjs @@ -0,0 +1,64 @@ +import { isSVGElement } from '../utils/is-svg-element.mjs'; +import { resolveElements } from '../utils/resolve-elements.mjs'; + +const resizeHandlers = new WeakMap(); +let observer; +const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } +}; +const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); +const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); +function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); +} +function notifyAll(entries) { + entries.forEach(notifyTarget); +} +function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); +} +function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; +} + +export { resizeElement }; +//# sourceMappingURL=handle-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map b/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map new file mode 100644 index 00000000..8a2c7657 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"handle-element.mjs","sources":["../../../src/resize/handle-element.ts"],"sourcesContent":["import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if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ist/es/resize/handle-window.mjs new file mode 100644 index 00000000..cdc8977d --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-window.mjs @@ -0,0 +1,32 @@ +const windowCallbacks = new Set(); +let windowResizeHandler; +function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); +} +function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; +} + +export { resizeWindow }; +//# sourceMappingURL=handle-window.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map b/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map new file mode 100644 index 00000000..53a12e40 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/handle-window.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"handle-window.mjs","sources":["../../../src/resize/handle-window.ts"],"sourcesContent":["import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,IAAI,GAAG,EAAuB,CAAA;AAEtD,IAAI,mBAA6C,CAAA;AAEjD,SAAS,yBAAyB,GAAA;IAC9B,mBAAmB,GAAG,MAAK;AACvB,QAAA,MAAM,IAAI,GAAG;AACT,YAAA,IAAI,KAAK,GAAA;gBACL,OAAO,MAAM,CAAC,UAAU,CAAA;aAC3B;AACD,YAAA,IAAI,MAAM,GAAA;gBACN,OAAO,MAAM,CAAC,WAAW,CAAA;aAC5B;SACJ,CAAA;AAED,QAAA,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AACzD,KAAC,CAAA;AAED,IAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAA;AAC1D,CAAC;AAEK,SAAU,YAAY,CAAC,QAA6B,EAAA;AACtD,IAAA,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAE7B,IAAA,IAAI,CAAC,mBAAmB;AAAE,QAAA,yBAAyB,EAAE,CAAA;AAErD,IAAA,OAAO,MAAK;AACR,QAAA,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAEhC,IACI,CAAC,eAAe,CAAC,IAAI;AACrB,YAAA,OAAO,mBAAmB,KAAK,UAAU,EAC3C;AACE,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAA;YACzD,mBAAmB,GAAG,SAAS,CAAA;SAClC;AACL,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/resize/index.mjs b/node_modules/motion-dom/dist/es/resize/index.mjs new file mode 100644 index 00000000..5d871a63 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/index.mjs @@ -0,0 +1,9 @@ +import { resizeElement } from './handle-element.mjs'; +import { resizeWindow } from './handle-window.mjs'; + +function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); +} + +export { resize }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/resize/index.mjs.map b/node_modules/motion-dom/dist/es/resize/index.mjs.map new file mode 100644 index 00000000..31753b00 --- /dev/null +++ b/node_modules/motion-dom/dist/es/resize/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/resize/index.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { resizeElement } from \"./handle-element\"\nimport { resizeWindow } from \"./handle-window\"\nimport { ResizeHandler, WindowResizeHandler } from \"./types\"\n\nexport function resize(onResize: WindowResizeHandler): VoidFunction\nexport function resize(\n target: ElementOrSelector,\n onResize: ResizeHandler\n): VoidFunction\nexport function resize(\n a: WindowResizeHandler | ElementOrSelector,\n b?: ResizeHandler\n) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b!)\n}\n"],"names":[],"mappings":";;;AAUgB,SAAA,MAAM,CAClB,CAA0C,EAC1C,CAA0B,EAAA;IAE1B,OAAO,OAAO,CAAC,KAAK,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,CAAE,CAAC,CAAA;AAC3E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/scroll/observe.mjs b/node_modules/motion-dom/dist/es/scroll/observe.mjs new file mode 100644 index 00000000..52c4a846 --- /dev/null +++ b/node_modules/motion-dom/dist/es/scroll/observe.mjs @@ -0,0 +1,19 @@ +import { frame, cancelFrame } from '../frameloop/frame.mjs'; + +function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); +} + +export { observeTimeline }; +//# sourceMappingURL=observe.mjs.map diff --git a/node_modules/motion-dom/dist/es/scroll/observe.mjs.map b/node_modules/motion-dom/dist/es/scroll/observe.mjs.map new file mode 100644 index 00000000..f46282d1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/scroll/observe.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"observe.mjs","sources":["../../../src/scroll/observe.ts"],"sourcesContent":["import { ProgressTimeline } from \"../animation/types\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\ntype Update = (progress: number) => void\n\nexport function observeTimeline(update: Update, timeline: ProgressTimeline) {\n let prevProgress: number\n\n const onFrame = () => {\n const { currentTime } = timeline\n const percentage = currentTime === null ? 0 : currentTime.value\n const progress = percentage / 100\n\n if (prevProgress !== progress) {\n update(progress)\n }\n\n prevProgress = progress\n }\n\n frame.preUpdate(onFrame, true)\n\n return () => cancelFrame(onFrame)\n}\n"],"names":[],"mappings":";;AAKgB,SAAA,eAAe,CAAC,MAAc,EAAE,QAA0B,EAAA;AACtE,IAAA,IAAI,YAAoB,CAAA;IAExB,MAAM,OAAO,GAAG,MAAK;AACjB,QAAA,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAA;AAChC,QAAA,MAAM,UAAU,GAAG,WAAW,KAAK,IAAI,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAA;AAC/D,QAAA,MAAM,QAAQ,GAAG,UAAU,GAAG,GAAG,CAAA;AAEjC,QAAA,IAAI,YAAY,KAAK,QAAQ,EAAE;YAC3B,MAAM,CAAC,QAAQ,CAAC,CAAA;SACnB;QAED,YAAY,GAAG,QAAQ,CAAA;AAC3B,KAAC,CAAA;AAED,IAAA,KAAK,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AAE9B,IAAA,OAAO,MAAM,WAAW,CAAC,OAAO,CAAC,CAAA;AACrC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/stats/animation-count.mjs b/node_modules/motion-dom/dist/es/stats/animation-count.mjs new file mode 100644 index 00000000..805ad764 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/animation-count.mjs @@ -0,0 +1,8 @@ +const activeAnimations = { + layout: 0, + mainThread: 0, + waapi: 0, +}; + +export { activeAnimations }; +//# sourceMappingURL=animation-count.mjs.map diff --git a/node_modules/motion-dom/dist/es/stats/animation-count.mjs.map b/node_modules/motion-dom/dist/es/stats/animation-count.mjs.map new file mode 100644 index 00000000..fdd0fe46 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/animation-count.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animation-count.mjs","sources":["../../../src/stats/animation-count.ts"],"sourcesContent":["export const activeAnimations = {\n layout: 0,\n mainThread: 0,\n waapi: 0,\n}\n"],"names":[],"mappings":"AAAa,MAAA,gBAAgB,GAAG;AAC5B,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,KAAK,EAAE,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/stats/buffer.mjs b/node_modules/motion-dom/dist/es/stats/buffer.mjs new file mode 100644 index 00000000..6349d902 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/buffer.mjs @@ -0,0 +1,7 @@ +const statsBuffer = { + value: null, + addProjectionMetrics: null, +}; + +export { statsBuffer }; +//# sourceMappingURL=buffer.mjs.map diff --git a/node_modules/motion-dom/dist/es/stats/buffer.mjs.map b/node_modules/motion-dom/dist/es/stats/buffer.mjs.map new file mode 100644 index 00000000..4572b64b --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/buffer.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"buffer.mjs","sources":["../../../src/stats/buffer.ts"],"sourcesContent":["import type { StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: {\n nodes: number\n calculatedTargetDeltas: number\n calculatedProjections: number\n }) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n"],"names":[],"mappings":"AAgBa,MAAA,WAAW,GAA4C;AAChE,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,oBAAoB,EAAE,IAAI;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/stats/index.mjs b/node_modules/motion-dom/dist/es/stats/index.mjs new file mode 100644 index 00000000..b9475468 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/index.mjs @@ -0,0 +1,118 @@ +import { activeAnimations } from './animation-count.mjs'; +import { statsBuffer } from './buffer.mjs'; +import { frame, cancelFrame, frameData } from '../frameloop/frame.mjs'; + +function record() { + const { value } = statsBuffer; + if (value === null) { + cancelFrame(record); + return; + } + value.frameloop.rate.push(frameData.delta); + value.animations.mainThread.push(activeAnimations.mainThread); + value.animations.waapi.push(activeAnimations.waapi); + value.animations.layout.push(activeAnimations.layout); +} +function mean(values) { + return values.reduce((acc, value) => acc + value, 0) / values.length; +} +function summarise(values, calcAverage = mean) { + if (values.length === 0) { + return { + min: 0, + max: 0, + avg: 0, + }; + } + return { + min: Math.min(...values), + max: Math.max(...values), + avg: calcAverage(values), + }; +} +const msToFps = (ms) => Math.round(1000 / ms); +function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; +} +function reportStats() { + const { value } = statsBuffer; + if (!value) { + throw new Error("Stats are not being measured"); + } + clearStatsBuffer(); + cancelFrame(record); + const summary = { + frameloop: { + setup: summarise(value.frameloop.setup), + rate: summarise(value.frameloop.rate), + read: summarise(value.frameloop.read), + resolveKeyframes: summarise(value.frameloop.resolveKeyframes), + preUpdate: summarise(value.frameloop.preUpdate), + update: summarise(value.frameloop.update), + preRender: summarise(value.frameloop.preRender), + render: summarise(value.frameloop.render), + postRender: summarise(value.frameloop.postRender), + }, + animations: { + mainThread: summarise(value.animations.mainThread), + waapi: summarise(value.animations.waapi), + layout: summarise(value.animations.layout), + }, + layoutProjection: { + nodes: summarise(value.layoutProjection.nodes), + calculatedTargetDeltas: summarise(value.layoutProjection.calculatedTargetDeltas), + calculatedProjections: summarise(value.layoutProjection.calculatedProjections), + }, + }; + /** + * Convert the rate to FPS + */ + const { rate } = summary.frameloop; + rate.min = msToFps(rate.min); + rate.max = msToFps(rate.max); + rate.avg = msToFps(rate.avg); + [rate.min, rate.max] = [rate.max, rate.min]; + return summary; +} +function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const newStatsBuffer = statsBuffer; + newStatsBuffer.value = { + frameloop: { + setup: [], + rate: [], + read: [], + resolveKeyframes: [], + preUpdate: [], + update: [], + preRender: [], + render: [], + postRender: [], + }, + animations: { + mainThread: [], + waapi: [], + layout: [], + }, + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + newStatsBuffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = newStatsBuffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; + frame.postRender(record, true); + return reportStats; +} + +export { recordStats }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/stats/index.mjs.map b/node_modules/motion-dom/dist/es/stats/index.mjs.map new file mode 100644 index 00000000..42f9bb29 --- /dev/null +++ b/node_modules/motion-dom/dist/es/stats/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/stats/index.ts"],"sourcesContent":["import { cancelFrame, frame, frameData } from \"../frameloop\"\nimport { activeAnimations } from \"./animation-count\"\nimport { ActiveStatsBuffer, statsBuffer } from \"./buffer\"\nimport { StatsSummary, Summary } from \"./types\"\n\nfunction record() {\n const { value } = statsBuffer\n\n if (value === null) {\n cancelFrame(record)\n return\n }\n\n value.frameloop.rate.push(frameData.delta)\n value.animations.mainThread.push(activeAnimations.mainThread)\n value.animations.waapi.push(activeAnimations.waapi)\n value.animations.layout.push(activeAnimations.layout)\n}\n\nfunction mean(values: number[]) {\n return values.reduce((acc, value) => acc + value, 0) / values.length\n}\n\nfunction summarise(\n values: number[],\n calcAverage: (allValues: number[]) => number = mean\n): Summary {\n if (values.length === 0) {\n return {\n min: 0,\n max: 0,\n avg: 0,\n }\n }\n\n return {\n min: Math.min(...values),\n max: Math.max(...values),\n avg: calcAverage(values),\n }\n}\n\nconst msToFps = (ms: number) => Math.round(1000 / ms)\n\nfunction clearStatsBuffer() {\n statsBuffer.value = null\n statsBuffer.addProjectionMetrics = null\n}\n\nfunction reportStats(): StatsSummary {\n const { value } = statsBuffer\n\n if (!value) {\n throw new Error(\"Stats are not being measured\")\n }\n\n clearStatsBuffer()\n cancelFrame(record)\n\n const summary = {\n frameloop: {\n setup: summarise(value.frameloop.setup),\n rate: summarise(value.frameloop.rate),\n read: summarise(value.frameloop.read),\n resolveKeyframes: summarise(value.frameloop.resolveKeyframes),\n preUpdate: summarise(value.frameloop.preUpdate),\n update: summarise(value.frameloop.update),\n preRender: summarise(value.frameloop.preRender),\n render: summarise(value.frameloop.render),\n postRender: summarise(value.frameloop.postRender),\n },\n animations: {\n mainThread: summarise(value.animations.mainThread),\n waapi: summarise(value.animations.waapi),\n layout: summarise(value.animations.layout),\n },\n layoutProjection: {\n nodes: summarise(value.layoutProjection.nodes),\n calculatedTargetDeltas: summarise(\n value.layoutProjection.calculatedTargetDeltas\n ),\n calculatedProjections: summarise(\n value.layoutProjection.calculatedProjections\n ),\n },\n }\n\n /**\n * Convert the rate to FPS\n */\n const { rate } = summary.frameloop\n rate.min = msToFps(rate.min)\n rate.max = msToFps(rate.max)\n rate.avg = msToFps(rate.avg)\n // Swap these as the min and max are inverted when converted to FPS\n ;[rate.min, rate.max] = [rate.max, rate.min]\n\n return summary\n}\n\nexport function recordStats() {\n if (statsBuffer.value) {\n clearStatsBuffer()\n throw new Error(\"Stats are already being measured\")\n }\n\n const newStatsBuffer = statsBuffer as unknown as ActiveStatsBuffer\n\n newStatsBuffer.value = {\n frameloop: {\n setup: [],\n rate: [],\n read: [],\n resolveKeyframes: [],\n preUpdate: [],\n update: [],\n preRender: [],\n render: [],\n postRender: [],\n },\n animations: {\n mainThread: [],\n waapi: [],\n layout: [],\n },\n layoutProjection: {\n nodes: [],\n calculatedTargetDeltas: [],\n calculatedProjections: [],\n },\n }\n\n newStatsBuffer.addProjectionMetrics = (metrics) => {\n const { layoutProjection } = newStatsBuffer.value\n layoutProjection.nodes.push(metrics.nodes)\n layoutProjection.calculatedTargetDeltas.push(\n metrics.calculatedTargetDeltas\n )\n layoutProjection.calculatedProjections.push(\n metrics.calculatedProjections\n )\n }\n\n frame.postRender(record, true)\n\n return reportStats\n}\n"],"names":[],"mappings":";;;;AAKA,SAAS,MAAM,GAAA;AACX,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAA;AAE7B,IAAA,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,WAAW,CAAC,MAAM,CAAC,CAAA;QACnB,OAAM;KACT;IAED,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC1C,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAA;IAC7D,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACnD,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;AACzD,CAAC;AAED,SAAS,IAAI,CAAC,MAAgB,EAAA;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK,GAAG,GAAG,KAAK,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAA;AACxE,CAAC;AAED,SAAS,SAAS,CACd,MAAgB,EAChB,cAA+C,IAAI,EAAA;AAEnD,IAAA,IAAI,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AC,CAAA;AAE9B,IAAA,OAAO,WAAW,CAAA;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/delay.mjs b/node_modules/motion-dom/dist/es/utils/delay.mjs new file mode 100644 index 00000000..55bfdf84 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/delay.mjs @@ -0,0 +1,25 @@ +import { time } from '../frameloop/sync-time.mjs'; +import { secondsToMilliseconds } from 'motion-utils'; +import { frame, cancelFrame } from '../frameloop/frame.mjs'; + +/** + * Timeout defined in ms + */ +function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); +} +function delayInSeconds(callback, timeout) { + return delay(callback, secondsToMilliseconds(timeout)); +} + +export { delay, delayInSeconds }; +//# sourceMappingURL=delay.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/delay.mjs.map b/node_modules/motion-dom/dist/es/utils/delay.mjs.map new file mode 100644 index 00000000..7e234271 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/delay.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"delay.mjs","sources":["../../../src/utils/delay.ts"],"sourcesContent":["import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { FrameData } from \"../frameloop/types\"\nimport { secondsToMilliseconds } from \"motion-utils\"\n\nexport type DelayedFunction = (overshoot: number) => void\n\n/**\n * Timeout defined in ms\n */\nexport function delay(callback: DelayedFunction, timeout: number) {\n const start = time.now()\n\n const checkElapsed = ({ timestamp }: FrameData) => {\n const elapsed = timestamp - start\n\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed)\n callback(elapsed - timeout)\n }\n }\n\n frame.setup(checkElapsed, true)\n\n return () => cancelFrame(checkElapsed)\n}\n\nexport function delayInSeconds(callback: DelayedFunction, timeout: number) {\n return delay(callback, secondsToMilliseconds(timeout))\n}\n"],"names":[],"mappings":";;;;AAOA;;AAEG;AACa,SAAA,KAAK,CAAC,QAAyB,EAAE,OAAe,EAAA;AAC5D,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AAExB,IAAA,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAa,KAAI;AAC9C,QAAA,MAAM,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEjC,QAAA,IAAI,OAAO,IAAI,OAAO,EAAE;YACpB,WAAW,CAAC,YAAY,CAAC,CAAA;AACzB,YAAA,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,CAAA;SAC9B;AACL,KAAC,CAAA;AAED,IAAA,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAE/B,IAAA,OAAO,MAAM,WAAW,CAAC,YAAY,CAAC,CAAA;AAC1C,CAAC;AAEe,SAAA,cAAc,CAAC,QAAyB,EAAE,OAAe,EAAA;IACrE,OAAO,KAAK,CAAC,QAAQ,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAA;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/interpolate.mjs b/node_modules/motion-dom/dist/es/utils/interpolate.mjs new file mode 100644 index 00000000..a7260c7b --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/interpolate.mjs @@ -0,0 +1,75 @@ +import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils'; +import { mix } from './mix/index.mjs'; + +function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease; + mixer = pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; +} +/** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ +function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) + : interpolator; +} + +export { interpolate }; +//# sourceMappingURL=interpolate.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map b/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map new file mode 100644 index 00000000..319235a9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/interpolate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"interpolate.mjs","sources":["../../../src/utils/interpolate.ts"],"sourcesContent":["import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory\n}\n\nfunction createMixers(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory\n) {\n const mixers: Array> = []\n const mixerFactory: MixerFactory =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n"],"names":[],"mappings":";;;AAkBA,SAAS,YAAY,CACjB,MAAW,EACX,IAAwC,EACxC,WAA6B,EAAA;IAE7B,MAAM,MAAM,GAAoB,EAAE,CAAA;IAClC,MAAM,YAAY,GACd,WAAW,IAAI,kBAAkB,CAAC,GAAG,IAAI,GAAG,CAAA;AAChD,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;AAEnC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;AAChC,QAAA,IAAI,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAElD,IAAI,IAAI,EAAE;YACN,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,IAAI,CAAA;AACnE,YAAA,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,KAAK,CAAa,CAAA;SAClD;AAED,QAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACrB;AAED,IAAA,OAAO,MAAM,CAAA;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;AAkBG;SACa,WAAW,CACvB,KAAe,EACf,MAAW,EACX,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,KAA4B,EAAE,EAAA;AAElE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAA;IAEhC,SAAS,CACL,WAAW,KAAK,MAAM,CAAC,MAAM,EAC7B,sDAAsD,EACtD,cAAc,CACjB,CAAA;AAED;;;AAGG;IACH,IAAI,WAAW,KAAK,CAAC;AAAE,QAAA,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AC,CAAC,eAAe,CAAC,CAAA;AACrC,KAAC,CAAA;AAED,IAAA,OAAO,OAAO;UACR,CAAC,CAAS,KACN,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;UAC5D,YAAY,CAAA;AACtB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs new file mode 100644 index 00000000..1042a116 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs @@ -0,0 +1,12 @@ +import { isObject } from 'motion-utils'; + +/** + * Checks if an element is an HTML element in a way + * that works across iframes + */ +function isHTMLElement(element) { + return isObject(element) && "offsetHeight" in element; +} + +export { isHTMLElement }; +//# sourceMappingURL=is-html-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map new file mode 100644 index 00000000..01749ac7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-html-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-html-element.mjs","sources":["../../../src/utils/is-html-element.ts"],"sourcesContent":["import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return isObject(element) && \"offsetHeight\" in element\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,aAAa,CAAC,OAAgB,EAAA;IAC1C,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,cAAc,IAAI,OAAO,CAAA;AACzD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs new file mode 100644 index 00000000..f529a495 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs @@ -0,0 +1,12 @@ +import { isObject } from 'motion-utils'; + +/** + * Checks if an element is an SVG element in a way + * that works across iframes + */ +function isSVGElement(element) { + return isObject(element) && "ownerSVGElement" in element; +} + +export { isSVGElement }; +//# sourceMappingURL=is-svg-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map new file mode 100644 index 00000000..5d0f1c25 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-element.mjs","sources":["../../../src/utils/is-svg-element.ts"],"sourcesContent":["import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,YAAY,CAAC,OAAgB,EAAA;IACzC,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,iBAAiB,IAAI,OAAO,CAAA;AAC5D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs new file mode 100644 index 00000000..e61de126 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs @@ -0,0 +1,12 @@ +import { isSVGElement } from './is-svg-element.mjs'; + +/** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ +function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; +} + +export { isSVGSVGElement }; +//# sourceMappingURL=is-svg-svg-element.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map new file mode 100644 index 00000000..5d366541 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-svg-svg-element.mjs","sources":["../../../src/utils/is-svg-svg-element.ts"],"sourcesContent":["import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n"],"names":[],"mappings":";;AAEA;;;AAGG;AACG,SAAU,eAAe,CAAC,OAAgB,EAAA;IAC5C,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,CAAA;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/color.mjs b/node_modules/motion-dom/dist/es/utils/mix/color.mjs new file mode 100644 index 00000000..5c1bc4bd --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/color.mjs @@ -0,0 +1,48 @@ +import { warning } from 'motion-utils'; +import { hex } from '../../value/types/color/hex.mjs'; +import { hsla } from '../../value/types/color/hsla.mjs'; +import { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs'; +import { rgba } from '../../value/types/color/rgba.mjs'; +import { mixImmediate } from './immediate.mjs'; +import { mixNumber } from './number.mjs'; + +// Linear color space blending +// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw +// Demonstrated http://codepen.io/osublake/pen/xGVVaN +const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); +}; +const colorTypes = [hex, rgba, hsla]; +const getColorType = (v) => colorTypes.find((type) => type.test(v)); +function asRGBA(color) { + const type = getColorType(color); + warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; +} +const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; +}; + +export { mixColor, mixLinearColor }; +//# sourceMappingURL=color.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map new file mode 100644 index 00000000..3192b875 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/color.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"color.mjs","sources":["../../../../src/utils/mix/color.ts"],"sourcesContent":["import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n"],"names":[],"mappings":";;;;;;;;AASA;AACA;AACA;AACa,MAAA,cAAc,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS,KAAI;AAClE,IAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAA;AAC5B,IAAA,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAA;AAChD,IAAA,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzC,EAAC;AAED,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACpC,MAAM,YAAY,GAAG,CAAC,CAAiB,KACnC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAE3C,SAAS,MAAM,CAAC,KAAqB,EAAA;AACjC,IAAA,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;AAEhC,IAAA,OAAO,CACH,OAAO,CAAC,IAAI,CAAC,EACb,CAAI,CAAA,EAAA,KAAK,CAAsE,oEAAA,CAAA,EAC/E,sBAAs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AAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs new file mode 100644 index 00000000..687a6411 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs @@ -0,0 +1,93 @@ +import { pipe, warning } from 'motion-utils'; +import { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs'; +import { color } from '../../value/types/color/index.mjs'; +import { complex, analyseComplexValue } from '../../value/types/complex/index.mjs'; +import { mixColor } from './color.mjs'; +import { mixImmediate } from './immediate.mjs'; +import { mixNumber as mixNumber$1 } from './number.mjs'; +import { invisibleValues, mixVisibility } from './visibility.mjs'; + +function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); +} +function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; +} +function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; +} +function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; +} +function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; +} +const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } +}; + +export { getMixer, mixArray, mixComplex, mixObject }; +//# sourceMappingURL=complex.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map new file mode 100644 index 00000000..4fef0cf1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/complex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"complex.mjs","sources":["../../../../src/utils/mix/complex.ts"],"sourcesContent":["import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n"],"names":["mixNumberImmediate"],"mappings":";;;;;;;;;AAqBA,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS,EAAA;AACnC,IAAA,OAAO,CAAC,CAAS,KAAKA,WAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AACrD,CAAC;AAEK,SAAU,QAAQ,CAAI,CAAI,EAAA;AAC5B,IAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AACvB,QAAA,OAAO,SAAS,CAAA;KACnB;AAAM,SAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;QAC9B,OAAO,kBAAkB,CAAC,CAAC,CAAC;AACxB,cAAE,YAAY;AACd,cAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACf,kBAAE,QAAQ;kBACR,UAAU,CAAA;KACnB;AAAM,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;AACzB,QAAA,OAAO,QAAQ,CAAA;KAClB;AAAM,SAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,SAAS,CAAA;KAC9C;AAED,IAAA,OAAO,YAAY,CAAA;AACvB,CAAC;AAEe,SAAA,QAAQ,CAAC,CAAe,EAAE,CAAe,EAAA;AACrD,IAAA,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AACrB,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAA;IAE/B,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,QA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CAAC,WAAW,CAAC,MAAM,CAAC,MAAM;AAC9B,aAAC,eAAe,CAAC,GAAG,CAAC,MAAgB,CAAC;AAClC,gBAAA,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EACjC;AACE,YAAA,OAAO,aAAa,CAAC,MAAgB,EAAE,MAAgB,CAAC,CAAA;SAC3D;AAED,QAAA,OAAO,IAAI,CACP,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAClE,QAAQ,CACX,CAAA;KACJ;SAAM;QACH,OAAO,CACH,IAAI,EACJ,CAAmB,gBAAA,EAAA,MAAM,CAAU,OAAA,EAAA,MAAM,CAA0K,wKAAA,CAAA,EACnN,0BAA0B,CAC7B,CAAA;AAED,QAAA,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACtC;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs new file mode 100644 index 00000000..12ca8720 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs @@ -0,0 +1,6 @@ +function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); +} + +export { mixImmediate }; +//# sourceMappingURL=immediate.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map new file mode 100644 index 00000000..de4c5d40 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/immediate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"immediate.mjs","sources":["../../../../src/utils/mix/immediate.ts"],"sourcesContent":["export function mixImmediate(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n"],"names":[],"mappings":"AAAgB,SAAA,YAAY,CAAI,CAAI,EAAE,CAAI,EAAA;AACtC,IAAA,OAAO,CAAC,CAAS,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;AACzC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/index.mjs b/node_modules/motion-dom/dist/es/utils/mix/index.mjs new file mode 100644 index 00000000..e41e103e --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/index.mjs @@ -0,0 +1,15 @@ +import { getMixer } from './complex.mjs'; +import { mixNumber } from './number.mjs'; + +function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); +} + +export { mix }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map new file mode 100644 index 00000000..7342bf73 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../src/utils/mix/index.ts"],"sourcesContent":["import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix(from: T, to: T): Mixer\nexport function mix(from: number, to: number, p: number): number\nexport function mix(from: T, to: T, p?: T): Mixer | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer\n}\n"],"names":["mixNumberImmediate"],"mappings":";;;SAMgB,GAAG,CAAI,IAAO,EAAE,EAAK,EAAE,CAAK,EAAA;IACxC,IACI,OAAO,IAAI,KAAK,QAAQ;QACxB,OAAO,EAAE,KAAK,QAAQ;AACtB,QAAA,OAAO,CAAC,KAAK,QAAQ,EACvB;QACE,OAAOA,SAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;KACzC;AAED,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC5B,IAAA,OAAO,KAAK,CAAC,IAAW,EAAE,EAAS,CAAa,CAAA;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/number.mjs b/node_modules/motion-dom/dist/es/utils/mix/number.mjs new file mode 100644 index 00000000..1e19dfc5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/number.mjs @@ -0,0 +1,27 @@ +/* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) +*/ +const mixNumber = (from, to, progress) => { + return from + (to - from) * progress; +}; + +export { mixNumber }; +//# sourceMappingURL=number.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map new file mode 100644 index 00000000..6b7934ec --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/number.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"number.mjs","sources":["../../../../src/utils/mix/number.ts"],"sourcesContent":["/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;AAoBE;AACW,MAAA,SAAS,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,QAAgB,KAAI;IACpE,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,IAAI,QAAQ,CAAA;AACxC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs new file mode 100644 index 00000000..3810ffe4 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs @@ -0,0 +1,17 @@ +const invisibleValues = new Set(["none", "hidden"]); +/** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ +function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } +} + +export { invisibleValues, mixVisibility }; +//# sourceMappingURL=visibility.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map new file mode 100644 index 00000000..918efe07 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/mix/visibility.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"visibility.mjs","sources":["../../../../src/utils/mix/visibility.ts"],"sourcesContent":["export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n"],"names":[],"mappings":"AAAO,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAC;AAE1D;;;;AAIG;AACa,SAAA,aAAa,CAAC,MAAc,EAAE,MAAc,EAAA;AACxD,IAAA,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC7B,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,CAAA;KACnD;SAAM;AACH,QAAA,OAAO,CAAC,CAAS,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,CAAA;KACnD;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs new file mode 100644 index 00000000..a90b0c34 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs @@ -0,0 +1,21 @@ +function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); +} + +export { resolveElements }; +//# sourceMappingURL=resolve-elements.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map new file mode 100644 index 00000000..ec94783f --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/resolve-elements.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-elements.mjs","sources":["../../../src/utils/resolve-elements.ts"],"sourcesContent":["export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n"],"names":[],"mappings":"SAqBgB,eAAe,CAC3B,iBAAoC,EACpC,KAAsB,EACtB,aAA6B,EAAA;AAE7B,IAAA,IAAI,iBAAiB,IAAI,IAAI,EAAE;AAC3B,QAAA,OAAO,EAAE,CAAA;KACZ;AAED,IAAA,IAAI,iBAAiB,YAAY,WAAW,EAAE;QAC1C,OAAO,CAAC,iBAAiB,CAAC,CAAA;KAC7B;AAAM,SAAA,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;QAC9C,IAAI,IAAI,GAAyB,QAAQ,CAAA;QAEzC,IAAI,KAAK,EAAE;AACP,YAAA,IAAI,GAAG,KAAK,CAAC,OAAO,CAAA;SACvB;AAED,QAAA,MAAM,QAAQ,GACV,aAAa,GAAG,iBAAiB,CAAC;AAClC,YAAA,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;AAE5C,QAAA,OAAO,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAA;KAC9C;AAED,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CACvC,CAAC,OAAO,KAAyB,OAAO,IAAI,IAAI,CACnD,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/stagger.mjs b/node_modules/motion-dom/dist/es/utils/stagger.mjs new file mode 100644 index 00000000..ed9b4699 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/stagger.mjs @@ -0,0 +1,27 @@ +import { easingDefinitionToFunction } from 'motion-utils'; + +function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } +} +function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; +} + +export { getOriginIndex, stagger }; +//# sourceMappingURL=stagger.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/stagger.mjs.map b/node_modules/motion-dom/dist/es/utils/stagger.mjs.map new file mode 100644 index 00000000..2b8e2d08 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/stagger.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"stagger.mjs","sources":["../../../src/utils/stagger.ts"],"sourcesContent":["import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin = \"first\" | \"last\" | \"center\" | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease }: StaggerOptions = {}\n): DynamicOption {\n return (i: number, total: number) => {\n const fromIndex =\n typeof from === \"number\" ? from : getOriginIndex(from, total)\n const distance = Math.abs(fromIndex - i)\n let delay = duration * distance\n\n if (ease) {\n const maxDelay = total * duration\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n"],"names":[],"mappings":";;AAWgB,SAAA,cAAc,CAAC,IAAmB,EAAE,KAAa,EAAA;AAC7D,IAAA,IAAI,IAAI,KAAK,OAAO,EAAE;AAClB,QAAA,OAAO,CAAC,CAAA;KACX;SAAM;AACH,QAAA,MAAM,SAAS,GAAG,KAAK,GAAG,CAAC,CAAA;AAC3B,QAAA,OAAO,IAAI,KAAK,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,CAAC,CAAA;KACrD;AACL,CAAC;SAEe,OAAO,CACnB,QAAmB,GAAA,GAAG,EACtB,EAAE,UAAU,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,KAAqB,EAAE,EAAA;AAEvD,IAAA,OAAO,CAAC,CAAS,EAAE,KAAa,KAAI;AAChC,QAAA,MAAM,SAAS,GACX,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA;AACxC,QAAA,IAAI,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAE/B,IAAI,IAAI,EAAE;AACN,YAAA,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAA;AACjC,YAAA,MAAM,cAAc,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAA;YACvD,KAAK,GAAG,cAAc,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAA;SACtD;QAED,OAAO,UAAU,GAAG,KAAK,CAAA;AAC7B,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs new file mode 100644 index 00000000..e0682b19 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs @@ -0,0 +1,8 @@ +/** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ +const supportsFlags = {}; + +export { supportsFlags }; +//# sourceMappingURL=flags.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map new file mode 100644 index 00000000..bd44b301 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/flags.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"flags.mjs","sources":["../../../../src/utils/supports/flags.ts"],"sourcesContent":["/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record = {}\n"],"names":[],"mappings":"AAAA;;;AAGG;AACI,MAAM,aAAa,GAAwC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs new file mode 100644 index 00000000..38f3729d --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs @@ -0,0 +1,16 @@ +import { memoSupports } from './memo.mjs'; + +const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; +}, "linearEasing"); + +export { supportsLinearEasing }; +//# sourceMappingURL=linear-easing.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map new file mode 100644 index 00000000..868f93c8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"linear-easing.mjs","sources":["../../../../src/utils/supports/linear-easing.ts"],"sourcesContent":["import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n"],"names":[],"mappings":";;MAEa,oBAAoB,iBAAiB,YAAY,CAAC,MAAK;AAChE,IAAA,IAAI;QACA,QAAQ;aACH,aAAa,CAAC,KAAK,CAAC;AACpB,aAAA,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAA;KAC3D;IAAC,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK,CAAA;KACf;AACD,IAAA,OAAO,IAAI,CAAA;AACf,CAAC,EAAE,cAAc;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs new file mode 100644 index 00000000..e8dd26a5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs @@ -0,0 +1,10 @@ +import { memo } from 'motion-utils'; +import { supportsFlags } from './flags.mjs'; + +function memoSupports(callback, supportsFlag) { + const memoized = memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); +} + +export { memoSupports }; +//# sourceMappingURL=memo.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map new file mode 100644 index 00000000..111d260c --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/memo.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"memo.mjs","sources":["../../../../src/utils/supports/memo.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n"],"names":[],"mappings":";;;AAGgB,SAAA,YAAY,CACxB,QAAiB,EACjB,YAAwC,EAAA;AAExC,IAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC/B,OAAO,MAAM,aAAa,CAAC,YAAY,CAAC,IAAI,QAAQ,EAAE,CAAA;AAC1D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs new file mode 100644 index 00000000..3744c45a --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs @@ -0,0 +1,6 @@ +import { memoSupports } from './memo.mjs'; + +const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); + +export { supportsScrollTimeline }; +//# sourceMappingURL=scroll-timeline.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map new file mode 100644 index 00000000..c641e751 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"scroll-timeline.mjs","sources":["../../../../src/utils/supports/scroll-timeline.ts"],"sourcesContent":["import { ProgressTimeline } from \"../..\"\nimport { memoSupports } from \"./memo\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nexport const supportsScrollTimeline = /* @__PURE__ */ memoSupports(\n () => window.ScrollTimeline !== undefined,\n \"scrollTimeline\"\n)\n"],"names":[],"mappings":";;AAiBa,MAAA,sBAAsB,mBAAmB,YAAY,CAC9D,MAAM,MAAM,CAAC,cAAc,KAAK,SAAS,EACzC,gBAAgB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/utils/transform.mjs b/node_modules/motion-dom/dist/es/utils/transform.mjs new file mode 100644 index 00000000..74b624e0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/transform.mjs @@ -0,0 +1,15 @@ +import { interpolate } from './interpolate.mjs'; + +function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; +} + +export { transform }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/utils/transform.mjs.map b/node_modules/motion-dom/dist/es/utils/transform.mjs.map new file mode 100644 index 00000000..9dec2671 --- /dev/null +++ b/node_modules/motion-dom/dist/es/utils/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../src/utils/transform.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\nimport { interpolate } from \"./interpolate\"\n\n/**\n * @public\n */\nexport interface TransformOptions {\n /**\n * Clamp values to within the given range. Defaults to `true`\n *\n * @public\n */\n clamp?: boolean\n\n /**\n * Easing functions to use on the interpolations between each value in the input and output ranges.\n *\n * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.\n *\n * @public\n */\n ease?: EasingFunction | EasingFunction[]\n\n /**\n * Provide a function that can interpolate between any two values in the provided range.\n *\n * @public\n */\n mixer?: (from: T, to: T) => (v: number) => any\n}\n\n/**\n * Transforms numbers into other values by mapping them from an input range to an output range.\n * Returns the type of the input provided.\n *\n * @remarks\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [0, 200]\n * const outputRange = [0, 1]\n * const output = transform(100, inputRange, outputRange)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n * ```\n *\n * @param inputValue - A number to transform between the input and output ranges.\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.\n * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputValue: number,\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): T\n/**\n *\n * Transforms numbers into other values by mapping them from an input range to an output range.\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [-200, -100, 100, 200]\n * const outputRange = [0, 1, 1, 0]\n * const convertRange = transform(inputRange, outputRange)\n * const output = convertRange(-150)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n *\n * ```\n *\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options - Clamp: clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): (inputValue: number) => T\nexport function transform(\n ...args:\n | [number, number[], T[], TransformOptions?]\n | [number[], T[], TransformOptions?]\n) {\n const useImmediate = !Array.isArray(args[0])\n const argOffset = useImmediate ? 0 : -1\n const inputValue = args[0 + argOffset] as number\n const inputRange = args[1 + argOffset] as number[]\n const outputRange = args[2 + argOffset] as T[]\n const options = args[3 + argOffset] as TransformOptions\n\n const interpolator = interpolate(inputRange, outputRange, options)\n\n return useImmediate ? interpolator(inputValue) : interpolator\n}\n"],"names":[],"mappings":";;AAqGgB,SAAA,SAAS,CACrB,GAAG,IAEwC,EAAA;AAE3C,IAAA,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC5C,IAAA,MAAM,SAAS,GAAG,YAAY,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAW,CAAA;IAChD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAa,CAAA;IAClD,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAQ,CAAA;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,GAAG,SAAS,CAAwB,CAAA;IAE1D,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;AAElE,IAAA,OAAO,YAAY,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,CAAA;AACjE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/follow-value.mjs b/node_modules/motion-dom/dist/es/value/follow-value.mjs new file mode 100644 index 00000000..05b83692 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/follow-value.mjs @@ -0,0 +1,102 @@ +import { motionValue } from './index.mjs'; +import { JSAnimation } from '../animation/JSAnimation.mjs'; +import { isMotionValue } from './utils/is-motion-value.mjs'; +import { frame } from '../frameloop/frame.mjs'; + +/** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ +function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; +} +/** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ +function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + }; + const startAnimation = () => { + stopAnimation(); + const currentValue = asNumber(value.get()); + const targetValue = asNumber(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + return; + } + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity: value.getVelocity(), + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(() => { + startAnimation(); + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value["events"].animationComplete?.notify(); + }); + }); + }, stopAnimation); + if (isMotionValue(source)) { + const removeSourceOnChange = source.on("change", (v) => value.set(parseValue(v, unit))); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; +} +function parseValue(v, unit) { + return unit ? v + unit : v; +} +function asNumber(v) { + return typeof v === "number" ? v : parseFloat(v); +} + +export { attachFollow, followValue }; +//# sourceMappingURL=follow-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/follow-value.mjs.map b/node_modules/motion-dom/dist/es/value/follow-value.mjs.map new file mode 100644 index 00000000..6a9470a2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/follow-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"follow-value.mjs","sources":["../../../src/value/follow-value.ts"],"sourcesContent":["import { MotionValue, motionValue } from \".\"\nimport { JSAnimation } from \"../animation/JSAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationTransition } from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Options for useFollowValue hook, extending ValueAnimationTransition\n * but excluding lifecycle callbacks that don't make sense for the hook pattern.\n */\nexport type FollowValueOptions = Omit<\n ValueAnimationTransition,\n \"onUpdate\" | \"onComplete\" | \"onPlay\" | \"onRepeat\" | \"onStop\"\n>\n\n/**\n * Create a `MotionValue` that animates to its latest value using any transition type.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = followValue(x, { type: \"spring\", stiffness: 300 })\n * // or with tween\n * const z = followValue(x, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function followValue(\n source: T | MotionValue,\n options?: FollowValueOptions\n) {\n const initialValue = isMotionValue(source) ? source.get() : source\n const value = motionValue(initialValue)\n\n attachFollow(value, source, options)\n\n return value\n}\n\n/**\n * Attach an animation to a MotionValue that will animate whenever the value changes.\n * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.)\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachFollow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowValueOptions = {}\n): VoidFunction {\n const initialValue = value.get()\n\n let activeAnimation: JSAnimation | null = null\n let latestValue = initialValue\n let latestSetter: (v: T) => void\n\n const unit =\n typeof initialValue === \"string\"\n ? initialValue.replace(/[\\d.-]/g, \"\")\n : undefined\n\n const stopAnimation = () => {\n if (activeAnimation) {\n activeAnimation.stop()\n activeAnimation = null\n }\n }\n\n const startAnimation = () => {\n stopAnimation()\n\n const currentValue = asNumber(value.get())\n const targetValue = asNumber(latestValue)\n\n // Don't animate if we're already at the target\n if (currentValue === targetValue) {\n return\n }\n\n activeAnimation = new JSAnimation({\n keyframes: [currentValue, targetValue],\n velocity: value.getVelocity(),\n // Default to spring if no type specified (matches useSpring behavior)\n type: \"spring\",\n restDelta: 0.001,\n restSpeed: 0.01,\n ...options,\n onUpdate: latestSetter,\n })\n }\n\n value.attach((v, set) => {\n latestValue = v\n latestSetter = (latest) => set(parseValue(latest, unit) as T)\n\n frame.postRender(() => {\n startAnimation()\n value[\"events\"].animationStart?.notify()\n activeAnimation?.then(() => {\n value[\"events\"].animationComplete?.notify()\n })\n })\n }, stopAnimation)\n\n if (isMotionValue(source)) {\n const removeSourceOnChange = source.on(\"change\", (v) =>\n value.set(parseValue(v, unit) as T)\n )\n\n const removeValueOnDestroy = value.on(\"destroy\", removeSourceOnChange)\n\n return () => {\n removeSourceOnChange()\n removeValueOnDestroy()\n }\n }\n\n return stopAnimation\n}\n\nfunction parseValue(v: AnyResolvedKeyframe, unit?: string) {\n return unit ? v + unit : v\n}\n\nfunction asNumber(v: AnyResolvedKeyframe) {\n return typeof v === \"number\" ? v : parseFloat(v)\n}\n"],"names":[],"mappings":";;;;;AAeA;;;;;;;;;;;;;;;;AAgBG;AACa,SAAA,WAAW,CACvB,MAA0B,EAC1B,OAA4B,EAAA;AAE5B,IAAA,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,MAAM,CAAA;AAClE,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;AAEvC,IAAA,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;AAEpC,IAAA,OAAO,KAAK,CAAA;AAChB,CAAC;AAED;;;;;;;;;;AAUG;AACG,SAAU,YAAY,CACxB,KAAqB,EACrB,MAA0B,EAC1B,UAA8B,EAAE,EAAA;AAEhC,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;IAEhC,IAAI,eAAe,GAA+B,IAAI,CAAA;IACtD,IAAI,WAAW,GAAG,YAAY,CAAA;AAC9B,IAAA,IAAI,YAA4B,CAAA;AAEhC,IAAA,MAAM,IAAI,GACN,OAAO,YAAY,KAAK,QAAQ;UAC1B,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;UACnC,SAAS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EAAE,aAAa,CAAC,CAAA;AAEjB,IAAA,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,KAC/C,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAM,CAAC,CACtC,CAAA;QAED,MAAM,oBAAoB,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAA;AAEtE,QAAA,OAAO,MAAK;AACR,YAAA,oBAAoB,EAAE,CAAA;AACtB,YAAA,oBAAoB,EAAE,CAAA;AAC1B,SAAC,CAAA;KACJ;AAED,IAAA,OAAO,aAAa,CAAA;AACxB,CAAC;AAED,SAAS,UAAU,CAAC,CAAsB,EAAE,IAAa,EAAA;IACrD,OAAO,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAA;AAC9B,CAAC;AAED,SAAS,QAAQ,CAAC,CAAsB,EAAA;AACpC,IAAA,OAAO,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;AACpD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/index.mjs b/node_modules/motion-dom/dist/es/value/index.mjs new file mode 100644 index 00000000..36993917 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/index.mjs @@ -0,0 +1,324 @@ +import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils'; +import { time } from '../frameloop/sync-time.mjs'; +import { frame } from '../frameloop/frame.mjs'; + +/** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ +const MAX_VELOCITY_DELTA = 30; +const isFloat = (value) => { + return !isNaN(parseFloat(value)); +}; +const collectMotionValues = { + current: undefined, +}; +/** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ +class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + if (process.env.NODE_ENV !== "production") { + warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } +} +function motionValue(init, options) { + return new MotionValue(init, options); +} + +export { MotionValue, collectMotionValues, motionValue }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/index.mjs.map b/node_modules/motion-dom/dist/es/value/index.mjs.map new file mode 100644 index 00000000..74085677 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/value/index.ts"],"sourcesContent":["import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n on>(\n eventName: EventName,\n callback: MotionValueEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue(init: V, options?: MotionValueOptions) {\n return new MotionValue(init, options)\n}\n"],"names":[],"mappings":";;;;AAoCA;;;AAGG;AACH,MAAM,kBAAkB,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;AAED;;;;AAIG;IACH,WAAW,GAAA;AACP,QAAA,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAA;KAC1B;IAEO,cAAc,GAAA;QAClB,OAAO,IAAI,CAAC,SAAS,CAAA;KACxB;AAED;;;;;;;;AAQG;IACH,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,CAAA;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,CAAA;QAC7B,IAAI,CAAC,cAAc,EAAE,CAAA;QACrB,IAAI,CAAC,IAAI,EAAE,CAAA;AAEX,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,EAAE,CAAA;SAC3B;KACJ;AACJ,CAAA;AAEe,SAAA,WAAW,CAAI,IAAO,EAAE,OAA4B,EAAA;AAChE,IAAA,OAAO,IAAI,WAAW,CAAI,IAAI,EAAE,OAAO,CAAC,CAAA;AAC5C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/map-value.mjs b/node_modules/motion-dom/dist/es/value/map-value.mjs new file mode 100644 index 00000000..d3eb12fd --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/map-value.mjs @@ -0,0 +1,47 @@ +import { transform } from '../utils/transform.mjs'; +import { transformValue } from './transform-value.mjs'; + +/** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); +} + +export { mapValue }; +//# sourceMappingURL=map-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/map-value.mjs.map b/node_modules/motion-dom/dist/es/value/map-value.mjs.map new file mode 100644 index 00000000..d97d63bf --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/map-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"map-value.mjs","sources":["../../../src/value/map-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { transform, TransformOptions } from \"../utils/transform\"\nimport { transformValue } from \"./transform-value\"\n\nexport type MapInputRange = number[]\n\n/**\n * Create a `MotionValue` that maps the output of another `MotionValue` by\n * mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * const x = motionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = mapValue(x, xRange, opacityRange)\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function mapValue(\n inputValue: MotionValue,\n inputRange: MapInputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue {\n const map = transform(inputRange, outputRange, options)\n return transformValue(() => map(inputValue.get()))\n}\n"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG;AACG,SAAU,QAAQ,CACpB,UAA+B,EAC/B,UAAyB,EACzB,WAAgB,EAChB,OAA6B,EAAA;IAE7B,MAAM,GAAG,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;AACvD,IAAA,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/spring-value.mjs b/node_modules/motion-dom/dist/es/value/spring-value.mjs new file mode 100644 index 00000000..819e7f65 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/spring-value.mjs @@ -0,0 +1,36 @@ +import { followValue, attachFollow } from './follow-value.mjs'; + +/** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ +function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); +} +/** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ +function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); +} + +export { attachSpring, springValue }; +//# sourceMappingURL=spring-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/spring-value.mjs.map b/node_modules/motion-dom/dist/es/value/spring-value.mjs.map new file mode 100644 index 00000000..27913fb1 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/spring-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"spring-value.mjs","sources":["../../../src/value/spring-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { AnyResolvedKeyframe, SpringOptions } from \"../animation/types\"\nimport { attachFollow, followValue } from \"./follow-value\"\n\n/**\n * Create a `MotionValue` that animates to its latest value using a spring.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = springValue(x, { stiffness: 300 })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function springValue(\n source: T | MotionValue,\n options?: SpringOptions\n) {\n return followValue(source, { type: \"spring\", ...options })\n}\n\n/**\n * Attach a spring animation to a MotionValue that will animate whenever the value changes.\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachSpring(\n value: MotionValue,\n source: T | MotionValue,\n options?: SpringOptions\n): VoidFunction {\n return attachFollow(value, source, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;AAcG;AACa,SAAA,WAAW,CACvB,MAA0B,EAC1B,OAAuB,EAAA;AAEvB,IAAA,OAAO,WAAW,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;AAC9D,CAAC;AAED;;;;;;;;;AASG;SACa,YAAY,CACxB,KAAqB,EACrB,MAA0B,EAC1B,OAAuB,EAAA;AAEvB,IAAA,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;AACtE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs new file mode 100644 index 00000000..166c874f --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs @@ -0,0 +1,14 @@ +import { cancelFrame, frame } from '../frameloop/frame.mjs'; + +function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); +} + +export { subscribeValue }; +//# sourceMappingURL=subscribe-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map new file mode 100644 index 00000000..fb7c6df0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/subscribe-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"subscribe-value.mjs","sources":["../../../src/value/subscribe-value.ts"],"sourcesContent":["import { MotionValue } from \".\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\nexport function subscribeValue(\n inputValues: MotionValue[],\n outputValue: MotionValue,\n getLatest: () => O\n) {\n const update = () => outputValue.set(getLatest())\n const scheduleUpdate = () => frame.preRender(update, false, true)\n\n const subscriptions = inputValues.map((v) => v.on(\"change\", scheduleUpdate))\n\n outputValue.on(\"destroy\", () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(update)\n })\n}\n"],"names":[],"mappings":";;SAGgB,cAAc,CAC1B,WAA0B,EAC1B,WAA2B,EAC3B,SAAkB,EAAA;AAElB,IAAA,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAA;AACjD,IAAA,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;IAEjE,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAA;AAE5E,IAAA,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAK;QAC3B,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC,CAAA;QACrD,WAAW,CAAC,MAAM,CAAC,CAAA;AACvB,KAAC,CAAC,CAAA;AACN;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/transform-value.mjs b/node_modules/motion-dom/dist/es/value/transform-value.mjs new file mode 100644 index 00000000..fd2c4e0e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/transform-value.mjs @@ -0,0 +1,36 @@ +import { collectMotionValues, motionValue } from './index.mjs'; +import { subscribeValue } from './subscribe-value.mjs'; + +/** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ +function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; +} + +export { transformValue }; +//# sourceMappingURL=transform-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/transform-value.mjs.map b/node_modules/motion-dom/dist/es/value/transform-value.mjs.map new file mode 100644 index 00000000..49ce454d --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/transform-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform-value.mjs","sources":["../../../src/value/transform-value.ts"],"sourcesContent":["import { MotionValue, collectMotionValues, motionValue } from \".\"\nimport { subscribeValue } from \"./subscribe-value\"\n\nexport type TransformInputRange = number[]\nexport type SingleTransformer = (input: I) => O\nexport type MultiTransformer = (input: I[]) => O\nexport type ValueTransformer =\n | SingleTransformer\n | MultiTransformer\n\n/**\n * Create a `MotionValue` that transforms the output of other `MotionValue`s by\n * passing their latest values through a transform function.\n *\n * Whenever a `MotionValue` referred to in the provided function is updated,\n * it will be re-evaluated.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = transformValue(() => x.get() * 2) // double x\n * ```\n *\n * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function transformValue(transform: () => O): MotionValue {\n const collectedValues: MotionValue[] = []\n\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * inside transform will be saved into this array.\n */\n collectMotionValues.current = collectedValues\n const initialValue = transform()\n collectMotionValues.current = undefined\n\n const value = motionValue(initialValue)\n\n subscribeValue(collectedValues, value, transform)\n\n return value\n}\n"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,cAAc,CAAI,SAAkB,EAAA;IAChD,MAAM,eAAe,GAAkB,EAAE,CAAA;AAEzC;;;AAGG;AACH,IAAA,mBAAmB,CAAC,OAAO,GAAG,eAAe,CAAA;AAC7C,IAAA,MAAM,YAAY,GAAG,SAAS,EAAE,CAAA;AAChC,IAAA,mBAAmB,CAAC,OAAO,GAAG,SAAS,CAAA;AAEvC,IAAA,MAAM,KAAK,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;AAEvC,IAAA,cAAc,CAAC,eAAe,EAAE,KAAK,EAAE,SAAS,CAAC,CAAA;AAEjD,IAAA,OAAO,KAAK,CAAA;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/auto.mjs b/node_modules/motion-dom/dist/es/value/types/auto.mjs new file mode 100644 index 00000000..b514b87c --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/auto.mjs @@ -0,0 +1,10 @@ +/** + * ValueType for "auto" + */ +const auto = { + test: (v) => v === "auto", + parse: (v) => v, +}; + +export { auto }; +//# sourceMappingURL=auto.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/auto.mjs.map b/node_modules/motion-dom/dist/es/value/types/auto.mjs.map new file mode 100644 index 00000000..9bf6d631 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/auto.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"auto.mjs","sources":["../../../../src/value/types/auto.ts"],"sourcesContent":["import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n"],"names":[],"mappings":"AAEA;;AAEG;AACU,MAAA,IAAI,GAAc;IAC3B,IAAI,EAAE,CAAC,CAAM,KAAK,CAAC,KAAK,MAAM;AAC9B,IAAA,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs new file mode 100644 index 00000000..1ec7840b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs @@ -0,0 +1,41 @@ +import { rgba } from './rgba.mjs'; +import { isColorString } from './utils.mjs'; + +function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; +} +const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, +}; + +export { hex }; +//# sourceMappingURL=hex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map new file mode 100644 index 00000000..8e4606e8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hex.mjs","sources":["../../../../../src/value/types/color/hex.ts"],"sourcesContent":["import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,QAAQ,CAAC,CAAS,EAAA;IACvB,IAAI,CAAC,GAAG,EAAE,CAAA;IACV,IAAI,CAAC,GAAG,EAAE,CAAA;IACV,IAAI,CAAC,GAAG,EAAE,CAAA;IACV,IAAI,CAAC,GAAG,EAAE,CAAA;;AAGV,IAAA,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QAC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node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs new file mode 100644 index 00000000..75a4e520 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs @@ -0,0 +1,43 @@ +// Adapted from https://gist.github.com/mjackson/5311256 +function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; +} +function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; +} + +export { hslaToRgba }; +//# sourceMappingURL=hsla-to-rgba.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map new file mode 100644 index 00000000..d9d61702 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hsla-to-rgba.mjs","sources":["../../../../../src/value/types/color/hsla-to-rgba.ts"],"sourcesContent":["import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n"],"names":[],"mappings":"AAEA;AACA,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;IAC7C,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,CAAC,CAAA;IACjB,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,CAAC,CAAA;AACjB,IAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACzC,IAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,CAAC,CAAA;AACvB,IAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAAE,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AACnD,IAAA,OAAO,CAAC,CAAA;AACZ,CAAC;AAEK,SAAU,UAAU,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAQ,EAAA;IAClE,GAAG,IAAI,GAAG,CAAA;IACV,UAAU,IAAI,GAAG,CAAA;IACjB,SAAS,IAAI,GAAG,CAAA;IAEhB,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,IAAI,GAAG,CAAC,CAAA;IAEZ,IAAI,CAAC,UAAU,EAAE;AACb,QAAA,GAAG,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAA;KACjC;SAAM;AACH,QAAA,MAAM,CAAC,GACH,SAAS,GAAG,GAAG;AACX,cAAE,SAAS,IAAI,CAAC,GAAG,UAAU,CAAC;cAC5B,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAA;AACzD,QAAA,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC,CAAA;AAE3B,QAAA,GAAG,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACjC,KAAK,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;AAC3B,QAAA,IAAI,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;KACrC;IAED,OAAO;QACH,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;QAC9B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;QAC5B,KAAK;KACR,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs new file mode 100644 index 00000000..d83ac527 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs @@ -0,0 +1,23 @@ +import { alpha } from '../numbers/index.mjs'; +import { percent } from '../numbers/units.mjs'; +import { sanitize } from '../utils/sanitize.mjs'; +import { isColorString, splitColor } from './utils.mjs'; + +const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, +}; + +export { hsla }; +//# sourceMappingURL=hsla.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map new file mode 100644 index 00000000..8a641423 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"hsla.mjs","sources":["../../../../../src/value/types/color/hsla.ts"],"sourcesContent":["import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n"],"names":["alpha","alphaType"],"mappings":";;;;;AAMa,MAAA,IAAI,GAAG;IAChB,IAAI,gBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,KAAK,gBAAgB,UAAU,CAAO,KAAK,EAAE,YAAY,EAAE,WAAW,CAAC;AACvE,IAAA,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,SAAEA,OAAK,GAAG,CAAC,EAAQ,KAAI;AAC3D,QAAA,QACI,OAAO;AACP,YAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACf,IAAI;AACJ,YAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACvC,IAAI;AACJ,YAAA,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACtC,IAAI;AACJ,YAAA,QAAQ,CAACC,KAAS,CAAC,SAAS,CAACD,OAAK,CAAC,CAAC;AACpC,YAAA,GAAG,EACN;KACJ;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/index.mjs b/node_modules/motion-dom/dist/es/value/types/color/index.mjs new file mode 100644 index 00000000..8de642b9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/index.mjs @@ -0,0 +1,33 @@ +import { hex } from './hex.mjs'; +import { hsla } from './hsla.mjs'; +import { rgba } from './rgba.mjs'; + +const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, +}; + +export { color }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map new file mode 100644 index 00000000..e6dc83c2 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/color/index.ts"],"sourcesContent":["import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n"],"names":[],"mappings":";;;;AAKa,MAAA,KAAK,GAAG;IACjB,IAAI,EAAE,CAAC,CAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7D,IAAA,KAAK,EAAE,CAAC,CAAM,KAAiB;AAC3B,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACd,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACvB;AAAM,aAAA,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACrB,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACvB;aAAM;AACH,YAAA,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACtB;KACJ;AACD,IAAA,SAAS,EAAE,CAAC,CAAuB,KAAI;QACnC,OAAO,OAAO,CAAC,KAAK,QAAQ;AACxB,cAAE,CAAC;AACH,cAAE,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;AACzB,kBAAE,IAAI,CAAC,SAAS,CAAC,CAAS,CAAC;AAC3B,kBAAE,IAAI,CAAC,SAAS,CAAC,CAAS,CAAC,CAAA;KAClC;AACD,IAAA,iBAAiB,EAAE,CAAC,CAAS,KAAI;QAC7B,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC7B,QAAA,MAAM,CAAC,KAAK,GAAG,CAAC,CAAA;AAChB,QAAA,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;KACjC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs new file mode 100644 index 00000000..26dc1f7a --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs @@ -0,0 +1,26 @@ +import { clamp } from 'motion-utils'; +import { number, alpha } from '../numbers/index.mjs'; +import { sanitize } from '../utils/sanitize.mjs'; +import { isColorString, splitColor } from './utils.mjs'; + +const clampRgbUnit = (v) => clamp(0, 255, v); +const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), +}; +const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", +}; + +export { rgbUnit, rgba }; +//# sourceMappingURL=rgba.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map new file mode 100644 index 00000000..50fdc021 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"rgba.mjs","sources":["../../../../../src/value/types/color/rgba.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n"],"names":["alpha","alphaType"],"mappings":";;;;;AAMA,MAAM,YAAY,GAAG,CAAC,CAAS,KAAK,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;AACvC,MAAA,OAAO,GAAG;AACnB,IAAA,GAAG,MAAM;AACT,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;EACxD;AAEY,MAAA,IAAI,GAAG;IAChB,IAAI,gBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,KAAK,gBAAgB,UAAU,CAAO,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC;AAC7D,IAAA,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,SAAEA,OAAK,GAAG,CAAC,EAAQ,KAC7C,OAAO;AACP,QAAA,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC;QACtB,IAAI;AACJ,QAAA,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;QACxB,IAAI;AACJ,QAAA,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACvB,IAAI;AACJ,QAAA,QAAQ,CAACC,KAAS,CAAC,SAAS,CAACD,OAAK,CAAC,CAAC;QACpC,GAAG;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs new file mode 100644 index 00000000..cc4bd124 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs @@ -0,0 +1,30 @@ +import { floatRegex } from '../utils/float-regex.mjs'; +import { isNullish } from '../utils/is-nullish.mjs'; +import { singleColorRegex } from '../utils/single-color-regex.mjs'; + +/** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ +const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); +}; +const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; +}; + +export { isColorString, splitColor }; +//# sourceMappingURL=utils.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map new file mode 100644 index 00000000..e93d8c95 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/color/utils.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.mjs","sources":["../../../../../src/value/types/color/utils.ts"],"sourcesContent":["import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n (aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n"],"names":[],"mappings":";;;;AAKA;;;AAGG;AACI,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,QAAiB,KAAK,CAAC,CAAM,KAAI;AACzE,IAAA,OAAO,OAAO,CACV,CAAC,OAAO,CAAC,KAAK,QAAQ;AAClB,QAAA,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB,QAAA,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;AAClB,SAAC,QAAQ;YACL,CAAC,SAAS,CAAC,CAAC,CAAC;AACb,YAAA,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAC7D,CAAA;AACL,EAAC;AAEY,MAAA,UAAU,GACnB,CAAwB,KAAa,EAAE,KAAa,EAAE,KAAa,KACnE,CAAC,CAAiB,KAAO;IACrB,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAQ,CAAA;AAE1C,IAAA,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAQ,CAAA;IAEnD,OAAO;AACH,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC;AACtB,QAAA,KAAK,EAAE,KAAK,KAAK,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;KAChD,CAAA;AACV;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs new file mode 100644 index 00000000..c0237bc0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs @@ -0,0 +1,31 @@ +import { complex } from './index.mjs'; +import { floatRegex } from '../utils/float-regex.mjs'; + +/** + * Properties that should default to 1 or 100% + */ +const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); +function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; +} +const functionRegex = /\b([a-z-]*)\(.*?\)/gu; +const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, +}; + +export { filter }; +//# sourceMappingURL=filter.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map new file mode 100644 index 00000000..24d52f98 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/filter.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"filter.mjs","sources":["../../../../../src/value/types/complex/filter.ts"],"sourcesContent":["import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions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of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs new file mode 100644 index 00000000..658020a3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs @@ -0,0 +1,92 @@ +import { color } from '../color/index.mjs'; +import { colorRegex } from '../utils/color-regex.mjs'; +import { floatRegex } from '../utils/float-regex.mjs'; +import { sanitize } from '../utils/sanitize.mjs'; + +function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); +} +const NUMBER_TOKEN = "number"; +const COLOR_TOKEN = "color"; +const VAR_TOKEN = "var"; +const VAR_FUNCTION_TOKEN = "var("; +const SPLIT_TOKEN = "${}"; +// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` +const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; +function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; +} +function parseComplexValue(v) { + return analyseComplexValue(v).values; +} +function createTransformer(source) { + const { split, types } = analyseComplexValue(source); + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; +} +const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; +function getAnimatableNone(v) { + const parsed = parseComplexValue(v); + const transformer = createTransformer(v); + return transformer(parsed.map(convertNumbersToZero)); +} +const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone, +}; + +export { analyseComplexValue, complex }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map new file mode 100644 index 00000000..b70d14ce --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/complex/index.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n const { split, types } = analyseComplexValue(source)\n\n const numSections = split.length\n return (v: Array) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const parsed = parseComplexValue(v)\n const transformer = createTransformer(v)\n return transformer(parsed.map(convertNumbersToZero))\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n"],"names":[],"mappings":";;;;;AAQA,SAAS,IAAI,CAAC,CAAM,EAAA;AAChB,IAAA,QACI,KAAK,CAAC,CAAC,CAAC;QACR,OAAO,CAAC,KAAK,QAAQ;QACrB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;aAC5B,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;AAClC,YAAA,CAAC,EACR;AACL,CAAC;AAED,MAAM,YAAY,GAAG,QAAQ,CAAA;AAC7B,MAAM,WAAW,GAAG,OAAO,CAAA;AAC3B,MAAM,SAAS,GAAG,KAAK,CAAA;AACvB,MAAM,kBAAkB,GAAG,MAAM,CAAA;AACjC,MAAM,WAAW,GAAG,KAAK,CAAA;AAmBzB;AACA,MAAM,YAAY,GACd,iOAAiO,CAAA;AAE/N,SAAU,mBAAmB,CAC/B,KAA0B,EAAA;AAE1B,IAAA,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;IAEtC,MAAM,MAAM,GAAkB,EAAE,CAAA;AAChC,IAAA,MAAM,OAAO,GAAiB;AAC1B,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,GAAG,EAAE,EAAE;KACV,CAAA;IACD,MAAM,KAAK,GAA8B,EAAE,CAAA;IAE3C,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,M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AAEY,MAAA,OAAO,GAAG;IACnB,IAAI;AACJ,IAAA,KAAK,EAAE,iBAAiB;IACxB,iBAAiB;IACjB,iBAAiB;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs new file mode 100644 index 00000000..2a3bb778 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs @@ -0,0 +1,13 @@ +import { complex } from './index.mjs'; + +const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, +}; + +export { mask }; +//# sourceMappingURL=mask.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map new file mode 100644 index 00000000..7b02a977 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/complex/mask.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mask.mjs","sources":["../../../../../src/value/types/complex/mask.ts"],"sourcesContent":["import { complex } from \".\"\nimport { AnyResolvedKeyframe } from \"../../../animation/types\"\n\nexport const mask = {\n ...complex,\n getAnimatableNone: (v: AnyResolvedKeyframe) => {\n const parsed = complex.parse(v)\n const transformer = complex.createTransformer(v)\n return transformer(\n parsed.map((v) =>\n typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v\n )\n )\n },\n}\n"],"names":[],"mappings":";;AAGa,MAAA,IAAI,GAAG;AAChB,IAAA,GAAG,OAAO;AACV,IAAA,iBAAiB,EAAE,CAAC,CAAsB,KAAI;QAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAA;AAChD,QAAA,OAAO,WAAW,CACd,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KACT,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,QAAQ,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAC7E,CACJ,CAAA;KACJ;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs new file mode 100644 index 00000000..de400475 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs @@ -0,0 +1,16 @@ +import { auto } from './auto.mjs'; +import { number } from './numbers/index.mjs'; +import { px, percent, degrees, vw, vh } from './numbers/units.mjs'; +import { testValueType } from './test.mjs'; + +/** + * A list of value types commonly used for dimensions + */ +const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; +/** + * Tests a dimensional value against the list of dimension ValueTypes + */ +const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + +export { dimensionValueTypes, findDimensionValueType }; +//# sourceMappingURL=dimensions.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map new file mode 100644 index 00000000..8b25a6c8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/dimensions.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"dimensions.mjs","sources":["../../../../src/value/types/dimensions.ts"],"sourcesContent":["import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;AACU,MAAA,mBAAmB,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAC;AAE/E;;AAEG;AACU,MAAA,sBAAsB,GAAG,CAAC,CAAM,KACzC,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/int.mjs b/node_modules/motion-dom/dist/es/value/types/int.mjs new file mode 100644 index 00000000..065c6adc --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/int.mjs @@ -0,0 +1,9 @@ +import { number } from './numbers/index.mjs'; + +const int = { + ...number, + transform: Math.round, +}; + +export { int }; +//# sourceMappingURL=int.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/int.mjs.map b/node_modules/motion-dom/dist/es/value/types/int.mjs.map new file mode 100644 index 00000000..68554e06 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/int.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"int.mjs","sources":["../../../../src/value/types/int.ts"],"sourcesContent":["import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n"],"names":[],"mappings":";;AAEa,MAAA,GAAG,GAAG;AACf,IAAA,GAAG,MAAM;IACT,SAAS,EAAE,IAAI,CAAC,KAAK;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs new file mode 100644 index 00000000..ebca7428 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs @@ -0,0 +1,34 @@ +import { color } from '../color/index.mjs'; +import { filter } from '../complex/filter.mjs'; +import { mask } from '../complex/mask.mjs'; +import { numberValueTypes } from './number.mjs'; + +/** + * A map of default value types for common values + */ +const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, +}; +/** + * Gets the default ValueType for the provided value key + */ +const getDefaultValueType = (key) => defaultValueTypes[key]; + +export { defaultValueTypes, getDefaultValueType }; +//# sourceMappingURL=defaults.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map new file mode 100644 index 00000000..96157a75 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"defaults.mjs","sources":["../../../../../src/value/types/maps/defaults.ts"],"sourcesContent":["import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n"],"names":[],"mappings":";;;;;AAMA;;AAEG;AACU,MAAA,iBAAiB,GAAiB;AAC3C,IAAA,GAAG,gBAAgB;;IAGnB,KAAK;AACL,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,IAAI,EAAE,KAAK;AACX,IAAA,MAAM,EAAE,KAAK;;AAGb,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,gBAAgB,EAAE,KAAK;AACvB,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,eAAe,EAAE,KAAK;IACtB,MAAM;AACN,IAAA,YAAY,EAAE,MAAM;IACpB,IAAI;AACJ,IAAA,UAAU,EAAE,IAAI;EACnB;AAED;;AAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,GAAW,KAAK,iBAAiB,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs new file mode 100644 index 00000000..e3ee5a22 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs @@ -0,0 +1,71 @@ +import { int } from '../int.mjs'; +import { alpha } from '../numbers/index.mjs'; +import { px } from '../numbers/units.mjs'; +import { transformValueTypes } from './transform.mjs'; + +const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, +}; + +export { numberValueTypes }; +//# sourceMappingURL=number.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map new file mode 100644 index 00000000..0a45699f --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/number.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"number.mjs","sources":["../../../../../src/value/types/maps/number.ts"],"sourcesContent":["import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n"],"names":[],"mappings":";;;;;AAMa,MAAA,gBAAgB,GAAiB;;AAE1C,IAAA,WAAW,EAAE,EAAE;AACf,IAAA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;AACf,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,iBAAiB,EAAE,EAAE;AACrB,IAAA,eAAe,EAAE,EAAE;;AAGnB,IAAA,QAAQ,EAAE,EAAE;;AAGZ,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,mBAAmB,EAAE,EAAE;AAEvB,IAAA,GAAG,mBAAmB;AACtB,IAAA,MAAM,EAAE,GAAG;;AAGX,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,UAAU,EAAE,GAAG;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs new file mode 100644 index 00000000..e2904472 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs @@ -0,0 +1,32 @@ +import { scale, alpha } from '../numbers/index.mjs'; +import { degrees, px, progressPercentage } from '../numbers/units.mjs'; + +const transformValueTypes = { + rotate: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, +}; + +export { transformValueTypes }; +//# sourceMappingURL=transform.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map new file mode 100644 index 00000000..0b225f30 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/maps/transform.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.mjs","sources":["../../../../../src/value/types/maps/transform.ts"],"sourcesContent":["import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,mBAAmB,GAAiB;AAC7C,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,OAAO,EAAE,OAAO;IAChB,KAAK;AACL,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,oBAAoB,EAAE,EAAE;AACxB,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,OAAO,EAAE,EAAE;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs new file mode 100644 index 00000000..96393054 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs @@ -0,0 +1,18 @@ +import { clamp } from 'motion-utils'; + +const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, +}; +const alpha = { + ...number, + transform: (v) => clamp(0, 1, v), +}; +const scale = { + ...number, + default: 1, +}; + +export { alpha, number, scale }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map new file mode 100644 index 00000000..6b9b7cd5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../../../src/value/types/numbers/index.ts"],"sourcesContent":["import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n"],"names":[],"mappings":";;AAEa,MAAA,MAAM,GAAG;IAClB,IAAI,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,KAAK,QAAQ;AAC1C,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,CAAC;EAC9B;AAEY,MAAA,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EAC3C;AAEY,MAAA,KAAK,GAAG;AACjB,IAAA,GAAG,MAAM;AACT,IAAA,OAAO,EAAE,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs new file mode 100644 index 00000000..5f592384 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs @@ -0,0 +1,19 @@ +/*#__NO_SIDE_EFFECTS__*/ +const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, +}); +const degrees = /*@__PURE__*/ createUnitType("deg"); +const percent = /*@__PURE__*/ createUnitType("%"); +const px = /*@__PURE__*/ createUnitType("px"); +const vh = /*@__PURE__*/ createUnitType("vh"); +const vw = /*@__PURE__*/ createUnitType("vw"); +const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), +}))(); + +export { degrees, percent, progressPercentage, px, vh, vw }; +//# sourceMappingURL=units.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map new file mode 100644 index 00000000..c9dfd48e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/numbers/units.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"units.mjs","sources":["../../../../../src/value/types/numbers/units.ts"],"sourcesContent":["import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n"],"names":[],"mappings":"AAEA;AACA,MAAM,cAAc,GAAG,CAAC,IAAY,MAAM;IACtC,IAAI,EAAE,CAAC,CAAsB,KACzB,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC;AAC1E,IAAA,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,CAAC,CAAkB,KAAK,CAAG,EAAA,CAAC,CAAG,EAAA,IAAI,CAAE,CAAA;AACnD,CAAA,CAAC,CAAA;AAEW,MAAA,OAAO,iBAAiB,cAAc,CAAC,KAAK,EAAC;AAC7C,MAAA,OAAO,iBAAiB,cAAc,CAAC,GAAG,EAAC;AAC3C,MAAA,EAAE,iBAAiB,cAAc,CAAC,IAAI,EAAC;AACvC,MAAA,EAAE,iBAAiB,cAAc,CAAC,IAAI,EAAC;AACvC,MAAA,EAAE,iBAAiB,cAAc,CAAC,IAAI,EAAC;AAEvC,MAAA,kBAAkB,iBAAiB,CAAC,OAAO;AACpD,IAAA,GAAG,OAAO;AACV,IAAA,KAAK,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG;AAC5C,IAAA,SAAS,EAAE,CAAC,CAAS,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC;CACvD,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/test.mjs b/node_modules/motion-dom/dist/es/value/types/test.mjs new file mode 100644 index 00000000..26cb26e3 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/test.mjs @@ -0,0 +1,7 @@ +/** + * Tests a provided value against a ValueType + */ +const testValueType = (v) => (type) => type.test(v); + +export { testValueType }; +//# sourceMappingURL=test.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/test.mjs.map b/node_modules/motion-dom/dist/es/value/types/test.mjs.map new file mode 100644 index 00000000..b0ecce07 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/test.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"test.mjs","sources":["../../../../src/value/types/test.ts"],"sourcesContent":["import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n"],"names":[],"mappings":"AAEA;;AAEG;MACU,aAAa,GAAG,CAAC,CAAM,KAAK,CAAC,IAAe,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs new file mode 100644 index 00000000..c4efbc2a --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs @@ -0,0 +1,18 @@ +import { complex } from '../complex/index.mjs'; +import { filter } from '../complex/filter.mjs'; +import { mask } from '../complex/mask.mjs'; +import { getDefaultValueType } from '../maps/defaults.mjs'; + +const customTypes = /*@__PURE__*/ new Set([filter, mask]); +function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; +} + +export { getAnimatableNone }; +//# sourceMappingURL=animatable-none.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map new file mode 100644 index 00000000..3bce3914 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"animatable-none.mjs","sources":["../../../../../src/value/types/utils/animatable-none.ts"],"sourcesContent":["import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask])\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (!customTypes.has(defaultValueType as any)) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n"],"names":[],"mappings":";;;;;AAKA,MAAM,WAAW,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AAEzC,SAAA,iBAAiB,CAAC,GAAW,EAAE,KAAa,EAAA;AACxD,IAAA,IAAI,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAA;AAC/C,IAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,gBAAuB,CAAC;QAAE,gBAAgB,GAAG,OAAO,CAAA;;IAEzE,OAAO,gBAAgB,CAAC,iBAAiB;AACrC,UAAE,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC;UACzC,SAAS,CAAA;AACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs new file mode 100644 index 00000000..645be1e6 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs @@ -0,0 +1,4 @@ +const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + +export { colorRegex }; +//# sourceMappingURL=color-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map new file mode 100644 index 00000000..fcfdf787 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"color-regex.mjs","sources":["../../../../../src/value/types/utils/color-regex.ts"],"sourcesContent":["export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GACnB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs new file mode 100644 index 00000000..aac4531b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs @@ -0,0 +1,16 @@ +import { color } from '../color/index.mjs'; +import { complex } from '../complex/index.mjs'; +import { dimensionValueTypes } from '../dimensions.mjs'; +import { testValueType } from '../test.mjs'; + +/** + * A list of all ValueTypes + */ +const valueTypes = [...dimensionValueTypes, color, complex]; +/** + * Tests a value against the list of ValueTypes + */ +const findValueType = (v) => valueTypes.find(testValueType(v)); + +export { findValueType }; +//# sourceMappingURL=find.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map new file mode 100644 index 00000000..d6bdcd9b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/find.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"find.mjs","sources":["../../../../../src/value/types/utils/find.ts"],"sourcesContent":["import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n"],"names":[],"mappings":";;;;;AAKA;;AAEG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AAE3D;;AAEG;AACU,MAAA,aAAa,GAAG,CAAC,CAAM,KAAK,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs new file mode 100644 index 00000000..2e1cd7da --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs @@ -0,0 +1,4 @@ +const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + +export { floatRegex }; +//# sourceMappingURL=float-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map new file mode 100644 index 00000000..76a6c87c --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"float-regex.mjs","sources":["../../../../../src/value/types/utils/float-regex.ts"],"sourcesContent":["export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n"],"names":[],"mappings":"AAAO,MAAM,UAAU,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs new file mode 100644 index 00000000..768d5667 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs @@ -0,0 +1,11 @@ +/** + * Provided a value and a ValueType, returns the value as that value type. + */ +const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; +}; + +export { getValueAsType }; +//# sourceMappingURL=get-as-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map new file mode 100644 index 00000000..b0fcd219 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-as-type.mjs","sources":["../../../../../src/value/types/utils/get-as-type.ts"],"sourcesContent":["import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n"],"names":[],"mappings":"AAEA;;AAEG;MACU,cAAc,GAAG,CAAC,KAAU,EAAE,IAAgB,KAAI;AAC3D,IAAA,OAAO,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;AACpC,UAAG,IAAY,CAAC,SAAS,CAAC,KAAK,CAAC;UAC9B,KAAK,CAAA;AACf;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs new file mode 100644 index 00000000..28ccf2f0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs @@ -0,0 +1,6 @@ +function isNullish(v) { + return v == null; +} + +export { isNullish }; +//# sourceMappingURL=is-nullish.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map new file mode 100644 index 00000000..e47c0761 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-nullish.mjs","sources":["../../../../../src/value/types/utils/is-nullish.ts"],"sourcesContent":["export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n"],"names":[],"mappings":"AAAM,SAAU,SAAS,CAAC,CAAM,EAAA;IAC5B,OAAO,CAAC,IAAI,IAAI,CAAA;AACpB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs new file mode 100644 index 00000000..8285b23b --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs @@ -0,0 +1,6 @@ +// If this number is a decimal, make it just five decimal places +// to avoid exponents +const sanitize = (v) => Math.round(v * 100000) / 100000; + +export { sanitize }; +//# sourceMappingURL=sanitize.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map new file mode 100644 index 00000000..b63c0ac0 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sanitize.mjs","sources":["../../../../../src/value/types/utils/sanitize.ts"],"sourcesContent":["// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n"],"names":[],"mappings":"AAAA;AACA;AACa,MAAA,QAAQ,GAAG,CAAC,CAAS,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs new file mode 100644 index 00000000..cf67f20a --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs @@ -0,0 +1,4 @@ +const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + +export { singleColorRegex }; +//# sourceMappingURL=single-color-regex.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map new file mode 100644 index 00000000..706651bc --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"single-color-regex.mjs","sources":["../../../../../src/value/types/utils/single-color-regex.ts"],"sourcesContent":["export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n"],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GACzB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs new file mode 100644 index 00000000..ae80d222 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs @@ -0,0 +1,4 @@ +const isMotionValue = (value) => Boolean(value && value.getVelocity); + +export { isMotionValue }; +//# sourceMappingURL=is-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map new file mode 100644 index 00000000..e1458293 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-motion-value.mjs","sources":["../../../../src/value/utils/is-motion-value.ts"],"sourcesContent":["import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n"],"names":[],"mappings":"AAEa,MAAA,aAAa,GAAG,CAAC,KAAU,KACpC,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs new file mode 100644 index 00000000..72614b6e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs @@ -0,0 +1,11 @@ +import { isMotionValue } from './is-motion-value.mjs'; + +/** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ +function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; +} + +export { resolveMotionValue }; +//# sourceMappingURL=resolve-motion-value.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map new file mode 100644 index 00000000..39f3c312 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-motion-value.mjs","sources":["../../../../src/value/utils/resolve-motion-value.ts"],"sourcesContent":["import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isMotionValue } from \"./is-motion-value\"\nimport type { MotionValue } from \"../index\"\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nexport function resolveMotionValue(\n value?: AnyResolvedKeyframe | MotionValue\n): AnyResolvedKeyframe {\n return isMotionValue(value) ? value.get() : value\n}\n"],"names":[],"mappings":";;AAIA;;AAEG;AACG,SAAU,kBAAkB,CAC9B,KAAyC,EAAA;AAEzC,IAAA,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAA;AACrD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs new file mode 100644 index 00000000..6c9ab79e --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs @@ -0,0 +1,21 @@ +import { MotionGlobalConfig } from 'motion-utils'; +import { isWillChangeMotionValue } from './is.mjs'; + +function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && MotionGlobalConfig.WillChange) { + const newWillChange = new MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } +} + +export { addValueToWillChange }; +//# sourceMappingURL=add-will-change.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map new file mode 100644 index 00000000..94b82eb8 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/add-will-change.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"add-will-change.mjs","sources":["../../../../src/value/will-change/add-will-change.ts"],"sourcesContent":["import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n"],"names":[],"mappings":";;;AAIgB,SAAA,oBAAoB,CAChC,aAA4B,EAC5B,GAAW,EAAA;IAEX,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;AAEvD;;;AAGG;AACH,IAAA,IAAI,uBAAuB,CAAC,UAAU,CAAC,EAAE;AACrC,QAAA,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;KAC7B;AAAM,SAAA,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,UAAU,EAAE;QACrD,MAAM,aAAa,GAAG,IAAI,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;AAE/D,QAAA,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;AACnD,QAAA,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;KACzB;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/value/will-change/is.mjs b/node_modules/motion-dom/dist/es/value/will-change/is.mjs new file mode 100644 index 00000000..b36be11f --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/is.mjs @@ -0,0 +1,8 @@ +import { isMotionValue } from '../utils/is-motion-value.mjs'; + +function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); +} + +export { isWillChangeMotionValue }; +//# sourceMappingURL=is.mjs.map diff --git a/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map b/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map new file mode 100644 index 00000000..89fab779 --- /dev/null +++ b/node_modules/motion-dom/dist/es/value/will-change/is.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is.mjs","sources":["../../../../src/value/will-change/is.ts"],"sourcesContent":["import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n"],"names":[],"mappings":";;AAGM,SAAU,uBAAuB,CAAC,KAAU,EAAA;IAC9C,OAAO,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAK,KAAoB,CAAC,GAAG,CAAC,CAAA;AACrE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/index.mjs b/node_modules/motion-dom/dist/es/view/index.mjs new file mode 100644 index 00000000..571627b9 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/index.mjs @@ -0,0 +1,65 @@ +import { noop } from 'motion-utils'; +import { addToQueue } from './queue.mjs'; + +class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + this.notifyReady = noop; + this.readyPromise = new Promise((resolve) => { + this.notifyReady = resolve; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + addToQueue(this); + } + get(subject) { + this.currentSubject = subject; + return this; + } + layout(keyframes, options) { + this.updateTarget("layout", keyframes, options); + return this; + } + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + crossfade(options) { + this.updateTarget("enter", { opacity: 1 }, options); + this.updateTarget("exit", { opacity: 0 }, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } +} +function animateView(update, defaultOptions = {}) { + return new ViewTransitionBuilder(update, defaultOptions); +} + +export { ViewTransitionBuilder, animateView }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/index.mjs.map b/node_modules/motion-dom/dist/es/view/index.mjs.map new file mode 100644 index 00000000..0aaf4b4b --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../../../src/view/index.ts"],"sourcesContent":["import { noop } from \"motion-utils\"\nimport type { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { AnimationOptions, DOMKeyframesDefinition } from \"../animation/types\"\nimport { addToQueue } from \"./queue\"\nimport {\n ViewTransitionOptions,\n ViewTransitionTarget,\n ViewTransitionTargetDefinition,\n} from \"./types\"\nimport \"./types.global\"\n\nexport class ViewTransitionBuilder {\n private currentSubject: ViewTransitionTargetDefinition = \"root\"\n\n targets = new Map()\n\n update: () => void | Promise\n\n options: ViewTransitionOptions\n\n notifyReady: (value: GroupAnimation) => void = noop\n\n private readyPromise = new Promise((resolve) => {\n this.notifyReady = resolve\n })\n\n constructor(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n ) {\n this.update = update\n this.options = {\n interrupt: \"wait\",\n ...options,\n }\n addToQueue(this)\n }\n\n get(subject: ViewTransitionTargetDefinition) {\n this.currentSubject = subject\n\n return this\n }\n\n layout(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"layout\", keyframes, options)\n\n return this\n }\n\n new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"new\", keyframes, options)\n\n return this\n }\n\n old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"old\", keyframes, options)\n\n return this\n }\n\n enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"enter\", keyframes, options)\n\n return this\n }\n\n exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"exit\", keyframes, options)\n\n return this\n }\n\n crossfade(options?: AnimationOptions) {\n this.updateTarget(\"enter\", { opacity: 1 }, options)\n this.updateTarget(\"exit\", { opacity: 0 }, options)\n\n return this\n }\n\n updateTarget(\n target: \"enter\" | \"exit\" | \"layout\" | \"new\" | \"old\",\n keyframes: DOMKeyframesDefinition,\n options: AnimationOptions = {}\n ) {\n const { currentSubject, targets } = this\n\n if (!targets.has(currentSubject)) {\n targets.set(currentSubject, {})\n }\n\n const targetData = targets.get(currentSubject)!\n\n targetData[target] = { keyframes, options }\n }\n\n then(resolve: () => void, reject?: () => void) {\n return this.readyPromise.then(resolve, reject)\n }\n}\n\nexport function animateView(\n update: () => void | Promise,\n defaultOptions: ViewTransitionOptions = {}\n) {\n return new ViewTransitionBuilder(update, defaultOptions)\n}\n"],"names":[],"mappings":";;;MAWa,qBAAqB,CAAA;IAe9B,WACI,CAAA,MAAkC,EAClC,OAAA,GAAiC,EAAE,EAAA;QAhB/B,IAAc,CAAA,cAAA,GAAmC,MAAM,CAAA;AAE/D,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,GAAG,EAAwD,CAAA;QAMzE,IAAW,CAAA,WAAA,GAAoC,IAAI,CAAA;AAE3C,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,O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AAY,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;AACnD,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;AAElD,QAAA,OAAO,IAAI,CAAA;KACd;AAED,IAAA,YAAY,CACR,MAAmD,EACnD,SAAiC,EACjC,UAA4B,EAAE,EAAA;AAE9B,QAAA,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;QAExC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AAC9B,YAAA,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;SAClC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAE,CAAA;QAE/C,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;KAC9C;IAED,IAAI,CAAC,OAAmB,EAAE,MAAmB,EAAA;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;KACjD;AACJ,CAAA;SAEe,WAAW,CACvB,MAAkC,EAClC,iBAAwC,EAAE,EAAA;AAE1C,IAAA,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAC5D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/queue.mjs b/node_modules/motion-dom/dist/es/view/queue.mjs new file mode 100644 index 00000000..9bde208e --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/queue.mjs @@ -0,0 +1,53 @@ +import { removeItem } from 'motion-utils'; +import { microtask } from '../frameloop/microtask.mjs'; +import { startViewAnimation } from './start.mjs'; + +let builders = []; +let current = null; +function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); +} +function start(builder) { + removeItem(builders, builder); + current = builder; + startViewAnimation(builder).then((animation) => { + builder.notifyReady(animation); + animation.finished.finally(next); + }); +} +function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } +} +function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); +} + +export { addToQueue }; +//# sourceMappingURL=queue.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/queue.mjs.map b/node_modules/motion-dom/dist/es/view/queue.mjs.map new file mode 100644 index 00000000..ded22cb7 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/queue.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"queue.mjs","sources":["../../../src/view/queue.ts"],"sourcesContent":["import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder).then((animation) => {\n builder.notifyReady(animation)\n animation.finished.finally(next)\n })\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n"],"names":[],"mappings":";;;;AAKA,IAAI,QAAQ,GAA4B,EAAE,CAAA;AAE1C,IAAI,OAAO,GAAiC,IAAI,CAAA;AAEhD,SAAS,IAAI,GAAA;IACT,OAAO,GAAG,IAAI,CAAA;AACd,IAAA,MAAM,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAA;AAC9B,IAAA,IAAI,WAAW;QAAE,KAAK,CAAC,WAAW,CAAC,CAAA;AACvC,CAAC;AAED,SAAS,KAAK,CAAC,OAA8B,EAAA;AACzC,IAAA,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,GAAG,OAAO,CAAA;IACjB,kBAAkB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,KAAI;AAC3C,QAAA,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;AAC9B,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACpC,KAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,YAAY,GAAA;AACjB;;;;;;AAMG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC3B,QAAA,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,OAAO,CAAA;AAErC,QAAA,IAAI,SAAS,KAAK,WAAW,EAAE;YAC3B,MAAM,cAAc,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;YACpE,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;AAEvC,YAAA,OAAO,CAAC,MAAM,GAAG,MAAK;gBAClB,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC,CAAA;AAChD,aAAC,CAAA;;AAGD,YAAA,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAA;YAElC,MAAK;SACR;KACJ;AAED,IAAA,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,WAAW,EAAE;AAC5D,QAAA,IAAI,EAAE,CAAA;KACT;AACL,CAAC;AAEK,SAAU,UAAU,CAAC,OAA8B,EAAA;AACrD,IAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AACtB,IAAA,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;AAClC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/start.mjs b/node_modules/motion-dom/dist/es/view/start.mjs new file mode 100644 index 00000000..22666ffe --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/start.mjs @@ -0,0 +1,156 @@ +import { secondsToMilliseconds } from 'motion-utils'; +import { GroupAnimation } from '../animation/GroupAnimation.mjs'; +import { NativeAnimation } from '../animation/NativeAnimation.mjs'; +import { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs'; +import { getValueTransition } from '../animation/utils/get-value-transition.mjs'; +import { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs'; +import { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs'; +import { chooseLayerType } from './utils/choose-layer-type.mjs'; +import { css } from './utils/css.mjs'; +import { getViewAnimationLayerInfo } from './utils/get-layer-info.mjs'; +import { getViewAnimations } from './utils/get-view-animations.mjs'; +import { hasTarget } from './utils/has-target.mjs'; + +const definitionNames = ["layout", "enter", "exit", "new", "old"]; +function startViewAnimation(builder) { + const { update, targets, options: defaultOptions } = builder; + if (!document.startViewTransition) { + return new Promise(async (resolve) => { + await update(); + resolve(new GroupAnimation([])); + }); + } + // TODO: Go over existing targets and ensure they all have ids + /** + * If we don't have any animations defined for the root target, + * remove it from being captured. + */ + if (!hasTarget("root", targets)) { + css.set(":root", { + "view-transition-name": "none", + }); + } + /** + * Set the timing curve to linear for all view transition layers. + * This gets baked into the keyframes, which can't be changed + * without breaking the generated animation. + * + * This allows us to set easing via updateTiming - which can be changed. + */ + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + css.commit(); // Write + const transition = document.startViewTransition(async () => { + await update(); + // TODO: Go over new targets and ensure they all have ids + }); + transition.finished.finally(() => { + css.remove(); // Write + }); + return new Promise((resolve) => { + transition.ready.then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + */ + targets.forEach((definition, target) => { + // TODO: If target is not "root", resolve elements + // and iterate over each + for (const key of definitionNames) { + if (!definition[key]) + continue; + const { keyframes, options } = definition[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + if (!valueKeyframes) + continue; + const valueOptions = { + ...getValueTransition(defaultOptions, valueName), + ...getValueTransition(options, valueName), + }; + const type = chooseLayerType(key); + /** + * If this is an opacity animation, and keyframes are not an array, + * we need to convert them into an array and set an initial value. + */ + if (valueName === "opacity" && + !Array.isArray(valueKeyframes)) { + const initialValue = type === "new" ? 0 : 1; + valueKeyframes = [initialValue, valueKeyframes]; + } + /** + * Resolve stagger function if provided. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(0, 1); + } + valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay)); + const animation = new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${target})`, + keyframes: valueKeyframes, + }); + animations.push(animation); + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = targets.get(name.layer); + if (!targetDefinition) { + /** + * If transition name is group then update the timing of the animation + * whereas if it's old or new then we could possibly replace it using + * the above method. + */ + const transitionName = name.type === "group" ? "layout" : ""; + let animationTransition = { + ...getValueTransition(defaultOptions, transitionName), + }; + animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration); + effect.updateTiming({ + delay: secondsToMilliseconds(animationTransition.delay ?? 0), + duration: animationTransition.duration, + easing, + }); + animations.push(new NativeAnimationWrapper(animation)); + } + else if (hasOpacity(targetDefinition, "enter") && + hasOpacity(targetDefinition, "exit") && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + } + resolve(new GroupAnimation(animations)); + }); + }); +} +function hasOpacity(target, key) { + return target?.[key]?.keyframes.opacity; +} + +export { startViewAnimation }; +//# sourceMappingURL=start.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/start.mjs.map b/node_modules/motion-dom/dist/es/view/start.mjs.map new file mode 100644 index 00000000..3e15e192 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/start.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"start.mjs","sources":["../../../src/view/start.ts"],"sourcesContent":["import { secondsToMilliseconds } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget } from \"./types\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise {\n const { update, targets, options: defaultOptions } = builder\n\n if (!document.startViewTransition) {\n return new Promise(async (resolve) => {\n await update()\n resolve(new GroupAnimation([]))\n })\n }\n\n // TODO: Go over existing targets and ensure they all have ids\n\n /**\n * If we don't have any animations defined for the root target,\n * remove it from being captured.\n */\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", {\n \"view-transition-name\": \"none\",\n })\n }\n\n /**\n * Set the timing curve to linear for all view transition layers.\n * This gets baked into the keyframes, which can't be changed\n * without breaking the generated animation.\n *\n * This allows us to set easing via updateTiming - which can be changed.\n */\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n css.commit() // Write\n\n const transition = document.startViewTransition(async () => {\n await update()\n\n // TODO: Go over new targets and ensure they all have ids\n })\n\n transition.finished.finally(() => {\n css.remove() // Write\n })\n\n return new Promise((resolve) => {\n transition.ready.then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n */\n targets.forEach((definition, target) => {\n // TODO: If target is not \"root\", resolve elements\n // and iterate over each\n for (const key of definitionNames) {\n if (!definition[key]) continue\n const { keyframes, options } =\n definition[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n if (!valueKeyframes) continue\n\n const valueOptions = {\n ...getValueTransition(\n defaultOptions as any,\n valueName\n ),\n ...getValueTransition(options as any, valueName),\n }\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n\n /**\n * If this is an opacity animation, and keyframes are not an array,\n * we need to convert them into an array and set an initial value.\n */\n if (\n valueName === \"opacity\" &&\n !Array.isArray(valueKeyframes)\n ) {\n const initialValue = type === \"new\" ? 0 : 1\n valueKeyframes = [initialValue, valueKeyframes]\n }\n\n /**\n * Resolve stagger function if provided.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(0, 1)\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n const animation = new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${target})`,\n keyframes: valueKeyframes,\n })\n\n animations.push(animation)\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = targets.get(name.layer)\n\n if (!targetDefinition) {\n /**\n * If transition name is group then update the timing of the animation\n * whereas if it's old or new then we could possibly replace it using\n * the above method.\n */\n const transitionName = name.type === \"group\" ? \"layout\" : \"\"\n let animationTransition = {\n ...getValueTransition(defaultOptions, transitionName),\n }\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n const easing = mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string\n\n effect.updateTiming({\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration: animationTransition.duration,\n easing,\n })\n\n animations.push(new NativeAnimationWrapper(animation))\n } else if (\n hasOpacity(targetDefinition, \"enter\") &&\n hasOpacity(targetDefinition, \"exit\") &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n }\n\n resolve(new GroupAnimation(animations))\n })\n })\n}\n\nfunction hasOpacity(\n target: ViewTransitionTarget | undefined,\n key: \"enter\" | \"exit\" | \"layout\"\n) {\n return target?.[key]?.keyframes.opacity\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;AAEpE,SAAU,kBAAkB,CAC9B,OAA8B,EAAA;IAE9B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CAAA;AAE5D,IAAA,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE;AAC/B,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,OAAO,KAAI;YACjC,MAAM,MAAM,EAAE,CAAA;AACd,YAAA,OAAO,CAAC,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;AACnC,SAAC,CAAC,CAAA;KACL;;AAID;;;AAGG;IACH,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE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AS,CAAC,CAAC,CAAA;iBACzD;AAAM,qBAAA,IACH,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC;AACrC,oBAAA,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC;oBACpC,MAAM;AACD,yBAAA,YAAY,EAAE;yBACd,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,YAAY,CAAC,EAChD;oBACE,UAAU,CAAC,IAAI,CAAC,IAAI,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAA;iBACzD;qBAAM;oBACH,SAAS,CAAC,MAAM,EAAE,CAAA;iBACrB;aACJ;AAED,YAAA,OAAO,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC,CAAA;AAC3C,SAAC,CAAC,CAAA;AACN,KAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,UAAU,CACf,MAAwC,EACxC,GAAgC,EAAA;IAEhC,OAAO,MAAM,GAAG,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,CAAA;AAC3C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs new file mode 100644 index 00000000..36b38686 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs @@ -0,0 +1,12 @@ +function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + if (valueName === "exit" || valueName === "old") + return "old"; + return "group"; +} + +export { chooseLayerType }; +//# sourceMappingURL=choose-layer-type.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map new file mode 100644 index 00000000..8d9f8cda --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"choose-layer-type.mjs","sources":["../../../../src/view/utils/choose-layer-type.ts"],"sourcesContent":["export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n if (valueName === \"exit\" || valueName === \"old\") return \"old\"\n\n return \"group\"\n}\n"],"names":[],"mappings":"AAAM,SAAU,eAAe,CAC3B,SAAsD,EAAA;IAEtD,IAAI,SAAS,KAAK,QAAQ;AAAE,QAAA,OAAO,OAAO,CAAA;AAC1C,IAAA,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK,CAAA;AAC9D,IAAA,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK,CAAA;AAE7D,IAAA,OAAO,OAAO,CAAA;AAClB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/css.mjs b/node_modules/motion-dom/dist/es/view/utils/css.mjs new file mode 100644 index 00000000..24f9b677 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/css.mjs @@ -0,0 +1,33 @@ +let pendingRules = {}; +let style = null; +const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, +}; + +export { css }; +//# sourceMappingURL=css.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/css.mjs.map b/node_modules/motion-dom/dist/es/view/utils/css.mjs.map new file mode 100644 index 00000000..54ccb407 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/css.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"css.mjs","sources":["../../../../src/view/utils/css.ts"],"sourcesContent":["let pendingRules: Record> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAA2C,EAAE,CAAA;AAE7D,IAAI,KAAK,GAA4B,IAAI,CAAA;AAE5B,MAAA,GAAG,GAAG;AACf,IAAA,GAAG,EAAE,CAAC,QAAgB,EAAE,MAA8B,KAAI;AACtD,QAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;KAClC;IAED,MAAM,EAAE,MAAK;QACT,IAAI,CAAC,KAAK,EAAE;AACR,YAAA,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;AACvC,YAAA,KAAK,CAAC,EAAE,GAAG,aAAa,CAAA;SAC3B;QAED,IAAI,OAAO,GAAG,EAAE,CAAA;AAEhB,QAAA,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;AACjC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;AACnC,YAAA,OAAO,IAAI,CAAA,EAAG,QAAQ,CAAA,IAAA,CAAM,CAAA;AAC5B,YAAA,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAClD,gBAAA,OAAO,IAAI,CAAK,EAAA,EAAA,QAAQ,CAAK,EAAA,EAAA,KAAK,KAAK,CAAA;aAC1C;YACD,OAAO,IAAI,KAAK,CAAA;SACnB;AAED,QAAA,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAC3B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QAEhC,YAAY,GAAG,EAAE,CAAA;KACpB;IAED,MAAM,EAAE,MAAK;AACT,QAAA,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE;AAC9B,YAAA,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;SACzC;KACJ;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs new file mode 100644 index 00000000..6e6de51f --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs @@ -0,0 +1,9 @@ +function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; +} + +export { getViewAnimationLayerInfo }; +//# sourceMappingURL=get-layer-info.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map new file mode 100644 index 00000000..26a60def --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-layer-info.mjs","sources":["../../../../src/view/utils/get-layer-info.ts"],"sourcesContent":["export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n /::view-transition-(old|new|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n"],"names":[],"mappings":"AAAM,SAAU,yBAAyB,CAAC,aAAqB,EAAA;IAC3D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAC7B,uDAAuD,CAC1D,CAAA;AACD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI,CAAA;AAEvB,IAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC9C;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs new file mode 100644 index 00000000..29e5abd5 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs @@ -0,0 +1,13 @@ +function filterViewAnimations(animation) { + const { effect } = animation; + if (!effect) + return false; + return (effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); +} +function getViewAnimations() { + return document.getAnimations().filter(filterViewAnimations); +} + +export { getViewAnimations }; +//# sourceMappingURL=get-view-animations.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map new file mode 100644 index 00000000..f838309b --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-view-animations.mjs","sources":["../../../../src/view/utils/get-view-animations.ts"],"sourcesContent":["function filterViewAnimations(animation: Animation) {\n const { effect } = animation\n if (!effect) return false\n\n return (\n effect.target === document.documentElement &&\n effect.pseudoElement?.startsWith(\"::view-transition\")\n )\n}\n\nexport function getViewAnimations() {\n return document.getAnimations().filter(filterViewAnimations)\n}\n"],"names":[],"mappings":"AAAA,SAAS,oBAAoB,CAAC,SAAoB,EAAA;AAC9C,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;AAC5B,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK,CAAA;AAEzB,IAAA,QACI,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe;QAC1C,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,mBAAmB,CAAC,EACxD;AACL,CAAC;SAEe,iBAAiB,GAAA;IAC7B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAA;AAChE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs new file mode 100644 index 00000000..ae14a102 --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs @@ -0,0 +1,6 @@ +function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; +} + +export { hasTarget }; +//# sourceMappingURL=has-target.mjs.map diff --git a/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map new file mode 100644 index 00000000..fef946eb --- /dev/null +++ b/node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"has-target.mjs","sources":["../../../../src/view/utils/has-target.ts"],"sourcesContent":["import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n"],"names":[],"mappings":"AAEgB,SAAA,SAAS,CACrB,MAAsC,EACtC,OAAkE,EAAA;IAElE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;AAC9E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-dom/dist/index.d.ts b/node_modules/motion-dom/dist/index.d.ts new file mode 100644 index 00000000..3b9381be --- /dev/null +++ b/node_modules/motion-dom/dist/index.d.ts @@ -0,0 +1,5065 @@ +import * as motion_utils from 'motion-utils'; +import { Point, BoundingBox, Axis, Box, TransformPoint, Easing, EasingFunction, BezierDefinition, Delta, AxisDelta, SubscriptionManager } from 'motion-utils'; + +/** + * Passed in to pan event handlers like `onPan` the `PanInfo` object contains + * information about the current state of the tap gesture such as its + * `point`, `delta`, `offset` and `velocity`. + * + * ```jsx + * { + * console.log(info.point.x, info.point.y) + * }} /> + * ``` + * + * @public + */ +interface PanInfo { + /** + * Contains `x` and `y` values for the current pan position relative + * to the device or page. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @public + */ + point: Point; + /** + * Contains `x` and `y` values for the distance moved since + * the last event. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.delta.x, info.delta.y) + * } + * + * + * ``` + * + * @public + */ + delta: Point; + /** + * Contains `x` and `y` values for the distance moved from + * the first pan event. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.offset.x, info.offset.y) + * } + * + * + * ``` + * + * @public + */ + offset: Point; + /** + * Contains `x` and `y` values for the current velocity of the pointer, in px/ms. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.velocity.x, info.velocity.y) + * } + * + * + * ``` + * + * @public + */ + velocity: Point; +} +type PanHandler = (event: Event, info: PanInfo) => void; + +type DragHandler = (event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo) => void; +type DragElastic = boolean | number | Partial; +interface ResolvedConstraints { + x: Partial; + y: Partial; +} +interface ResolvedElastic { + x: Axis; + y: Axis; +} + +interface EventInfo { + point: Point; +} +/** + * A generic set of string/number values + */ +interface ResolvedValues$1 { + [key: string]: AnyResolvedKeyframe; +} +type AnimationDefinition = VariantLabels | TargetAndTransition | TargetResolver; +/** + * An object that specifies values to animate to. Each value may be set either as + * a single value, or an array of values. + * + * It may also option contain these properties: + * + * - `transition`: Specifies transitions for all or individual values. + * - `transitionEnd`: Specifies values to set when the animation finishes. + * + * ```jsx + * const target = { + * x: "0%", + * opacity: 0, + * transition: { duration: 1 }, + * transitionEnd: { display: "none" } + * } + * ``` + * + * @public + */ +type TargetAndTransition = Target & { + transition?: Transition; + transitionEnd?: ResolvedValues$1; +}; +type TargetResolver = (custom: any, current: ResolvedValues$1, velocity: ResolvedValues$1) => TargetAndTransition | string; +/** + * Either a string, or array of strings, that reference variants defined via the `variants` prop. + * @public + */ +type VariantLabels = string | string[]; +type Variant = TargetAndTransition | TargetResolver; +interface Variants { + [key: string]: Variant; +} +/** + * @deprecated + */ +type LegacyAnimationControls = { + /** + * Subscribes a component's animation controls to this. + * + * @param controls - The controls to subscribe + * @returns An unsubscribe function. + */ + subscribe(visualElement: any): () => void; + /** + * Starts an animation on all linked components. + * + * @remarks + * + * ```jsx + * controls.start("variantLabel") + * controls.start({ + * x: 0, + * transition: { duration: 1 } + * }) + * ``` + * + * @param definition - Properties or variant label to animate to + * @param transition - Optional `transition` to apply to a variant + * @returns - A `Promise` that resolves when all animations have completed. + * + * @public + */ + start(definition: AnimationDefinition, transitionOverride?: Transition): Promise; + /** + * Instantly set to a set of properties or a variant. + * + * ```jsx + * // With properties + * controls.set({ opacity: 0 }) + * + * // With variants + * controls.set("hidden") + * ``` + * + * @privateRemarks + * We could perform a similar trick to `.start` where this can be called before mount + * and we maintain a list of of pending actions that get applied on mount. But the + * expectation of `set` is that it happens synchronously and this would be difficult + * to do before any children have even attached themselves. It's also poor practise + * and we should discourage render-synchronous `.start` calls rather than lean into this. + * + * @public + */ + set(definition: AnimationDefinition): void; + /** + * Stops animations on all linked components. + * + * ```jsx + * controls.stop() + * ``` + * + * @public + */ + stop(): void; + mount(): () => void; +}; +interface MotionNodeAnimationOptions { + /** + * Properties, variant label or array of variant labels to start in. + * + * Set to `false` to initialise with the values in `animate` (disabling the mount animation) + * + * ```jsx + * // As values + * + * + * // As variant + * + * + * // Multiple variants + * + * + * // As false (disable mount animation) + * + * ``` + */ + initial?: TargetAndTransition | VariantLabels | boolean; + /** + * Values to animate to, variant label(s), or `LegacyAnimationControls`. + * + * ```jsx + * // As values + * + * + * // As variant + * + * + * // Multiple variants + * + * + * // LegacyAnimationControls + * + * ``` + */ + animate?: TargetAndTransition | VariantLabels | boolean | LegacyAnimationControls; + /** + * A target to animate to when this component is removed from the tree. + * + * This component **must** be the first animatable child of an `AnimatePresence` to enable this exit animation. + * + * This limitation exists because React doesn't allow components to defer unmounting until after + * an animation is complete. Once this limitation is fixed, the `AnimatePresence` component will be unnecessary. + * + * ```jsx + * import { AnimatePresence, motion } from 'framer-motion' + * + * export const MyComponent = ({ isVisible }) => { + * return ( + * + * {isVisible && ( + * + * )} + * + * ) + * } + * ``` + */ + exit?: TargetAndTransition | VariantLabels; + /** + * Variants allow you to define animation states and organise them by name. They allow + * you to control animations throughout a component tree by switching a single `animate` prop. + * + * Using `transition` options like `delayChildren` and `when`, you can orchestrate + * when children animations play relative to their parent. + + * + * After passing variants to one or more `motion` component's `variants` prop, these variants + * can be used in place of values on the `animate`, `initial`, `whileFocus`, `whileTap` and `whileHover` props. + * + * ```jsx + * const variants = { + * active: { + * backgroundColor: "#f00" + * }, + * inactive: { + * backgroundColor: "#fff", + * transition: { duration: 2 } + * } + * } + * + * + * ``` + */ + variants?: Variants; + /** + * Default transition. If no `transition` is defined in `animate`, it will use the transition defined here. + * ```jsx + * const spring = { + * type: "spring", + * damping: 10, + * stiffness: 100 + * } + * + * + * ``` + */ + transition?: Transition; +} +interface MotionNodeEventOptions { + /** + * Callback with latest motion values, fired max once per frame. + * + * ```jsx + * function onUpdate(latest) { + * console.log(latest.x, latest.opacity) + * } + * + * + * ``` + */ + onUpdate?(latest: ResolvedValues$1): void; + /** + * Callback when animation defined in `animate` begins. + * + * The provided callback will be called with the triggering animation definition. + * If this is a variant, it'll be the variant name, and if a target object + * then it'll be the target object. + * + * This way, it's possible to figure out which animation has started. + * + * ```jsx + * function onStart() { + * console.log("Animation started") + * } + * + * + * ``` + */ + onAnimationStart?(definition: AnimationDefinition): void; + /** + * Callback when animation defined in `animate` is complete. + * + * The provided callback will be called with the triggering animation definition. + * If this is a variant, it'll be the variant name, and if a target object + * then it'll be the target object. + * + * This way, it's possible to figure out which animation has completed. + * + * ```jsx + * function onComplete() { + * console.log("Animation completed") + * } + * + * { + * console.log('Completed animating', definition) + * }} + * /> + * ``` + */ + onAnimationComplete?(definition: AnimationDefinition): void; + onBeforeLayoutMeasure?(box: Box): void; + onLayoutMeasure?(box: Box, prevBox: Box): void; + onLayoutAnimationStart?(): void; + onLayoutAnimationComplete?(): void; +} +interface MotionNodePanHandlers { + /** + * Callback function that fires when the pan gesture is recognised on this element. + * + * **Note:** For pan gestures to work correctly with touch input, the element needs + * touch scrolling to be disabled on either x/y or both axis with the + * [touch-action](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) CSS rule. + * + * ```jsx + * function onPan(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - A {@link PanInfo} object containing `x` and `y` values for: + * + * - `point`: Relative to the device or page. + * - `delta`: Distance moved since the last event. + * - `offset`: Offset from the original pan event. + * - `velocity`: Current velocity of the pointer. + */ + onPan?(event: PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when the pan gesture begins on this element. + * + * ```jsx + * function onPanStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - A {@link PanInfo} object containing `x`/`y` values for: + * + * - `point`: Relative to the device or page. + * - `delta`: Distance moved since the last event. + * - `offset`: Offset from the original pan event. + * - `velocity`: Current velocity of the pointer. + */ + onPanStart?(event: PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when we begin detecting a pan gesture. This + * is analogous to `onMouseStart` or `onTouchStart`. + * + * ```jsx + * function onPanSessionStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link EventInfo} object containing `x`/`y` values for: + * + * - `point`: Relative to the device or page. + */ + onPanSessionStart?(event: PointerEvent, info: EventInfo): void; + /** + * Callback function that fires when the pan gesture ends on this element. + * + * ```jsx + * function onPanEnd(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - A {@link PanInfo} object containing `x`/`y` values for: + * + * - `point`: Relative to the device or page. + * - `delta`: Distance moved since the last event. + * - `offset`: Offset from the original pan event. + * - `velocity`: Current velocity of the pointer. + */ + onPanEnd?(event: PointerEvent, info: PanInfo): void; +} +interface MotionNodeHoverHandlers { + /** + * Properties or variant label to animate to while the hover gesture is recognised. + * + * ```jsx + * + * ``` + */ + whileHover?: VariantLabels | TargetAndTransition; + /** + * Callback function that fires when pointer starts hovering over the component. + * + * ```jsx + * console.log('Hover starts')} /> + * ``` + */ + onHoverStart?(event: PointerEvent, info: EventInfo): void; + /** + * Callback function that fires when pointer stops hovering over the component. + * + * ```jsx + * console.log("Hover ends")} /> + * ``` + */ + onHoverEnd?(event: PointerEvent, info: EventInfo): void; +} +/** + * Passed in to tap event handlers like `onTap` the `TapInfo` object contains + * information about the tap gesture such as itā€˜s location. + * + * ```jsx + * function onTap(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @public + */ +interface TapInfo { + /** + * Contains `x` and `y` values for the tap gesture relative to the + * device or page. + * + * ```jsx + * function onTapStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @public + */ + point: Point; +} +interface MotionNodeTapHandlers { + /** + * Callback when the tap gesture successfully ends on this element. + * + * ```jsx + * function onTap(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. + */ + onTap?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; + /** + * Callback when the tap gesture starts on this element. + * + * ```jsx + * function onTapStart(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. + */ + onTapStart?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; + /** + * Callback when the tap gesture ends outside this element. + * + * ```jsx + * function onTapCancel(event, info) { + * console.log(info.point.x, info.point.y) + * } + * + * + * ``` + * + * @param event - The originating pointer event. + * @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. + */ + onTapCancel?(event: MouseEvent | TouchEvent | PointerEvent, info: TapInfo): void; + /** + * Properties or variant label to animate to while the component is pressed. + * + * ```jsx + * + * ``` + */ + whileTap?: VariantLabels | TargetAndTransition; + /** + * If `true`, the tap gesture will attach its start listener to window. + * + * Note: This is not supported publically. + */ + globalTapTarget?: boolean; +} +/** + * @deprecated - Use MotionNodeTapHandlers + */ +interface TapHandlers extends MotionNodeTapHandlers { +} +interface MotionNodeFocusHandlers { + /** + * Properties or variant label to animate to while the focus gesture is recognised. + * + * ```jsx + * + * ``` + */ + whileFocus?: VariantLabels | TargetAndTransition; +} +/** + * TODO: Replace with types from inView() + */ +type ViewportEventHandler = (entry: IntersectionObserverEntry | null) => void; +interface ViewportOptions { + root?: { + current: Element | null; + }; + once?: boolean; + margin?: string; + amount?: "some" | "all" | number; +} +interface MotionNodeViewportOptions { + whileInView?: VariantLabels | TargetAndTransition; + onViewportEnter?: ViewportEventHandler; + onViewportLeave?: ViewportEventHandler; + viewport?: ViewportOptions; +} +interface MotionNodeDraggableOptions { + /** + * Enable dragging for this element. Set to `false` by default. + * Set `true` to drag in both directions. + * Set `"x"` or `"y"` to only drag in a specific direction. + * + * ```jsx + * + * ``` + */ + drag?: boolean | "x" | "y"; + /** + * Properties or variant label to animate to while the drag gesture is recognised. + * + * ```jsx + * + * ``` + */ + whileDrag?: VariantLabels | TargetAndTransition; + /** + * If `true`, this will lock dragging to the initially-detected direction. Defaults to `false`. + * + * ```jsx + * + * ``` + */ + dragDirectionLock?: boolean; + /** + * Allows drag gesture propagation to child components. Set to `false` by + * default. + * + * ```jsx + * + * ``` + */ + dragPropagation?: boolean; + /** + * Applies constraints on the permitted draggable area. + * + * It can accept an object of optional `top`, `left`, `right`, and `bottom` values, measured in pixels. + * This will define a distance from the named edge of the draggable component. + * + * Alternatively, it can accept a `ref` to another component created with React's `useRef` hook. + * This `ref` should be passed both to the draggable component's `dragConstraints` prop, and the `ref` + * of the component you want to use as constraints. + * + * ```jsx + * // In pixels + * + * + * // As a ref to another component + * const MyComponent = () => { + * const constraintsRef = useRef(null) + * + * return ( + * + * + * + * ) + * } + * ``` + */ + dragConstraints?: false | Partial | { + current: Element | null; + }; + /** + * The degree of movement allowed outside constraints. 0 = no movement, 1 = + * full movement. + * + * Set to `0.5` by default. Can also be set as `false` to disable movement. + * + * By passing an object of `top`/`right`/`bottom`/`left`, individual values can be set + * per constraint. Any missing values will be set to `0`. + * + * ```jsx + * + * ``` + */ + dragElastic?: DragElastic; + /** + * Apply momentum from the pan gesture to the component when dragging + * finishes. Set to `true` by default. + * + * ```jsx + * + * ``` + */ + dragMomentum?: boolean; + /** + * Allows you to change dragging inertia parameters. + * When releasing a draggable Frame, an animation with type `inertia` starts. The animation is based on your dragging velocity. This property allows you to customize it. + * See {@link https://motion.dev/docs/react-motion-component#dragtransition | Inertia} for all properties you can use. + * + * ```jsx + * + * ``` + */ + dragTransition?: InertiaOptions; + /** + * Usually, dragging is initiated by pressing down on a component and moving it. For some + * use-cases, for instance clicking at an arbitrary point on a video scrubber, we + * might want to initiate dragging from a different component than the draggable one. + * + * By creating a `dragControls` using the `useDragControls` hook, we can pass this into + * the draggable component's `dragControls` prop. It exposes a `start` method + * that can start dragging from pointer events on other components. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + */ + dragControls?: any; + /** + * If true, element will snap back to its origin when dragging ends. + * + * Enabling this is the equivalent of setting all `dragConstraints` axes to `0` + * with `dragElastic={1}`, but when used together `dragConstraints` can define + * a wider draggable area and `dragSnapToOrigin` will ensure the element + * animates back to its origin on release. + */ + dragSnapToOrigin?: boolean; + /** + * By default, if `drag` is defined on a component then an event listener will be attached + * to automatically initiate dragging when a user presses down on it. + * + * By setting `dragListener` to `false`, this event listener will not be created. + * + * ```jsx + * const dragControls = useDragControls() + * + * function startDrag(event) { + * dragControls.start(event, { snapToCursor: true }) + * } + * + * return ( + * <> + *
+ * + * + * ) + * ``` + */ + dragListener?: boolean; + /** + * If `dragConstraints` is set to a React ref, this callback will call with the measured drag constraints. + * + * @public + */ + onMeasureDragConstraints?: (constraints: BoundingBox) => BoundingBox | void; + /** + * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. + * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. + * This allows you to manually control how updates from a drag gesture on an element is applied. + * + * @public + */ + _dragX?: MotionValue; + /** + * Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. + * Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. + * This allows you to manually control how updates from a drag gesture on an element is applied. + * + * @public + */ + _dragY?: MotionValue; +} +interface MotionNodeDragHandlers { + /** + * Callback function that fires when dragging starts. + * + * ```jsx + * console.log(info.point.x, info.point.y) + * } + * /> + * ``` + * + * @public + */ + onDragStart?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when dragging ends. + * + * ```jsx + * console.log(info.point.x, info.point.y) + * } + * /> + * ``` + * + * @public + */ + onDragEnd?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; + /** + * Callback function that fires when the component is dragged. + * + * ```jsx + * console.log(info.point.x, info.point.y) + * } + * /> + * ``` + * + * @public + */ + onDrag?(event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo): void; + /** + * Callback function that fires a drag direction is determined. + * + * ```jsx + * console.log(axis)} + * /> + * ``` + * + * @public + */ + onDirectionLock?(axis: "x" | "y"): void; + /** + * Callback function that fires when drag momentum/bounce transition finishes. + * + * ```jsx + * console.log('Drag transition complete')} + * /> + * ``` + * + * @public + */ + onDragTransitionEnd?(): void; +} +interface MotionNodeLayoutOptions { + /** + * If `true`, this component will automatically animate to its new position when + * its layout changes. + * + * ```jsx + * + * ``` + * + * This will perform a layout animation using performant transforms. Part of this technique + * involved animating an element's scale. This can introduce visual distortions on children, + * `boxShadow` and `borderRadius`. + * + * To correct distortion on immediate children, add `layout` to those too. + * + * `boxShadow` and `borderRadius` will automatically be corrected if they are already being + * animated on this component. Otherwise, set them directly via the `initial` prop. + * + * If `layout` is set to `"position"`, the size of the component will change instantly and + * only its position will animate. + * + * If `layout` is set to `"size"`, the position of the component will change instantly and + * only its size will animate. + * + * If `layout` is set to `"preserve-aspect"`, the component will animate size & position if + * the aspect ratio remains the same between renders, and just position if the ratio changes. + * + * @public + */ + layout?: boolean | "position" | "size" | "preserve-aspect"; + /** + * Enable shared layout transitions between different components with the same `layoutId`. + * + * When a component with a layoutId is removed from the React tree, and then + * added elsewhere, it will visually animate from the previous component's bounding box + * and its latest animated values. + * + * ```jsx + * {items.map(item => ( + * + * {item.name} + * {item.isSelected && } + * + * ))} + * ``` + * + * If the previous component remains in the tree it will crossfade with the new component. + * + * @public + */ + layoutId?: string; + /** + * A callback that will fire when a layout animation on this component starts. + * + * @public + */ + onLayoutAnimationStart?(): void; + /** + * A callback that will fire when a layout animation on this component completes. + * + * @public + */ + onLayoutAnimationComplete?(): void; + /** + * @public + */ + layoutDependency?: any; + /** + * Whether a projection node should measure its scroll when it or its descendants update their layout. + * + * @public + */ + layoutScroll?: boolean; + /** + * Whether an element should be considered a "layout root", where + * all children will be forced to resolve relatively to it. + * Currently used for `position: sticky` elements in Framer. + */ + layoutRoot?: boolean; + /** + * Attached to a portal root to ensure we attach the child to the document root and don't + * perform scale correction on it. + */ + "data-framer-portal-id"?: string; + /** + * By default, shared layout elements will crossfade. By setting this + * to `false`, this element will take its default opacity throughout the animation. + */ + layoutCrossfade?: boolean; +} +/** + * @deprecated - Use MotionNodeDragHandlers/MotionNodeDraggableOptions + */ +interface DraggableProps extends MotionNodeDragHandlers, MotionNodeDraggableOptions { +} +type TransformTemplate = (transform: TransformProperties, generatedTransform: string) => string; +interface MotionNodeAdvancedOptions { + /** + * Custom data to use to resolve dynamic variants differently for each animating component. + * + * ```jsx + * const variants = { + * visible: (custom) => ({ + * opacity: 1, + * transition: { delay: custom * 0.2 } + * }) + * } + * + * + * + * + * ``` + * + * @public + */ + custom?: any; + /** + * @public + * Set to `false` to prevent inheriting variant changes from its parent. + */ + inherit?: boolean; + /** + * @public + * Set to `false` to prevent throwing an error when a `motion` component is used within a `LazyMotion` set to strict. + */ + ignoreStrict?: boolean; + /** + * Provide a set of motion values to perform animations on. + */ + values?: { + [key: string]: MotionValue | MotionValue; + }; + /** + * By default, Motion generates a `transform` property with a sensible transform order. `transformTemplate` + * can be used to create a different order, or to append/preprend the automatically generated `transform` property. + * + * ```jsx + * `rotate(${rotate}deg) translateX(${x}px)` + * } + * /> + * ``` + * + * @param transform - The latest animated transform props. + * @param generatedTransform - The transform string as automatically generated by Motion + * + * @public + */ + transformTemplate?: TransformTemplate; + "data-framer-appear-id"?: string; +} +interface PropagateOptions { + /** + * If `false`, this element's tap gesture will prevent any parent + * element's tap gesture handlers (`onTap`, `onTapStart`, `whileTap`) + * from firing. Defaults to `true`. + */ + tap?: boolean; +} +interface MotionNodeOptions extends MotionNodeAnimationOptions, MotionNodeEventOptions, MotionNodePanHandlers, MotionNodeTapHandlers, MotionNodeHoverHandlers, MotionNodeFocusHandlers, MotionNodeViewportOptions, MotionNodeDragHandlers, MotionNodeDraggableOptions, MotionNodeLayoutOptions, MotionNodeAdvancedOptions { + /** + * Controls whether gesture events propagate to parent motion components. + * By default all gestures propagate. Set individual gestures to `false` + * to prevent parent handlers from firing. + * + * ```jsx + * + * + * + * ``` + */ + propagate?: PropagateOptions; +} + +/** + * @public + */ +interface PresenceContextProps { + id: string; + isPresent: boolean; + register: (id: string | number) => () => void; + onExitComplete?: (id: string | number) => void; + initial?: false | VariantLabels; + custom?: any; +} +/** + * @public + */ +type ReducedMotionConfig = "always" | "never" | "user"; +/** + * @public + */ +interface MotionConfigContextProps { + /** + * Internal, exported only for usage in Framer + */ + transformPagePoint: TransformPoint; + /** + * Internal. Determines whether this is a static context ie the Framer canvas. If so, + * it'll disable all dynamic functionality. + */ + isStatic: boolean; + /** + * Defines a new default transition for the entire tree. + * + * @public + */ + transition?: Transition; + /** + * If true, will respect the device prefersReducedMotion setting by switching + * transform animations off. + * + * @public + */ + reducedMotion?: ReducedMotionConfig; + /** + * A custom `nonce` attribute used when wanting to enforce a Content Security Policy (CSP). + * For more details see: + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src#unsafe_inline_styles + * + * @public + */ + nonce?: string; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + * + * @public + */ + skipAnimations?: boolean; +} +interface VisualState<_Instance, RenderState> { + latestValues: ResolvedValues$1; + renderState: RenderState; +} +interface VisualElementOptions { + visualState: VisualState; + parent?: any; + variantParent?: any; + presenceContext: PresenceContextProps | null; + props: MotionNodeOptions; + blockInitialAnimation?: boolean; + reducedMotionConfig?: ReducedMotionConfig; + /** + * If true, all animations will be skipped and values will be set instantly. + * Useful for E2E tests and visual regression testing. + */ + skipAnimations?: boolean; + /** + * Explicit override for SVG detection. When true, uses SVG rendering; + * when false, uses HTML rendering. If undefined, auto-detects. + */ + isSVG?: boolean; +} +interface VisualElementEventCallbacks { + BeforeLayoutMeasure: () => void; + LayoutMeasure: (layout: Box, prevLayout?: Box) => void; + LayoutUpdate: (layout: Axis, prevLayout: Axis) => void; + Update: (latest: ResolvedValues$1) => void; + AnimationStart: (definition: AnimationDefinition) => void; + AnimationComplete: (definition: AnimationDefinition) => void; + LayoutAnimationStart: () => void; + LayoutAnimationComplete: () => void; + SetAxisTarget: () => void; + Unmount: () => void; +} +interface LayoutLifecycles { + onBeforeLayoutMeasure?(box: Box): void; + onLayoutMeasure?(box: Box, prevBox: Box): void; +} +type ScrapeMotionValuesFromProps = (props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: any) => { + [key: string]: MotionValue | AnyResolvedKeyframe; +}; +type UseRenderState = () => RenderState; +/** + * Animation type for variant state management + */ +type AnimationType = "animate" | "whileHover" | "whileTap" | "whileDrag" | "whileFocus" | "whileInView" | "exit"; +interface FeatureClass { + new (props: Props): any; +} +interface FeatureDefinition { + isEnabled: (props: MotionNodeOptions) => boolean; + Feature?: FeatureClass; + ProjectionNode?: any; + MeasureLayout?: any; +} +type FeatureDefinitions = { + animation?: FeatureDefinition; + exit?: FeatureDefinition; + drag?: FeatureDefinition; + tap?: FeatureDefinition; + focus?: FeatureDefinition; + hover?: FeatureDefinition; + pan?: FeatureDefinition; + inView?: FeatureDefinition; + layout?: FeatureDefinition; +}; + +interface TransformOrigin { + originX?: number | string; + originY?: number | string; + originZ?: number | string; +} +interface HTMLRenderState { + /** + * A mutable record of transforms we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + transform: ResolvedValues$1; + /** + * A mutable record of transform origins we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + transformOrigin: TransformOrigin; + /** + * A mutable record of styles we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + style: ResolvedValues$1; + /** + * A mutable record of CSS variables we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + vars: ResolvedValues$1; +} + +interface SVGRenderState extends HTMLRenderState { + /** + * A mutable record of attributes we want to apply directly to the rendered Element + * every frame. We use a mutable data structure to reduce GC during animations. + */ + attrs: ResolvedValues$1; +} +interface SVGAttributes { + accentHeight?: AnyResolvedKeyframe | undefined; + accumulate?: "none" | "sum" | undefined; + additive?: "replace" | "sum" | undefined; + alignmentBaseline?: "auto" | "baseline" | "before-edge" | "text-before-edge" | "middle" | "central" | "after-edge" | "text-after-edge" | "ideographic" | "alphabetic" | "hanging" | "mathematical" | "inherit" | undefined; + allowReorder?: "no" | "yes" | undefined; + alphabetic?: AnyResolvedKeyframe | undefined; + amplitude?: AnyResolvedKeyframe | undefined; + arabicForm?: "initial" | "medial" | "terminal" | "isolated" | undefined; + ascent?: AnyResolvedKeyframe | undefined; + attributeName?: string | undefined; + attributeType?: string | undefined; + autoReverse?: boolean | undefined; + azimuth?: AnyResolvedKeyframe | undefined; + baseFrequency?: AnyResolvedKeyframe | undefined; + baselineShift?: AnyResolvedKeyframe | undefined; + baseProfile?: AnyResolvedKeyframe | undefined; + bbox?: AnyResolvedKeyframe | undefined; + begin?: AnyResolvedKeyframe | undefined; + bias?: AnyResolvedKeyframe | undefined; + by?: AnyResolvedKeyframe | undefined; + calcMode?: AnyResolvedKeyframe | undefined; + capHeight?: AnyResolvedKeyframe | undefined; + clip?: AnyResolvedKeyframe | undefined; + clipPath?: string | undefined; + clipPathUnits?: AnyResolvedKeyframe | undefined; + clipRule?: AnyResolvedKeyframe | undefined; + colorInterpolation?: AnyResolvedKeyframe | undefined; + colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB" | "inherit" | undefined; + colorProfile?: AnyResolvedKeyframe | undefined; + colorRendering?: AnyResolvedKeyframe | undefined; + contentScriptType?: AnyResolvedKeyframe | undefined; + contentStyleType?: AnyResolvedKeyframe | undefined; + cursor?: AnyResolvedKeyframe | undefined; + cx?: AnyResolvedKeyframe | undefined; + cy?: AnyResolvedKeyframe | undefined; + d?: string | undefined; + decelerate?: AnyResolvedKeyframe | undefined; + descent?: AnyResolvedKeyframe | undefined; + diffuseConstant?: AnyResolvedKeyframe | undefined; + direction?: AnyResolvedKeyframe | undefined; + display?: AnyResolvedKeyframe | undefined; + divisor?: AnyResolvedKeyframe | undefined; + dominantBaseline?: AnyResolvedKeyframe | undefined; + dur?: AnyResolvedKeyframe | undefined; + dx?: AnyResolvedKeyframe | undefined; + dy?: AnyResolvedKeyframe | undefined; + edgeMode?: AnyResolvedKeyframe | undefined; + elevation?: AnyResolvedKeyframe | undefined; + enableBackground?: AnyResolvedKeyframe | undefined; + end?: AnyResolvedKeyframe | undefined; + exponent?: AnyResolvedKeyframe | undefined; + externalResourcesRequired?: boolean | undefined; + fill?: string | undefined; + fillOpacity?: AnyResolvedKeyframe | undefined; + fillRule?: "nonzero" | "evenodd" | "inherit" | undefined; + filter?: string | undefined; + filterRes?: AnyResolvedKeyframe | undefined; + filterUnits?: AnyResolvedKeyframe | undefined; + floodColor?: AnyResolvedKeyframe | undefined; + floodOpacity?: AnyResolvedKeyframe | undefined; + focusable?: boolean | "auto" | undefined; + fontFamily?: string | undefined; + fontSize?: AnyResolvedKeyframe | undefined; + fontSizeAdjust?: AnyResolvedKeyframe | undefined; + fontStretch?: AnyResolvedKeyframe | undefined; + fontStyle?: AnyResolvedKeyframe | undefined; + fontVariant?: AnyResolvedKeyframe | undefined; + fontWeight?: AnyResolvedKeyframe | undefined; + format?: AnyResolvedKeyframe | undefined; + fr?: AnyResolvedKeyframe | undefined; + from?: AnyResolvedKeyframe | undefined; + fx?: AnyResolvedKeyframe | undefined; + fy?: AnyResolvedKeyframe | undefined; + g1?: AnyResolvedKeyframe | undefined; + g2?: AnyResolvedKeyframe | undefined; + glyphName?: AnyResolvedKeyframe | undefined; + glyphOrientationHorizontal?: AnyResolvedKeyframe | undefined; + glyphOrientationVertical?: AnyResolvedKeyframe | undefined; + glyphRef?: AnyResolvedKeyframe | undefined; + gradientTransform?: string | undefined; + gradientUnits?: string | undefined; + hanging?: AnyResolvedKeyframe | undefined; + horizAdvX?: AnyResolvedKeyframe | undefined; + horizOriginX?: AnyResolvedKeyframe | undefined; + href?: string | undefined; + ideographic?: AnyResolvedKeyframe | undefined; + imageRendering?: AnyResolvedKeyframe | undefined; + in2?: AnyResolvedKeyframe | undefined; + in?: string | undefined; + intercept?: AnyResolvedKeyframe | undefined; + k1?: AnyResolvedKeyframe | undefined; + k2?: AnyResolvedKeyframe | undefined; + k3?: AnyResolvedKeyframe | undefined; + k4?: AnyResolvedKeyframe | undefined; + k?: AnyResolvedKeyframe | undefined; + kernelMatrix?: AnyResolvedKeyframe | undefined; + kernelUnitLength?: AnyResolvedKeyframe | undefined; + kerning?: AnyResolvedKeyframe | undefined; + keyPoints?: AnyResolvedKeyframe | undefined; + keySplines?: AnyResolvedKeyframe | undefined; + keyTimes?: AnyResolvedKeyframe | undefined; + lengthAdjust?: AnyResolvedKeyframe | undefined; + letterSpacing?: AnyResolvedKeyframe | undefined; + lightingColor?: AnyResolvedKeyframe | undefined; + limitingConeAngle?: AnyResolvedKeyframe | undefined; + local?: AnyResolvedKeyframe | undefined; + markerEnd?: string | undefined; + markerHeight?: AnyResolvedKeyframe | undefined; + markerMid?: string | undefined; + markerStart?: string | undefined; + markerUnits?: AnyResolvedKeyframe | undefined; + markerWidth?: AnyResolvedKeyframe | undefined; + mask?: string | undefined; + maskContentUnits?: AnyResolvedKeyframe | undefined; + maskUnits?: AnyResolvedKeyframe | undefined; + mathematical?: AnyResolvedKeyframe | undefined; + mode?: AnyResolvedKeyframe | undefined; + numOctaves?: AnyResolvedKeyframe | undefined; + offset?: AnyResolvedKeyframe | undefined; + opacity?: AnyResolvedKeyframe | undefined; + operator?: AnyResolvedKeyframe | undefined; + order?: AnyResolvedKeyframe | undefined; + orient?: AnyResolvedKeyframe | undefined; + orientation?: AnyResolvedKeyframe | undefined; + origin?: AnyResolvedKeyframe | undefined; + overflow?: AnyResolvedKeyframe | undefined; + overlinePosition?: AnyResolvedKeyframe | undefined; + overlineThickness?: AnyResolvedKeyframe | undefined; + paintOrder?: AnyResolvedKeyframe | undefined; + panose1?: AnyResolvedKeyframe | undefined; + path?: string | undefined; + pathLength?: AnyResolvedKeyframe | undefined; + patternContentUnits?: string | undefined; + patternTransform?: AnyResolvedKeyframe | undefined; + patternUnits?: string | undefined; + pointerEvents?: AnyResolvedKeyframe | undefined; + points?: string | undefined; + pointsAtX?: AnyResolvedKeyframe | undefined; + pointsAtY?: AnyResolvedKeyframe | undefined; + pointsAtZ?: AnyResolvedKeyframe | undefined; + preserveAlpha?: boolean | undefined; + preserveAspectRatio?: string | undefined; + primitiveUnits?: AnyResolvedKeyframe | undefined; + r?: AnyResolvedKeyframe | undefined; + radius?: AnyResolvedKeyframe | undefined; + refX?: AnyResolvedKeyframe | undefined; + refY?: AnyResolvedKeyframe | undefined; + renderingIntent?: AnyResolvedKeyframe | undefined; + repeatCount?: AnyResolvedKeyframe | undefined; + repeatDur?: AnyResolvedKeyframe | undefined; + requiredExtensions?: AnyResolvedKeyframe | undefined; + requiredFeatures?: AnyResolvedKeyframe | undefined; + restart?: AnyResolvedKeyframe | undefined; + result?: string | undefined; + rotate?: AnyResolvedKeyframe | undefined; + rx?: AnyResolvedKeyframe | undefined; + ry?: AnyResolvedKeyframe | undefined; + scale?: AnyResolvedKeyframe | undefined; + seed?: AnyResolvedKeyframe | undefined; + shapeRendering?: AnyResolvedKeyframe | undefined; + slope?: AnyResolvedKeyframe | undefined; + spacing?: AnyResolvedKeyframe | undefined; + specularConstant?: AnyResolvedKeyframe | undefined; + specularExponent?: AnyResolvedKeyframe | undefined; + speed?: AnyResolvedKeyframe | undefined; + spreadMethod?: string | undefined; + startOffset?: AnyResolvedKeyframe | undefined; + stdDeviation?: AnyResolvedKeyframe | undefined; + stemh?: AnyResolvedKeyframe | undefined; + stemv?: AnyResolvedKeyframe | undefined; + stitchTiles?: AnyResolvedKeyframe | undefined; + stopColor?: string | undefined; + stopOpacity?: AnyResolvedKeyframe | undefined; + strikethroughPosition?: AnyResolvedKeyframe | undefined; + strikethroughThickness?: AnyResolvedKeyframe | undefined; + string?: AnyResolvedKeyframe | undefined; + stroke?: string | undefined; + strokeDasharray?: AnyResolvedKeyframe | undefined; + strokeDashoffset?: AnyResolvedKeyframe | undefined; + strokeLinecap?: "butt" | "round" | "square" | "inherit" | undefined; + strokeLinejoin?: "miter" | "round" | "bevel" | "inherit" | undefined; + strokeMiterlimit?: AnyResolvedKeyframe | undefined; + strokeOpacity?: AnyResolvedKeyframe | undefined; + strokeWidth?: AnyResolvedKeyframe | undefined; + surfaceScale?: AnyResolvedKeyframe | undefined; + systemLanguage?: AnyResolvedKeyframe | undefined; + tableValues?: AnyResolvedKeyframe | undefined; + targetX?: AnyResolvedKeyframe | undefined; + targetY?: AnyResolvedKeyframe | undefined; + textAnchor?: string | undefined; + textDecoration?: AnyResolvedKeyframe | undefined; + textLength?: AnyResolvedKeyframe | undefined; + textRendering?: AnyResolvedKeyframe | undefined; + to?: AnyResolvedKeyframe | undefined; + transform?: string | undefined; + u1?: AnyResolvedKeyframe | undefined; + u2?: AnyResolvedKeyframe | undefined; + underlinePosition?: AnyResolvedKeyframe | undefined; + underlineThickness?: AnyResolvedKeyframe | undefined; + unicode?: AnyResolvedKeyframe | undefined; + unicodeBidi?: AnyResolvedKeyframe | undefined; + unicodeRange?: AnyResolvedKeyframe | undefined; + unitsPerEm?: AnyResolvedKeyframe | undefined; + vAlphabetic?: AnyResolvedKeyframe | undefined; + values?: string | undefined; + vectorEffect?: AnyResolvedKeyframe | undefined; + version?: string | undefined; + vertAdvY?: AnyResolvedKeyframe | undefined; + vertOriginX?: AnyResolvedKeyframe | undefined; + vertOriginY?: AnyResolvedKeyframe | undefined; + vHanging?: AnyResolvedKeyframe | undefined; + vIdeographic?: AnyResolvedKeyframe | undefined; + viewBox?: string | undefined; + viewTarget?: AnyResolvedKeyframe | undefined; + visibility?: AnyResolvedKeyframe | undefined; + vMathematical?: AnyResolvedKeyframe | undefined; + widths?: AnyResolvedKeyframe | undefined; + wordSpacing?: AnyResolvedKeyframe | undefined; + writingMode?: AnyResolvedKeyframe | undefined; + x1?: AnyResolvedKeyframe | undefined; + x2?: AnyResolvedKeyframe | undefined; + x?: AnyResolvedKeyframe | undefined; + xChannelSelector?: string | undefined; + xHeight?: AnyResolvedKeyframe | undefined; + xlinkActuate?: string | undefined; + xlinkArcrole?: string | undefined; + xlinkHref?: string | undefined; + xlinkRole?: string | undefined; + xlinkShow?: string | undefined; + xlinkTitle?: string | undefined; + xlinkType?: string | undefined; + xmlBase?: string | undefined; + xmlLang?: string | undefined; + xmlns?: string | undefined; + xmlnsXlink?: string | undefined; + xmlSpace?: string | undefined; + y1?: AnyResolvedKeyframe | undefined; + y2?: AnyResolvedKeyframe | undefined; + y?: AnyResolvedKeyframe | undefined; + yChannelSelector?: string | undefined; + z?: AnyResolvedKeyframe | undefined; + zoomAndPan?: string | undefined; +} + +/** + * An update function. It accepts a timestamp used to advance the animation. + */ +type Update$1 = (timestamp: number) => void; +/** + * Drivers accept a update function and call it at an interval. This interval + * could be a synchronous loop, a setInterval, or tied to the device's framerate. + */ +interface DriverControls { + start: (keepAlive?: boolean) => void; + stop: () => void; + now: () => number; +} +type Driver = (update: Update$1) => DriverControls; + +/** + * Temporary subset of VisualElement until VisualElement is + * moved to motion-dom + */ +interface WithRender { + render: () => void; + readValue: (name: string, keyframe: any) => any; + getValue: (name: string, defaultValue?: any) => any; + current?: HTMLElement | SVGElement; + measureViewportBox: () => Box; +} + +type AnyResolvedKeyframe = string | number; +interface ProgressTimeline { + currentTime: null | { + value: number; + }; + cancel?: VoidFunction; +} +interface ValueAnimationOptionsWithRenderContext extends ValueAnimationOptions { + KeyframeResolver?: typeof KeyframeResolver; + motionValue?: MotionValue; + element?: WithRender; +} +interface TimelineWithFallback { + timeline?: ProgressTimeline; + observe: (animation: AnimationPlaybackControls) => VoidFunction; +} +/** + * Methods to control an animation. + */ +interface AnimationPlaybackControls { + /** + * The current time of the animation, in seconds. + */ + time: number; + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + speed: number; + /** + * The start time of the animation, in milliseconds. + */ + startTime: number | null; + /** + * The state of the animation. + * + * This is currently for internal use only. + */ + state: AnimationPlayState; + duration: number; + /** + * The duration of the animation, including any delay. + */ + iterationDuration: number; + /** + * Stops the animation at its current state, and prevents it from + * resuming when the animation is played again. + */ + stop: () => void; + /** + * Plays the animation. + */ + play: () => void; + /** + * Pauses the animation. + */ + pause: () => void; + /** + * Completes the animation and applies the final state. + */ + complete: () => void; + /** + * Cancels the animation and applies the initial state. + */ + cancel: () => void; + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + * + * This is currently for internal use only. + */ + attachTimeline: (timeline: TimelineWithFallback) => VoidFunction; + finished: Promise; +} +type AnimationPlaybackControlsWithThen = AnimationPlaybackControls & { + then: (onResolve: VoidFunction, onReject?: VoidFunction) => Promise; +}; +interface AnimationState$1 { + value: V; + done: boolean; +} +interface KeyframeGenerator { + calculatedDuration: null | number; + next: (t: number) => AnimationState$1; + toString: () => string; +} +interface DOMValueAnimationOptions extends ValueAnimationTransition { + element: HTMLElement | SVGElement; + keyframes: ValueKeyframesDefinition; + name: string; + pseudoElement?: string; + allowFlatten?: boolean; +} +interface ValueAnimationOptions extends ValueAnimationTransition { + keyframes: V[]; + element?: any; + name?: string; + motionValue?: MotionValue; + from?: any; + isHandoff?: boolean; + allowFlatten?: boolean; + finalKeyframe?: V; +} +type GeneratorFactoryFunction = (options: ValueAnimationOptions) => KeyframeGenerator; +interface GeneratorFactory extends GeneratorFactoryFunction { + applyToOptions?: (options: Transition) => Transition; +} +type AnimationGeneratorName = "decay" | "spring" | "keyframes" | "tween" | "inertia"; +type AnimationGeneratorType = GeneratorFactory | AnimationGeneratorName | false; +interface AnimationPlaybackLifecycles { + onUpdate?: (latest: V) => void; + onPlay?: () => void; + onComplete?: () => void; + onRepeat?: () => void; + onStop?: () => void; +} +interface ValueAnimationTransition extends ValueTransition, AnimationPlaybackLifecycles { + isSync?: boolean; +} +type RepeatType = "loop" | "reverse" | "mirror"; +interface AnimationPlaybackOptions { + /** + * The number of times to repeat the transition. Set to `Infinity` for perpetual repeating. + * + * Without setting `repeatType`, this will loop the animation. + * + * @public + */ + repeat?: number; + /** + * How to repeat the animation. This can be either: + * + * "loop": Repeats the animation from the start + * + * "reverse": Alternates between forward and backwards playback + * + * "mirror": Switches `from` and `to` alternately + * + * @public + */ + repeatType?: RepeatType; + /** + * When repeating an animation, `repeatDelay` will set the + * duration of the time to wait, in seconds, between each repetition. + * + * @public + */ + repeatDelay?: number; +} +interface VelocityOptions { + velocity?: number; + /** + * End animation if absolute speed (in units per second) drops below this + * value and delta is smaller than `restDelta`. Set to `0.01` by default. + * + * @public + */ + restSpeed?: number; + /** + * End animation if distance is below this value and speed is below + * `restSpeed`. When animation ends, spring gets "snapped" to. Set to + * `0.01` by default. + * + * @public + */ + restDelta?: number; +} +interface DurationSpringOptions { + /** + * The total duration of the animation. Set to `0.3` by default. + * + * @public + */ + duration?: number; + /** + * If visualDuration is set, this will override duration. + * + * The visual duration is a time, set in seconds, that the animation will take to visually appear to reach its target. + * + * In other words, the bulk of the transition will occur before this time, and the "bouncy bit" will mostly happen after. + * + * This makes it easier to edit a spring, as well as visually coordinate it with other time-based animations. + * + * @public + */ + visualDuration?: number; + /** + * `bounce` determines the "bounciness" of a spring animation. + * + * `0` is no bounce, and `1` is extremely bouncy. + * + * If `duration` is set, this defaults to `0.25`. + * + * Note: `bounce` and `duration` will be overridden if `stiffness`, `damping` or `mass` are set. + * + * @public + */ + bounce?: number; +} +interface SpringOptions extends DurationSpringOptions, VelocityOptions { + /** + * Stiffness of the spring. Higher values will create more sudden movement. + * Set to `100` by default. + * + * @public + */ + stiffness?: number; + /** + * Strength of opposing force. If set to 0, spring will oscillate + * indefinitely. Set to `10` by default. + * + * @public + */ + damping?: number; + /** + * Mass of the moving object. Higher values will result in more lethargic + * movement. Set to `1` by default. + * + * @public + */ + mass?: number; +} +/** + * @deprecated Use SpringOptions instead + */ +interface Spring extends SpringOptions { +} +interface DecayOptions extends VelocityOptions { + keyframes?: number[]; + /** + * A higher power value equals a further target. Set to `0.8` by default. + * + * @public + */ + power?: number; + /** + * Adjusting the time constant will change the duration of the + * deceleration, thereby affecting its feel. Set to `700` by default. + * + * @public + */ + timeConstant?: number; + /** + * A function that receives the automatically-calculated target and returns a new one. Useful for snapping the target to a grid. + * + * @public + */ + modifyTarget?: (v: number) => number; +} +interface InertiaOptions extends DecayOptions { + /** + * If `min` or `max` is set, this affects the stiffness of the bounce + * spring. Higher values will create more sudden movement. Set to `500` by + * default. + * + * @public + */ + bounceStiffness?: number; + /** + * If `min` or `max` is set, this affects the damping of the bounce spring. + * If set to `0`, spring will oscillate indefinitely. Set to `10` by + * default. + * + * @public + */ + bounceDamping?: number; + /** + * Minimum constraint. If set, the value will "bump" against this value (or immediately spring to it if the animation starts as less than this value). + * + * @public + */ + min?: number; + /** + * Maximum constraint. If set, the value will "bump" against this value (or immediately snap to it, if the initial animation value exceeds this value). + * + * @public + */ + max?: number; +} +interface AnimationOrchestrationOptions { + /** + * Delay the animation by this duration (in seconds). Defaults to `0`. + * + * @public + */ + delay?: number; + /** + * Describes the relationship between the transition and its children. Set + * to `false` by default. + * + * @remarks + * When using variants, the transition can be scheduled in relation to its + * children with either `"beforeChildren"` to finish this transition before + * starting children transitions, `"afterChildren"` to finish children + * transitions before starting this transition. + * + * @public + */ + when?: false | "beforeChildren" | "afterChildren" | string; + /** + * When using variants, children animations will start after this duration + * (in seconds). You can add the `transition` property to both the `motion.div` and the + * `variant` directly. Adding it to the `variant` generally offers more flexibility, + * as it allows you to customize the delay per visual state. + * + * @public + */ + delayChildren?: number | DynamicOption; + /** + * When using variants, animations of child components can be staggered by this + * duration (in seconds). + * + * For instance, if `staggerChildren` is `0.01`, the first child will be + * delayed by `0` seconds, the second by `0.01`, the third by `0.02` and so + * on. + * + * The calculated stagger delay will be added to `delayChildren`. + * + * @deprecated - Use `delayChildren: stagger(interval)` instead. + */ + staggerChildren?: number; + /** + * The direction in which to stagger children. + * + * A value of `1` staggers from the first to the last while `-1` + * staggers from the last to the first. + * + * @deprecated - Use `delayChildren: stagger(interval, { from: "last" })` instead. + */ + staggerDirection?: number; +} +interface KeyframeOptions { + /** + * The total duration of the animation. Set to `0.3` by default. + * + * @public + */ + duration?: number; + ease?: Easing | Easing[]; + times?: number[]; +} +interface ValueTransition extends AnimationOrchestrationOptions, AnimationPlaybackOptions, Omit, Omit, KeyframeOptions { + /** + * Delay the animation by this duration (in seconds). Defaults to `0`. + * + * @public + */ + delay?: number; + /** + * The duration of time already elapsed in the animation. Set to `0` by + * default. + */ + elapsed?: number; + driver?: Driver; + /** + * Type of animation to use. + * + * - "tween": Duration-based animation with ease curve + * - "spring": Physics or duration-based spring animation + * - false: Use an instant animation + */ + type?: AnimationGeneratorType; + /** + * The duration of the tween animation. Set to `0.3` by default, 0r `0.8` if animating a series of keyframes. + * + * @public + */ + duration?: number; + autoplay?: boolean; + startTime?: number; + from?: any; + /** + * If true, this transition will shallow-merge with its parent transition + * instead of replacing it. Inner keys win. + * + * @public + */ + inherit?: boolean; +} +/** + * @deprecated Use KeyframeOptions instead + */ +interface Tween extends KeyframeOptions { +} +type SVGForcedAttrTransitions = { + [K in keyof SVGForcedAttrProperties]: ValueTransition; +}; +type SVGPathTransitions = { + [K in keyof SVGPathProperties]: ValueTransition; +}; +type SVGTransitions = { + [K in keyof Omit]: ValueTransition; +}; +interface VariableTransitions { + [key: `--${string}`]: ValueTransition; +} +type StyleTransitions = { + [K in keyof CSSStyleDeclarationWithTransform]?: ValueTransition; +}; +type ValueKeyframe = T; +type UnresolvedValueKeyframe = ValueKeyframe | null; +type ResolvedValueKeyframe = ValueKeyframe | ValueKeyframe[]; +type ValueKeyframesDefinition = ValueKeyframe | ValueKeyframe[] | UnresolvedValueKeyframe[]; +type StyleKeyframesDefinition = { + [K in keyof CSSStyleDeclarationWithTransform]?: ValueKeyframesDefinition; +}; +type SVGKeyframesDefinition = { + [K in keyof Omit]?: ValueKeyframesDefinition; +}; +interface VariableKeyframesDefinition { + [key: `--${string}`]: ValueKeyframesDefinition; +} +type SVGForcedAttrKeyframesDefinition = { + [K in keyof SVGForcedAttrProperties]?: ValueKeyframesDefinition; +}; +type SVGPathKeyframesDefinition = { + [K in keyof SVGPathProperties]?: ValueKeyframesDefinition; +}; +type DOMKeyframesDefinition = StyleKeyframesDefinition & SVGKeyframesDefinition & SVGPathKeyframesDefinition & SVGForcedAttrKeyframesDefinition & VariableKeyframesDefinition; +interface Target extends DOMKeyframesDefinition { +} +type CSSPropertyKeys = { + [K in keyof CSSStyleDeclaration as K extends string ? CSSStyleDeclaration[K] extends AnyResolvedKeyframe ? K : never : never]: CSSStyleDeclaration[K]; +}; +interface CSSStyleDeclarationWithTransform extends Omit { + x: number | string; + y: number | string; + z: number | string; + originX: number; + originY: number; + originZ: number; + translateX: number | string; + translateY: number | string; + translateZ: number | string; + rotateX: number | string; + rotateY: number | string; + rotateZ: number | string; + scaleX: number; + scaleY: number; + scaleZ: number; + skewX: number | string; + skewY: number | string; + transformPerspective: number; +} +type TransitionWithValueOverrides = ValueAnimationTransition & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & { + default?: ValueTransition; + layout?: ValueTransition; +}; +type Transition = ValueAnimationTransition | TransitionWithValueOverrides; +type DynamicOption = (i: number, total: number) => T; +type ValueAnimationWithDynamicDelay = Omit, "delay"> & { + delay?: number | DynamicOption; +}; +interface ReduceMotionOption { + /** + * Whether to reduce motion for transform/layout animations. + * + * - `true`: Skip transform/layout animations (instant transition) + * - `false`: Always animate transforms/layout + * - `undefined`: Use device preference (default behavior) + */ + reduceMotion?: boolean; +} +type AnimationOptions = (ValueAnimationWithDynamicDelay & ReduceMotionOption) | (ValueAnimationWithDynamicDelay & ReduceMotionOption & StyleTransitions & SVGPathTransitions & SVGForcedAttrTransitions & SVGTransitions & VariableTransitions & { + default?: ValueTransition; + layout?: ValueTransition; +}); +interface TransformProperties { + x?: AnyResolvedKeyframe; + y?: AnyResolvedKeyframe; + z?: AnyResolvedKeyframe; + translateX?: AnyResolvedKeyframe; + translateY?: AnyResolvedKeyframe; + translateZ?: AnyResolvedKeyframe; + rotate?: AnyResolvedKeyframe; + rotateX?: AnyResolvedKeyframe; + rotateY?: AnyResolvedKeyframe; + rotateZ?: AnyResolvedKeyframe; + scale?: AnyResolvedKeyframe; + scaleX?: AnyResolvedKeyframe; + scaleY?: AnyResolvedKeyframe; + scaleZ?: AnyResolvedKeyframe; + skew?: AnyResolvedKeyframe; + skewX?: AnyResolvedKeyframe; + skewY?: AnyResolvedKeyframe; + originX?: AnyResolvedKeyframe; + originY?: AnyResolvedKeyframe; + originZ?: AnyResolvedKeyframe; + perspective?: AnyResolvedKeyframe; + transformPerspective?: AnyResolvedKeyframe; +} +interface SVGForcedAttrProperties { + attrX?: number; + attrY?: number; + attrScale?: number; +} +interface SVGPathProperties { + pathLength?: number; + pathOffset?: number; + pathSpacing?: number; +} + +/** + * @public + */ +type Subscriber = (v: T) => void; +/** + * @public + */ +type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void; +type StartAnimation = (complete: () => void) => AnimationPlaybackControlsWithThen | undefined; +interface MotionValueEventCallbacks { + animationStart: () => void; + animationComplete: () => void; + animationCancel: () => void; + change: (latestValue: V) => void; + destroy: () => void; +} +interface ResolvedValues { + [key: string]: AnyResolvedKeyframe; +} +interface Owner { + current: HTMLElement | unknown; + getProps: () => { + onUpdate?: (latest: ResolvedValues) => void; + transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string; + }; +} +interface AccelerateConfig { + factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction; + times: number[]; + keyframes: any[]; + ease?: EasingFunction | EasingFunction[]; + duration: number; + isTransformed?: boolean; +} +interface MotionValueOptions { + owner?: Owner; +} +declare const collectMotionValues: { + current: MotionValue[] | undefined; +}; +/** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ +declare class MotionValue { + /** + * If a MotionValue has an owner, it was created internally within Motion + * and therefore has no external listeners. It is therefore safe to animate via WAAPI. + */ + owner?: Owner; + /** + * The current state of the `MotionValue`. + */ + private current; + /** + * The previous state of the `MotionValue`. + */ + private prev; + /** + * The previous state of the `MotionValue` at the end of the previous frame. + */ + private prevFrameValue; + /** + * The last time the `MotionValue` was updated. + */ + updatedAt: number; + /** + * The time `prevFrameValue` was updated. + */ + prevUpdatedAt: number | undefined; + private stopPassiveEffect?; + /** + * Whether the passive effect is active. + */ + isEffectActive?: boolean; + /** + * A reference to the currently-controlling animation. + */ + animation?: AnimationPlaybackControlsWithThen; + /** + * A list of MotionValues whose values are computed from this one. + * This is a rough start to a proper signal-like dirtying system. + */ + private dependents; + /** + * Tracks whether this value should be removed + */ + liveStyle?: boolean; + /** + * Scroll timeline acceleration metadata. When set, VisualElement + * can create a native WAAPI animation attached to a scroll timeline + * instead of driving updates through JS. + */ + accelerate?: AccelerateConfig; + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init: V, options?: MotionValueOptions); + setCurrent(current: V): void; + setPrevFrameValue(prevFrameValue?: V | undefined): void; + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription: Subscriber): () => void; + /** + * An object containing a SubscriptionManager for each active event. + */ + private events; + on>(eventName: EventName, callback: MotionValueEventCallbacks[EventName]): VoidFunction; + clearListeners(): void; + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction): void; + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v: V): void; + setWithVelocity(prev: V, current: V, delta: number): void; + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v: V, endAnimation?: boolean): void; + dirty(): void; + addDependent(dependent: MotionValue): void; + removeDependent(dependent: MotionValue): void; + updateAndNotify: (v: V) => void; + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get(): NonNullable; + /** + * @public + */ + getPrevious(): V | undefined; + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity(): number; + hasAnimated: boolean; + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation: StartAnimation): Promise; + /** + * Stop the currently active animation. + * + * @public + */ + stop(): void; + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating(): boolean; + private clearAnimation; + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy(): void; +} +declare function motionValue(init: V, options?: MotionValueOptions): MotionValue; + +type UnresolvedKeyframes = Array; +type ResolvedKeyframes = Array; +declare function flushKeyframeResolvers(): void; +type OnKeyframesResolved = (resolvedKeyframes: ResolvedKeyframes, finalKeyframe: T, forced: boolean) => void; +declare class KeyframeResolver { + name?: string; + element?: WithRender; + finalKeyframe?: T; + suspendedScrollY?: number; + protected unresolvedKeyframes: UnresolvedKeyframes; + private motionValue?; + private onComplete; + state: "pending" | "scheduled" | "complete"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + private isAsync; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + needsMeasurement: boolean; + constructor(unresolvedKeyframes: UnresolvedKeyframes, onComplete: OnKeyframesResolved, name?: string, motionValue?: MotionValue, element?: WithRender, isAsync?: boolean); + scheduleResolve(): void; + readKeyframes(): void; + setFinalKeyframe(): void; + measureInitialState(): void; + renderEndStyles(): void; + measureEndState(): void; + complete(isForcedComplete?: boolean): void; + cancel(): void; + resume(): void; +} + +declare class WithPromise { + protected _finished: Promise; + resolve: VoidFunction; + constructor(); + get finished(): Promise; + protected updateFinished(): void; + protected notifyFinished(): void; + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve: VoidFunction, onReject?: VoidFunction): Promise; +} + +type OptionsWithoutKeyframes = Omit, "keyframes">; +declare class AsyncMotionValueAnimation extends WithPromise implements AnimationPlaybackControls { + private createdAt; + private resolvedAt; + private _animation; + private pendingTimeline; + private keyframeResolver; + private stopTimeline; + constructor({ autoplay, delay, type, repeat, repeatDelay, repeatType, keyframes, name, motionValue, element, ...options }: ValueAnimationOptions); + onKeyframesResolved(keyframes: ResolvedKeyframes, finalKeyframe: T, options: OptionsWithoutKeyframes, sync: boolean): void; + get finished(): Promise; + then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise; + get animation(): AnimationPlaybackControls; + get duration(): number; + get iterationDuration(): number; + get time(): number; + set time(newTime: number); + get speed(): number; + get state(): AnimationPlayState; + set speed(newSpeed: number); + get startTime(): number | null; + attachTimeline(timeline: TimelineWithFallback): () => void; + play(): void; + pause(): void; + complete(): void; + cancel(): void; + /** + * Bound to support return animation.stop pattern + */ + stop: () => void; +} + +type AcceptedAnimations = AnimationPlaybackControls; +type GroupedAnimations = AcceptedAnimations[]; +declare class GroupAnimation implements AnimationPlaybackControls { + animations: GroupedAnimations; + constructor(animations: Array); + get finished(): Promise; + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + private getAll; + private setAll; + attachTimeline(timeline: TimelineWithFallback): () => void; + get time(): number; + set time(time: number); + get speed(): number; + set speed(speed: number); + get state(): any; + get startTime(): any; + get duration(): number; + get iterationDuration(): number; + private runAll; + play(): void; + pause(): void; + stop: () => void; + cancel(): void; + complete(): void; +} + +declare class GroupAnimationWithThen extends GroupAnimation implements AnimationPlaybackControlsWithThen { + then(onResolve: VoidFunction, _onReject?: VoidFunction): Promise; +} + +declare class JSAnimation extends WithPromise implements AnimationPlaybackControlsWithThen { + state: AnimationPlayState; + startTime: number | null; + /** + * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop + * but in tests we can pass in a synchronous loop. + */ + private driver?; + private isStopped; + private generator; + private calculatedDuration; + private resolvedDuration; + private totalDuration; + private options; + /** + * The current time of the animation. + */ + private currentTime; + /** + * The time at which the animation was paused. + */ + private holdTime; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + private playbackSpeed; + private mixKeyframes; + private mirroredGenerator; + constructor(options: ValueAnimationOptions); + initAnimation(): void; + updateTime(timestamp: number): void; + tick(timestamp: number, sample?: boolean): AnimationState$1; + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve: VoidFunction, reject?: VoidFunction): Promise; + get duration(): number; + get iterationDuration(): number; + get time(): number; + set time(newTime: number); + get speed(): number; + set speed(newSpeed: number); + play(): void; + pause(): void; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + stop: () => void; + complete(): void; + finish(): void; + cancel(): void; + private teardown; + private stopDriver; + sample(sampleTime: number): AnimationState$1; + attachTimeline(timeline: TimelineWithFallback): VoidFunction; +} +declare function animateValue(options: ValueAnimationOptions): JSAnimation; + +interface NativeAnimationOptions extends DOMValueAnimationOptions { + pseudoElement?: string; + startTime?: number; +} +/** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ +declare class NativeAnimation extends WithPromise implements AnimationPlaybackControlsWithThen { + /** + * The interfaced Web Animation API animation + */ + protected animation: Animation; + protected finishedTime: number | null; + protected options: NativeAnimationOptions; + private allowFlatten; + private isStopped; + private isPseudoElement; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + protected manualStartTime: number | null; + constructor(options?: NativeAnimationOptions); + updateMotionValue?(value?: T): void; + play(): void; + pause(): void; + complete(): void; + cancel(): void; + stop(): void; + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + protected commitStyles(): void; + get duration(): number; + get iterationDuration(): number; + get time(): number; + set time(newTime: number); + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed(): number; + set speed(newSpeed: number); + get state(): AnimationPlayState; + get startTime(): number; + set startTime(newStartTime: number); + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, observe }: TimelineWithFallback): VoidFunction; +} + +type NativeAnimationOptionsExtended = NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions; +declare class NativeAnimationExtended extends NativeAnimation { + options: NativeAnimationOptionsExtended; + constructor(options: NativeAnimationOptionsExtended); + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value?: T): void; +} + +declare class NativeAnimationWrapper extends NativeAnimation { + constructor(animation: Animation); +} + +declare const animationMapKey: (name: string, pseudoElement?: string) => string; +declare function getAnimationMap(element: Element): Map; + +interface VisualElementAnimationOptions { + delay?: number; + transitionOverride?: Transition; + custom?: any; + type?: AnimationType; +} + +interface AnimationState { + animateChanges: (type?: AnimationType) => Promise; + setActive: (type: AnimationType, isActive: boolean, options?: VisualElementAnimationOptions) => Promise; + setAnimateFunction: (fn: any) => void; + getState: () => { + [key: string]: AnimationTypeState; + }; + reset: () => void; +} +type AnimationList = string[] | TargetAndTransition[]; +declare function createAnimationState(visualElement: any): AnimationState; +declare function checkVariantsDidChange(prev: any, next: any): boolean; +interface AnimationTypeState { + isActive: boolean; + protectedKeys: { + [key: string]: true; + }; + needsAnimating: { + [key: string]: boolean; + }; + prevResolvedValues: { + [key: string]: any; + }; + prevProp?: VariantLabels | TargetAndTransition; +} + +/** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ +declare function setFeatureDefinitions(definitions: Partial): void; +/** + * Get the current feature definitions + */ +declare function getFeatureDefinitions(): Partial; +/** + * Motion style type - a subset of CSS properties that can contain motion values + */ +type MotionStyle = { + [K: string]: AnyResolvedKeyframe | MotionValue | undefined; +}; +/** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ +declare abstract class VisualElement { + /** + * VisualElements are arranged in trees mirroring that of the React tree. + * Each type of VisualElement has a unique name, to detect when we're crossing + * type boundaries within that tree. + */ + abstract type: string; + /** + * An `Array.sort` compatible function that will compare two Instances and + * compare their respective positions within the tree. + */ + abstract sortInstanceNodePosition(a: Instance, b: Instance): number; + /** + * Measure the viewport-relative bounding box of the Instance. + */ + abstract measureInstanceViewportBox(instance: Instance, props: MotionNodeOptions & Partial): Box; + /** + * When a value has been removed from all animation props we need to + * pick a target to animate back to. For instance, for HTMLElements + * we can look in the style prop. + */ + abstract getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | undefined | MotionValue; + /** + * When we first animate to a value we need to animate it *from* a value. + * Often this have been specified via the initial prop but it might be + * that the value needs to be read from the Instance. + */ + abstract readValueFromInstance(instance: Instance, key: string, options: Options): AnyResolvedKeyframe | null | undefined; + /** + * When a value has been removed from the VisualElement we use this to remove + * it from the inherting class' unique render state. + */ + abstract removeValueFromRenderState(key: string, renderState: RenderState): void; + /** + * Run before a React or VisualElement render, builds the latest motion + * values into an Instance-specific format. For example, HTMLVisualElement + * will use this step to build `style` and `var` values. + */ + abstract build(renderState: RenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; + /** + * Apply the built values to the Instance. For example, HTMLElements will have + * styles applied via `setProperty` and the style attribute, whereas SVGElements + * will have values applied to attributes. + */ + abstract renderInstance(instance: Instance, renderState: RenderState, styleProp?: MotionStyle, projection?: any): void; + /** + * This method is called when a transform property is bound to a motion value. + * It's currently used to measure SVG elements when a new transform property is bound. + */ + onBindTransform?(): void; + /** + * If the component child is provided as a motion value, handle subscriptions + * with the renderer-specific VisualElement. + */ + handleChildMotionValue?(): void; + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props: MotionNodeOptions, _prevProps: MotionNodeOptions, _visualElement: VisualElement): { + [key: string]: MotionValue | AnyResolvedKeyframe; + }; + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + current: Instance | null; + /** + * A reference to the parent VisualElement (if exists). + */ + parent: VisualElement | undefined; + /** + * A set containing references to this VisualElement's children. + */ + children: Set>; + /** + * A set containing the latest children of this VisualElement. This is flushed + * at the start of every commit. We use it to calculate the stagger delay + * for newly-added children. + */ + enteringChildren?: Set; + /** + * The depth of this VisualElement within the overall VisualElement tree. + */ + depth: number; + /** + * The current render state of this VisualElement. Defined by inherting VisualElements. + */ + renderState: RenderState; + /** + * An object containing the latest static values for each of this VisualElement's + * MotionValues. + */ + latestValues: ResolvedValues$1; + /** + * Determine what role this visual element should take in the variant tree. + */ + isVariantNode: boolean; + isControllingVariants: boolean; + /** + * If this component is part of the variant tree, it should track + * any children that are also part of the tree. This is essentially + * a shadow tree to simplify logic around how to stagger over children. + */ + variantChildren?: Set; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + shouldReduceMotion: boolean | null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + shouldSkipAnimations: boolean; + /** + * Normally, if a component is controlled by a parent's variants, it can + * rely on that ancestor to trigger animations further down the tree. + * However, if a component is created after its parent is mounted, the parent + * won't trigger that mount animation so the child needs to. + * + * TODO: This might be better replaced with a method isParentMounted + */ + manuallyAnimateOnMount: boolean; + /** + * This can be set by AnimatePresence to force components that mount + * at the same time as it to mount as if they have initial={false} set. + */ + blockInitialAnimation: boolean; + /** + * A reference to this VisualElement's projection node, used in layout animations. + */ + projection?: any; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + values: Map>; + /** + * The AnimationState, this is hydrated by the animation Feature. + */ + animationState?: AnimationState; + KeyframeResolver: typeof KeyframeResolver; + /** + * The options used to create this VisualElement. The Options type is defined + * by the inheriting VisualElement and is passed straight through to the render functions. + */ + readonly options: Options; + /** + * A reference to the latest props provided to the VisualElement's host React component. + */ + props: MotionNodeOptions; + prevProps?: MotionNodeOptions; + presenceContext: PresenceContextProps | null; + prevPresenceContext?: PresenceContextProps | null; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + private features; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + private valueSubscriptions; + /** + * A reference to the ReducedMotionConfig passed to the VisualElement's host React component. + */ + private reducedMotionConfig; + /** + * A reference to the skipAnimations config passed to the VisualElement's host React component. + */ + private skipAnimationsConfig; + /** + * On mount, this will be hydrated with a callback to disconnect + * this visual element from its parent on unmount. + */ + private removeFromVariantTree; + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + private prevMotionValues; + /** + * When values are removed from all animation props we need to search + * for a fallback value to animate to. These values are tracked in baseTarget. + */ + private baseTarget; + /** + * Create an object of the values we initially animated from (if initial prop present). + */ + private initialValues; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + private hasBeenMounted; + /** + * An object containing a SubscriptionManager for each active event. + */ + private events; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + private propEventSubscriptions; + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }: VisualElementOptions, options?: Options); + mount(instance: Instance): void; + unmount(): void; + addChild(child: VisualElement): void; + removeChild(child: VisualElement): void; + private bindToMotionValue; + sortNodePosition(other: VisualElement): number; + updateFeatures(): void; + notifyUpdate: () => void; + triggerBuild(): void; + render: () => void; + private renderScheduledAt; + scheduleRender: () => void; + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox(): Box; + getStaticValue(key: string): AnyResolvedKeyframe; + setStaticValue(key: string, value: AnyResolvedKeyframe): void; + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props: MotionNodeOptions, presenceContext: PresenceContextProps | null): void; + getProps(): MotionNodeOptions; + /** + * Returns the variant definition with a given name. + */ + getVariant(name: string): Variant | undefined; + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition(): Transition | undefined; + getTransformPagePoint(): any; + getClosestVariantNode(): VisualElement | undefined; + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child: VisualElement): (() => boolean) | undefined; + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key: string, value: MotionValue): void; + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key: string): void; + /** + * Check whether we have a motion value for this key + */ + hasValue(key: string): boolean; + /** + * Get a motion value for this key. If called with a default + * value, we'll create one if none exists. + */ + getValue(key: string): MotionValue | undefined; + getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue; + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key: string, target?: AnyResolvedKeyframe | null): any; + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key: string, value: AnyResolvedKeyframe): void; + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key: string): ResolvedValues$1[string] | undefined | null; + on(eventName: EventName, callback: VisualElementEventCallbacks[EventName]): VoidFunction; + notify(eventName: EventName, ...args: any): void; + scheduleRenderMicrotask(): void; +} + +declare function calcChildStagger(children: Set, child: VisualElement, delayChildren?: number | DynamicOption, staggerChildren?: number, staggerDirection?: number): number; + +type CSSVariableName = `--${string}`; +type CSSVariableToken = `var(${CSSVariableName})`; +declare const isCSSVariableName: (key?: AnyResolvedKeyframe | null) => key is `--${string}`; +declare const isCSSVariableToken: (value?: string) => value is `var(--${string})`; +/** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ +declare function containsCSSVariable(value?: AnyResolvedKeyframe | null): boolean; + +declare function parseCSSVariable(current: string): string[] | undefined[]; +declare function getVariableValue(current: CSSVariableToken, element: Element, depth?: number): AnyResolvedKeyframe | undefined; + +declare const getDefaultTransition: (valueKey: string, { keyframes }: ValueAnimationOptions) => Partial; + +declare function getFinalKeyframe(keyframes: T[], { repeat, repeatType }: AnimationPlaybackOptions, finalKeyframe?: T): T; + +declare function getValueTransition(transition: any, key: string): any; + +/** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ +declare function resolveTransition(transition: any, parentTransition?: any): any; + +/** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ +declare function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }: Transition & { + elapsed?: number; + from?: AnyResolvedKeyframe; +}): boolean; + +declare function makeAnimationInstant(options: Partial<{ + duration: ValueAnimationOptions["duration"]; + type: ValueAnimationOptions["type"]; +}>): void; + +declare const animateMotionValue: (name: string, value: MotionValue, target: V | UnresolvedKeyframes, transition?: ValueTransition & { + elapsed?: number; +}, element?: VisualElement, isHandoff?: boolean) => StartAnimation; + +declare function animateVisualElement(visualElement: VisualElement, definition: AnimationDefinition, options?: VisualElementAnimationOptions): Promise; + +declare function animateTarget(visualElement: VisualElement, targetAndTransition: TargetAndTransition, { delay, transitionOverride, type }?: VisualElementAnimationOptions): AnimationPlaybackControlsWithThen[]; + +declare function animateVariant(visualElement: VisualElement, variant: string, options?: VisualElementAnimationOptions): Promise; + +declare const optimizedAppearDataId = "framerAppearId"; +declare const optimizedAppearDataAttribute: "data-framer-appear-id"; + +type Process = (data: FrameData) => void; +type Schedule = (process: Process, keepAlive?: boolean, immediate?: boolean) => Process; +interface Step { + schedule: Schedule; + cancel: (process: Process) => void; + process: (data: FrameData) => void; +} +type StepId = "setup" | "read" | "resolveKeyframes" | "preUpdate" | "update" | "preRender" | "render" | "postRender"; +type CancelProcess = (process: Process) => void; +type Batcher = { + [key in StepId]: Schedule; +}; +type Steps = { + [key in StepId]: Step; +}; +interface FrameData { + delta: number; + timestamp: number; + isProcessing: boolean; +} + +/** + * Expose only the needed part of the VisualElement interface to + * ensure React types don't end up in the generic DOM bundle. + */ +interface WithAppearProps { + props: { + [optimizedAppearDataAttribute]?: string; + values?: { + [key: string]: MotionValue | MotionValue; + }; + }; +} +type HandoffFunction = (storeId: string, valueName: string, frame: Batcher) => number | null; +/** + * The window global object acts as a bridge between our inline script + * triggering the optimized appear animations, and Motion. + */ +declare global { + interface Window { + MotionHandoffAnimation?: HandoffFunction; + MotionHandoffMarkAsComplete?: (elementId: string) => void; + MotionHandoffIsComplete?: (elementId: string) => boolean; + MotionHasOptimisedAnimation?: (elementId?: string, valueName?: string) => boolean; + MotionCancelOptimisedAnimation?: (elementId?: string, valueName?: string, frame?: Batcher, canResume?: boolean) => void; + MotionCheckAppearSync?: (visualElement: WithAppearProps, valueName: string, value: MotionValue) => VoidFunction | void; + MotionIsMounted?: boolean; + } +} + +declare function getOptimisedAppearId(visualElement: WithAppearProps): string | undefined; + +declare function inertia({ keyframes, velocity, power, timeConstant, bounceDamping, bounceStiffness, modifyTarget, min, max, restDelta, restSpeed, }: ValueAnimationOptions): KeyframeGenerator; + +declare function defaultEasing(values: any[], easing?: EasingFunction): EasingFunction[]; +declare function keyframes({ duration, keyframes: keyframeValues, times, ease, }: ValueAnimationOptions): KeyframeGenerator; + +declare function spring(optionsOrVisualDuration?: ValueAnimationOptions | number, bounce?: number): KeyframeGenerator; +declare namespace spring { + var applyToOptions: (options: Transition) => Transition; +} + +/** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ +declare const maxGeneratorDuration = 20000; +declare function calcGeneratorDuration(generator: KeyframeGenerator): number; + +/** + * Create a progress => progress easing function from a generator. + */ +declare function createGeneratorEasing(options: Transition, scale: number | undefined, createGenerator: GeneratorFactory): { + type: string; + ease: (progress: number) => number; + duration: number; +}; + +declare function isGenerator(type?: AnimationGeneratorType): type is GeneratorFactory; + +declare class DOMKeyframesResolver extends KeyframeResolver { + name: string; + element?: WithRender; + private removedTransforms?; + private measuredOrigin?; + constructor(unresolvedKeyframes: UnresolvedKeyframes, onComplete: OnKeyframesResolved, name?: string, motionValue?: MotionValue, element?: WithRender); + readKeyframes(): void; + resolveNoneKeyframes(): void; + measureInitialState(): void; + measureEndState(): void; +} + +declare function defaultOffset(arr: any[]): number[]; + +declare function fillOffset(offset: number[], remaining: number): void; + +declare function convertOffsetToTimes(offset: number[], duration: number): number[]; + +declare function applyPxDefaults(keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[], name: string): void; + +declare function fillWildcards(keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]): void; + +declare const cubicBezierAsString: ([a, b, c, d]: BezierDefinition) => string; + +declare function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean; + +declare function mapEasingToNativeEasing(easing: Easing | Easing[] | undefined, duration: number): undefined | string | string[]; + +declare const supportedWaapiEasing: { + linear: string; + ease: string; + easeIn: string; + easeOut: string; + easeInOut: string; + circIn: string; + circOut: string; + backIn: string; + backOut: string; +}; + +declare function startWaapiAnimation(element: Element, valueName: string, keyframes: ValueKeyframesDefinition, { delay, duration, repeat, repeatType, ease, times, }?: ValueTransition, pseudoElement?: string | undefined): Animation; + +declare const supportsPartialKeyframes: () => boolean; + +declare function supportsBrowserAnimation(options: ValueAnimationOptionsWithRenderContext): any; + +/** + * A list of values that can be hardware-accelerated. + */ +declare const acceleratedValues: Set; + +declare function applyGeneratorOptions({ type, ...options }: ValueTransition): ValueTransition; + +declare const generateLinearEasing: (easing: EasingFunction, duration: number, resolution?: number) => string; + +declare class MotionValueState { + latest: { + [name: string]: AnyResolvedKeyframe; + }; + private values; + set(name: string, value: MotionValue, render?: VoidFunction, computed?: MotionValue, useDefaultValueType?: boolean): () => void; + get(name: string): MotionValue | undefined; + destroy(): void; +} + +declare const addAttrValue: (element: HTMLElement | SVGElement, state: MotionValueState, key: string, value: MotionValue) => () => void; +declare const attrEffect: (subject: ElementOrSelector, values: Record>) => () => void; + +declare const propEffect: (subject: { + [key: string]: any; +}, values: Record>) => VoidFunction; + +declare const addStyleValue: (element: HTMLElement | SVGElement, state: MotionValueState, key: string, value: MotionValue) => () => void; +declare const styleEffect: (subject: ElementOrSelector, values: Record>) => () => void; + +declare const svgEffect: (subject: ElementOrSelector, values: Record>) => () => void; + +declare const frame: Batcher; +declare const cancelFrame: (process: Process) => void; +declare const frameData: FrameData; +declare const frameSteps: Steps; + +declare function createRenderBatcher(scheduleNextBatch: (callback: Function) => void, allowKeepAlive: boolean): { + schedule: Batcher; + cancel: (process: Process) => void; + state: FrameData; + steps: Steps; +}; + +declare const microtask: Batcher; +declare const cancelMicrotask: (process: Process) => void; + +/** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ +declare const time: { + now: () => number; + set: (newTime: number) => void; +}; + +declare const isDragging: { + x: boolean; + y: boolean; +}; +declare function isDragActive(): boolean; + +declare function setDragLock(axis: boolean | "x" | "y" | "lockDirection"): (() => void) | null; + +type ElementOrSelector = Element | Element[] | NodeListOf | string | null | undefined; +interface WithQuerySelectorAll { + querySelectorAll: Element["querySelectorAll"]; +} +interface AnimationScope { + readonly current: T; + animations: any[]; +} +interface SelectorCache { + [key: string]: NodeListOf; +} +declare function resolveElements(elementOrSelector: ElementOrSelector, scope?: AnimationScope, selectorCache?: SelectorCache): Element[]; + +/** + * Options for event listeners. + * + * @public + */ +interface EventOptions { + /** + * Use passive event listeners. Doing so allows the browser to optimize + * scrolling performance by not allowing the use of `preventDefault()`. + * + * @default true + */ + passive?: boolean; + /** + * Remove the event listener after the first event. + * + * @default false + */ + once?: boolean; +} + +/** + * A function to be called when a hover gesture starts. + * + * This function can optionally return a function that will be called + * when the hover gesture ends. + * + * @public + */ +type OnHoverStartEvent = (element: Element, event: PointerEvent) => void | OnHoverEndEvent; +/** + * A function to be called when a hover gesture ends. + * + * @public + */ +type OnHoverEndEvent = (event: PointerEvent) => void; +/** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ +declare function hover(elementOrSelector: ElementOrSelector, onHoverStart: OnHoverStartEvent, options?: EventOptions): VoidFunction; + +interface PressGestureInfo { + success: boolean; +} +type OnPressEndEvent = (event: PointerEvent, info: PressGestureInfo) => void; +type OnPressStartEvent = (element: Element, event: PointerEvent) => OnPressEndEvent | void; + +interface PointerEventOptions extends EventOptions { + useGlobalTarget?: boolean; + stopPropagation?: boolean; +} +/** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ +declare function press(targetOrSelector: ElementOrSelector, onPressStart: OnPressStartEvent, options?: PointerEventOptions): VoidFunction; + +/** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ +declare function isElementKeyboardAccessible(element: Element): boolean; +/** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ +declare function isElementTextInput(element: Element): boolean; + +/** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ +declare const isNodeOrChild: (parent: Element | null, child?: Element | null) => boolean; + +declare const isPrimaryPointer: (event: PointerEvent) => boolean; + +declare function defaultTransformValue(name: string): number; +declare function parseValueFromTransform(transform: string | undefined, name: string): number; +declare const readTransformValue: (instance: HTMLElement, name: string) => number; + +declare function getComputedStyle(element: HTMLElement | SVGElement, name: string): string; + +declare function setStyle(element: HTMLElement | SVGElement, name: string, value: AnyResolvedKeyframe): void; + +declare const isKeyframesTarget: (v: ValueKeyframesDefinition) => v is UnresolvedValueKeyframe[]; + +declare const positionalKeys: Set; + +/** + * Generate a list of every possible transform key. + */ +declare const transformPropOrder: string[]; +/** + * A quick lookup for transform props. + */ +declare const transformProps: Set; + +interface ResizeInfo { + width: number; + height: number; +} +type ResizeHandler = (element: I, info: ResizeInfo) => void; +type WindowResizeHandler = (info: ResizeInfo) => void; + +declare function resize(onResize: WindowResizeHandler): VoidFunction; +declare function resize(target: ElementOrSelector, onResize: ResizeHandler): VoidFunction; + +type Update = (progress: number) => void; +declare function observeTimeline(update: Update, timeline: ProgressTimeline): () => void; + +declare const stepsOrder: StepId[]; +type StepNames = (typeof stepsOrder)[number]; + +interface Summary { + min: number; + max: number; + avg: number; +} +type FrameloopStatNames = "rate" | StepNames; +interface Stats { + frameloop: { + [key in FrameloopStatNames]: T; + }; + animations: { + mainThread: T; + waapi: T; + layout: T; + }; + layoutProjection: { + nodes: T; + calculatedTargetDeltas: T; + calculatedProjections: T; + }; +} +type StatsBuffer = number[]; +type FrameStats = Stats; +type StatsRecording = Stats; +type StatsSummary = Stats; + +declare function reportStats(): StatsSummary; +declare function recordStats(): typeof reportStats; + +declare const activeAnimations: { + layout: number; + mainThread: number; + waapi: number; +}; + +type InactiveStatsBuffer = { + value: null; + addProjectionMetrics: null; +}; +type ActiveStatsBuffer = { + value: StatsRecording; + addProjectionMetrics: (metrics: { + nodes: number; + calculatedTargetDeltas: number; + calculatedProjections: number; + }) => void; +}; +declare const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer; + +type Mixer = (p: number) => T; +type MixerFactory = (a: T, b: T) => Mixer; + +interface InterpolateOptions { + clamp?: boolean; + ease?: EasingFunction | EasingFunction[]; + mixer?: MixerFactory; +} +/** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ +declare function interpolate(input: number[], output: T[], { clamp: isClamp, ease, mixer }?: InterpolateOptions): (v: number) => T; + +/** + * Checks if an element is an HTML element in a way + * that works across iframes + */ +declare function isHTMLElement(element: unknown): element is HTMLElement; + +/** + * Checks if an element is an SVG element in a way + * that works across iframes + */ +declare function isSVGElement(element: unknown): element is SVGElement; + +/** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ +declare function isSVGSVGElement(element: unknown): element is SVGSVGElement; + +declare function mix(from: T, to: T): Mixer; +declare function mix(from: number, to: number, p: number): number; + +type Transformer = (v: any) => any; +type ValueType = { + test: (v: any) => boolean; + parse: (v: any) => any; + transform?: Transformer; + createTransformer?: (template: string) => Transformer; + default?: any; + getAnimatableNone?: (v: any) => any; +}; +type NumberMap = { + [key: string]: number; +}; +type RGBA = { + red: number; + green: number; + blue: number; + alpha: number; +}; +type HSLA = { + hue: number; + saturation: number; + lightness: number; + alpha: number; +}; +type Color = HSLA | RGBA; + +declare const mixLinearColor: (from: number, to: number, v: number) => number; +declare const mixColor: (from: Color | string, to: Color | string) => (p: number) => string | Color; + +type MixableArray = Array; +interface MixableObject { + [key: string]: AnyResolvedKeyframe | RGBA | HSLA; +} +declare function getMixer(a: T): ((from: string | Color, to: string | Color) => (p: number) => string | Color) | ((origin: AnyResolvedKeyframe, target: AnyResolvedKeyframe) => Function) | typeof mixArray | typeof mixObject; +declare function mixArray(a: MixableArray, b: MixableArray): (p: number) => (string | number | RGBA | HSLA)[]; +declare function mixObject(a: MixableObject, b: MixableObject): (v: number) => { + [x: string]: AnyResolvedKeyframe | RGBA | HSLA; +}; +declare const mixComplex: (origin: AnyResolvedKeyframe, target: AnyResolvedKeyframe) => Function; + +declare function mixImmediate(a: T, b: T): (p: number) => T; + +declare const mixNumber: (from: number, to: number, progress: number) => number; + +declare const invisibleValues: Set; +/** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ +declare function mixVisibility(origin: string, target: string): (p: number) => string; + +type StaggerOrigin = "first" | "last" | "center" | number; +type StaggerOptions = { + startDelay?: number; + from?: StaggerOrigin; + ease?: Easing; +}; +declare function getOriginIndex(from: StaggerOrigin, total: number): number; +declare function stagger(duration?: number, { startDelay, from, ease }?: StaggerOptions): DynamicOption; + +/** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ +declare const supportsFlags: Record; + +declare const supportsLinearEasing: () => boolean; + +declare global { + interface Window { + ScrollTimeline: ScrollTimeline; + } +} +declare class ScrollTimeline implements ProgressTimeline { + constructor(options: ScrollOptions); + currentTime: null | { + value: number; + }; + cancel?: VoidFunction; +} +declare const supportsScrollTimeline: () => boolean; + +/** + * @public + */ +interface TransformOptions { + /** + * Clamp values to within the given range. Defaults to `true` + * + * @public + */ + clamp?: boolean; + /** + * Easing functions to use on the interpolations between each value in the input and output ranges. + * + * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each. + * + * @public + */ + ease?: EasingFunction | EasingFunction[]; + /** + * Provide a function that can interpolate between any two values in the provided range. + * + * @public + */ + mixer?: (from: T, to: T) => (v: number) => any; +} +/** + * Transforms numbers into other values by mapping them from an input range to an output range. + * Returns the type of the input provided. + * + * @remarks + * + * Given an input range of `[0, 200]` and an output range of + * `[0, 1]`, this function will return a value between `0` and `1`. + * The input range must be a linear series of numbers. The output range + * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more. + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * export function MyComponent() { + * const inputRange = [0, 200] + * const outputRange = [0, 1] + * const output = transform(100, inputRange, outputRange) + * + * // Returns 0.5 + * return
{output}
+ * } + * ``` + * + * @param inputValue - A number to transform between the input and output ranges. + * @param inputRange - A linear series of numbers (either all increasing or decreasing). + * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`. + * @param options - Clamp: Clamp values to within the given range. Defaults to `true`. + * + * @public + */ +declare function transform(inputValue: number, inputRange: number[], outputRange: T[], options?: TransformOptions): T; +/** + * + * Transforms numbers into other values by mapping them from an input range to an output range. + * + * Given an input range of `[0, 200]` and an output range of + * `[0, 1]`, this function will return a value between `0` and `1`. + * The input range must be a linear series of numbers. The output range + * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more. + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * export function MyComponent() { + * const inputRange = [-200, -100, 100, 200] + * const outputRange = [0, 1, 1, 0] + * const convertRange = transform(inputRange, outputRange) + * const output = convertRange(-150) + * + * // Returns 0.5 + * return
{output}
+ * } + * + * ``` + * + * @param inputRange - A linear series of numbers (either all increasing or decreasing). + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - Clamp: clamp values to within the given range. Defaults to `true`. + * + * @public + */ +declare function transform(inputRange: number[], outputRange: T[], options?: TransformOptions): (inputValue: number) => T; + +/** + * Options for useFollowValue hook, extending ValueAnimationTransition + * but excluding lifecycle callbacks that don't make sense for the hook pattern. + */ +type FollowValueOptions = Omit; +/** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ +declare function followValue(source: T | MotionValue, options?: FollowValueOptions): MotionValue; +/** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ +declare function attachFollow(value: MotionValue, source: T | MotionValue, options?: FollowValueOptions): VoidFunction; + +type MapInputRange = number[]; +/** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ +declare function mapValue(inputValue: MotionValue, inputRange: MapInputRange, outputRange: O[], options?: TransformOptions): MotionValue; + +/** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ +declare function springValue(source: T | MotionValue, options?: SpringOptions): MotionValue; +/** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ +declare function attachSpring(value: MotionValue, source: T | MotionValue, options?: SpringOptions): VoidFunction; + +type TransformInputRange = number[]; +type SingleTransformer = (input: I) => O; +type MultiTransformer = (input: I[]) => O; +type ValueTransformer = SingleTransformer | MultiTransformer; +/** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ +declare function transformValue(transform: () => O): MotionValue; + +declare const color: { + test: (v: any) => boolean; + parse: (v: any) => RGBA | HSLA; + transform: (v: HSLA | RGBA | string) => string; + getAnimatableNone: (v: string) => string; +}; + +declare function parseHex(v: string): RGBA; +declare const hex: { + test: (v: any) => boolean; + parse: typeof parseHex; + transform: ({ red, green, blue, alpha }: RGBA) => string; +}; + +declare const hsla: { + test: (v: any) => boolean; + parse: (v: string | Color) => HSLA; + transform: ({ hue, saturation, lightness, alpha }: HSLA) => string; +}; + +declare function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA; + +declare const rgbUnit: { + transform: (v: number) => number; + test: (v: number) => boolean; + parse: typeof parseFloat; +}; +declare const rgba: { + test: (v: any) => boolean; + parse: (v: string | Color) => RGBA; + transform: ({ red, green, blue, alpha }: RGBA) => string; +}; + +declare function test(v: any): boolean; +type ComplexValues = Array; +interface ValueIndexes { + color: number[]; + number: number[]; + var: number[]; +} +interface ComplexValueInfo { + values: ComplexValues; + split: string[]; + indexes: ValueIndexes; + types: Array; +} +declare function analyseComplexValue(value: AnyResolvedKeyframe): ComplexValueInfo; +declare function parseComplexValue(v: AnyResolvedKeyframe): ComplexValues; +declare function createTransformer(source: AnyResolvedKeyframe): (v: Array) => string; +declare function getAnimatableNone$1(v: AnyResolvedKeyframe): string; +declare const complex: { + test: typeof test; + parse: typeof parseComplexValue; + createTransformer: typeof createTransformer; + getAnimatableNone: typeof getAnimatableNone$1; +}; + +/** + * A list of value types commonly used for dimensions + */ +declare const dimensionValueTypes: ({ + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +} | { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: string | number) => string; +} | ValueType)[]; +/** + * Tests a dimensional value against the list of dimension ValueTypes + */ +declare const findDimensionValueType: (v: any) => { + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +} | { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: string | number) => string; +} | ValueType | undefined; + +interface ValueTypeMap { + [key: string]: ValueType; +} + +/** + * A map of default value types for common values + */ +declare const defaultValueTypes: ValueTypeMap; +/** + * Gets the default ValueType for the provided value key + */ +declare const getDefaultValueType: (key: string) => ValueType; + +declare const numberValueTypes: ValueTypeMap; + +declare const transformValueTypes: ValueTypeMap; + +declare const number: { + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +}; +declare const alpha: { + transform: (v: number) => number; + test: (v: number) => boolean; + parse: typeof parseFloat; +}; +declare const scale: { + default: number; + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +}; + +declare const degrees: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const percent: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const px: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const vh: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const vw: { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: number | string) => string; +}; +declare const progressPercentage: { + parse: (v: string) => number; + transform: (v: number) => string; + test: (v: AnyResolvedKeyframe) => boolean; +}; + +/** + * Tests a provided value against a ValueType + */ +declare const testValueType: (v: any) => (type: ValueType) => boolean; + +declare function getAnimatableNone(key: string, value: string): any; + +/** + * Tests a value against the list of ValueTypes + */ +declare const findValueType: (v: any) => { + test: (v: number) => boolean; + parse: typeof parseFloat; + transform: (v: number) => number; +} | { + test: (v: AnyResolvedKeyframe) => boolean; + parse: typeof parseFloat; + transform: (v: string | number) => string; +} | ValueType | { + test: (v: any) => boolean; + parse: (v: any) => RGBA | HSLA; + transform: (v: string | RGBA | HSLA) => string; + getAnimatableNone: (v: string) => string; +} | { + test: (v: any) => boolean; + parse: (v: AnyResolvedKeyframe) => ComplexValues; + createTransformer: (source: AnyResolvedKeyframe) => (v: (string | number | Color)[]) => string; + getAnimatableNone: (v: AnyResolvedKeyframe) => string; +} | undefined; + +/** + * Provided a value and a ValueType, returns the value as that value type. + */ +declare const getValueAsType: (value: any, type?: ValueType) => any; + +declare const isMotionValue: (value: any) => value is MotionValue; + +declare function addValueToWillChange(visualElement: VisualElement, key: string): void; + +interface WillChange extends MotionValue { + add(name: string): void; +} + +declare function isWillChangeMotionValue(value: any): value is WillChange; + +type ViewTransitionAnimationDefinition = { + keyframes: DOMKeyframesDefinition; + options: AnimationOptions; +}; +type ViewTransitionTarget = { + layout?: ViewTransitionAnimationDefinition; + enter?: ViewTransitionAnimationDefinition; + exit?: ViewTransitionAnimationDefinition; + new?: ViewTransitionAnimationDefinition; + old?: ViewTransitionAnimationDefinition; +}; +type ViewTransitionOptions = AnimationOptions & { + interrupt?: "wait" | "immediate"; +}; +type ViewTransitionTargetDefinition = string | Element; + +declare class ViewTransitionBuilder { + private currentSubject; + targets: Map; + update: () => void | Promise; + options: ViewTransitionOptions; + notifyReady: (value: GroupAnimation) => void; + private readyPromise; + constructor(update: () => void | Promise, options?: ViewTransitionOptions); + get(subject: ViewTransitionTargetDefinition): this; + layout(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions): this; + crossfade(options?: AnimationOptions): this; + updateTarget(target: "enter" | "exit" | "layout" | "new" | "old", keyframes: DOMKeyframesDefinition, options?: AnimationOptions): void; + then(resolve: () => void, reject?: () => void): Promise; +} +declare function animateView(update: () => void | Promise, defaultOptions?: ViewTransitionOptions): ViewTransitionBuilder; + +declare function getViewAnimationLayerInfo(pseudoElement: string): { + layer: string; + type: string; +} | null; + +declare function getViewAnimations(): Animation[]; + +interface DOMVisualElementOptions { + /** + * If `true`, this element will be included in the projection tree. + * + * Default: `true` + * + * @public + */ + allowProjection?: boolean; + /** + * Allow this element to be GPU-accelerated. We currently enable this by + * adding a `translateZ(0)`. + * + * @public + */ + enableHardwareAcceleration?: boolean; +} + +declare abstract class DOMVisualElement extends VisualElement { + sortInstanceNodePosition(a: Instance, b: Instance): number; + getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | MotionValue | undefined; + removeValueFromRenderState(key: string, { vars, style }: HTMLRenderState): void; + KeyframeResolver: typeof DOMKeyframesResolver; + childSubscription?: VoidFunction; + handleChildMotionValue(): void; +} + +/** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ +declare abstract class Feature { + isMounted: boolean; + node: VisualElement; + constructor(node: VisualElement); + abstract mount(): void; + abstract unmount(): void; + update(): void; +} + +declare function renderHTML(element: HTMLElement, { style, vars }: HTMLRenderState, styleProp?: MotionStyle, projection?: any): void; + +declare class HTMLVisualElement extends DOMVisualElement { + type: string; + readValueFromInstance(instance: HTMLElement, key: string): AnyResolvedKeyframe | null | undefined; + measureInstanceViewportBox(instance: HTMLElement, { transformPagePoint }: MotionNodeOptions & Partial): Box; + build(renderState: HTMLRenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; + scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement: VisualElement): { + [key: string]: any; + }; + renderInstance: typeof renderHTML; +} + +interface ObjectRenderState { + output: ResolvedValues$1; +} +declare class ObjectVisualElement extends VisualElement { + type: string; + readValueFromInstance(instance: Object, key: string): undefined; + getBaseTargetFromProps(): undefined; + removeValueFromRenderState(key: string, renderState: ObjectRenderState): void; + measureInstanceViewportBox(): motion_utils.Box; + build(renderState: ObjectRenderState, latestValues: ResolvedValues$1): void; + renderInstance(instance: Object, { output }: ObjectRenderState): void; + sortInstanceNodePosition(): number; +} + +declare const visualElementStore: WeakMap>; + +declare class SVGVisualElement extends DOMVisualElement { + type: string; + isSVGTag: boolean; + getBaseTargetFromProps(props: MotionNodeOptions, key: string): AnyResolvedKeyframe | MotionValue | undefined; + readValueFromInstance(instance: SVGElement, key: string): any; + measureInstanceViewportBox: () => motion_utils.Box; + scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement: VisualElement): { + [key: string]: any; + }; + build(renderState: SVGRenderState, latestValues: ResolvedValues$1, props: MotionNodeOptions): void; + renderInstance(instance: SVGElement, renderState: SVGRenderState, styleProp?: MotionStyle | undefined, projection?: any): void; + mount(instance: SVGElement): void; +} + +type VariantStateContext = { + initial?: string | string[]; + animate?: string | string[]; + exit?: string | string[]; + whileHover?: string | string[]; + whileDrag?: string | string[]; + whileFocus?: string | string[]; + whileTap?: string | string[]; +}; +/** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +declare function getVariantContext(visualElement?: any): undefined | VariantStateContext; + +declare function isAnimationControls(v?: unknown): v is LegacyAnimationControls; + +declare function isControllingVariants(props: MotionNodeOptions): boolean; +declare function isVariantNode(props: MotionNodeOptions): boolean; + +/** + * Minimal interface for projection node properties used by scale correctors. + * This avoids circular dependencies with the full IProjectionNode interface. + */ +interface ScaleCorrectionNode { + target?: Box; + treeScale?: Point; + projectionDelta?: Delta; +} +type ScaleCorrector = (latest: AnyResolvedKeyframe, node: ScaleCorrectionNode) => AnyResolvedKeyframe; +interface ScaleCorrectorDefinition { + correct: ScaleCorrector; + applyTo?: string[]; + isCSSVariable?: boolean; +} +interface ScaleCorrectorMap { + [key: string]: ScaleCorrectorDefinition; +} + +declare const scaleCorrectors: ScaleCorrectorMap; +declare function addScaleCorrector(correctors: ScaleCorrectorMap): void; + +declare function isForcedMotionValue(key: string, { layout, layoutId }: MotionNodeOptions): boolean; + +/** + * Decides if the supplied variable is variant label + */ +declare function isVariantLabel(v: unknown): v is string | string[]; + +type MotionStyleLike = Record; +/** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ +declare function updateMotionValuesFromProps(element: any, next: MotionStyleLike, prev: MotionStyleLike): MotionStyleLike; + +/** + * Resolves a variant if it's a variant resolver. + * Uses `any` type for visualElement to avoid circular dependencies. + */ +declare function resolveVariant(visualElement: any, definition?: TargetAndTransition | TargetResolver, custom?: any): TargetAndTransition; +declare function resolveVariant(visualElement: any, definition?: AnimationDefinition, custom?: any): TargetAndTransition | undefined; + +declare function resolveVariantFromProps(props: MotionNodeOptions, definition: TargetAndTransition | TargetResolver, custom?: any, visualElement?: any): TargetAndTransition; +declare function resolveVariantFromProps(props: MotionNodeOptions, definition?: AnimationDefinition, custom?: any, visualElement?: any): undefined | TargetAndTransition; + +declare function setTarget(visualElement: VisualElement, definition: AnimationDefinition): void; + +declare const variantPriorityOrder: AnimationType[]; +declare const variantProps: string[]; + +interface ReducedMotionState { + current: boolean | null; +} +declare const prefersReducedMotion: ReducedMotionState; +declare const hasReducedMotionListener: { + current: boolean; +}; + +declare function initPrefersReducedMotion(): void; + +/** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ +declare function convertBoundingBoxToBox({ top, left, right, bottom, }: BoundingBox): Box; +declare function convertBoxToBoundingBox({ x, y }: Box): BoundingBox; +/** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ +declare function transformBoxPoints(point: BoundingBox, transformPoint?: TransformPoint): BoundingBox; + +/** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ +declare function copyAxisInto(axis: Axis, originAxis: Axis): void; +/** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ +declare function copyBoxInto(box: Box, originBox: Box): void; +/** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ +declare function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta): void; + +/** + * Scales a point based on a factor and an originPoint + */ +declare function scalePoint(point: number, scale: number, originPoint: number): number; +/** + * Applies a translate/scale delta to a point + */ +declare function applyPointDelta(point: number, translate: number, scale: number, originPoint: number, boxScale?: number): number; +/** + * Applies a translate/scale delta to an axis + */ +declare function applyAxisDelta(axis: Axis, translate: number | undefined, scale: number | undefined, originPoint: number, boxScale?: number): void; +/** + * Applies a translate/scale delta to a box + */ +declare function applyBoxDelta(box: Box, { x, y }: Delta): void; +/** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ +declare function applyTreeDeltas(box: Box, treeScale: Point, treePath: any[], isSharedTransition?: boolean): void; +declare function translateAxis(axis: Axis, distance: number): void; +/** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ +declare function transformAxis(axis: Axis, axisTranslate?: number, axisScale?: number, boxScale?: number, axisOrigin?: number): void; +/** + * Apply a transform to a box from the latest resolved motion values. + */ +declare function transformBox(box: Box, transform: ResolvedValues$1): void; + +declare function calcLength(axis: Axis): number; +declare function isNear(value: number, target: number, maxDistance: number): boolean; +declare function calcAxisDelta(delta: AxisDelta, source: Axis, target: Axis, origin?: number): void; +declare function calcBoxDelta(delta: Delta, source: Box, target: Box, origin?: ResolvedValues$1): void; +declare function calcRelativeAxis(target: Axis, relative: Axis, parent: Axis): void; +declare function calcRelativeBox(target: Box, relative: Box, parent: Box): void; +declare function calcRelativeAxisPosition(target: Axis, layout: Axis, parent: Axis): void; +declare function calcRelativePosition(target: Box, layout: Box, parent: Box): void; + +/** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ +declare function removePointDelta(point: number, translate: number, scale: number, originPoint: number, boxScale?: number): number; +/** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ +declare function removeAxisDelta(axis: Axis, translate?: number | string, scale?: number, origin?: number, boxScale?: number, originAxis?: Axis, sourceAxis?: Axis): void; +/** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +declare function removeAxisTransforms(axis: Axis, transforms: ResolvedValues$1, [key, scaleKey, originKey]: string[], origin?: Axis, sourceAxis?: Axis): void; +/** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ +declare function removeBoxTransforms(box: Box, transforms: ResolvedValues$1, originBox?: Box, sourceBox?: Box): void; + +declare const createAxisDelta: () => AxisDelta; +declare const createDelta: () => Delta; +declare const createAxis: () => Axis; +declare const createBox: () => Box; + +declare function isDeltaZero(delta: Delta): boolean; +declare function axisEquals(a: Axis, b: Axis): boolean; +declare function boxEquals(a: Box, b: Box): boolean; +declare function axisEqualsRounded(a: Axis, b: Axis): boolean; +declare function boxEqualsRounded(a: Box, b: Box): boolean; +declare function aspectRatio(box: Box): number; +declare function axisDeltaEquals(a: AxisDelta, b: AxisDelta): boolean; + +type Callback = (axis: "x" | "y") => void; +declare function eachAxis(callback: Callback): void[]; + +declare function hasScale({ scale, scaleX, scaleY }: ResolvedValues$1): boolean; +declare function hasTransform(values: ResolvedValues$1): true | AnyResolvedKeyframe; +declare function has2DTranslate(values: ResolvedValues$1): boolean | "" | 0 | undefined; + +declare function measureViewportBox(instance: HTMLElement, transformPoint?: TransformPoint): motion_utils.Box; +declare function measurePageBox(element: HTMLElement, rootProjectionNode: any, transformPagePoint?: TransformPoint): motion_utils.Box; + +declare function pixelsToPercent(pixels: number, axis: Axis): number; +/** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ +declare const correctBorderRadius: ScaleCorrectorDefinition; + +declare const correctBoxShadow: ScaleCorrectorDefinition; + +declare function buildProjectionTransform(delta: Delta, treeScale: Point, latestTransform?: ResolvedValues$1): string; + +declare function mixValues(target: ResolvedValues$1, follow: ResolvedValues$1, lead: ResolvedValues$1, progress: number, shouldCrossfadeOpacity: boolean, isOnlyMember: boolean): void; + +declare function animateSingleValue(value: MotionValue | V, keyframes: V | UnresolvedValueKeyframe[], options?: ValueAnimationTransition): AnimationPlaybackControlsWithThen; + +declare function addDomEvent(target: EventTarget, eventName: string, handler: EventListener, options?: AddEventListenerOptions): () => void; + +interface WithDepth { + depth: number; +} +declare const compareByDepth: (a: VisualElement, b: VisualElement) => number; + +declare class FlatTree { + private children; + private isDirty; + add(child: WithDepth): void; + remove(child: WithDepth): void; + forEach(callback: (child: WithDepth) => void): void; +} + +type DelayedFunction = (overshoot: number) => void; +/** + * Timeout defined in ms + */ +declare function delay(callback: DelayedFunction, timeout: number): () => void; +declare function delayInSeconds(callback: DelayedFunction, timeout: number): () => void; + +/** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ +declare function resolveMotionValue(value?: AnyResolvedKeyframe | MotionValue): AnyResolvedKeyframe; + +interface Measurements { + animationId: number; + measuredBox: Box; + layoutBox: Box; + latestValues: ResolvedValues$1; + source: number; +} +type Phase = "snapshot" | "measure"; +interface ScrollMeasurements { + animationId: number; + phase: Phase; + offset: Point; + isRoot: boolean; + wasRoot: boolean; +} +type LayoutEvents = "willUpdate" | "didUpdate" | "beforeMeasure" | "measure" | "projectionUpdate" | "animationStart" | "animationComplete"; +interface IProjectionNode { + linkedParentVersion: number; + layoutVersion: number; + id: number; + animationId: number; + animationCommitId: number; + parent?: IProjectionNode; + relativeParent?: IProjectionNode; + root?: IProjectionNode; + children: Set; + path: IProjectionNode[]; + nodes?: FlatTree; + depth: number; + instance: I | undefined; + mount: (node: I, isLayoutDirty?: boolean) => void; + unmount: () => void; + options: ProjectionNodeOptions; + setOptions(options: ProjectionNodeOptions): void; + layout?: Measurements; + snapshot?: Measurements; + target?: Box; + relativeTarget?: Box; + relativeTargetOrigin?: Box; + targetDelta?: Delta; + targetWithTransforms?: Box; + scroll?: ScrollMeasurements; + treeScale?: Point; + projectionDelta?: Delta; + projectionDeltaWithTransform?: Delta; + latestValues: ResolvedValues$1; + isLayoutDirty: boolean; + isProjectionDirty: boolean; + isSharedProjectionDirty: boolean; + isTransformDirty: boolean; + resolvedRelativeTargetAt?: number; + shouldResetTransform: boolean; + prevTransformTemplateValue: string | undefined; + isUpdateBlocked(): boolean; + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + blockUpdate(): void; + unblockUpdate(): void; + isUpdating: boolean; + needsReset: boolean; + startUpdate(): void; + willUpdate(notifyListeners?: boolean): void; + didUpdate(): void; + measure(removeTransform?: boolean): Measurements; + measurePageBox(): Box; + updateLayout(): void; + updateSnapshot(): void; + clearSnapshot(): void; + updateScroll(phase?: Phase): void; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed(): void; + sharedNodes: Map; + registerSharedNode(id: string, node: IProjectionNode): void; + getStack(): NodeStack | undefined; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + setTargetDelta(delta: Delta): void; + resetTransform(): void; + resetSkewAndRotation(): void; + applyTransform(box: Box, transformOnly?: boolean): Box; + resolveTargetDelta(force?: boolean): void; + calcProjection(): void; + applyProjectionStyles(targetStyle: CSSStyleDeclaration, styleProp?: MotionStyle): void; + clearMeasurements(): void; + resetTree(): void; + isProjecting(): boolean; + animationValues?: ResolvedValues$1; + currentAnimation?: JSAnimation; + isTreeAnimating?: boolean; + isAnimationBlocked?: boolean; + isTreeAnimationBlocked: () => boolean; + setAnimationOrigin(delta: Delta): void; + startAnimation(transition: ValueTransition): void; + finishAnimation(): void; + hasCheckedOptimisedAppear: boolean; + isLead(): boolean; + promote(options?: { + needsReset?: boolean; + transition?: Transition; + preserveFollowOpacity?: boolean; + }): void; + relegate(): boolean; + resumeFrom?: IProjectionNode; + resumingFrom?: IProjectionNode; + isPresent?: boolean; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + hasTreeAnimated: boolean; + preserveOpacity?: boolean; +} +interface LayoutUpdateData { + layout: Box; + snapshot: Measurements; + delta: Delta; + layoutDelta: Delta; + hasLayoutChanged: boolean; + hasRelativeLayoutChanged: boolean; +} +type LayoutUpdateHandler = (data: LayoutUpdateData) => void; +interface ProjectionNodeConfig { + defaultParent?: () => IProjectionNode; + attachResizeListener?: (instance: I, notifyResize: VoidFunction) => VoidFunction; + measureScroll: (instance: I) => Point; + checkIsScrollRoot: (instance: I) => boolean; + resetTransform?: (instance: I, value?: string) => void; +} +/** + * Configuration for initial promotion of shared layout elements. + * This was originally in React's SwitchLayoutGroupContext but is now + * framework-agnostic to support vanilla JS usage. + */ +interface InitialPromotionConfig { + /** + * The initial transition to use when the elements in this group mount (and automatically promoted). + * Subsequent updates should provide a transition in the promote method. + */ + transition?: Transition; + /** + * If the follow tree should preserve its opacity when the lead is promoted on mount + */ + shouldPreserveFollowOpacity?: (member: IProjectionNode) => boolean; +} +interface ProjectionNodeOptions { + animate?: boolean; + layoutScroll?: boolean; + layoutRoot?: boolean; + alwaysMeasureLayout?: boolean; + onExitComplete?: VoidFunction; + animationType?: "size" | "position" | "both" | "preserve-aspect"; + layoutId?: string; + layout?: boolean | string; + visualElement?: VisualElement; + crossfade?: boolean; + transition?: Transition; + initialPromotionConfig?: InitialPromotionConfig; + layoutDependency?: unknown; +} +type ProjectionEventName = "layoutUpdate" | "projectionUpdate"; + +declare class NodeStack { + lead?: IProjectionNode; + prevLead?: IProjectionNode; + members: IProjectionNode[]; + add(node: IProjectionNode): void; + remove(node: IProjectionNode): void; + relegate(node: IProjectionNode): boolean; + promote(node: IProjectionNode, preserveFollowOpacity?: boolean): void; + exitAnimationComplete(): void; + scheduleRender(): void; + /** + * Clear any leads that have been removed this render to prevent them from being + * used in future animations and to prevent memory leaks + */ + removeLeadSnapshot(): void; +} + +declare function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }: ProjectionNodeConfig): { + new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { + /** + * A unique ID generated for every projection node. + */ + id: number; + /** + * An id that represents a unique session instigated by startUpdate. + */ + animationId: number; + animationCommitId: number; + /** + * A reference to the platform-native node (currently this will be a HTMLElement). + */ + instance: I | undefined; + /** + * A reference to the root projection node. There'll only ever be one tree and one root. + */ + root: IProjectionNode; + /** + * A reference to this node's parent. + */ + parent?: IProjectionNode | undefined; + /** + * A path from this node to the root node. This provides a fast way to iterate + * back up the tree. + */ + path: IProjectionNode[]; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + children: Set>; + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + options: ProjectionNodeOptions; + /** + * A snapshot of the element's state just before the current update. This is + * hydrated when this node's `willUpdate` method is called and scrubbed at the + * end of the tree's `didUpdate` method. + */ + snapshot: Measurements | undefined; + /** + * A box defining the element's layout relative to the page. This will have been + * captured with all parent scrolls and projection transforms unset. + */ + layout: Measurements | undefined; + /** + * The layout used to calculate the previous layout animation. We use this to compare + * layouts between renders and decide whether we need to trigger a new layout animation + * or just let the current one play out. + */ + targetLayout?: Box | undefined; + /** + * A mutable data structure we use to apply all parent transforms currently + * acting on the element's layout. It's from here we can calculate the projectionDelta + * required to get the element from its layout into its calculated target box. + */ + layoutCorrected: Box; + /** + * An ideal projection transform we want to apply to the element. This is calculated, + * usually when an element's layout has changed, and we want the element to look as though + * its in its previous layout on the next frame. From there, we animated it down to 0 + * to animate the element to its new layout. + */ + targetDelta?: Delta | undefined; + /** + * A mutable structure representing the visual bounding box on the page where we want + * and element to appear. This can be set directly but is currently derived once a frame + * from apply targetDelta to layout. + */ + target?: Box | undefined; + /** + * A mutable structure describing a visual bounding box relative to the element's + * projected parent. If defined, target will be derived from this rather than targetDelta. + * If not defined, we'll attempt to calculate on the first layout animation frame + * based on the targets calculated from targetDelta. This will transfer a layout animation + * from viewport-relative to parent-relative. + */ + relativeTarget?: Box | undefined; + relativeTargetOrigin?: Box | undefined; + relativeParent?: IProjectionNode | undefined; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + isTreeAnimating: boolean; + isAnimationBlocked: boolean; + /** + * If true, attempt to resolve relativeTarget. + */ + attemptToResolveRelativeTarget?: boolean | undefined; + /** + * A mutable structure that represents the target as transformed by the element's + * latest user-set transforms (ie scale, x) + */ + targetWithTransforms?: Box | undefined; + /** + * The previous projection delta, which we can compare with the newly calculated + * projection delta to see if we need to render. + */ + prevProjectionDelta?: Delta | undefined; + /** + * A calculated transform that will project an element from its layoutCorrected + * into the target. This will be used by children to calculate their own layoutCorrect boxes. + */ + projectionDelta?: Delta | undefined; + /** + * A calculated transform that will project an element from its layoutCorrected + * into the targetWithTransforms. + */ + projectionDeltaWithTransform?: Delta | undefined; + /** + * If we're tracking the scroll of this element, we store it here. + */ + scroll?: ScrollMeasurements | undefined; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + isLayoutDirty: boolean; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + isProjectionDirty: boolean; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + isSharedProjectionDirty: boolean; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + isTransformDirty: boolean; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + isUpdating: boolean; + /** + * If this is an SVG element we currently disable projection transforms + */ + isSVG: boolean; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + needsReset: boolean; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + shouldResetTransform: boolean; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + hasCheckedOptimisedAppear: boolean; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + treeScale: Point; + /** + * Is hydrated with a projection node if an element is animating from another. + */ + resumeFrom?: IProjectionNode | undefined; + /** + * Is hydrated with a projection node if an element is animating from another. + */ + resumingFrom?: IProjectionNode | undefined; + /** + * A reference to the element's latest animated values. This is a reference shared + * between the element's VisualElement and the ProjectionNode. + */ + latestValues: ResolvedValues$1; + /** + * + */ + eventHandlers: Map>; + nodes?: FlatTree | undefined; + depth: number; + /** + * If transformTemplate generates a different value before/after the + * update, we need to reset the transform. + */ + prevTransformTemplateValue: string | undefined; + preserveOpacity?: boolean | undefined; + hasTreeAnimated: boolean; + layoutVersion: number; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + /** + * Lifecycles + */ + mount(instance: I): void; + unmount(): void; + blockUpdate(): void; + unblockUpdate(): void; + isUpdateBlocked(): boolean; + isTreeAnimationBlocked(): boolean; + startUpdate(): void; + getTransformTemplate(): TransformTemplate | undefined; + willUpdate(shouldNotifyListeners?: boolean): void; + updateScheduled: boolean; + update(): void; + scheduleUpdate: () => void; + didUpdate(): void; + clearAllSnapshots(): void; + projectionUpdateScheduled: boolean; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed: () => void; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + updateProjection: () => void; + /** + * Update measurements + */ + updateSnapshot(): void; + updateLayout(): void; + updateScroll(phase?: Phase): void; + resetTransform(): void; + measure(removeTransform?: boolean): { + animationId: number; + measuredBox: Box; + layoutBox: Box; + latestValues: {}; + source: number; + }; + measurePageBox(): Box; + removeElementScroll(box: Box): Box; + applyTransform(box: Box, transformOnly?: boolean): Box; + removeTransform(box: Box): Box; + setTargetDelta(delta: Delta): void; + setOptions(options: ProjectionNodeOptions): void; + clearMeasurements(): void; + forceRelativeParentToResolveTarget(): void; + /** + * Frame calculations + */ + resolvedRelativeTargetAt: number; + resolveTargetDelta(forceRecalculation?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + isProjecting(): boolean; + linkedParentVersion: number; + createRelativeTarget(relativeParent: IProjectionNode, layout: Box, parentLayout: Box): void; + removeRelativeTarget(): void; + hasProjected: boolean; + calcProjection(): void; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + createProjectionDeltas(): void; + /** + * Animation + */ + animationValues?: ResolvedValues$1 | undefined; + pendingAnimation?: Process | undefined; + currentAnimation?: JSAnimation | undefined; + mixTargetDelta: (progress: number) => void; + animationProgress: number; + setAnimationOrigin(delta: Delta, hasOnlyRelativeTargetChanged?: boolean): void; + motionValue?: MotionValue | undefined; + startAnimation(options: ValueAnimationOptions): void; + completeAnimation(): void; + finishAnimation(): void; + applyTransformsToTarget(): void; + /** + * Shared layout + */ + sharedNodes: Map; + registerSharedNode(layoutId: string, node: IProjectionNode): void; + isLead(): boolean; + getLead(): IProjectionNode | any; + getPrevLead(): IProjectionNode | undefined; + getStack(): NodeStack | undefined; + promote({ needsReset, transition, preserveFollowOpacity, }?: { + needsReset?: boolean | undefined; + transition?: Transition | undefined; + preserveFollowOpacity?: boolean | undefined; + }): void; + relegate(): boolean; + resetSkewAndRotation(): void; + applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle): void; + clearSnapshot(): void; + resetTree(): void; + }; +}; +declare function propagateDirtyNodes(node: IProjectionNode): void; +declare function cleanDirtyNodes(node: IProjectionNode): void; + +declare const DocumentProjectionNode: { + new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { + id: number; + animationId: number; + animationCommitId: number; + instance: Window | undefined; + root: IProjectionNode; + parent?: IProjectionNode | undefined; + path: IProjectionNode[]; + children: Set>; + options: ProjectionNodeOptions; + snapshot: Measurements | undefined; + layout: Measurements | undefined; + targetLayout?: motion_utils.Box | undefined; + layoutCorrected: motion_utils.Box; + targetDelta?: motion_utils.Delta | undefined; + target?: motion_utils.Box | undefined; + relativeTarget?: motion_utils.Box | undefined; + relativeTargetOrigin?: motion_utils.Box | undefined; + relativeParent?: IProjectionNode | undefined; + isTreeAnimating: boolean; + isAnimationBlocked: boolean; + attemptToResolveRelativeTarget?: boolean | undefined; + targetWithTransforms?: motion_utils.Box | undefined; + prevProjectionDelta?: motion_utils.Delta | undefined; + projectionDelta?: motion_utils.Delta | undefined; + projectionDeltaWithTransform?: motion_utils.Delta | undefined; + scroll?: ScrollMeasurements | undefined; + isLayoutDirty: boolean; + isProjectionDirty: boolean; + isSharedProjectionDirty: boolean; + isTransformDirty: boolean; + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + isUpdating: boolean; + isSVG: boolean; + needsReset: boolean; + shouldResetTransform: boolean; + hasCheckedOptimisedAppear: boolean; + treeScale: motion_utils.Point; + resumeFrom?: IProjectionNode | undefined; + resumingFrom?: IProjectionNode | undefined; + latestValues: ResolvedValues$1; + eventHandlers: Map>; + nodes?: FlatTree | undefined; + depth: number; + prevTransformTemplateValue: string | undefined; + preserveOpacity?: boolean | undefined; + hasTreeAnimated: boolean; + layoutVersion: number; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + mount(instance: Window): void; + unmount(): void; + blockUpdate(): void; + unblockUpdate(): void; + isUpdateBlocked(): boolean; + isTreeAnimationBlocked(): boolean; + startUpdate(): void; + getTransformTemplate(): TransformTemplate | undefined; + willUpdate(shouldNotifyListeners?: boolean): void; + updateScheduled: boolean; + update(): void; + scheduleUpdate: () => void; + didUpdate(): void; + clearAllSnapshots(): void; + projectionUpdateScheduled: boolean; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed: () => void; + updateProjection: () => void; + updateSnapshot(): void; + updateLayout(): void; + updateScroll(phase?: Phase): void; + resetTransform(): void; + measure(removeTransform?: boolean): { + animationId: number; + measuredBox: motion_utils.Box; + layoutBox: motion_utils.Box; + latestValues: {}; + source: number; + }; + measurePageBox(): motion_utils.Box; + removeElementScroll(box: motion_utils.Box): motion_utils.Box; + applyTransform(box: motion_utils.Box, transformOnly?: boolean): motion_utils.Box; + removeTransform(box: motion_utils.Box): motion_utils.Box; + setTargetDelta(delta: motion_utils.Delta): void; + setOptions(options: ProjectionNodeOptions): void; + clearMeasurements(): void; + forceRelativeParentToResolveTarget(): void; + resolvedRelativeTargetAt: number; + resolveTargetDelta(forceRecalculation?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + isProjecting(): boolean; + linkedParentVersion: number; + createRelativeTarget(relativeParent: IProjectionNode, layout: motion_utils.Box, parentLayout: motion_utils.Box): void; + removeRelativeTarget(): void; + hasProjected: boolean; + calcProjection(): void; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + createProjectionDeltas(): void; + animationValues?: ResolvedValues$1 | undefined; + pendingAnimation?: Process | undefined; + currentAnimation?: JSAnimation | undefined; + mixTargetDelta: (progress: number) => void; + animationProgress: number; + setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean): void; + motionValue?: MotionValue | undefined; + startAnimation(options: ValueAnimationOptions): void; + completeAnimation(): void; + finishAnimation(): void; + applyTransformsToTarget(): void; + sharedNodes: Map; + registerSharedNode(layoutId: string, node: IProjectionNode): void; + isLead(): boolean; + getLead(): IProjectionNode | any; + getPrevLead(): IProjectionNode | undefined; + getStack(): NodeStack | undefined; + promote({ needsReset, transition, preserveFollowOpacity, }?: { + needsReset?: boolean | undefined; + transition?: Transition | undefined; + preserveFollowOpacity?: boolean | undefined; + }): void; + relegate(): boolean; + resetSkewAndRotation(): void; + applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle | undefined): void; + clearSnapshot(): void; + resetTree(): void; + }; +}; + +interface NodeGroup { + add: (node: IProjectionNode) => void; + remove: (node: IProjectionNode) => void; + dirty: VoidFunction; +} +declare function nodeGroup(): NodeGroup; + +declare const rootProjectionNode: { + current: IProjectionNode | undefined; +}; +declare const HTMLProjectionNode: { + new (latestValues?: ResolvedValues$1, parent?: IProjectionNode | undefined): { + id: number; + animationId: number; + animationCommitId: number; + instance: HTMLElement | undefined; + root: IProjectionNode; + parent?: IProjectionNode | undefined; + path: IProjectionNode[]; + children: Set>; + options: ProjectionNodeOptions; + snapshot: Measurements | undefined; + layout: Measurements | undefined; + targetLayout?: motion_utils.Box | undefined; + layoutCorrected: motion_utils.Box; + targetDelta?: motion_utils.Delta | undefined; + target?: motion_utils.Box | undefined; + relativeTarget?: motion_utils.Box | undefined; + relativeTargetOrigin?: motion_utils.Box | undefined; + relativeParent?: IProjectionNode | undefined; + isTreeAnimating: boolean; + isAnimationBlocked: boolean; + attemptToResolveRelativeTarget?: boolean | undefined; + targetWithTransforms?: motion_utils.Box | undefined; + prevProjectionDelta?: motion_utils.Delta | undefined; + projectionDelta?: motion_utils.Delta | undefined; + projectionDeltaWithTransform?: motion_utils.Delta | undefined; + scroll?: ScrollMeasurements | undefined; + isLayoutDirty: boolean; + isProjectionDirty: boolean; + isSharedProjectionDirty: boolean; + isTransformDirty: boolean; + updateManuallyBlocked: boolean; + updateBlockedByResize: boolean; + isUpdating: boolean; + isSVG: boolean; + needsReset: boolean; + shouldResetTransform: boolean; + hasCheckedOptimisedAppear: boolean; + treeScale: motion_utils.Point; + resumeFrom?: IProjectionNode | undefined; + resumingFrom?: IProjectionNode | undefined; + latestValues: ResolvedValues$1; + eventHandlers: Map>; + nodes?: FlatTree | undefined; + depth: number; + prevTransformTemplateValue: string | undefined; + preserveOpacity?: boolean | undefined; + hasTreeAnimated: boolean; + layoutVersion: number; + addEventListener(name: LayoutEvents, handler: any): VoidFunction; + notifyListeners(name: LayoutEvents, ...args: any): void; + hasListeners(name: LayoutEvents): boolean; + mount(instance: HTMLElement): void; + unmount(): void; + blockUpdate(): void; + unblockUpdate(): void; + isUpdateBlocked(): boolean; + isTreeAnimationBlocked(): boolean; + startUpdate(): void; + getTransformTemplate(): TransformTemplate | undefined; + willUpdate(shouldNotifyListeners?: boolean): void; + updateScheduled: boolean; + update(): void; + scheduleUpdate: () => void; + didUpdate(): void; + clearAllSnapshots(): void; + projectionUpdateScheduled: boolean; + scheduleUpdateProjection(): void; + scheduleCheckAfterUnmount(): void; + checkUpdateFailed: () => void; + updateProjection: () => void; + updateSnapshot(): void; + updateLayout(): void; + updateScroll(phase?: Phase): void; + resetTransform(): void; + measure(removeTransform?: boolean): { + animationId: number; + measuredBox: motion_utils.Box; + layoutBox: motion_utils.Box; + latestValues: {}; + source: number; + }; + measurePageBox(): motion_utils.Box; + removeElementScroll(box: motion_utils.Box): motion_utils.Box; + applyTransform(box: motion_utils.Box, transformOnly?: boolean): motion_utils.Box; + removeTransform(box: motion_utils.Box): motion_utils.Box; + setTargetDelta(delta: motion_utils.Delta): void; + setOptions(options: ProjectionNodeOptions): void; + clearMeasurements(): void; + forceRelativeParentToResolveTarget(): void; + resolvedRelativeTargetAt: number; + resolveTargetDelta(forceRecalculation?: boolean): void; + getClosestProjectingParent(): IProjectionNode | undefined; + isProjecting(): boolean; + linkedParentVersion: number; + createRelativeTarget(relativeParent: IProjectionNode, layout: motion_utils.Box, parentLayout: motion_utils.Box): void; + removeRelativeTarget(): void; + hasProjected: boolean; + calcProjection(): void; + isVisible: boolean; + hide(): void; + show(): void; + scheduleRender(notifyAll?: boolean): void; + createProjectionDeltas(): void; + animationValues?: ResolvedValues$1 | undefined; + pendingAnimation?: Process | undefined; + currentAnimation?: JSAnimation | undefined; + mixTargetDelta: (progress: number) => void; + animationProgress: number; + setAnimationOrigin(delta: motion_utils.Delta, hasOnlyRelativeTargetChanged?: boolean): void; + motionValue?: MotionValue | undefined; + startAnimation(options: ValueAnimationOptions): void; + completeAnimation(): void; + finishAnimation(): void; + applyTransformsToTarget(): void; + sharedNodes: Map; + registerSharedNode(layoutId: string, node: IProjectionNode): void; + isLead(): boolean; + getLead(): IProjectionNode | any; + getPrevLead(): IProjectionNode | undefined; + getStack(): NodeStack | undefined; + promote({ needsReset, transition, preserveFollowOpacity, }?: { + needsReset?: boolean | undefined; + transition?: Transition | undefined; + preserveFollowOpacity?: boolean | undefined; + }): void; + relegate(): boolean; + resetSkewAndRotation(): void; + applyProjectionStyles(targetStyle: any, styleProp?: MotionStyle | undefined): void; + clearSnapshot(): void; + resetTree(): void; + }; +}; + +/** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ +declare const globalProjectionState: { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: boolean; + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: boolean; +}; + +declare function camelToDash(str: string): string; + +declare function buildHTMLStyles(state: HTMLRenderState, latestValues: ResolvedValues$1, transformTemplate?: MotionNodeOptions["transformTemplate"]): void; + +/** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ +declare function buildTransform(latestValues: ResolvedValues$1, transform: HTMLRenderState["transform"], transformTemplate?: MotionNodeOptions["transformTemplate"]): string; + +declare function scrapeMotionValuesFromProps$1(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: VisualElement): { + [key: string]: any; +}; + +/** + * Build SVG visual attributes, like cx and style.transform + */ +declare function buildSVGAttrs(state: SVGRenderState, { attrX, attrY, attrScale, pathLength, pathSpacing, pathOffset, ...latest }: ResolvedValues$1, isSVGTag: boolean, transformTemplate?: MotionNodeOptions["transformTemplate"], styleProp?: Record): void; + +/** + * A set of attribute names that are always read/written as camel case. + */ +declare const camelCaseAttributes: Set; + +declare const isSVGTag: (tag: unknown) => boolean; + +/** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ +declare function buildSVGPath(attrs: ResolvedValues$1, length: number, spacing?: number, offset?: number, useDashCase?: boolean): void; + +declare function renderSVG(element: SVGElement, renderState: SVGRenderState, _styleProp?: MotionStyle, projection?: any): void; + +declare function scrapeMotionValuesFromProps(props: MotionNodeOptions, prevProps: MotionNodeOptions, visualElement?: VisualElement): { + [key: string]: any; +}; + +type LayoutAnimationScope = Element | Document; +type LayoutBuilderResolve = (animation: GroupAnimation) => void; +type LayoutBuilderReject = (error: unknown) => void; +declare class LayoutAnimationBuilder { + private scope; + private updateDom; + private defaultOptions?; + private sharedTransitions; + private notifyReady; + private rejectReady; + private readyPromise; + constructor(scope: LayoutAnimationScope, updateDom: () => void | Promise, defaultOptions?: AnimationOptions); + shared(id: string, transition: AnimationOptions): this; + then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject): Promise; + private start; + private buildRecords; + private handleExitingElements; +} +declare function parseAnimateLayoutArgs(scopeOrUpdateDom: ElementOrSelector | (() => void), updateDomOrOptions?: (() => void) | AnimationOptions, options?: AnimationOptions): { + scope: Element | Document; + updateDom: () => void; + defaultOptions?: AnimationOptions; +}; + +/** + * @deprecated + * + * Import as `frame` instead. + */ +declare const sync: Batcher; +/** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ +declare const cancelSync: Record void>; + +export { type AccelerateConfig, type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type FrameStats, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type Phase, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type PropagateOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type Stats, type StatsBuffer, type StatsRecording, type StatsSummary, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type Summary, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, activeAnimations, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveTransition, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw }; diff --git a/node_modules/motion-dom/dist/motion-dom.dev.js b/node_modules/motion-dom/dist/motion-dom.dev.js new file mode 100644 index 00000000..53b96672 --- /dev/null +++ b/node_modules/motion-dom/dist/motion-dom.dev.js @@ -0,0 +1,9777 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('motion-utils')) : + typeof define === 'function' && define.amd ? define(['exports', 'motion-utils'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MotionDom = {}, global.MotionUtils)); +})(this, (function (exports, motionUtils) { 'use strict'; + + const stepsOrder = [ + "setup", // Compute + "read", // Read + "resolveKeyframes", // Write/Read/Write/Read + "preUpdate", // Compute + "update", // Compute + "preRender", // Compute + "render", // Write + "postRender", // Compute + ]; + + const statsBuffer = { + value: null, + addProjectionMetrics: null, + }; + + function createRenderStep(runNextFrame, stepName) { + /** + * We create and reuse two queues, one to queue jobs for the current frame + * and one for the next. We reuse to avoid triggering GC after x frames. + */ + let thisFrame = new Set(); + let nextFrame = new Set(); + /** + * Track whether we're currently processing jobs in this step. This way + * we can decide whether to schedule new jobs for this frame or next. + */ + let isProcessing = false; + let flushNextFrame = false; + /** + * A set of processes which were marked keepAlive when scheduled. + */ + const toKeepAlive = new WeakSet(); + let latestFrameData = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + let numCalls = 0; + function triggerCallback(callback) { + if (toKeepAlive.has(callback)) { + step.schedule(callback); + runNextFrame(); + } + numCalls++; + callback(latestFrameData); + } + const step = { + /** + * Schedule a process to run on the next frame. + */ + schedule: (callback, keepAlive = false, immediate = false) => { + const addToCurrentFrame = immediate && isProcessing; + const queue = addToCurrentFrame ? thisFrame : nextFrame; + if (keepAlive) + toKeepAlive.add(callback); + if (!queue.has(callback)) + queue.add(callback); + return callback; + }, + /** + * Cancel the provided callback from running on the next frame. + */ + cancel: (callback) => { + nextFrame.delete(callback); + toKeepAlive.delete(callback); + }, + /** + * Execute all schedule callbacks. + */ + process: (frameData) => { + latestFrameData = frameData; + /** + * If we're already processing we've probably been triggered by a flushSync + * inside an existing process. Instead of executing, mark flushNextFrame + * as true and ensure we flush the following frame at the end of this one. + */ + if (isProcessing) { + flushNextFrame = true; + return; + } + isProcessing = true; + [thisFrame, nextFrame] = [nextFrame, thisFrame]; + // Execute this frame + thisFrame.forEach(triggerCallback); + /** + * If we're recording stats then + */ + if (stepName && statsBuffer.value) { + statsBuffer.value.frameloop[stepName].push(numCalls); + } + numCalls = 0; + // Clear the frame so no callbacks remain. This is to avoid + // memory leaks should this render step not run for a while. + thisFrame.clear(); + isProcessing = false; + if (flushNextFrame) { + flushNextFrame = false; + step.process(frameData); + } + }, + }; + return step; + } + + const maxElapsed = 40; + function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { + let runNextFrame = false; + let useDefaultElapsed = true; + const state = { + delta: 0.0, + timestamp: 0.0, + isProcessing: false, + }; + const flagRunNextFrame = () => (runNextFrame = true); + const steps = stepsOrder.reduce((acc, key) => { + acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined); + return acc; + }, {}); + const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps; + const processBatch = () => { + const timestamp = motionUtils.MotionGlobalConfig.useManualTiming + ? state.timestamp + : performance.now(); + runNextFrame = false; + if (!motionUtils.MotionGlobalConfig.useManualTiming) { + state.delta = useDefaultElapsed + ? 1000 / 60 + : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); + } + state.timestamp = timestamp; + state.isProcessing = true; + // Unrolled render loop for better per-frame performance + setup.process(state); + read.process(state); + resolveKeyframes.process(state); + preUpdate.process(state); + update.process(state); + preRender.process(state); + render.process(state); + postRender.process(state); + state.isProcessing = false; + if (runNextFrame && allowKeepAlive) { + useDefaultElapsed = false; + scheduleNextBatch(processBatch); + } + }; + const wake = () => { + runNextFrame = true; + useDefaultElapsed = true; + if (!state.isProcessing) { + scheduleNextBatch(processBatch); + } + }; + const schedule = stepsOrder.reduce((acc, key) => { + const step = steps[key]; + acc[key] = (process, keepAlive = false, immediate = false) => { + if (!runNextFrame) + wake(); + return step.schedule(process, keepAlive, immediate); + }; + return acc; + }, {}); + const cancel = (process) => { + for (let i = 0; i < stepsOrder.length; i++) { + steps[stepsOrder[i]].cancel(process); + } + }; + return { schedule, cancel, state, steps }; + } + + const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : motionUtils.noop, true); + + let now; + function clearTime() { + now = undefined; + } + /** + * An eventloop-synchronous alternative to performance.now(). + * + * Ensures that time measurements remain consistent within a synchronous context. + * Usually calling performance.now() twice within the same synchronous context + * will return different values which isn't useful for animations when we're usually + * trying to sync animations to the same frame. + */ + const time = { + now: () => { + if (now === undefined) { + time.set(frameData.isProcessing || motionUtils.MotionGlobalConfig.useManualTiming + ? frameData.timestamp + : performance.now()); + } + return now; + }, + set: (newTime) => { + now = newTime; + queueMicrotask(clearTime); + }, + }; + + const activeAnimations = { + layout: 0, + mainThread: 0, + waapi: 0, + }; + + const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token); + const isCSSVariableName = + /*@__PURE__*/ checkStringStartsWith("--"); + const startsAsVariableToken = + /*@__PURE__*/ checkStringStartsWith("var(--"); + const isCSSVariableToken = (value) => { + const startsWithToken = startsAsVariableToken(value); + if (!startsWithToken) + return false; + // Ensure any comments are stripped from the value as this can harm performance of the regex. + return singleCssVariableRegex.test(value.split("/*")[0].trim()); + }; + const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; + /** + * Check if a value contains a CSS variable anywhere (e.g. inside calc()). + * Unlike isCSSVariableToken which checks if the value IS a var() token, + * this checks if the value CONTAINS var() somewhere in the string. + */ + function containsCSSVariable(value) { + if (typeof value !== "string") + return false; + // Strip comments to avoid false positives + return value.split("/*")[0].includes("var(--"); + } + + const number = { + test: (v) => typeof v === "number", + parse: parseFloat, + transform: (v) => v, + }; + const alpha = { + ...number, + transform: (v) => motionUtils.clamp(0, 1, v), + }; + const scale = { + ...number, + default: 1, + }; + + // If this number is a decimal, make it just five decimal places + // to avoid exponents + const sanitize = (v) => Math.round(v * 100000) / 100000; + + const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; + + function isNullish(v) { + return v == null; + } + + const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; + + /** + * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000, + * but false if a number or multiple colors + */ + const isColorString = (type, testProp) => (v) => { + return Boolean((typeof v === "string" && + singleColorRegex.test(v) && + v.startsWith(type)) || + (testProp && + !isNullish(v) && + Object.prototype.hasOwnProperty.call(v, testProp))); + }; + const splitColor = (aName, bName, cName) => (v) => { + if (typeof v !== "string") + return v; + const [a, b, c, alpha] = v.match(floatRegex); + return { + [aName]: parseFloat(a), + [bName]: parseFloat(b), + [cName]: parseFloat(c), + alpha: alpha !== undefined ? parseFloat(alpha) : 1, + }; + }; + + const clampRgbUnit = (v) => motionUtils.clamp(0, 255, v); + const rgbUnit = { + ...number, + transform: (v) => Math.round(clampRgbUnit(v)), + }; + const rgba = { + test: /*@__PURE__*/ isColorString("rgb", "red"), + parse: /*@__PURE__*/ splitColor("red", "green", "blue"), + transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + + rgbUnit.transform(red) + + ", " + + rgbUnit.transform(green) + + ", " + + rgbUnit.transform(blue) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")", + }; + + function parseHex(v) { + let r = ""; + let g = ""; + let b = ""; + let a = ""; + // If we have 6 characters, ie #FF0000 + if (v.length > 5) { + r = v.substring(1, 3); + g = v.substring(3, 5); + b = v.substring(5, 7); + a = v.substring(7, 9); + // Or we have 3 characters, ie #F00 + } + else { + r = v.substring(1, 2); + g = v.substring(2, 3); + b = v.substring(3, 4); + a = v.substring(4, 5); + r += r; + g += g; + b += b; + a += a; + } + return { + red: parseInt(r, 16), + green: parseInt(g, 16), + blue: parseInt(b, 16), + alpha: a ? parseInt(a, 16) / 255 : 1, + }; + } + const hex = { + test: /*@__PURE__*/ isColorString("#"), + parse: parseHex, + transform: rgba.transform, + }; + + /*#__NO_SIDE_EFFECTS__*/ + const createUnitType = (unit) => ({ + test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1, + parse: parseFloat, + transform: (v) => `${v}${unit}`, + }); + const degrees = /*@__PURE__*/ createUnitType("deg"); + const percent = /*@__PURE__*/ createUnitType("%"); + const px = /*@__PURE__*/ createUnitType("px"); + const vh = /*@__PURE__*/ createUnitType("vh"); + const vw = /*@__PURE__*/ createUnitType("vw"); + const progressPercentage = /*@__PURE__*/ (() => ({ + ...percent, + parse: (v) => percent.parse(v) / 100, + transform: (v) => percent.transform(v * 100), + }))(); + + const hsla = { + test: /*@__PURE__*/ isColorString("hsl", "hue"), + parse: /*@__PURE__*/ splitColor("hue", "saturation", "lightness"), + transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { + return ("hsla(" + + Math.round(hue) + + ", " + + percent.transform(sanitize(saturation)) + + ", " + + percent.transform(sanitize(lightness)) + + ", " + + sanitize(alpha.transform(alpha$1)) + + ")"); + }, + }; + + const color = { + test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v), + parse: (v) => { + if (rgba.test(v)) { + return rgba.parse(v); + } + else if (hsla.test(v)) { + return hsla.parse(v); + } + else { + return hex.parse(v); + } + }, + transform: (v) => { + return typeof v === "string" + ? v + : v.hasOwnProperty("red") + ? rgba.transform(v) + : hsla.transform(v); + }, + getAnimatableNone: (v) => { + const parsed = color.parse(v); + parsed.alpha = 0; + return color.transform(parsed); + }, + }; + + const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; + + function test(v) { + return (isNaN(v) && + typeof v === "string" && + (v.match(floatRegex)?.length || 0) + + (v.match(colorRegex)?.length || 0) > + 0); + } + const NUMBER_TOKEN = "number"; + const COLOR_TOKEN = "color"; + const VAR_TOKEN = "var"; + const VAR_FUNCTION_TOKEN = "var("; + const SPLIT_TOKEN = "${}"; + // this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex` + const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; + function analyseComplexValue(value) { + const originalValue = value.toString(); + const values = []; + const indexes = { + color: [], + number: [], + var: [], + }; + const types = []; + let i = 0; + const tokenised = originalValue.replace(complexRegex, (parsedValue) => { + if (color.test(parsedValue)) { + indexes.color.push(i); + types.push(COLOR_TOKEN); + values.push(color.parse(parsedValue)); + } + else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { + indexes.var.push(i); + types.push(VAR_TOKEN); + values.push(parsedValue); + } + else { + indexes.number.push(i); + types.push(NUMBER_TOKEN); + values.push(parseFloat(parsedValue)); + } + ++i; + return SPLIT_TOKEN; + }); + const split = tokenised.split(SPLIT_TOKEN); + return { values, split, indexes, types }; + } + function parseComplexValue(v) { + return analyseComplexValue(v).values; + } + function createTransformer(source) { + const { split, types } = analyseComplexValue(source); + const numSections = split.length; + return (v) => { + let output = ""; + for (let i = 0; i < numSections; i++) { + output += split[i]; + if (v[i] !== undefined) { + const type = types[i]; + if (type === NUMBER_TOKEN) { + output += sanitize(v[i]); + } + else if (type === COLOR_TOKEN) { + output += color.transform(v[i]); + } + else { + output += v[i]; + } + } + } + return output; + }; + } + const convertNumbersToZero = (v) => typeof v === "number" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v; + function getAnimatableNone$1(v) { + const parsed = parseComplexValue(v); + const transformer = createTransformer(v); + return transformer(parsed.map(convertNumbersToZero)); + } + const complex = { + test, + parse: parseComplexValue, + createTransformer, + getAnimatableNone: getAnimatableNone$1, + }; + + // Adapted from https://gist.github.com/mjackson/5311256 + function hueToRgb(p, q, t) { + if (t < 0) + t += 1; + if (t > 1) + t -= 1; + if (t < 1 / 6) + return p + (q - p) * 6 * t; + if (t < 1 / 2) + return q; + if (t < 2 / 3) + return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + function hslaToRgba({ hue, saturation, lightness, alpha }) { + hue /= 360; + saturation /= 100; + lightness /= 100; + let red = 0; + let green = 0; + let blue = 0; + if (!saturation) { + red = green = blue = lightness; + } + else { + const q = lightness < 0.5 + ? lightness * (1 + saturation) + : lightness + saturation - lightness * saturation; + const p = 2 * lightness - q; + red = hueToRgb(p, q, hue + 1 / 3); + green = hueToRgb(p, q, hue); + blue = hueToRgb(p, q, hue - 1 / 3); + } + return { + red: Math.round(red * 255), + green: Math.round(green * 255), + blue: Math.round(blue * 255), + alpha, + }; + } + + function mixImmediate(a, b) { + return (p) => (p > 0 ? b : a); + } + + /* + Value in range from progress + + Given a lower limit and an upper limit, we return the value within + that range as expressed by progress (usually a number from 0 to 1) + + So progress = 0.5 would change + + from -------- to + + to + + from ---- to + + E.g. from = 10, to = 20, progress = 0.5 => 15 + + @param [number]: Lower limit of range + @param [number]: Upper limit of range + @param [number]: The progress between lower and upper limits expressed 0-1 + @return [number]: Value as calculated from progress within range (not limited within range) + */ + const mixNumber$1 = (from, to, progress) => { + return from + (to - from) * progress; + }; + + // Linear color space blending + // Explained https://www.youtube.com/watch?v=LKnqECcg6Gw + // Demonstrated http://codepen.io/osublake/pen/xGVVaN + const mixLinearColor = (from, to, v) => { + const fromExpo = from * from; + const expo = v * (to * to - fromExpo) + fromExpo; + return expo < 0 ? 0 : Math.sqrt(expo); + }; + const colorTypes = [hex, rgba, hsla]; + const getColorType = (v) => colorTypes.find((type) => type.test(v)); + function asRGBA(color) { + const type = getColorType(color); + motionUtils.warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"); + if (!Boolean(type)) + return false; + let model = type.parse(color); + if (type === hsla) { + // TODO Remove this cast - needed since Motion's stricter typing + model = hslaToRgba(model); + } + return model; + } + const mixColor = (from, to) => { + const fromRGBA = asRGBA(from); + const toRGBA = asRGBA(to); + if (!fromRGBA || !toRGBA) { + return mixImmediate(from, to); + } + const blended = { ...fromRGBA }; + return (v) => { + blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v); + blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v); + blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v); + blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v); + return rgba.transform(blended); + }; + }; + + const invisibleValues = new Set(["none", "hidden"]); + /** + * Returns a function that, when provided a progress value between 0 and 1, + * will return the "none" or "hidden" string only when the progress is that of + * the origin or target. + */ + function mixVisibility(origin, target) { + if (invisibleValues.has(origin)) { + return (p) => (p <= 0 ? origin : target); + } + else { + return (p) => (p >= 1 ? target : origin); + } + } + + function mixNumber(a, b) { + return (p) => mixNumber$1(a, b, p); + } + function getMixer(a) { + if (typeof a === "number") { + return mixNumber; + } + else if (typeof a === "string") { + return isCSSVariableToken(a) + ? mixImmediate + : color.test(a) + ? mixColor + : mixComplex; + } + else if (Array.isArray(a)) { + return mixArray; + } + else if (typeof a === "object") { + return color.test(a) ? mixColor : mixObject; + } + return mixImmediate; + } + function mixArray(a, b) { + const output = [...a]; + const numValues = output.length; + const blendValue = a.map((v, i) => getMixer(v)(v, b[i])); + return (p) => { + for (let i = 0; i < numValues; i++) { + output[i] = blendValue[i](p); + } + return output; + }; + } + function mixObject(a, b) { + const output = { ...a, ...b }; + const blendValue = {}; + for (const key in output) { + if (a[key] !== undefined && b[key] !== undefined) { + blendValue[key] = getMixer(a[key])(a[key], b[key]); + } + } + return (v) => { + for (const key in blendValue) { + output[key] = blendValue[key](v); + } + return output; + }; + } + function matchOrder(origin, target) { + const orderedOrigin = []; + const pointers = { color: 0, var: 0, number: 0 }; + for (let i = 0; i < target.values.length; i++) { + const type = target.types[i]; + const originIndex = origin.indexes[type][pointers[type]]; + const originValue = origin.values[originIndex] ?? 0; + orderedOrigin[i] = originValue; + pointers[type]++; + } + return orderedOrigin; + } + const mixComplex = (origin, target) => { + const template = complex.createTransformer(target); + const originStats = analyseComplexValue(origin); + const targetStats = analyseComplexValue(target); + const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && + originStats.indexes.color.length === targetStats.indexes.color.length && + originStats.indexes.number.length >= targetStats.indexes.number.length; + if (canInterpolate) { + if ((invisibleValues.has(origin) && + !targetStats.values.length) || + (invisibleValues.has(target) && + !originStats.values.length)) { + return mixVisibility(origin, target); + } + return motionUtils.pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); + } + else { + motionUtils.warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"); + return mixImmediate(origin, target); + } + }; + + function mix(from, to, p) { + if (typeof from === "number" && + typeof to === "number" && + typeof p === "number") { + return mixNumber$1(from, to, p); + } + const mixer = getMixer(from); + return mixer(from, to); + } + + const frameloopDriver = (update) => { + const passTimestamp = ({ timestamp }) => update(timestamp); + return { + start: (keepAlive = true) => frame.update(passTimestamp, keepAlive), + stop: () => cancelFrame(passTimestamp), + /** + * If we're processing this frame we can use the + * framelocked timestamp to keep things in sync. + */ + now: () => (frameData.isProcessing ? frameData.timestamp : time.now()), + }; + }; + + const generateLinearEasing = (easing, duration, // as milliseconds + resolution = 10 // as milliseconds + ) => { + let points = ""; + const numPoints = Math.max(Math.round(duration / resolution), 2); + for (let i = 0; i < numPoints; i++) { + points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", "; + } + return `linear(${points.substring(0, points.length - 2)})`; + }; + + /** + * Implement a practical max duration for keyframe generation + * to prevent infinite loops + */ + const maxGeneratorDuration = 20000; + function calcGeneratorDuration(generator) { + let duration = 0; + const timeStep = 50; + let state = generator.next(duration); + while (!state.done && duration < maxGeneratorDuration) { + duration += timeStep; + state = generator.next(duration); + } + return duration >= maxGeneratorDuration ? Infinity : duration; + } + + /** + * Create a progress => progress easing function from a generator. + */ + function createGeneratorEasing(options, scale = 100, createGenerator) { + const generator = createGenerator({ ...options, keyframes: [0, scale] }); + const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + return { + type: "keyframes", + ease: (progress) => { + return generator.next(duration * progress).value / scale; + }, + duration: motionUtils.millisecondsToSeconds(duration), + }; + } + + const velocitySampleDuration = 5; // ms + function calcGeneratorVelocity(resolveValue, t, current) { + const prevT = Math.max(t - velocitySampleDuration, 0); + return motionUtils.velocityPerSecond(current - resolveValue(prevT), t - prevT); + } + + const springDefaults = { + // Default spring physics + stiffness: 100, + damping: 10, + mass: 1.0, + velocity: 0.0, + // Default duration/bounce-based options + duration: 800, // in ms + bounce: 0.3, + visualDuration: 0.3, // in seconds + // Rest thresholds + restSpeed: { + granular: 0.01, + default: 2, + }, + restDelta: { + granular: 0.005, + default: 0.5, + }, + // Limits + minDuration: 0.01, // in seconds + maxDuration: 10.0, // in seconds + minDamping: 0.05, + maxDamping: 1, + }; + + const safeMin = 0.001; + function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) { + let envelope; + let derivative; + motionUtils.warning(duration <= motionUtils.secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit"); + let dampingRatio = 1 - bounce; + /** + * Restrict dampingRatio and duration to within acceptable ranges. + */ + dampingRatio = motionUtils.clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); + duration = motionUtils.clamp(springDefaults.minDuration, springDefaults.maxDuration, motionUtils.millisecondsToSeconds(duration)); + if (dampingRatio < 1) { + /** + * Underdamped spring + */ + envelope = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const a = exponentialDecay - velocity; + const b = calcAngularFreq(undampedFreq, dampingRatio); + const c = Math.exp(-delta); + return safeMin - (a / b) * c; + }; + derivative = (undampedFreq) => { + const exponentialDecay = undampedFreq * dampingRatio; + const delta = exponentialDecay * duration; + const d = delta * velocity + velocity; + const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; + const f = Math.exp(-delta); + const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); + const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; + return (factor * ((d - e) * f)) / g; + }; + } + else { + /** + * Critically-damped spring + */ + envelope = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (undampedFreq - velocity) * duration + 1; + return -safeMin + a * b; + }; + derivative = (undampedFreq) => { + const a = Math.exp(-undampedFreq * duration); + const b = (velocity - undampedFreq) * (duration * duration); + return a * b; + }; + } + const initialGuess = 5 / duration; + const undampedFreq = approximateRoot(envelope, derivative, initialGuess); + duration = motionUtils.secondsToMilliseconds(duration); + if (isNaN(undampedFreq)) { + return { + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + duration, + }; + } + else { + const stiffness = Math.pow(undampedFreq, 2) * mass; + return { + stiffness, + damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), + duration, + }; + } + } + const rootIterations = 12; + function approximateRoot(envelope, derivative, initialGuess) { + let result = initialGuess; + for (let i = 1; i < rootIterations; i++) { + result = result - envelope(result) / derivative(result); + } + return result; + } + function calcAngularFreq(undampedFreq, dampingRatio) { + return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); + } + + const durationKeys = ["duration", "bounce"]; + const physicsKeys = ["stiffness", "damping", "mass"]; + function isSpringType(options, keys) { + return keys.some((key) => options[key] !== undefined); + } + function getSpringOptions(options) { + let springOptions = { + velocity: springDefaults.velocity, + stiffness: springDefaults.stiffness, + damping: springDefaults.damping, + mass: springDefaults.mass, + isResolvedFromDuration: false, + ...options, + }; + // stiffness/damping/mass overrides duration/bounce + if (!isSpringType(options, physicsKeys) && + isSpringType(options, durationKeys)) { + if (options.visualDuration) { + const visualDuration = options.visualDuration; + const root = (2 * Math.PI) / (visualDuration * 1.2); + const stiffness = root * root; + const damping = 2 * + motionUtils.clamp(0.05, 1, 1 - (options.bounce || 0)) * + Math.sqrt(stiffness); + springOptions = { + ...springOptions, + mass: springDefaults.mass, + stiffness, + damping, + }; + } + else { + const derived = findSpring(options); + springOptions = { + ...springOptions, + ...derived, + mass: springDefaults.mass, + }; + springOptions.isResolvedFromDuration = true; + } + } + return springOptions; + } + function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { + const options = typeof optionsOrVisualDuration !== "object" + ? { + visualDuration: optionsOrVisualDuration, + keyframes: [0, 1], + bounce, + } + : optionsOrVisualDuration; + let { restSpeed, restDelta } = options; + const origin = options.keyframes[0]; + const target = options.keyframes[options.keyframes.length - 1]; + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { done: false, value: origin }; + const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({ + ...options, + velocity: -motionUtils.millisecondsToSeconds(options.velocity || 0), + }); + const initialVelocity = velocity || 0.0; + const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); + const initialDelta = target - origin; + const undampedAngularFreq = motionUtils.millisecondsToSeconds(Math.sqrt(stiffness / mass)); + /** + * If we're working on a granular scale, use smaller defaults for determining + * when the spring is finished. + * + * These defaults have been selected emprically based on what strikes a good + * ratio between feeling good and finishing as soon as changes are imperceptible. + */ + const isGranularScale = Math.abs(initialDelta) < 5; + restSpeed || (restSpeed = isGranularScale + ? springDefaults.restSpeed.granular + : springDefaults.restSpeed.default); + restDelta || (restDelta = isGranularScale + ? springDefaults.restDelta.granular + : springDefaults.restDelta.default); + let resolveSpring; + if (dampingRatio < 1) { + const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); + // Underdamped spring + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + return (target - + envelope * + (((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) / + angularFreq) * + Math.sin(angularFreq * t) + + initialDelta * Math.cos(angularFreq * t))); + }; + } + else if (dampingRatio === 1) { + // Critically damped spring + resolveSpring = (t) => target - + Math.exp(-undampedAngularFreq * t) * + (initialDelta + + (initialVelocity + undampedAngularFreq * initialDelta) * t); + } + else { + // Overdamped spring + const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); + resolveSpring = (t) => { + const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); + // When performing sinh or cosh values can hit Infinity so we cap them here + const freqForT = Math.min(dampedAngularFreq * t, 300); + return (target - + (envelope * + ((initialVelocity + + dampingRatio * undampedAngularFreq * initialDelta) * + Math.sinh(freqForT) + + dampedAngularFreq * + initialDelta * + Math.cosh(freqForT))) / + dampedAngularFreq); + }; + } + const generator = { + calculatedDuration: isResolvedFromDuration ? duration || null : null, + next: (t) => { + const current = resolveSpring(t); + if (!isResolvedFromDuration) { + let currentVelocity = t === 0 ? initialVelocity : 0.0; + /** + * We only need to calculate velocity for under-damped springs + * as over- and critically-damped springs can't overshoot, so + * checking only for displacement is enough. + */ + if (dampingRatio < 1) { + currentVelocity = + t === 0 + ? motionUtils.secondsToMilliseconds(initialVelocity) + : calcGeneratorVelocity(resolveSpring, t, current); + } + const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; + const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; + state.done = + isBelowVelocityThreshold && isBelowDisplacementThreshold; + } + else { + state.done = t >= duration; + } + state.value = state.done ? target : current; + return state; + }, + toString: () => { + const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); + const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30); + return calculatedDuration + "ms " + easing; + }, + toTransition: () => { }, + }; + return generator; + } + spring.applyToOptions = (options) => { + const generatorOptions = createGeneratorEasing(options, 100, spring); + options.ease = generatorOptions.ease; + options.duration = motionUtils.secondsToMilliseconds(generatorOptions.duration); + options.type = "keyframes"; + return options; + }; + + function inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) { + const origin = keyframes[0]; + const state = { + done: false, + value: origin, + }; + const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max); + const nearestBoundary = (v) => { + if (min === undefined) + return max; + if (max === undefined) + return min; + return Math.abs(min - v) < Math.abs(max - v) ? min : max; + }; + let amplitude = power * velocity; + const ideal = origin + amplitude; + const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); + /** + * If the target has changed we need to re-calculate the amplitude, otherwise + * the animation will start from the wrong position. + */ + if (target !== ideal) + amplitude = target - origin; + const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant); + const calcLatest = (t) => target + calcDelta(t); + const applyFriction = (t) => { + const delta = calcDelta(t); + const latest = calcLatest(t); + state.done = Math.abs(delta) <= restDelta; + state.value = state.done ? target : latest; + }; + /** + * Ideally this would resolve for t in a stateless way, we could + * do that by always precalculating the animation but as we know + * this will be done anyway we can assume that spring will + * be discovered during that. + */ + let timeReachedBoundary; + let spring$1; + const checkCatchBoundary = (t) => { + if (!isOutOfBounds(state.value)) + return; + timeReachedBoundary = t; + spring$1 = spring({ + keyframes: [state.value, nearestBoundary(state.value)], + velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000 + damping: bounceDamping, + stiffness: bounceStiffness, + restDelta, + restSpeed, + }); + }; + checkCatchBoundary(0); + return { + calculatedDuration: null, + next: (t) => { + /** + * We need to resolve the friction to figure out if we need a + * spring but we don't want to do this twice per frame. So here + * we flag if we updated for this frame and later if we did + * we can skip doing it again. + */ + let hasUpdatedFrame = false; + if (!spring$1 && timeReachedBoundary === undefined) { + hasUpdatedFrame = true; + applyFriction(t); + checkCatchBoundary(t); + } + /** + * If we have a spring and the provided t is beyond the moment the friction + * animation crossed the min/max boundary, use the spring. + */ + if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) { + return spring$1.next(t - timeReachedBoundary); + } + else { + !hasUpdatedFrame && applyFriction(t); + return state; + } + }, + }; + } + + function createMixers(output, ease, customMixer) { + const mixers = []; + const mixerFactory = customMixer || motionUtils.MotionGlobalConfig.mix || mix; + const numMixers = output.length - 1; + for (let i = 0; i < numMixers; i++) { + let mixer = mixerFactory(output[i], output[i + 1]); + if (ease) { + const easingFunction = Array.isArray(ease) ? ease[i] || motionUtils.noop : ease; + mixer = motionUtils.pipe(easingFunction, mixer); + } + mixers.push(mixer); + } + return mixers; + } + /** + * Create a function that maps from a numerical input array to a generic output array. + * + * Accepts: + * - Numbers + * - Colors (hex, hsl, hsla, rgb, rgba) + * - Complex (combinations of one or more numbers or strings) + * + * ```jsx + * const mixColor = interpolate([0, 1], ['#fff', '#000']) + * + * mixColor(0.5) // 'rgba(128, 128, 128, 1)' + * ``` + * + * TODO Revisit this approach once we've moved to data models for values, + * probably not needed to pregenerate mixer functions. + * + * @public + */ + function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { + const inputLength = input.length; + motionUtils.invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length"); + /** + * If we're only provided a single input, we can just make a function + * that returns the output. + */ + if (inputLength === 1) + return () => output[0]; + if (inputLength === 2 && output[0] === output[1]) + return () => output[1]; + const isZeroDeltaRange = input[0] === input[1]; + // If input runs highest -> lowest, reverse both arrays + if (input[0] > input[inputLength - 1]) { + input = [...input].reverse(); + output = [...output].reverse(); + } + const mixers = createMixers(output, ease, mixer); + const numMixers = mixers.length; + const interpolator = (v) => { + if (isZeroDeltaRange && v < input[0]) + return output[0]; + let i = 0; + if (numMixers > 1) { + for (; i < input.length - 2; i++) { + if (v < input[i + 1]) + break; + } + } + const progressInRange = motionUtils.progress(input[i], input[i + 1], v); + return mixers[i](progressInRange); + }; + return isClamp + ? (v) => interpolator(motionUtils.clamp(input[0], input[inputLength - 1], v)) + : interpolator; + } + + function fillOffset(offset, remaining) { + const min = offset[offset.length - 1]; + for (let i = 1; i <= remaining; i++) { + const offsetProgress = motionUtils.progress(0, remaining, i); + offset.push(mixNumber$1(min, 1, offsetProgress)); + } + } + + function defaultOffset(arr) { + const offset = [0]; + fillOffset(offset, arr.length - 1); + return offset; + } + + function convertOffsetToTimes(offset, duration) { + return offset.map((o) => o * duration); + } + + function defaultEasing(values, easing) { + return values.map(() => easing || motionUtils.easeInOut).splice(0, values.length - 1); + } + function keyframes({ duration = 300, keyframes: keyframeValues, times, ease = "easeInOut", }) { + /** + * Easing functions can be externally defined as strings. Here we convert them + * into actual functions. + */ + const easingFunctions = motionUtils.isEasingArray(ease) + ? ease.map(motionUtils.easingDefinitionToFunction) + : motionUtils.easingDefinitionToFunction(ease); + /** + * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator + * to reduce GC during animation. + */ + const state = { + done: false, + value: keyframeValues[0], + }; + /** + * Create a times array based on the provided 0-1 offsets + */ + const absoluteTimes = convertOffsetToTimes( + // Only use the provided offsets if they're the correct length + // TODO Maybe we should warn here if there's a length mismatch + times && times.length === keyframeValues.length + ? times + : defaultOffset(keyframeValues), duration); + const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { + ease: Array.isArray(easingFunctions) + ? easingFunctions + : defaultEasing(keyframeValues, easingFunctions), + }); + return { + calculatedDuration: duration, + next: (t) => { + state.value = mapTimeToKeyframe(t); + state.done = t >= duration; + return state; + }, + }; + } + + const isNotNull$1 = (value) => value !== null; + function getFinalKeyframe$1(keyframes, { repeat, repeatType = "loop" }, finalKeyframe, speed = 1) { + const resolvedKeyframes = keyframes.filter(isNotNull$1); + const useFirstKeyframe = speed < 0 || (repeat && repeatType !== "loop" && repeat % 2 === 1); + const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; + } + + const transitionTypeMap = { + decay: inertia, + inertia, + tween: keyframes, + keyframes: keyframes, + spring, + }; + function replaceTransitionType(transition) { + if (typeof transition.type === "string") { + transition.type = transitionTypeMap[transition.type]; + } + } + + class WithPromise { + constructor() { + this.updateFinished(); + } + get finished() { + return this._finished; + } + updateFinished() { + this._finished = new Promise((resolve) => { + this.resolve = resolve; + }); + } + notifyFinished() { + this.resolve(); + } + /** + * Allows the animation to be awaited. + * + * @deprecated Use `finished` instead. + */ + then(onResolve, onReject) { + return this.finished.then(onResolve, onReject); + } + } + + const percentToProgress = (percent) => percent / 100; + class JSAnimation extends WithPromise { + constructor(options) { + super(); + this.state = "idle"; + this.startTime = null; + this.isStopped = false; + /** + * The current time of the animation. + */ + this.currentTime = 0; + /** + * The time at which the animation was paused. + */ + this.holdTime = null; + /** + * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed. + */ + this.playbackSpeed = 1; + /** + * This method is bound to the instance to fix a pattern where + * animation.stop is returned as a reference from a useEffect. + */ + this.stop = () => { + const { motionValue } = this.options; + if (motionValue && motionValue.updatedAt !== time.now()) { + this.tick(time.now()); + } + this.isStopped = true; + if (this.state === "idle") + return; + this.teardown(); + this.options.onStop?.(); + }; + activeAnimations.mainThread++; + this.options = options; + this.initAnimation(); + this.play(); + if (options.autoplay === false) + this.pause(); + } + initAnimation() { + const { options } = this; + replaceTransitionType(options); + const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options; + let { keyframes: keyframes$1 } = options; + const generatorFactory = type || keyframes; + if (generatorFactory !== keyframes) { + motionUtils.invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, "spring-two-frames"); + } + if (generatorFactory !== keyframes && + typeof keyframes$1[0] !== "number") { + this.mixKeyframes = motionUtils.pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); + keyframes$1 = [0, 100]; + } + const generator = generatorFactory({ ...options, keyframes: keyframes$1 }); + /** + * If we have a mirror repeat type we need to create a second generator that outputs the + * mirrored (not reversed) animation and later ping pong between the two generators. + */ + if (repeatType === "mirror") { + this.mirroredGenerator = generatorFactory({ + ...options, + keyframes: [...keyframes$1].reverse(), + velocity: -velocity, + }); + } + /** + * If duration is undefined and we have repeat options, + * we need to calculate a duration from the generator. + * + * We set it to the generator itself to cache the duration. + * Any timeline resolver will need to have already precalculated + * the duration by this step. + */ + if (generator.calculatedDuration === null) { + generator.calculatedDuration = calcGeneratorDuration(generator); + } + const { calculatedDuration } = generator; + this.calculatedDuration = calculatedDuration; + this.resolvedDuration = calculatedDuration + repeatDelay; + this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay; + this.generator = generator; + } + updateTime(timestamp) { + const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed; + // Update currentTime + if (this.holdTime !== null) { + this.currentTime = this.holdTime; + } + else { + // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 = + // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for + // example. + this.currentTime = animationTime; + } + } + tick(timestamp, sample = false) { + const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this; + if (this.startTime === null) + return generator.next(0); + const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options; + /** + * requestAnimationFrame timestamps can come through as lower than + * the startTime as set by performance.now(). Here we prevent this, + * though in the future it could be possible to make setting startTime + * a pending operation that gets resolved here. + */ + if (this.speed > 0) { + this.startTime = Math.min(this.startTime, timestamp); + } + else if (this.speed < 0) { + this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); + } + if (sample) { + this.currentTime = timestamp; + } + else { + this.updateTime(timestamp); + } + // Rebase on delay + const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1); + const isInDelayPhase = this.playbackSpeed >= 0 + ? timeWithoutDelay < 0 + : timeWithoutDelay > totalDuration; + this.currentTime = Math.max(timeWithoutDelay, 0); + // If this animation has finished, set the current time to the total duration. + if (this.state === "finished" && this.holdTime === null) { + this.currentTime = totalDuration; + } + let elapsed = this.currentTime; + let frameGenerator = generator; + if (repeat) { + /** + * Get the current progress (0-1) of the animation. If t is > + * than duration we'll get values like 2.5 (midway through the + * third iteration) + */ + const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration; + /** + * Get the current iteration (0 indexed). For instance the floor of + * 2.5 is 2. + */ + let currentIteration = Math.floor(progress); + /** + * Get the current progress of the iteration by taking the remainder + * so 2.5 is 0.5 through iteration 2 + */ + let iterationProgress = progress % 1.0; + /** + * If iteration progress is 1 we count that as the end + * of the previous iteration. + */ + if (!iterationProgress && progress >= 1) { + iterationProgress = 1; + } + iterationProgress === 1 && currentIteration--; + currentIteration = Math.min(currentIteration, repeat + 1); + /** + * Reverse progress if we're not running in "normal" direction + */ + const isOddIteration = Boolean(currentIteration % 2); + if (isOddIteration) { + if (repeatType === "reverse") { + iterationProgress = 1 - iterationProgress; + if (repeatDelay) { + iterationProgress -= repeatDelay / resolvedDuration; + } + } + else if (repeatType === "mirror") { + frameGenerator = mirroredGenerator; + } + } + elapsed = motionUtils.clamp(0, 1, iterationProgress) * resolvedDuration; + } + /** + * If we're in negative time, set state as the initial keyframe. + * This prevents delay: x, duration: 0 animations from finishing + * instantly. + */ + const state = isInDelayPhase + ? { done: false, value: keyframes[0] } + : frameGenerator.next(elapsed); + if (mixKeyframes) { + state.value = mixKeyframes(state.value); + } + let { done } = state; + if (!isInDelayPhase && calculatedDuration !== null) { + done = + this.playbackSpeed >= 0 + ? this.currentTime >= totalDuration + : this.currentTime <= 0; + } + const isAnimationFinished = this.holdTime === null && + (this.state === "finished" || (this.state === "running" && done)); + // TODO: The exception for inertia could be cleaner here + if (isAnimationFinished && type !== inertia) { + state.value = getFinalKeyframe$1(keyframes, this.options, finalKeyframe, this.speed); + } + if (onUpdate) { + onUpdate(state.value); + } + if (isAnimationFinished) { + this.finish(); + } + return state; + } + /** + * Allows the returned animation to be awaited or promise-chained. Currently + * resolves when the animation finishes at all but in a future update could/should + * reject if its cancels. + */ + then(resolve, reject) { + return this.finished.then(resolve, reject); + } + get duration() { + return motionUtils.millisecondsToSeconds(this.calculatedDuration); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(this.currentTime); + } + set time(newTime) { + newTime = motionUtils.secondsToMilliseconds(newTime); + this.currentTime = newTime; + if (this.startTime === null || + this.holdTime !== null || + this.playbackSpeed === 0) { + this.holdTime = newTime; + } + else if (this.driver) { + this.startTime = this.driver.now() - newTime / this.playbackSpeed; + } + this.driver?.start(false); + } + get speed() { + return this.playbackSpeed; + } + set speed(newSpeed) { + this.updateTime(time.now()); + const hasChanged = this.playbackSpeed !== newSpeed; + this.playbackSpeed = newSpeed; + if (hasChanged) { + this.time = motionUtils.millisecondsToSeconds(this.currentTime); + } + } + play() { + if (this.isStopped) + return; + const { driver = frameloopDriver, startTime } = this.options; + if (!this.driver) { + this.driver = driver((timestamp) => this.tick(timestamp)); + } + this.options.onPlay?.(); + const now = this.driver.now(); + if (this.state === "finished") { + this.updateFinished(); + this.startTime = now; + } + else if (this.holdTime !== null) { + this.startTime = now - this.holdTime; + } + else if (!this.startTime) { + this.startTime = startTime ?? now; + } + if (this.state === "finished" && this.speed < 0) { + this.startTime += this.calculatedDuration; + } + this.holdTime = null; + /** + * Set playState to running only after we've used it in + * the previous logic. + */ + this.state = "running"; + this.driver.start(); + } + pause() { + this.state = "paused"; + this.updateTime(time.now()); + this.holdTime = this.currentTime; + } + complete() { + if (this.state !== "running") { + this.play(); + } + this.state = "finished"; + this.holdTime = null; + } + finish() { + this.notifyFinished(); + this.teardown(); + this.state = "finished"; + this.options.onComplete?.(); + } + cancel() { + this.holdTime = null; + this.startTime = 0; + this.tick(0); + this.teardown(); + this.options.onCancel?.(); + } + teardown() { + this.state = "idle"; + this.stopDriver(); + this.startTime = this.holdTime = null; + activeAnimations.mainThread--; + } + stopDriver() { + if (!this.driver) + return; + this.driver.stop(); + this.driver = undefined; + } + sample(sampleTime) { + this.startTime = 0; + return this.tick(sampleTime, true); + } + attachTimeline(timeline) { + if (this.options.allowFlatten) { + this.options.type = "keyframes"; + this.options.ease = "linear"; + this.initAnimation(); + } + this.driver?.stop(); + return timeline.observe(this); + } + } + // Legacy function support + function animateValue(options) { + return new JSAnimation(options); + } + + function fillWildcards(keyframes) { + for (let i = 1; i < keyframes.length; i++) { + keyframes[i] ?? (keyframes[i] = keyframes[i - 1]); + } + } + + const radToDeg = (rad) => (rad * 180) / Math.PI; + const rotate = (v) => { + const angle = radToDeg(Math.atan2(v[1], v[0])); + return rebaseAngle(angle); + }; + const matrix2dParsers = { + x: 4, + y: 5, + translateX: 4, + translateY: 5, + scaleX: 0, + scaleY: 3, + scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2, + rotate, + rotateZ: rotate, + skewX: (v) => radToDeg(Math.atan(v[1])), + skewY: (v) => radToDeg(Math.atan(v[2])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2, + }; + const rebaseAngle = (angle) => { + angle = angle % 360; + if (angle < 0) + angle += 360; + return angle; + }; + const rotateZ = rotate; + const scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]); + const scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]); + const matrix3dParsers = { + x: 12, + y: 13, + z: 14, + translateX: 12, + translateY: 13, + translateZ: 14, + scaleX, + scaleY, + scale: (v) => (scaleX(v) + scaleY(v)) / 2, + rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))), + rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))), + rotateZ, + rotate: rotateZ, + skewX: (v) => radToDeg(Math.atan(v[4])), + skewY: (v) => radToDeg(Math.atan(v[1])), + skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2, + }; + function defaultTransformValue(name) { + return name.includes("scale") ? 1 : 0; + } + function parseValueFromTransform(transform, name) { + if (!transform || transform === "none") { + return defaultTransformValue(name); + } + const matrix3dMatch = transform.match(/^matrix3d\(([-\d.e\s,]+)\)$/u); + let parsers; + let match; + if (matrix3dMatch) { + parsers = matrix3dParsers; + match = matrix3dMatch; + } + else { + const matrix2dMatch = transform.match(/^matrix\(([-\d.e\s,]+)\)$/u); + parsers = matrix2dParsers; + match = matrix2dMatch; + } + if (!match) { + return defaultTransformValue(name); + } + const valueParser = parsers[name]; + const values = match[1].split(",").map(convertTransformToNumber); + return typeof valueParser === "function" + ? valueParser(values) + : values[valueParser]; + } + const readTransformValue = (instance, name) => { + const { transform = "none" } = getComputedStyle(instance); + return parseValueFromTransform(transform, name); + }; + function convertTransformToNumber(value) { + return parseFloat(value.trim()); + } + + /** + * Generate a list of every possible transform key. + */ + const transformPropOrder = [ + "transformPerspective", + "x", + "y", + "z", + "translateX", + "translateY", + "translateZ", + "scale", + "scaleX", + "scaleY", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "skew", + "skewX", + "skewY", + ]; + /** + * A quick lookup for transform props. + */ + const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))(); + + const isNumOrPxType = (v) => v === number || v === px; + const transformKeys = new Set(["x", "y", "z"]); + const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); + function removeNonTranslationalTransform(visualElement) { + const removedTransforms = []; + nonTranslationalTransformKeys.forEach((key) => { + const value = visualElement.getValue(key); + if (value !== undefined) { + removedTransforms.push([key, value.get()]); + value.set(key.startsWith("scale") ? 1 : 0); + } + }); + return removedTransforms; + } + const positionalValues = { + // Dimensions + width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight), + height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom), + top: (_bbox, { top }) => parseFloat(top), + left: (_bbox, { left }) => parseFloat(left), + bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min), + right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min), + // Transform + x: (_bbox, { transform }) => parseValueFromTransform(transform, "x"), + y: (_bbox, { transform }) => parseValueFromTransform(transform, "y"), + }; + // Alias translate longform names + positionalValues.translateX = positionalValues.x; + positionalValues.translateY = positionalValues.y; + + const toResolve = new Set(); + let isScheduled = false; + let anyNeedsMeasurement = false; + let isForced = false; + function measureAllKeyframes() { + if (anyNeedsMeasurement) { + const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); + const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); + const transformsToRestore = new Map(); + /** + * Write pass + * If we're measuring elements we want to remove bounding box-changing transforms. + */ + elementsToMeasure.forEach((element) => { + const removedTransforms = removeNonTranslationalTransform(element); + if (!removedTransforms.length) + return; + transformsToRestore.set(element, removedTransforms); + element.render(); + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); + // Write + elementsToMeasure.forEach((element) => { + element.render(); + const restore = transformsToRestore.get(element); + if (restore) { + restore.forEach(([key, value]) => { + element.getValue(key)?.set(value); + }); + } + }); + // Read + resolversToMeasure.forEach((resolver) => resolver.measureEndState()); + // Write + resolversToMeasure.forEach((resolver) => { + if (resolver.suspendedScrollY !== undefined) { + window.scrollTo(0, resolver.suspendedScrollY); + } + }); + } + anyNeedsMeasurement = false; + isScheduled = false; + toResolve.forEach((resolver) => resolver.complete(isForced)); + toResolve.clear(); + } + function readAllKeyframes() { + toResolve.forEach((resolver) => { + resolver.readKeyframes(); + if (resolver.needsMeasurement) { + anyNeedsMeasurement = true; + } + }); + } + function flushKeyframeResolvers() { + isForced = true; + readAllKeyframes(); + measureAllKeyframes(); + isForced = false; + } + class KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) { + this.state = "pending"; + /** + * Track whether this resolver is async. If it is, it'll be added to the + * resolver queue and flushed in the next frame. Resolvers that aren't going + * to trigger read/write thrashing don't need to be async. + */ + this.isAsync = false; + /** + * Track whether this resolver needs to perform a measurement + * to resolve its keyframes. + */ + this.needsMeasurement = false; + this.unresolvedKeyframes = [...unresolvedKeyframes]; + this.onComplete = onComplete; + this.name = name; + this.motionValue = motionValue; + this.element = element; + this.isAsync = isAsync; + } + scheduleResolve() { + this.state = "scheduled"; + if (this.isAsync) { + toResolve.add(this); + if (!isScheduled) { + isScheduled = true; + frame.read(readAllKeyframes); + frame.resolveKeyframes(measureAllKeyframes); + } + } + else { + this.readKeyframes(); + this.complete(); + } + } + readKeyframes() { + const { unresolvedKeyframes, name, element, motionValue } = this; + // If initial keyframe is null we need to read it from the DOM + if (unresolvedKeyframes[0] === null) { + const currentValue = motionValue?.get(); + // TODO: This doesn't work if the final keyframe is a wildcard + const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (currentValue !== undefined) { + unresolvedKeyframes[0] = currentValue; + } + else if (element && name) { + const valueAsRead = element.readValue(name, finalKeyframe); + if (valueAsRead !== undefined && valueAsRead !== null) { + unresolvedKeyframes[0] = valueAsRead; + } + } + if (unresolvedKeyframes[0] === undefined) { + unresolvedKeyframes[0] = finalKeyframe; + } + if (motionValue && currentValue === undefined) { + motionValue.set(unresolvedKeyframes[0]); + } + } + fillWildcards(unresolvedKeyframes); + } + setFinalKeyframe() { } + measureInitialState() { } + renderEndStyles() { } + measureEndState() { } + complete(isForcedComplete = false) { + this.state = "complete"; + this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete); + toResolve.delete(this); + } + cancel() { + if (this.state === "scheduled") { + toResolve.delete(this); + this.state = "pending"; + } + } + resume() { + if (this.state === "pending") + this.scheduleResolve(); + } + } + + const isCSSVar = (name) => name.startsWith("--"); + + function setStyle(element, name, value) { + isCSSVar(name) + ? element.style.setProperty(name, value) + : (element.style[name] = value); + } + + /** + * Add the ability for test suites to manually set support flags + * to better test more environments. + */ + const supportsFlags = {}; + + function memoSupports(callback, supportsFlag) { + const memoized = motionUtils.memo(callback); + return () => supportsFlags[supportsFlag] ?? memoized(); + } + + const supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, "scrollTimeline"); + + const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => { + try { + document + .createElement("div") + .animate({ opacity: 0 }, { easing: "linear(0, 1)" }); + } + catch (e) { + return false; + } + return true; + }, "linearEasing"); + + const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`; + + const supportedWaapiEasing = { + linear: "linear", + ease: "ease", + easeIn: "ease-in", + easeOut: "ease-out", + easeInOut: "ease-in-out", + circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]), + circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]), + backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), + backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]), + }; + + function mapEasingToNativeEasing(easing, duration) { + if (!easing) { + return undefined; + } + else if (typeof easing === "function") { + return supportsLinearEasing() + ? generateLinearEasing(easing, duration) + : "ease-out"; + } + else if (motionUtils.isBezierDefinition(easing)) { + return cubicBezierAsString(easing); + } + else if (Array.isArray(easing)) { + return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || + supportedWaapiEasing.easeOut); + } + else { + return supportedWaapiEasing[easing]; + } + } + + function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) { + const keyframeOptions = { + [valueName]: keyframes, + }; + if (times) + keyframeOptions.offset = times; + const easing = mapEasingToNativeEasing(ease, duration); + /** + * If this is an easing array, apply to keyframes, not animation as a whole + */ + if (Array.isArray(easing)) + keyframeOptions.easing = easing; + if (statsBuffer.value) { + activeAnimations.waapi++; + } + const options = { + delay, + duration, + easing: !Array.isArray(easing) ? easing : "linear", + fill: "both", + iterations: repeat + 1, + direction: repeatType === "reverse" ? "alternate" : "normal", + }; + if (pseudoElement) + options.pseudoElement = pseudoElement; + const animation = element.animate(keyframeOptions, options); + if (statsBuffer.value) { + animation.finished.finally(() => { + activeAnimations.waapi--; + }); + } + return animation; + } + + function isGenerator(type) { + return typeof type === "function" && "applyToOptions" in type; + } + + function applyGeneratorOptions({ type, ...options }) { + if (isGenerator(type) && supportsLinearEasing()) { + return type.applyToOptions(options); + } + else { + options.duration ?? (options.duration = 300); + options.ease ?? (options.ease = "easeOut"); + } + return options; + } + + /** + * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API. + */ + class NativeAnimation extends WithPromise { + constructor(options) { + super(); + this.finishedTime = null; + this.isStopped = false; + /** + * Tracks a manually-set start time that takes precedence over WAAPI's + * dynamic startTime. This is cleared when play() or time setter is called, + * allowing WAAPI to take over timing. + */ + this.manualStartTime = null; + if (!options) + return; + const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options; + this.isPseudoElement = Boolean(pseudoElement); + this.allowFlatten = allowFlatten; + this.options = options; + motionUtils.invariant(typeof options.type !== "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring"); + const transition = applyGeneratorOptions(options); + this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement); + if (transition.autoplay === false) { + this.animation.pause(); + } + this.animation.onfinish = () => { + this.finishedTime = this.time; + if (!pseudoElement) { + const keyframe = getFinalKeyframe$1(keyframes, this.options, finalKeyframe, this.speed); + if (this.updateMotionValue) { + this.updateMotionValue(keyframe); + } + else { + /** + * If we can, we want to commit the final style as set by the user, + * rather than the computed keyframe value supplied by the animation. + */ + setStyle(element, name, keyframe); + } + this.animation.cancel(); + } + onComplete?.(); + this.notifyFinished(); + }; + } + play() { + if (this.isStopped) + return; + this.manualStartTime = null; + this.animation.play(); + if (this.state === "finished") { + this.updateFinished(); + } + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.finish?.(); + } + cancel() { + try { + this.animation.cancel(); + } + catch (e) { } + } + stop() { + if (this.isStopped) + return; + this.isStopped = true; + const { state } = this; + if (state === "idle" || state === "finished") { + return; + } + if (this.updateMotionValue) { + this.updateMotionValue(); + } + else { + this.commitStyles(); + } + if (!this.isPseudoElement) + this.cancel(); + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * In this method, we commit styles back to the DOM before cancelling + * the animation. + * + * This is designed to be overridden by NativeAnimationExtended, which + * will create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to also correctly calculate velocity for any subsequent animation + * while deferring the commit until the next animation frame. + */ + commitStyles() { + const element = this.options?.element; + if (!this.isPseudoElement && element?.isConnected) { + this.animation.commitStyles?.(); + } + } + get duration() { + const duration = this.animation.effect?.getComputedTiming?.().duration || 0; + return motionUtils.millisecondsToSeconds(Number(duration)); + } + get iterationDuration() { + const { delay = 0 } = this.options || {}; + return this.duration + motionUtils.millisecondsToSeconds(delay); + } + get time() { + return motionUtils.millisecondsToSeconds(Number(this.animation.currentTime) || 0); + } + set time(newTime) { + this.manualStartTime = null; + this.finishedTime = null; + this.animation.currentTime = motionUtils.secondsToMilliseconds(newTime); + } + /** + * The playback speed of the animation. + * 1 = normal speed, 2 = double speed, 0.5 = half speed. + */ + get speed() { + return this.animation.playbackRate; + } + set speed(newSpeed) { + // Allow backwards playback after finishing + if (newSpeed < 0) + this.finishedTime = null; + this.animation.playbackRate = newSpeed; + } + get state() { + return this.finishedTime !== null + ? "finished" + : this.animation.playState; + } + get startTime() { + return this.manualStartTime ?? Number(this.animation.startTime); + } + set startTime(newStartTime) { + this.manualStartTime = this.animation.startTime = newStartTime; + } + /** + * Attaches a timeline to the animation, for instance the `ScrollTimeline`. + */ + attachTimeline({ timeline, observe }) { + if (this.allowFlatten) { + this.animation.effect?.updateTiming({ easing: "linear" }); + } + this.animation.onfinish = null; + if (timeline && supportsScrollTimeline()) { + this.animation.timeline = timeline; + return motionUtils.noop; + } + else { + return observe(this); + } + } + } + + const unsupportedEasingFunctions = { + anticipate: motionUtils.anticipate, + backInOut: motionUtils.backInOut, + circInOut: motionUtils.circInOut, + }; + function isUnsupportedEase(key) { + return key in unsupportedEasingFunctions; + } + function replaceStringEasing(transition) { + if (typeof transition.ease === "string" && + isUnsupportedEase(transition.ease)) { + transition.ease = unsupportedEasingFunctions[transition.ease]; + } + } + + /** + * 10ms is chosen here as it strikes a balance between smooth + * results (more than one keyframe per frame at 60fps) and + * keyframe quantity. + */ + const sampleDelta = 10; //ms + class NativeAnimationExtended extends NativeAnimation { + constructor(options) { + /** + * The base NativeAnimation function only supports a subset + * of Motion easings, and WAAPI also only supports some + * easing functions via string/cubic-bezier definitions. + * + * This function replaces those unsupported easing functions + * with a JS easing function. This will later get compiled + * to a linear() easing function. + */ + replaceStringEasing(options); + /** + * Ensure we replace the transition type with a generator function + * before passing to WAAPI. + * + * TODO: Does this have a better home? It could be shared with + * JSAnimation. + */ + replaceTransitionType(options); + super(options); + if (options.startTime !== undefined) { + this.startTime = options.startTime; + } + this.options = options; + } + /** + * WAAPI doesn't natively have any interruption capabilities. + * + * Rather than read committed styles back out of the DOM, we can + * create a renderless JS animation and sample it twice to calculate + * its current value, "previous" value, and therefore allow + * Motion to calculate velocity for any subsequent animation. + */ + updateMotionValue(value) { + const { motionValue, onUpdate, onComplete, element, ...options } = this.options; + if (!motionValue) + return; + if (value !== undefined) { + motionValue.set(value); + return; + } + const sampleAnimation = new JSAnimation({ + ...options, + autoplay: false, + }); + /** + * Use wall-clock elapsed time for sampling. + * Under CPU load, WAAPI's currentTime may not reflect actual + * elapsed time, causing incorrect sampling and visual jumps. + */ + const sampleTime = Math.max(sampleDelta, time.now() - this.startTime); + const delta = motionUtils.clamp(0, sampleDelta, sampleTime - sampleDelta); + motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta); + sampleAnimation.stop(); + } + } + + /** + * Check if a value is animatable. Examples: + * + * āœ…: 100, "100px", "#fff" + * āŒ: "block", "url(2.jpg)" + * @param value + * + * @internal + */ + const isAnimatable = (value, name) => { + // If the list of keys that might be non-animatable grows, replace with Set + if (name === "zIndex") + return false; + // If it's a number or a keyframes array, we can animate it. We might at some point + // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, + // but for now lets leave it like this for performance reasons + if (typeof value === "number" || Array.isArray(value)) + return true; + if (typeof value === "string" && // It's animatable if we have a string + (complex.test(value) || value === "0") && // And it contains numbers and/or colors + !value.startsWith("url(") // Unless it starts with "url(" + ) { + return true; + } + return false; + }; + + function hasKeyframesChanged(keyframes) { + const current = keyframes[0]; + if (keyframes.length === 1) + return true; + for (let i = 0; i < keyframes.length; i++) { + if (keyframes[i] !== current) + return true; + } + } + function canAnimate(keyframes, name, type, velocity) { + /** + * Check if we're able to animate between the start and end keyframes, + * and throw a warning if we're attempting to animate between one that's + * animatable and another that isn't. + */ + const originKeyframe = keyframes[0]; + if (originKeyframe === null) { + return false; + } + /** + * These aren't traditionally animatable but we do support them. + * In future we could look into making this more generic or replacing + * this function with mix() === mixImmediate + */ + if (name === "display" || name === "visibility") + return true; + const targetKeyframe = keyframes[keyframes.length - 1]; + const isOriginAnimatable = isAnimatable(originKeyframe, name); + const isTargetAnimatable = isAnimatable(targetKeyframe, name); + motionUtils.warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable ? targetKeyframe : originKeyframe}" is not an animatable value.`, "value-not-animatable"); + // Always skip if any of these are true + if (!isOriginAnimatable || !isTargetAnimatable) { + return false; + } + return (hasKeyframesChanged(keyframes) || + ((type === "spring" || isGenerator(type)) && velocity)); + } + + function makeAnimationInstant(options) { + options.duration = 0; + options.type = "keyframes"; + } + + /** + * A list of values that can be hardware-accelerated. + */ + const acceleratedValues$1 = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Could be re-enabled now we have support for linear() easing + // "background-color" + ]); + const supportsWaapi = /*@__PURE__*/ motionUtils.memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); + function supportsBrowserAnimation(options) { + const { motionValue, name, repeatDelay, repeatType, damping, type } = options; + const subject = motionValue?.owner?.current; + /** + * We use this check instead of isHTMLElement() because we explicitly + * **don't** want elements in different timing contexts (i.e. popups) + * to be accelerated, as it's not possible to sync these animations + * properly with those driven from the main window frameloop. + */ + if (!(subject instanceof HTMLElement)) { + return false; + } + const { onUpdate, transformTemplate } = motionValue.owner.getProps(); + return (supportsWaapi() && + name && + acceleratedValues$1.has(name) && + (name !== "transform" || !transformTemplate) && + /** + * If we're outputting values to onUpdate then we can't use WAAPI as there's + * no way to read the value from WAAPI every frame. + */ + !onUpdate && + !repeatDelay && + repeatType !== "mirror" && + damping !== 0 && + type !== "inertia"); + } + + /** + * Maximum time allowed between an animation being created and it being + * resolved for us to use the latter as the start time. + * + * This is to ensure that while we prefer to "start" an animation as soon + * as it's triggered, we also want to avoid a visual jump if there's a big delay + * between these two moments. + */ + const MAX_RESOLVE_DELAY = 40; + class AsyncMotionValueAnimation extends WithPromise { + constructor({ autoplay = true, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", keyframes, name, motionValue, element, ...options }) { + super(); + /** + * Bound to support return animation.stop pattern + */ + this.stop = () => { + if (this._animation) { + this._animation.stop(); + this.stopTimeline?.(); + } + this.keyframeResolver?.cancel(); + }; + this.createdAt = time.now(); + const optionsWithDefaults = { + autoplay, + delay, + type, + repeat, + repeatDelay, + repeatType, + name, + motionValue, + element, + ...options, + }; + const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver; + this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element); + this.keyframeResolver?.scheduleResolve(); + } + onKeyframesResolved(keyframes, finalKeyframe, options, sync) { + this.keyframeResolver = undefined; + const { name, type, velocity, delay, isHandoff, onUpdate } = options; + this.resolvedAt = time.now(); + /** + * If we can't animate this value with the resolved keyframes + * then we should complete it immediately. + */ + if (!canAnimate(keyframes, name, type, velocity)) { + if (motionUtils.MotionGlobalConfig.instantAnimations || !delay) { + onUpdate?.(getFinalKeyframe$1(keyframes, options, finalKeyframe)); + } + keyframes[0] = keyframes[keyframes.length - 1]; + makeAnimationInstant(options); + options.repeat = 0; + } + /** + * Resolve startTime for the animation. + * + * This method uses the createdAt and resolvedAt to calculate the + * animation startTime. *Ideally*, we would use the createdAt time as t=0 + * as the following frame would then be the first frame of the animation in + * progress, which would feel snappier. + * + * However, if there's a delay (main thread work) between the creation of + * the animation and the first committed frame, we prefer to use resolvedAt + * to avoid a sudden jump into the animation. + */ + const startTime = sync + ? !this.resolvedAt + ? this.createdAt + : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY + ? this.resolvedAt + : this.createdAt + : undefined; + const resolvedOptions = { + startTime, + finalKeyframe, + ...options, + keyframes, + }; + /** + * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via + * WAAPI. Therefore, this animation must be JS to ensure it runs "under" the + * optimised animation. + */ + const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions); + const element = resolvedOptions.motionValue?.owner?.current; + const animation = useWaapi + ? new NativeAnimationExtended({ + ...resolvedOptions, + element, + }) + : new JSAnimation(resolvedOptions); + animation.finished.then(() => { + this.notifyFinished(); + }).catch(motionUtils.noop); + if (this.pendingTimeline) { + this.stopTimeline = animation.attachTimeline(this.pendingTimeline); + this.pendingTimeline = undefined; + } + this._animation = animation; + } + get finished() { + if (!this._animation) { + return this._finished; + } + else { + return this.animation.finished; + } + } + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + get animation() { + if (!this._animation) { + this.keyframeResolver?.resume(); + flushKeyframeResolvers(); + } + return this._animation; + } + get duration() { + return this.animation.duration; + } + get iterationDuration() { + return this.animation.iterationDuration; + } + get time() { + return this.animation.time; + } + set time(newTime) { + this.animation.time = newTime; + } + get speed() { + return this.animation.speed; + } + get state() { + return this.animation.state; + } + set speed(newSpeed) { + this.animation.speed = newSpeed; + } + get startTime() { + return this.animation.startTime; + } + attachTimeline(timeline) { + if (this._animation) { + this.stopTimeline = this.animation.attachTimeline(timeline); + } + else { + this.pendingTimeline = timeline; + } + return () => this.stop(); + } + play() { + this.animation.play(); + } + pause() { + this.animation.pause(); + } + complete() { + this.animation.complete(); + } + cancel() { + if (this._animation) { + this.animation.cancel(); + } + this.keyframeResolver?.cancel(); + } + } + + class GroupAnimation { + constructor(animations) { + // Bound to accomadate common `return animation.stop` pattern + this.stop = () => this.runAll("stop"); + this.animations = animations.filter(Boolean); + } + get finished() { + return Promise.all(this.animations.map((animation) => animation.finished)); + } + /** + * TODO: Filter out cancelled or stopped animations before returning + */ + getAll(propName) { + return this.animations[0][propName]; + } + setAll(propName, newValue) { + for (let i = 0; i < this.animations.length; i++) { + this.animations[i][propName] = newValue; + } + } + attachTimeline(timeline) { + const subscriptions = this.animations.map((animation) => animation.attachTimeline(timeline)); + return () => { + subscriptions.forEach((cancel, i) => { + cancel && cancel(); + this.animations[i].stop(); + }); + }; + } + get time() { + return this.getAll("time"); + } + set time(time) { + this.setAll("time", time); + } + get speed() { + return this.getAll("speed"); + } + set speed(speed) { + this.setAll("speed", speed); + } + get state() { + return this.getAll("state"); + } + get startTime() { + return this.getAll("startTime"); + } + get duration() { + return getMax(this.animations, "duration"); + } + get iterationDuration() { + return getMax(this.animations, "iterationDuration"); + } + runAll(methodName) { + this.animations.forEach((controls) => controls[methodName]()); + } + play() { + this.runAll("play"); + } + pause() { + this.runAll("pause"); + } + cancel() { + this.runAll("cancel"); + } + complete() { + this.runAll("complete"); + } + } + function getMax(animations, propName) { + let max = 0; + for (let i = 0; i < animations.length; i++) { + const value = animations[i][propName]; + if (value !== null && value > max) { + max = value; + } + } + return max; + } + + class GroupAnimationWithThen extends GroupAnimation { + then(onResolve, _onReject) { + return this.finished.finally(onResolve).then(() => { }); + } + } + + class NativeAnimationWrapper extends NativeAnimation { + constructor(animation) { + super(); + this.animation = animation; + animation.onfinish = () => { + this.finishedTime = this.time; + this.notifyFinished(); + }; + } + } + + const animationMaps = new WeakMap(); + const animationMapKey = (name, pseudoElement = "") => `${name}:${pseudoElement}`; + function getAnimationMap(element) { + const map = animationMaps.get(element) || new Map(); + animationMaps.set(element, map); + return map; + } + + function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) { + const index = Array.from(children) + .sort((a, b) => a.sortNodePosition(b)) + .indexOf(child); + const numChildren = children.size; + const maxStaggerDuration = (numChildren - 1) * staggerChildren; + const delayIsFunction = typeof delayChildren === "function"; + return delayIsFunction + ? delayChildren(index, numChildren) + : staggerDirection === 1 + ? index * staggerChildren + : maxStaggerDuration - index * staggerChildren; + } + + /** + * Parse Framer's special CSS variable format into a CSS token and a fallback. + * + * ``` + * `var(--foo, #fff)` => [`--foo`, '#fff'] + * ``` + * + * @param current + */ + const splitCSSVariableRegex = + // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words + /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u; + function parseCSSVariable(current) { + const match = splitCSSVariableRegex.exec(current); + if (!match) + return [,]; + const [, token1, token2, fallback] = match; + return [`--${token1 ?? token2}`, fallback]; + } + const maxDepth = 4; + function getVariableValue(current, element, depth = 1) { + motionUtils.invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`, "max-css-var-depth"); + const [token, fallback] = parseCSSVariable(current); + // No CSS variable detected + if (!token) + return; + // Attempt to read this CSS variable off the element + const resolved = window.getComputedStyle(element).getPropertyValue(token); + if (resolved) { + const trimmed = resolved.trim(); + return motionUtils.isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; + } + return isCSSVariableToken(fallback) + ? getVariableValue(fallback, element, depth + 1) + : fallback; + } + + const underDampedSpring = { + type: "spring", + stiffness: 500, + damping: 25, + restSpeed: 10, + }; + const criticallyDampedSpring = (target) => ({ + type: "spring", + stiffness: 550, + damping: target === 0 ? 2 * Math.sqrt(550) : 30, + restSpeed: 10, + }); + const keyframesTransition = { + type: "keyframes", + duration: 0.8, + }; + /** + * Default easing curve is a slightly shallower version of + * the default browser easing curve. + */ + const ease = { + type: "keyframes", + ease: [0.25, 0.1, 0.35, 1], + duration: 0.3, + }; + const getDefaultTransition = (valueKey, { keyframes }) => { + if (keyframes.length > 2) { + return keyframesTransition; + } + else if (transformProps.has(valueKey)) { + return valueKey.startsWith("scale") + ? criticallyDampedSpring(keyframes[1]) + : underDampedSpring; + } + return ease; + }; + + const isNotNull = (value) => value !== null; + function getFinalKeyframe(keyframes, { repeat, repeatType = "loop" }, finalKeyframe) { + const resolvedKeyframes = keyframes.filter(isNotNull); + const index = repeat && repeatType !== "loop" && repeat % 2 === 1 + ? 0 + : resolvedKeyframes.length - 1; + return !index || finalKeyframe === undefined + ? resolvedKeyframes[index] + : finalKeyframe; + } + + /** + * If `transition` has `inherit: true`, shallow-merge it with + * `parentTransition` (child keys win) and strip the `inherit` key. + * Otherwise return `transition` unchanged. + */ + function resolveTransition(transition, parentTransition) { + if (transition?.inherit && parentTransition) { + const { inherit: _, ...rest } = transition; + return { ...parentTransition, ...rest }; + } + return transition; + } + + function getValueTransition(transition, key) { + const valueTransition = transition?.[key] ?? + transition?.["default"] ?? + transition; + if (valueTransition !== transition) { + return resolveTransition(valueTransition, transition); + } + return valueTransition; + } + + /** + * Decide whether a transition is defined on a given Transition. + * This filters out orchestration options and returns true + * if any options are left. + */ + function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) { + return !!Object.keys(transition).length; + } + + const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { + const valueTransition = getValueTransition(transition, name) || {}; + /** + * Most transition values are currently completely overwritten by value-specific + * transitions. In the future it'd be nicer to blend these transitions. But for now + * delay actually does inherit from the root transition if not value-specific. + */ + const delay = valueTransition.delay || transition.delay || 0; + /** + * Elapsed isn't a public transition option but can be passed through from + * optimized appear effects in milliseconds. + */ + let { elapsed = 0 } = transition; + elapsed = elapsed - motionUtils.secondsToMilliseconds(delay); + const options = { + keyframes: Array.isArray(target) ? target : [null, target], + ease: "easeOut", + velocity: value.getVelocity(), + ...valueTransition, + delay: -elapsed, + onUpdate: (v) => { + value.set(v); + valueTransition.onUpdate && valueTransition.onUpdate(v); + }, + onComplete: () => { + onComplete(); + valueTransition.onComplete && valueTransition.onComplete(); + }, + name, + motionValue: value, + element: isHandoff ? undefined : element, + }; + /** + * If there's no transition defined for this value, we can generate + * unique transition settings for this value. + */ + if (!isTransitionDefined(valueTransition)) { + Object.assign(options, getDefaultTransition(name, options)); + } + /** + * Both WAAPI and our internal animation functions use durations + * as defined by milliseconds, while our external API defines them + * as seconds. + */ + options.duration && (options.duration = motionUtils.secondsToMilliseconds(options.duration)); + options.repeatDelay && (options.repeatDelay = motionUtils.secondsToMilliseconds(options.repeatDelay)); + /** + * Support deprecated way to set initial value. Prefer keyframe syntax. + */ + if (options.from !== undefined) { + options.keyframes[0] = options.from; + } + let shouldSkip = false; + if (options.type === false || + (options.duration === 0 && !options.repeatDelay)) { + makeAnimationInstant(options); + if (options.delay === 0) { + shouldSkip = true; + } + } + if (motionUtils.MotionGlobalConfig.instantAnimations || + motionUtils.MotionGlobalConfig.skipAnimations || + element?.shouldSkipAnimations) { + shouldSkip = true; + makeAnimationInstant(options); + options.delay = 0; + } + /** + * If the transition type or easing has been explicitly set by the user + * then we don't want to allow flattening the animation. + */ + options.allowFlatten = !valueTransition.type && !valueTransition.ease; + /** + * If we can or must skip creating the animation, and apply only + * the final keyframe, do so. We also check once keyframes are resolved but + * this early check prevents the need to create an animation at all. + */ + if (shouldSkip && !isHandoff && value.get() !== undefined) { + const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition); + if (finalKeyframe !== undefined) { + frame.update(() => { + options.onUpdate(finalKeyframe); + options.onComplete(); + }); + return; + } + } + return valueTransition.isSync + ? new JSAnimation(options) + : new AsyncMotionValueAnimation(options); + }; + + function getValueState(visualElement) { + const state = [{}, {}]; + visualElement?.values.forEach((value, key) => { + state[0][key] = value.get(); + state[1][key] = value.getVelocity(); + }); + return state; + } + function resolveVariantFromProps(props, definition, custom, visualElement) { + /** + * If the variant definition is a function, resolve. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + /** + * If the variant definition is a variant label, or + * the function returned a variant label, resolve. + */ + if (typeof definition === "string") { + definition = props.variants && props.variants[definition]; + } + /** + * At this point we've resolved both functions and variant labels, + * but the resolved variant label might itself have been a function. + * If so, resolve. This can only have returned a valid target object. + */ + if (typeof definition === "function") { + const [current, velocity] = getValueState(visualElement); + definition = definition(custom !== undefined ? custom : props.custom, current, velocity); + } + return definition; + } + + function resolveVariant(visualElement, definition, custom) { + const props = visualElement.getProps(); + return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement); + } + + const positionalKeys = new Set([ + "width", + "height", + "top", + "left", + "right", + "bottom", + ...transformPropOrder, + ]); + + /** + * Maximum time between the value of two frames, beyond which we + * assume the velocity has since been 0. + */ + const MAX_VELOCITY_DELTA = 30; + const isFloat = (value) => { + return !isNaN(parseFloat(value)); + }; + const collectMotionValues = { + current: undefined, + }; + /** + * `MotionValue` is used to track the state and velocity of motion values. + * + * @public + */ + class MotionValue { + /** + * @param init - The initiating value + * @param config - Optional configuration options + * + * - `transformer`: A function to transform incoming values with. + */ + constructor(init, options = {}) { + /** + * Tracks whether this value can output a velocity. Currently this is only true + * if the value is numerical, but we might be able to widen the scope here and support + * other value types. + * + * @internal + */ + this.canTrackVelocity = null; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + this.updateAndNotify = (v) => { + const currentTime = time.now(); + /** + * If we're updating the value during another frame or eventloop + * than the previous frame, then the we set the previous frame value + * to current. + */ + if (this.updatedAt !== currentTime) { + this.setPrevFrameValue(); + } + this.prev = this.current; + this.setCurrent(v); + // Update update subscribers + if (this.current !== this.prev) { + this.events.change?.notify(this.current); + if (this.dependents) { + for (const dependent of this.dependents) { + dependent.dirty(); + } + } + } + }; + this.hasAnimated = false; + this.setCurrent(init); + this.owner = options.owner; + } + setCurrent(current) { + this.current = current; + this.updatedAt = time.now(); + if (this.canTrackVelocity === null && current !== undefined) { + this.canTrackVelocity = isFloat(this.current); + } + } + setPrevFrameValue(prevFrameValue = this.current) { + this.prevFrameValue = prevFrameValue; + this.prevUpdatedAt = this.updatedAt; + } + /** + * Adds a function that will be notified when the `MotionValue` is updated. + * + * It returns a function that, when called, will cancel the subscription. + * + * When calling `onChange` inside a React component, it should be wrapped with the + * `useEffect` hook. As it returns an unsubscribe function, this should be returned + * from the `useEffect` function to ensure you don't add duplicate subscribers.. + * + * ```jsx + * export const MyComponent = () => { + * const x = useMotionValue(0) + * const y = useMotionValue(0) + * const opacity = useMotionValue(1) + * + * useEffect(() => { + * function updateOpacity() { + * const maxXY = Math.max(x.get(), y.get()) + * const newOpacity = transform(maxXY, [0, 100], [1, 0]) + * opacity.set(newOpacity) + * } + * + * const unsubscribeX = x.on("change", updateOpacity) + * const unsubscribeY = y.on("change", updateOpacity) + * + * return () => { + * unsubscribeX() + * unsubscribeY() + * } + * }, []) + * + * return + * } + * ``` + * + * @param subscriber - A function that receives the latest value. + * @returns A function that, when called, will cancel this subscription. + * + * @deprecated + */ + onChange(subscription) { + { + motionUtils.warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`); + } + return this.on("change", subscription); + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + const unsubscribe = this.events[eventName].add(callback); + if (eventName === "change") { + return () => { + unsubscribe(); + /** + * If we have no more change listeners by the start + * of the next frame, stop active animations. + */ + frame.read(() => { + if (!this.events.change.getSize()) { + this.stop(); + } + }); + }; + } + return unsubscribe; + } + clearListeners() { + for (const eventManagers in this.events) { + this.events[eventManagers].clear(); + } + } + /** + * Attaches a passive effect to the `MotionValue`. + */ + attach(passiveEffect, stopPassiveEffect) { + this.passiveEffect = passiveEffect; + this.stopPassiveEffect = stopPassiveEffect; + } + /** + * Sets the state of the `MotionValue`. + * + * @remarks + * + * ```jsx + * const x = useMotionValue(0) + * x.set(10) + * ``` + * + * @param latest - Latest value to set. + * @param render - Whether to notify render subscribers. Defaults to `true` + * + * @public + */ + set(v) { + if (!this.passiveEffect) { + this.updateAndNotify(v); + } + else { + this.passiveEffect(v, this.updateAndNotify); + } + } + setWithVelocity(prev, current, delta) { + this.set(current); + this.prev = undefined; + this.prevFrameValue = prev; + this.prevUpdatedAt = this.updatedAt - delta; + } + /** + * Set the state of the `MotionValue`, stopping any active animations, + * effects, and resets velocity to `0`. + */ + jump(v, endAnimation = true) { + this.updateAndNotify(v); + this.prev = v; + this.prevUpdatedAt = this.prevFrameValue = undefined; + endAnimation && this.stop(); + if (this.stopPassiveEffect) + this.stopPassiveEffect(); + } + dirty() { + this.events.change?.notify(this.current); + } + addDependent(dependent) { + if (!this.dependents) { + this.dependents = new Set(); + } + this.dependents.add(dependent); + } + removeDependent(dependent) { + if (this.dependents) { + this.dependents.delete(dependent); + } + } + /** + * Returns the latest state of `MotionValue` + * + * @returns - The latest state of `MotionValue` + * + * @public + */ + get() { + if (collectMotionValues.current) { + collectMotionValues.current.push(this); + } + return this.current; + } + /** + * @public + */ + getPrevious() { + return this.prev; + } + /** + * Returns the latest velocity of `MotionValue` + * + * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. + * + * @public + */ + getVelocity() { + const currentTime = time.now(); + if (!this.canTrackVelocity || + this.prevFrameValue === undefined || + currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { + return 0; + } + const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); + // Casts because of parseFloat's poor typing + return motionUtils.velocityPerSecond(parseFloat(this.current) - + parseFloat(this.prevFrameValue), delta); + } + /** + * Registers a new animation to control this `MotionValue`. Only one + * animation can drive a `MotionValue` at one time. + * + * ```jsx + * value.start() + * ``` + * + * @param animation - A function that starts the provided animation + */ + start(startAnimation) { + this.stop(); + return new Promise((resolve) => { + this.hasAnimated = true; + this.animation = startAnimation(resolve); + if (this.events.animationStart) { + this.events.animationStart.notify(); + } + }).then(() => { + if (this.events.animationComplete) { + this.events.animationComplete.notify(); + } + this.clearAnimation(); + }); + } + /** + * Stop the currently active animation. + * + * @public + */ + stop() { + if (this.animation) { + this.animation.stop(); + if (this.events.animationCancel) { + this.events.animationCancel.notify(); + } + } + this.clearAnimation(); + } + /** + * Returns `true` if this value is currently animating. + * + * @public + */ + isAnimating() { + return !!this.animation; + } + clearAnimation() { + delete this.animation; + } + /** + * Destroy and clean up subscribers to this `MotionValue`. + * + * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically + * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually + * created a `MotionValue` via the `motionValue` function. + * + * @public + */ + destroy() { + this.dependents?.clear(); + this.events.destroy?.notify(); + this.clearListeners(); + this.stop(); + if (this.stopPassiveEffect) { + this.stopPassiveEffect(); + } + } + } + function motionValue(init, options) { + return new MotionValue(init, options); + } + + const isKeyframesTarget = (v) => { + return Array.isArray(v); + }; + + /** + * Set VisualElement's MotionValue, creating a new MotionValue for it if + * it doesn't exist. + */ + function setMotionValue(visualElement, key, value) { + if (visualElement.hasValue(key)) { + visualElement.getValue(key).set(value); + } + else { + visualElement.addValue(key, motionValue(value)); + } + } + function resolveFinalValueInKeyframes(v) { + // TODO maybe throw if v.length - 1 is placeholder token? + return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; + } + function setTarget(visualElement, definition) { + const resolved = resolveVariant(visualElement, definition); + let { transitionEnd = {}, transition = {}, ...target } = resolved || {}; + target = { ...target, ...transitionEnd }; + for (const key in target) { + const value = resolveFinalValueInKeyframes(target[key]); + setMotionValue(visualElement, key, value); + } + } + + const isMotionValue = (value) => Boolean(value && value.getVelocity); + + function isWillChangeMotionValue(value) { + return Boolean(isMotionValue(value) && value.add); + } + + function addValueToWillChange(visualElement, key) { + const willChange = visualElement.getValue("willChange"); + /** + * It could be that a user has set willChange to a regular MotionValue, + * in which case we can't add the value to it. + */ + if (isWillChangeMotionValue(willChange)) { + return willChange.add(key); + } + else if (!willChange && motionUtils.MotionGlobalConfig.WillChange) { + const newWillChange = new motionUtils.MotionGlobalConfig.WillChange("auto"); + visualElement.addValue("willChange", newWillChange); + newWillChange.add(key); + } + } + + function camelToDash(str) { + return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`); + } + + const optimizedAppearDataId = "framerAppearId"; + const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); + + function getOptimisedAppearId(visualElement) { + return visualElement.props[optimizedAppearDataAttribute]; + } + + /** + * Decide whether we should block this animation. Previously, we achieved this + * just by checking whether the key was listed in protectedKeys, but this + * posed problems if an animation was triggered by afterChildren and protectedKeys + * had been set to true in the meantime. + */ + function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { + const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; + needsAnimating[key] = false; + return shouldBlock; + } + function animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) { + let { transition, transitionEnd, ...target } = targetAndTransition; + const defaultTransition = visualElement.getDefaultTransition(); + transition = transition + ? resolveTransition(transition, defaultTransition) + : defaultTransition; + const reduceMotion = transition?.reduceMotion; + if (transitionOverride) + transition = transitionOverride; + const animations = []; + const animationTypeState = type && + visualElement.animationState && + visualElement.animationState.getState()[type]; + for (const key in target) { + const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null); + const valueTarget = target[key]; + if (valueTarget === undefined || + (animationTypeState && + shouldBlockAnimation(animationTypeState, key))) { + continue; + } + const valueTransition = { + delay, + ...getValueTransition(transition || {}, key), + }; + /** + * If the value is already at the defined target, skip the animation. + */ + const currentValue = value.get(); + if (currentValue !== undefined && + !value.isAnimating && + !Array.isArray(valueTarget) && + valueTarget === currentValue && + !valueTransition.velocity) { + continue; + } + /** + * If this is the first time a value is being animated, check + * to see if we're handling off from an existing animation. + */ + let isHandoff = false; + if (window.MotionHandoffAnimation) { + const appearId = getOptimisedAppearId(visualElement); + if (appearId) { + const startTime = window.MotionHandoffAnimation(appearId, key, frame); + if (startTime !== null) { + valueTransition.startTime = startTime; + isHandoff = true; + } + } + } + addValueToWillChange(visualElement, key); + const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion; + value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key) + ? { type: false } + : valueTransition, visualElement, isHandoff)); + const animation = value.animation; + if (animation) { + animations.push(animation); + } + } + if (transitionEnd) { + const applyTransitionEnd = () => frame.update(() => { + transitionEnd && setTarget(visualElement, transitionEnd); + }); + if (animations.length) { + Promise.all(animations).then(applyTransitionEnd); + } + else { + applyTransitionEnd(); + } + } + return animations; + } + + function animateVariant(visualElement, variant, options = {}) { + const resolved = resolveVariant(visualElement, variant, options.type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; + if (options.transitionOverride) { + transition = options.transitionOverride; + } + /** + * If we have a variant, create a callback that runs it as an animation. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getAnimation = resolved + ? () => Promise.all(animateTarget(visualElement, resolved, options)) + : () => Promise.resolve(); + /** + * If we have children, create a callback that runs all their animations. + * Otherwise, we resolve a Promise immediately for a composable no-op. + */ + const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size + ? (forwardDelay = 0) => { + const { delayChildren = 0, staggerChildren, staggerDirection, } = transition; + return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options); + } + : () => Promise.resolve(); + /** + * If the transition explicitly defines a "when" option, we need to resolve either + * this animation or all children animations before playing the other. + */ + const { when } = transition; + if (when) { + const [first, last] = when === "beforeChildren" + ? [getAnimation, getChildAnimations] + : [getChildAnimations, getAnimation]; + return first().then(() => last()); + } + else { + return Promise.all([getAnimation(), getChildAnimations(options.delay)]); + } + } + function animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) { + const animations = []; + for (const child of visualElement.variantChildren) { + child.notify("AnimationStart", variant); + animations.push(animateVariant(child, variant, { + ...options, + delay: delay + + (typeof delayChildren === "function" ? 0 : delayChildren) + + calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection), + }).then(() => child.notify("AnimationComplete", variant))); + } + return Promise.all(animations); + } + + function animateVisualElement(visualElement, definition, options = {}) { + visualElement.notify("AnimationStart", definition); + let animation; + if (Array.isArray(definition)) { + const animations = definition.map((variant) => animateVariant(visualElement, variant, options)); + animation = Promise.all(animations); + } + else if (typeof definition === "string") { + animation = animateVariant(visualElement, definition, options); + } + else { + const resolvedDefinition = typeof definition === "function" + ? resolveVariant(visualElement, definition, options.custom) + : definition; + animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options)); + } + return animation.then(() => { + visualElement.notify("AnimationComplete", definition); + }); + } + + /** + * ValueType for "auto" + */ + const auto = { + test: (v) => v === "auto", + parse: (v) => v, + }; + + /** + * Tests a provided value against a ValueType + */ + const testValueType = (v) => (type) => type.test(v); + + /** + * A list of value types commonly used for dimensions + */ + const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]; + /** + * Tests a dimensional value against the list of dimension ValueTypes + */ + const findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v)); + + function isNone(value) { + if (typeof value === "number") { + return value === 0; + } + else if (value !== null) { + return value === "none" || value === "0" || motionUtils.isZeroValueString(value); + } + else { + return true; + } + } + + /** + * Properties that should default to 1 or 100% + */ + const maxDefaults = new Set(["brightness", "contrast", "saturate", "opacity"]); + function applyDefaultFilter(v) { + const [name, value] = v.slice(0, -1).split("("); + if (name === "drop-shadow") + return v; + const [number] = value.match(floatRegex) || []; + if (!number) + return v; + const unit = value.replace(number, ""); + let defaultValue = maxDefaults.has(name) ? 1 : 0; + if (number !== value) + defaultValue *= 100; + return name + "(" + defaultValue + unit + ")"; + } + const functionRegex = /\b([a-z-]*)\(.*?\)/gu; + const filter = { + ...complex, + getAnimatableNone: (v) => { + const functions = v.match(functionRegex); + return functions ? functions.map(applyDefaultFilter).join(" ") : v; + }, + }; + + const mask = { + ...complex, + getAnimatableNone: (v) => { + const parsed = complex.parse(v); + const transformer = complex.createTransformer(v); + return transformer(parsed.map((v) => typeof v === "number" ? 0 : typeof v === "object" ? { ...v, alpha: 1 } : v)); + }, + }; + + const int = { + ...number, + transform: Math.round, + }; + + const transformValueTypes = { + rotate: degrees, + rotateX: degrees, + rotateY: degrees, + rotateZ: degrees, + scale, + scaleX: scale, + scaleY: scale, + scaleZ: scale, + skew: degrees, + skewX: degrees, + skewY: degrees, + distance: px, + translateX: px, + translateY: px, + translateZ: px, + x: px, + y: px, + z: px, + perspective: px, + transformPerspective: px, + opacity: alpha, + originX: progressPercentage, + originY: progressPercentage, + originZ: px, + }; + + const numberValueTypes = { + // Border props + borderWidth: px, + borderTopWidth: px, + borderRightWidth: px, + borderBottomWidth: px, + borderLeftWidth: px, + borderRadius: px, + borderTopLeftRadius: px, + borderTopRightRadius: px, + borderBottomRightRadius: px, + borderBottomLeftRadius: px, + // Positioning props + width: px, + maxWidth: px, + height: px, + maxHeight: px, + top: px, + right: px, + bottom: px, + left: px, + inset: px, + insetBlock: px, + insetBlockStart: px, + insetBlockEnd: px, + insetInline: px, + insetInlineStart: px, + insetInlineEnd: px, + // Spacing props + padding: px, + paddingTop: px, + paddingRight: px, + paddingBottom: px, + paddingLeft: px, + paddingBlock: px, + paddingBlockStart: px, + paddingBlockEnd: px, + paddingInline: px, + paddingInlineStart: px, + paddingInlineEnd: px, + margin: px, + marginTop: px, + marginRight: px, + marginBottom: px, + marginLeft: px, + marginBlock: px, + marginBlockStart: px, + marginBlockEnd: px, + marginInline: px, + marginInlineStart: px, + marginInlineEnd: px, + // Typography + fontSize: px, + // Misc + backgroundPositionX: px, + backgroundPositionY: px, + ...transformValueTypes, + zIndex: int, + // SVG + fillOpacity: alpha, + strokeOpacity: alpha, + numOctaves: int, + }; + + /** + * A map of default value types for common values + */ + const defaultValueTypes = { + ...numberValueTypes, + // Color props + color, + backgroundColor: color, + outlineColor: color, + fill: color, + stroke: color, + // Border props + borderColor: color, + borderTopColor: color, + borderRightColor: color, + borderBottomColor: color, + borderLeftColor: color, + filter, + WebkitFilter: filter, + mask, + WebkitMask: mask, + }; + /** + * Gets the default ValueType for the provided value key + */ + const getDefaultValueType = (key) => defaultValueTypes[key]; + + const customTypes = /*@__PURE__*/ new Set([filter, mask]); + function getAnimatableNone(key, value) { + let defaultValueType = getDefaultValueType(key); + if (!customTypes.has(defaultValueType)) + defaultValueType = complex; + // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target + return defaultValueType.getAnimatableNone + ? defaultValueType.getAnimatableNone(value) + : undefined; + } + + /** + * If we encounter keyframes like "none" or "0" and we also have keyframes like + * "#fff" or "200px 200px" we want to find a keyframe to serve as a template for + * the "none" keyframes. In this case "#fff" or "200px 200px" - then these get turned into + * zero equivalents, i.e. "#fff0" or "0px 0px". + */ + const invalidTemplates = new Set(["auto", "none", "0"]); + function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { + let i = 0; + let animatableTemplate = undefined; + while (i < unresolvedKeyframes.length && !animatableTemplate) { + const keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string" && + !invalidTemplates.has(keyframe) && + analyseComplexValue(keyframe).values.length) { + animatableTemplate = unresolvedKeyframes[i]; + } + i++; + } + if (animatableTemplate && name) { + for (const noneIndex of noneKeyframeIndexes) { + unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); + } + } + } + + class DOMKeyframesResolver extends KeyframeResolver { + constructor(unresolvedKeyframes, onComplete, name, motionValue, element) { + super(unresolvedKeyframes, onComplete, name, motionValue, element, true); + } + readKeyframes() { + const { unresolvedKeyframes, element, name } = this; + if (!element || !element.current) + return; + super.readKeyframes(); + /** + * If any keyframe is a CSS variable, we need to find its value by sampling the element + */ + for (let i = 0; i < unresolvedKeyframes.length; i++) { + let keyframe = unresolvedKeyframes[i]; + if (typeof keyframe === "string") { + keyframe = keyframe.trim(); + if (isCSSVariableToken(keyframe)) { + const resolved = getVariableValue(keyframe, element.current); + if (resolved !== undefined) { + unresolvedKeyframes[i] = resolved; + } + if (i === unresolvedKeyframes.length - 1) { + this.finalKeyframe = keyframe; + } + } + } + } + /** + * Resolve "none" values. We do this potentially twice - once before and once after measuring keyframes. + * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which + * have a far bigger performance impact. + */ + this.resolveNoneKeyframes(); + /** + * Check to see if unit type has changed. If so schedule jobs that will + * temporarily set styles to the destination keyframes. + * Skip if we have more than two keyframes or this isn't a positional value. + * TODO: We can throw if there are multiple keyframes and the value type changes. + */ + if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { + return; + } + const [origin, target] = unresolvedKeyframes; + const originType = findDimensionValueType(origin); + const targetType = findDimensionValueType(target); + /** + * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other + * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410. + */ + const originHasVar = containsCSSVariable(origin); + const targetHasVar = containsCSSVariable(target); + if (originHasVar !== targetHasVar && positionalValues[name]) { + this.needsMeasurement = true; + return; + } + /** + * Either we don't recognise these value types or we can animate between them. + */ + if (originType === targetType) + return; + /** + * If both values are numbers or pixels, we can animate between them by + * converting them to numbers. + */ + if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { + for (let i = 0; i < unresolvedKeyframes.length; i++) { + const value = unresolvedKeyframes[i]; + if (typeof value === "string") { + unresolvedKeyframes[i] = parseFloat(value); + } + } + } + else if (positionalValues[name]) { + /** + * Else, the only way to resolve this is by measuring the element. + */ + this.needsMeasurement = true; + } + } + resolveNoneKeyframes() { + const { unresolvedKeyframes, name } = this; + const noneKeyframeIndexes = []; + for (let i = 0; i < unresolvedKeyframes.length; i++) { + if (unresolvedKeyframes[i] === null || + isNone(unresolvedKeyframes[i])) { + noneKeyframeIndexes.push(i); + } + } + if (noneKeyframeIndexes.length) { + makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); + } + } + measureInitialState() { + const { element, unresolvedKeyframes, name } = this; + if (!element || !element.current) + return; + if (name === "height") { + this.suspendedScrollY = window.pageYOffset; + } + this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + unresolvedKeyframes[0] = this.measuredOrigin; + // Set final key frame to measure after next render + const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; + if (measureKeyframe !== undefined) { + element.getValue(name, measureKeyframe).jump(measureKeyframe, false); + } + } + measureEndState() { + const { element, name, unresolvedKeyframes } = this; + if (!element || !element.current) + return; + const value = element.getValue(name); + value && value.jump(this.measuredOrigin, false); + const finalKeyframeIndex = unresolvedKeyframes.length - 1; + const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; + unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); + if (finalKeyframe !== null && this.finalKeyframe === undefined) { + this.finalKeyframe = finalKeyframe; + } + // If we removed transform values, reapply them before the next render + if (this.removedTransforms?.length) { + this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { + element + .getValue(unsetTransformName) + .set(unsetTransformValue); + }); + } + this.resolveNoneKeyframes(); + } + } + + const pxValues = new Set([ + // Border props + "borderWidth", + "borderTopWidth", + "borderRightWidth", + "borderBottomWidth", + "borderLeftWidth", + "borderRadius", + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomRightRadius", + "borderBottomLeftRadius", + // Positioning props + "width", + "maxWidth", + "height", + "maxHeight", + "top", + "right", + "bottom", + "left", + "inset", + "insetBlock", + "insetBlockStart", + "insetBlockEnd", + "insetInline", + "insetInlineStart", + "insetInlineEnd", + // Spacing props + "padding", + "paddingTop", + "paddingRight", + "paddingBottom", + "paddingLeft", + "paddingBlock", + "paddingBlockStart", + "paddingBlockEnd", + "paddingInline", + "paddingInlineStart", + "paddingInlineEnd", + "margin", + "marginTop", + "marginRight", + "marginBottom", + "marginLeft", + "marginBlock", + "marginBlockStart", + "marginBlockEnd", + "marginInline", + "marginInlineStart", + "marginInlineEnd", + // Typography + "fontSize", + // Misc + "backgroundPositionX", + "backgroundPositionY", + ]); + + function applyPxDefaults(keyframes, name) { + for (let i = 0; i < keyframes.length; i++) { + if (typeof keyframes[i] === "number" && pxValues.has(name)) { + keyframes[i] = keyframes[i] + "px"; + } + } + } + + function isWaapiSupportedEasing(easing) { + return Boolean((typeof easing === "function" && supportsLinearEasing()) || + !easing || + (typeof easing === "string" && + (easing in supportedWaapiEasing || supportsLinearEasing())) || + motionUtils.isBezierDefinition(easing) || + (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))); + } + + const supportsPartialKeyframes = /*@__PURE__*/ motionUtils.memo(() => { + try { + document.createElement("div").animate({ opacity: [1] }); + } + catch (e) { + return false; + } + return true; + }); + + /** + * A list of values that can be hardware-accelerated. + */ + const acceleratedValues = new Set([ + "opacity", + "clipPath", + "filter", + "transform", + // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved + // or until we implement support for linear() easing. + // "background-color" + ]); + + function resolveElements(elementOrSelector, scope, selectorCache) { + if (elementOrSelector == null) { + return []; + } + if (elementOrSelector instanceof EventTarget) { + return [elementOrSelector]; + } + else if (typeof elementOrSelector === "string") { + let root = document; + if (scope) { + root = scope.current; + } + const elements = selectorCache?.[elementOrSelector] ?? + root.querySelectorAll(elementOrSelector); + return elements ? Array.from(elements) : []; + } + return Array.from(elementOrSelector).filter((element) => element != null); + } + + function createSelectorEffect(subjectEffect) { + return (subject, values) => { + const elements = resolveElements(subject); + const subscriptions = []; + for (const element of elements) { + const remove = subjectEffect(element, values); + subscriptions.push(remove); + } + return () => { + for (const remove of subscriptions) + remove(); + }; + }; + } + + /** + * Provided a value and a ValueType, returns the value as that value type. + */ + const getValueAsType = (value, type) => { + return type && typeof value === "number" + ? type.transform(value) + : value; + }; + + class MotionValueState { + constructor() { + this.latest = {}; + this.values = new Map(); + } + set(name, value, render, computed, useDefaultValueType = true) { + const existingValue = this.values.get(name); + if (existingValue) { + existingValue.onRemove(); + } + const onChange = () => { + const v = value.get(); + if (useDefaultValueType) { + this.latest[name] = getValueAsType(v, numberValueTypes[name]); + } + else { + this.latest[name] = v; + } + render && frame.render(render); + }; + onChange(); + const cancelOnChange = value.on("change", onChange); + computed && value.addDependent(computed); + const remove = () => { + cancelOnChange(); + render && cancelFrame(render); + this.values.delete(name); + computed && value.removeDependent(computed); + }; + this.values.set(name, { value, onRemove: remove }); + return remove; + } + get(name) { + return this.values.get(name)?.value; + } + destroy() { + for (const value of this.values.values()) { + value.onRemove(); + } + } + } + + function createEffect(addValue) { + const stateCache = new WeakMap(); + const subscriptions = []; + return (subject, values) => { + const state = stateCache.get(subject) ?? new MotionValueState(); + stateCache.set(subject, state); + for (const key in values) { + const value = values[key]; + const remove = addValue(subject, state, key, value); + subscriptions.push(remove); + } + return () => { + for (const cancel of subscriptions) + cancel(); + }; + }; + } + + function canSetAsProperty(element, name) { + if (!(name in element)) + return false; + const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) || + Object.getOwnPropertyDescriptor(element, name); + // Check if it has a setter + return descriptor && typeof descriptor.set === "function"; + } + const addAttrValue = (element, state, key, value) => { + const isProp = canSetAsProperty(element, key); + const name = isProp + ? key + : key.startsWith("data") || key.startsWith("aria") + ? camelToDash(key) + : key; + /** + * Set attribute directly via property if available + */ + const render = isProp + ? () => { + element[name] = state.latest[key]; + } + : () => { + const v = state.latest[key]; + if (v === null || v === undefined) { + element.removeAttribute(name); + } + else { + element.setAttribute(name, String(v)); + } + }; + return state.set(key, value, render); + }; + const attrEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addAttrValue)); + + const propEffect = /*@__PURE__*/ createEffect((subject, state, key, value) => { + return state.set(key, value, () => { + subject[key] = state.latest[key]; + }, undefined, false); + }); + + /** + * Checks if an element is an HTML element in a way + * that works across iframes + */ + function isHTMLElement(element) { + return motionUtils.isObject(element) && "offsetHeight" in element; + } + + const translateAlias$1 = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + function buildTransform$1(state) { + let transform = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < transformPropOrder.length; i++) { + const key = transformPropOrder[i]; + const value = state.latest[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias$1[key] || key; + const valueToRender = state.latest[key]; + transform += `${transformName}(${valueToRender}) `; + } + } + return transformIsDefault ? "none" : transform.trim(); + } + + const originProps = new Set(["originX", "originY", "originZ"]); + const addStyleValue = (element, state, key, value) => { + let render = undefined; + let computed = undefined; + if (transformProps.has(key)) { + if (!state.get("transform")) { + // If this is an HTML element, we need to set the transform-box to fill-box + // to normalise the transform relative to the element's bounding box + if (!isHTMLElement(element) && !state.get("transformBox")) { + addStyleValue(element, state, "transformBox", new MotionValue("fill-box")); + } + state.set("transform", new MotionValue("none"), () => { + element.style.transform = buildTransform$1(state); + }); + } + computed = state.get("transform"); + } + else if (originProps.has(key)) { + if (!state.get("transformOrigin")) { + state.set("transformOrigin", new MotionValue(""), () => { + const originX = state.latest.originX ?? "50%"; + const originY = state.latest.originY ?? "50%"; + const originZ = state.latest.originZ ?? 0; + element.style.transformOrigin = `${originX} ${originY} ${originZ}`; + }); + } + computed = state.get("transformOrigin"); + } + else if (isCSSVar(key)) { + render = () => { + element.style.setProperty(key, state.latest[key]); + }; + } + else { + render = () => { + element.style[key] = state.latest[key]; + }; + } + return state.set(key, value, render, computed); + }; + const styleEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addStyleValue)); + + function addSVGPathValue(element, state, key, value) { + frame.render(() => element.setAttribute("pathLength", "1")); + if (key === "pathOffset") { + return state.set(key, value, () => { + // Use unitless value to avoid Safari zoom bug + const offset = state.latest[key]; + element.setAttribute("stroke-dashoffset", `${-offset}`); + }); + } + else { + if (!state.get("stroke-dasharray")) { + state.set("stroke-dasharray", new MotionValue("1 1"), () => { + const { pathLength = 1, pathSpacing } = state.latest; + // Use unitless values to avoid Safari zoom bug + element.setAttribute("stroke-dasharray", `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`); + }); + } + return state.set(key, value, undefined, state.get("stroke-dasharray")); + } + } + const addSVGValue = (element, state, key, value) => { + if (key.startsWith("path")) { + return addSVGPathValue(element, state, key, value); + } + else if (key.startsWith("attr")) { + return addAttrValue(element, state, convertAttrKey(key), value); + } + const handler = key in element.style ? addStyleValue : addAttrValue; + return handler(element, state, key, value); + }; + const svgEffect = /*@__PURE__*/ createSelectorEffect( + /*@__PURE__*/ createEffect(addSVGValue)); + function convertAttrKey(key) { + return key.replace(/^attr([A-Z])/, (_, firstChar) => firstChar.toLowerCase()); + } + + const { schedule: microtask, cancel: cancelMicrotask } = + /* @__PURE__ */ createRenderBatcher(queueMicrotask, false); + + const isDragging = { + x: false, + y: false, + }; + function isDragActive() { + return isDragging.x || isDragging.y; + } + + function setDragLock(axis) { + if (axis === "x" || axis === "y") { + if (isDragging[axis]) { + return null; + } + else { + isDragging[axis] = true; + return () => { + isDragging[axis] = false; + }; + } + } + else { + if (isDragging.x || isDragging.y) { + return null; + } + else { + isDragging.x = isDragging.y = true; + return () => { + isDragging.x = isDragging.y = false; + }; + } + } + } + + function setupGesture(elementOrSelector, options) { + const elements = resolveElements(elementOrSelector); + const gestureAbortController = new AbortController(); + const eventOptions = { + passive: true, + ...options, + signal: gestureAbortController.signal, + }; + const cancel = () => gestureAbortController.abort(); + return [elements, eventOptions, cancel]; + } + + function isValidHover(event) { + return !(event.pointerType === "touch" || isDragActive()); + } + /** + * Create a hover gesture. hover() is different to .addEventListener("pointerenter") + * in that it has an easier syntax, filters out polyfilled touch events, interoperates + * with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends. + * + * @public + */ + function hover(elementOrSelector, onHoverStart, options = {}) { + const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options); + elements.forEach((element) => { + let isPressed = false; + let deferredHoverEnd = false; + let hoverEndCallback; + const removePointerLeave = () => { + element.removeEventListener("pointerleave", onPointerLeave); + }; + const endHover = (event) => { + if (hoverEndCallback) { + hoverEndCallback(event); + hoverEndCallback = undefined; + } + removePointerLeave(); + }; + const onPointerUp = (event) => { + isPressed = false; + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerUp); + if (deferredHoverEnd) { + deferredHoverEnd = false; + endHover(event); + } + }; + const onPointerDown = () => { + isPressed = true; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerUp, eventOptions); + }; + const onPointerLeave = (leaveEvent) => { + if (leaveEvent.pointerType === "touch") + return; + if (isPressed) { + deferredHoverEnd = true; + return; + } + endHover(leaveEvent); + }; + const onPointerEnter = (enterEvent) => { + if (!isValidHover(enterEvent)) + return; + deferredHoverEnd = false; + const onHoverEnd = onHoverStart(element, enterEvent); + if (typeof onHoverEnd !== "function") + return; + hoverEndCallback = onHoverEnd; + element.addEventListener("pointerleave", onPointerLeave, eventOptions); + }; + element.addEventListener("pointerenter", onPointerEnter, eventOptions); + element.addEventListener("pointerdown", onPointerDown, eventOptions); + }); + return cancel; + } + + /** + * Recursively traverse up the tree to check whether the provided child node + * is the parent or a descendant of it. + * + * @param parent - Element to find + * @param child - Element to test against parent + */ + const isNodeOrChild = (parent, child) => { + if (!child) { + return false; + } + else if (parent === child) { + return true; + } + else { + return isNodeOrChild(parent, child.parentElement); + } + }; + + const isPrimaryPointer = (event) => { + if (event.pointerType === "mouse") { + return typeof event.button !== "number" || event.button <= 0; + } + else { + /** + * isPrimary is true for all mice buttons, whereas every touch point + * is regarded as its own input. So subsequent concurrent touch points + * will be false. + * + * Specifically match against false here as incomplete versions of + * PointerEvents in very old browser might have it set as undefined. + */ + return event.isPrimary !== false; + } + }; + + const keyboardAccessibleElements = new Set([ + "BUTTON", + "INPUT", + "SELECT", + "TEXTAREA", + "A", + ]); + /** + * Checks if an element is natively keyboard accessible (focusable). + * Used by the press gesture to determine if we need to add tabIndex. + */ + function isElementKeyboardAccessible(element) { + return (keyboardAccessibleElements.has(element.tagName) || + element.isContentEditable === true); + } + const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]); + /** + * Checks if an element has text selection or direct interaction behavior + * that should block drag gestures from starting. + * + * This specifically targets form controls where the user might want to select + * text or interact with the control (e.g., sliders, dropdowns). + * + * Buttons and links are NOT included because they don't have click-and-move + * actions of their own - they only respond to click events, so dragging + * should still work when initiated from these elements. + */ + function isElementTextInput(element) { + return (textInputElements.has(element.tagName) || + element.isContentEditable === true); + } + + const isPressing = new WeakSet(); + + /** + * Filter out events that are not "Enter" keys. + */ + function filterEvents(callback) { + return (event) => { + if (event.key !== "Enter") + return; + callback(event); + }; + } + function firePointerEvent(target, type) { + target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); + } + const enableKeyboardPress = (focusEvent, eventOptions) => { + const element = focusEvent.currentTarget; + if (!element) + return; + const handleKeydown = filterEvents(() => { + if (isPressing.has(element)) + return; + firePointerEvent(element, "down"); + const handleKeyup = filterEvents(() => { + firePointerEvent(element, "up"); + }); + const handleBlur = () => firePointerEvent(element, "cancel"); + element.addEventListener("keyup", handleKeyup, eventOptions); + element.addEventListener("blur", handleBlur, eventOptions); + }); + element.addEventListener("keydown", handleKeydown, eventOptions); + /** + * Add an event listener that fires on blur to remove the keydown events. + */ + element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); + }; + + /** + * Filter out events that are not primary pointer events, or are triggering + * while a Motion gesture is active. + */ + function isValidPressEvent(event) { + return isPrimaryPointer(event) && !isDragActive(); + } + const claimedPointerDownEvents = new WeakSet(); + /** + * Create a press gesture. + * + * Press is different to `"pointerdown"`, `"pointerup"` in that it + * automatically filters out secondary pointer events like right + * click and multitouch. + * + * It also adds accessibility support for keyboards, where + * an element with a press gesture will receive focus and + * trigger on Enter `"keydown"` and `"keyup"` events. + * + * This is different to a browser's `"click"` event, which does + * respond to keyboards but only for the `"click"` itself, rather + * than the press start and end/cancel. The element also needs + * to be focusable for this to work, whereas a press gesture will + * make an element focusable by default. + * + * @public + */ + function press(targetOrSelector, onPressStart, options = {}) { + const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options); + const startPress = (startEvent) => { + const target = startEvent.currentTarget; + if (!isValidPressEvent(startEvent)) + return; + if (claimedPointerDownEvents.has(startEvent)) + return; + isPressing.add(target); + if (options.stopPropagation) { + claimedPointerDownEvents.add(startEvent); + } + const onPressEnd = onPressStart(target, startEvent); + const onPointerEnd = (endEvent, success) => { + window.removeEventListener("pointerup", onPointerUp); + window.removeEventListener("pointercancel", onPointerCancel); + if (isPressing.has(target)) { + isPressing.delete(target); + } + if (!isValidPressEvent(endEvent)) { + return; + } + if (typeof onPressEnd === "function") { + onPressEnd(endEvent, { success }); + } + }; + const onPointerUp = (upEvent) => { + onPointerEnd(upEvent, target === window || + target === document || + options.useGlobalTarget || + isNodeOrChild(target, upEvent.target)); + }; + const onPointerCancel = (cancelEvent) => { + onPointerEnd(cancelEvent, false); + }; + window.addEventListener("pointerup", onPointerUp, eventOptions); + window.addEventListener("pointercancel", onPointerCancel, eventOptions); + }; + targets.forEach((target) => { + const pointerDownTarget = options.useGlobalTarget ? window : target; + pointerDownTarget.addEventListener("pointerdown", startPress, eventOptions); + if (isHTMLElement(target)) { + target.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions)); + if (!isElementKeyboardAccessible(target) && + !target.hasAttribute("tabindex")) { + target.tabIndex = 0; + } + } + }); + return cancelEvents; + } + + function getComputedStyle$2(element, name) { + const computedStyle = window.getComputedStyle(element); + return isCSSVar(name) + ? computedStyle.getPropertyValue(name) + : computedStyle[name]; + } + + /** + * Checks if an element is an SVG element in a way + * that works across iframes + */ + function isSVGElement(element) { + return motionUtils.isObject(element) && "ownerSVGElement" in element; + } + + const resizeHandlers = new WeakMap(); + let observer; + const getSize = (borderBoxAxis, svgAxis, htmlAxis) => (target, borderBoxSize) => { + if (borderBoxSize && borderBoxSize[0]) { + return borderBoxSize[0][(borderBoxAxis + "Size")]; + } + else if (isSVGElement(target) && "getBBox" in target) { + return target.getBBox()[svgAxis]; + } + else { + return target[htmlAxis]; + } + }; + const getWidth = /*@__PURE__*/ getSize("inline", "width", "offsetWidth"); + const getHeight = /*@__PURE__*/ getSize("block", "height", "offsetHeight"); + function notifyTarget({ target, borderBoxSize }) { + resizeHandlers.get(target)?.forEach((handler) => { + handler(target, { + get width() { + return getWidth(target, borderBoxSize); + }, + get height() { + return getHeight(target, borderBoxSize); + }, + }); + }); + } + function notifyAll(entries) { + entries.forEach(notifyTarget); + } + function createResizeObserver() { + if (typeof ResizeObserver === "undefined") + return; + observer = new ResizeObserver(notifyAll); + } + function resizeElement(target, handler) { + if (!observer) + createResizeObserver(); + const elements = resolveElements(target); + elements.forEach((element) => { + let elementHandlers = resizeHandlers.get(element); + if (!elementHandlers) { + elementHandlers = new Set(); + resizeHandlers.set(element, elementHandlers); + } + elementHandlers.add(handler); + observer?.observe(element); + }); + return () => { + elements.forEach((element) => { + const elementHandlers = resizeHandlers.get(element); + elementHandlers?.delete(handler); + if (!elementHandlers?.size) { + observer?.unobserve(element); + } + }); + }; + } + + const windowCallbacks = new Set(); + let windowResizeHandler; + function createWindowResizeHandler() { + windowResizeHandler = () => { + const info = { + get width() { + return window.innerWidth; + }, + get height() { + return window.innerHeight; + }, + }; + windowCallbacks.forEach((callback) => callback(info)); + }; + window.addEventListener("resize", windowResizeHandler); + } + function resizeWindow(callback) { + windowCallbacks.add(callback); + if (!windowResizeHandler) + createWindowResizeHandler(); + return () => { + windowCallbacks.delete(callback); + if (!windowCallbacks.size && + typeof windowResizeHandler === "function") { + window.removeEventListener("resize", windowResizeHandler); + windowResizeHandler = undefined; + } + }; + } + + function resize(a, b) { + return typeof a === "function" ? resizeWindow(a) : resizeElement(a, b); + } + + function observeTimeline(update, timeline) { + let prevProgress; + const onFrame = () => { + const { currentTime } = timeline; + const percentage = currentTime === null ? 0 : currentTime.value; + const progress = percentage / 100; + if (prevProgress !== progress) { + update(progress); + } + prevProgress = progress; + }; + frame.preUpdate(onFrame, true); + return () => cancelFrame(onFrame); + } + + function record() { + const { value } = statsBuffer; + if (value === null) { + cancelFrame(record); + return; + } + value.frameloop.rate.push(frameData.delta); + value.animations.mainThread.push(activeAnimations.mainThread); + value.animations.waapi.push(activeAnimations.waapi); + value.animations.layout.push(activeAnimations.layout); + } + function mean(values) { + return values.reduce((acc, value) => acc + value, 0) / values.length; + } + function summarise(values, calcAverage = mean) { + if (values.length === 0) { + return { + min: 0, + max: 0, + avg: 0, + }; + } + return { + min: Math.min(...values), + max: Math.max(...values), + avg: calcAverage(values), + }; + } + const msToFps = (ms) => Math.round(1000 / ms); + function clearStatsBuffer() { + statsBuffer.value = null; + statsBuffer.addProjectionMetrics = null; + } + function reportStats() { + const { value } = statsBuffer; + if (!value) { + throw new Error("Stats are not being measured"); + } + clearStatsBuffer(); + cancelFrame(record); + const summary = { + frameloop: { + setup: summarise(value.frameloop.setup), + rate: summarise(value.frameloop.rate), + read: summarise(value.frameloop.read), + resolveKeyframes: summarise(value.frameloop.resolveKeyframes), + preUpdate: summarise(value.frameloop.preUpdate), + update: summarise(value.frameloop.update), + preRender: summarise(value.frameloop.preRender), + render: summarise(value.frameloop.render), + postRender: summarise(value.frameloop.postRender), + }, + animations: { + mainThread: summarise(value.animations.mainThread), + waapi: summarise(value.animations.waapi), + layout: summarise(value.animations.layout), + }, + layoutProjection: { + nodes: summarise(value.layoutProjection.nodes), + calculatedTargetDeltas: summarise(value.layoutProjection.calculatedTargetDeltas), + calculatedProjections: summarise(value.layoutProjection.calculatedProjections), + }, + }; + /** + * Convert the rate to FPS + */ + const { rate } = summary.frameloop; + rate.min = msToFps(rate.min); + rate.max = msToFps(rate.max); + rate.avg = msToFps(rate.avg); + [rate.min, rate.max] = [rate.max, rate.min]; + return summary; + } + function recordStats() { + if (statsBuffer.value) { + clearStatsBuffer(); + throw new Error("Stats are already being measured"); + } + const newStatsBuffer = statsBuffer; + newStatsBuffer.value = { + frameloop: { + setup: [], + rate: [], + read: [], + resolveKeyframes: [], + preUpdate: [], + update: [], + preRender: [], + render: [], + postRender: [], + }, + animations: { + mainThread: [], + waapi: [], + layout: [], + }, + layoutProjection: { + nodes: [], + calculatedTargetDeltas: [], + calculatedProjections: [], + }, + }; + newStatsBuffer.addProjectionMetrics = (metrics) => { + const { layoutProjection } = newStatsBuffer.value; + layoutProjection.nodes.push(metrics.nodes); + layoutProjection.calculatedTargetDeltas.push(metrics.calculatedTargetDeltas); + layoutProjection.calculatedProjections.push(metrics.calculatedProjections); + }; + frame.postRender(record, true); + return reportStats; + } + + /** + * Checks if an element is specifically an SVGSVGElement (the root SVG element) + * in a way that works across iframes + */ + function isSVGSVGElement(element) { + return isSVGElement(element) && element.tagName === "svg"; + } + + function getOriginIndex(from, total) { + if (from === "first") { + return 0; + } + else { + const lastIndex = total - 1; + return from === "last" ? lastIndex : lastIndex / 2; + } + } + function stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) { + return (i, total) => { + const fromIndex = typeof from === "number" ? from : getOriginIndex(from, total); + const distance = Math.abs(fromIndex - i); + let delay = duration * distance; + if (ease) { + const maxDelay = total * duration; + const easingFunction = motionUtils.easingDefinitionToFunction(ease); + delay = easingFunction(delay / maxDelay) * maxDelay; + } + return startDelay + delay; + }; + } + + function transform(...args) { + const useImmediate = !Array.isArray(args[0]); + const argOffset = useImmediate ? 0 : -1; + const inputValue = args[0 + argOffset]; + const inputRange = args[1 + argOffset]; + const outputRange = args[2 + argOffset]; + const options = args[3 + argOffset]; + const interpolator = interpolate(inputRange, outputRange, options); + return useImmediate ? interpolator(inputValue) : interpolator; + } + + /** + * Create a `MotionValue` that animates to its latest value using any transition type. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = followValue(x, { type: "spring", stiffness: 300 }) + * // or with tween + * const z = followValue(x, { type: "tween", duration: 0.5, ease: "easeOut" }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns `MotionValue` + * + * @public + */ + function followValue(source, options) { + const initialValue = isMotionValue(source) ? source.get() : source; + const value = motionValue(initialValue); + attachFollow(value, source, options); + return value; + } + /** + * Attach an animation to a MotionValue that will animate whenever the value changes. + * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.) + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Animation transition options + * @returns Cleanup function + * + * @public + */ + function attachFollow(value, source, options = {}) { + const initialValue = value.get(); + let activeAnimation = null; + let latestValue = initialValue; + let latestSetter; + const unit = typeof initialValue === "string" + ? initialValue.replace(/[\d.-]/g, "") + : undefined; + const stopAnimation = () => { + if (activeAnimation) { + activeAnimation.stop(); + activeAnimation = null; + } + }; + const startAnimation = () => { + stopAnimation(); + const currentValue = asNumber$1(value.get()); + const targetValue = asNumber$1(latestValue); + // Don't animate if we're already at the target + if (currentValue === targetValue) { + return; + } + activeAnimation = new JSAnimation({ + keyframes: [currentValue, targetValue], + velocity: value.getVelocity(), + // Default to spring if no type specified (matches useSpring behavior) + type: "spring", + restDelta: 0.001, + restSpeed: 0.01, + ...options, + onUpdate: latestSetter, + }); + }; + value.attach((v, set) => { + latestValue = v; + latestSetter = (latest) => set(parseValue(latest, unit)); + frame.postRender(() => { + startAnimation(); + value["events"].animationStart?.notify(); + activeAnimation?.then(() => { + value["events"].animationComplete?.notify(); + }); + }); + }, stopAnimation); + if (isMotionValue(source)) { + const removeSourceOnChange = source.on("change", (v) => value.set(parseValue(v, unit))); + const removeValueOnDestroy = value.on("destroy", removeSourceOnChange); + return () => { + removeSourceOnChange(); + removeValueOnDestroy(); + }; + } + return stopAnimation; + } + function parseValue(v, unit) { + return unit ? v + unit : v; + } + function asNumber$1(v) { + return typeof v === "number" ? v : parseFloat(v); + } + + function subscribeValue(inputValues, outputValue, getLatest) { + const update = () => outputValue.set(getLatest()); + const scheduleUpdate = () => frame.preRender(update, false, true); + const subscriptions = inputValues.map((v) => v.on("change", scheduleUpdate)); + outputValue.on("destroy", () => { + subscriptions.forEach((unsubscribe) => unsubscribe()); + cancelFrame(update); + }); + } + + /** + * Create a `MotionValue` that transforms the output of other `MotionValue`s by + * passing their latest values through a transform function. + * + * Whenever a `MotionValue` referred to in the provided function is updated, + * it will be re-evaluated. + * + * ```jsx + * const x = motionValue(0) + * const y = transformValue(() => x.get() * 2) // double x + * ``` + * + * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements. + * @returns `MotionValue` + * + * @public + */ + function transformValue(transform) { + const collectedValues = []; + /** + * Open session of collectMotionValues. Any MotionValue that calls get() + * inside transform will be saved into this array. + */ + collectMotionValues.current = collectedValues; + const initialValue = transform(); + collectMotionValues.current = undefined; + const value = motionValue(initialValue); + subscribeValue(collectedValues, value, transform); + return value; + } + + /** + * Create a `MotionValue` that maps the output of another `MotionValue` by + * mapping it from one range of values into another. + * + * @remarks + * + * Given an input range of `[-200, -100, 100, 200]` and an output range of + * `[0, 1, 1, 0]`, the returned `MotionValue` will: + * + * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`. + * - When provided a value between `-100` and `100`, will return `1`. + * - When provided a value between `100` and `200`, will return a value between `1` and `0` + * + * The input range must be a linear series of numbers. The output range + * can be any value type supported by Motion: numbers, colors, shadows, etc. + * + * Every value in the output range must be of the same type and in the same format. + * + * ```jsx + * const x = motionValue(0) + * const xRange = [-200, -100, 100, 200] + * const opacityRange = [0, 1, 1, 0] + * const opacity = mapValue(x, xRange, opacityRange) + * ``` + * + * @param inputValue - `MotionValue` + * @param inputRange - A linear series of numbers (either all increasing or decreasing) + * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`. + * @param options - + * + * - clamp: boolean. Clamp values to within the given range. Defaults to `true` + * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each. + * + * @returns `MotionValue` + * + * @public + */ + function mapValue(inputValue, inputRange, outputRange, options) { + const map = transform(inputRange, outputRange, options); + return transformValue(() => map(inputValue.get())); + } + + /** + * Create a `MotionValue` that animates to its latest value using a spring. + * Can either be a value or track another `MotionValue`. + * + * ```jsx + * const x = motionValue(0) + * const y = springValue(x, { stiffness: 300 }) + * ``` + * + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns `MotionValue` + * + * @public + */ + function springValue(source, options) { + return followValue(source, { type: "spring", ...options }); + } + /** + * Attach a spring animation to a MotionValue that will animate whenever the value changes. + * + * @param value - The MotionValue to animate + * @param source - Initial value or MotionValue to track + * @param options - Spring configuration options + * @returns Cleanup function + * + * @public + */ + function attachSpring(value, source, options) { + return attachFollow(value, source, { type: "spring", ...options }); + } + + /** + * A list of all ValueTypes + */ + const valueTypes = [...dimensionValueTypes, color, complex]; + /** + * Tests a value against the list of ValueTypes + */ + const findValueType = (v) => valueTypes.find(testValueType(v)); + + function chooseLayerType(valueName) { + if (valueName === "layout") + return "group"; + if (valueName === "enter" || valueName === "new") + return "new"; + if (valueName === "exit" || valueName === "old") + return "old"; + return "group"; + } + + let pendingRules = {}; + let style = null; + const css = { + set: (selector, values) => { + pendingRules[selector] = values; + }, + commit: () => { + if (!style) { + style = document.createElement("style"); + style.id = "motion-view"; + } + let cssText = ""; + for (const selector in pendingRules) { + const rule = pendingRules[selector]; + cssText += `${selector} {\n`; + for (const [property, value] of Object.entries(rule)) { + cssText += ` ${property}: ${value};\n`; + } + cssText += "}\n"; + } + style.textContent = cssText; + document.head.appendChild(style); + pendingRules = {}; + }, + remove: () => { + if (style && style.parentElement) { + style.parentElement.removeChild(style); + } + }, + }; + + function getViewAnimationLayerInfo(pseudoElement) { + const match = pseudoElement.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/); + if (!match) + return null; + return { layer: match[2], type: match[1] }; + } + + function filterViewAnimations(animation) { + const { effect } = animation; + if (!effect) + return false; + return (effect.target === document.documentElement && + effect.pseudoElement?.startsWith("::view-transition")); + } + function getViewAnimations() { + return document.getAnimations().filter(filterViewAnimations); + } + + function hasTarget(target, targets) { + return targets.has(target) && Object.keys(targets.get(target)).length > 0; + } + + const definitionNames = ["layout", "enter", "exit", "new", "old"]; + function startViewAnimation(builder) { + const { update, targets, options: defaultOptions } = builder; + if (!document.startViewTransition) { + return new Promise(async (resolve) => { + await update(); + resolve(new GroupAnimation([])); + }); + } + // TODO: Go over existing targets and ensure they all have ids + /** + * If we don't have any animations defined for the root target, + * remove it from being captured. + */ + if (!hasTarget("root", targets)) { + css.set(":root", { + "view-transition-name": "none", + }); + } + /** + * Set the timing curve to linear for all view transition layers. + * This gets baked into the keyframes, which can't be changed + * without breaking the generated animation. + * + * This allows us to set easing via updateTiming - which can be changed. + */ + css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" }); + css.commit(); // Write + const transition = document.startViewTransition(async () => { + await update(); + // TODO: Go over new targets and ensure they all have ids + }); + transition.finished.finally(() => { + css.remove(); // Write + }); + return new Promise((resolve) => { + transition.ready.then(() => { + const generatedViewAnimations = getViewAnimations(); + const animations = []; + /** + * Create animations for each of our explicitly-defined subjects. + */ + targets.forEach((definition, target) => { + // TODO: If target is not "root", resolve elements + // and iterate over each + for (const key of definitionNames) { + if (!definition[key]) + continue; + const { keyframes, options } = definition[key]; + for (let [valueName, valueKeyframes] of Object.entries(keyframes)) { + if (!valueKeyframes) + continue; + const valueOptions = { + ...getValueTransition(defaultOptions, valueName), + ...getValueTransition(options, valueName), + }; + const type = chooseLayerType(key); + /** + * If this is an opacity animation, and keyframes are not an array, + * we need to convert them into an array and set an initial value. + */ + if (valueName === "opacity" && + !Array.isArray(valueKeyframes)) { + const initialValue = type === "new" ? 0 : 1; + valueKeyframes = [initialValue, valueKeyframes]; + } + /** + * Resolve stagger function if provided. + */ + if (typeof valueOptions.delay === "function") { + valueOptions.delay = valueOptions.delay(0, 1); + } + valueOptions.duration && (valueOptions.duration = motionUtils.secondsToMilliseconds(valueOptions.duration)); + valueOptions.delay && (valueOptions.delay = motionUtils.secondsToMilliseconds(valueOptions.delay)); + const animation = new NativeAnimation({ + ...valueOptions, + element: document.documentElement, + name: valueName, + pseudoElement: `::view-transition-${type}(${target})`, + keyframes: valueKeyframes, + }); + animations.push(animation); + } + } + }); + /** + * Handle browser generated animations + */ + for (const animation of generatedViewAnimations) { + if (animation.playState === "finished") + continue; + const { effect } = animation; + if (!effect || !(effect instanceof KeyframeEffect)) + continue; + const { pseudoElement } = effect; + if (!pseudoElement) + continue; + const name = getViewAnimationLayerInfo(pseudoElement); + if (!name) + continue; + const targetDefinition = targets.get(name.layer); + if (!targetDefinition) { + /** + * If transition name is group then update the timing of the animation + * whereas if it's old or new then we could possibly replace it using + * the above method. + */ + const transitionName = name.type === "group" ? "layout" : ""; + let animationTransition = { + ...getValueTransition(defaultOptions, transitionName), + }; + animationTransition.duration && (animationTransition.duration = motionUtils.secondsToMilliseconds(animationTransition.duration)); + animationTransition = + applyGeneratorOptions(animationTransition); + const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration); + effect.updateTiming({ + delay: motionUtils.secondsToMilliseconds(animationTransition.delay ?? 0), + duration: animationTransition.duration, + easing, + }); + animations.push(new NativeAnimationWrapper(animation)); + } + else if (hasOpacity(targetDefinition, "enter") && + hasOpacity(targetDefinition, "exit") && + effect + .getKeyframes() + .some((keyframe) => keyframe.mixBlendMode)) { + animations.push(new NativeAnimationWrapper(animation)); + } + else { + animation.cancel(); + } + } + resolve(new GroupAnimation(animations)); + }); + }); + } + function hasOpacity(target, key) { + return target?.[key]?.keyframes.opacity; + } + + let builders = []; + let current = null; + function next() { + current = null; + const [nextBuilder] = builders; + if (nextBuilder) + start(nextBuilder); + } + function start(builder) { + motionUtils.removeItem(builders, builder); + current = builder; + startViewAnimation(builder).then((animation) => { + builder.notifyReady(animation); + animation.finished.finally(next); + }); + } + function processQueue() { + /** + * Iterate backwards over the builders array. We can ignore the + * "wait" animations. If we have an interrupting animation in the + * queue then we need to batch all preceeding animations into it. + * Currently this only batches the update functions but will also + * need to batch the targets. + */ + for (let i = builders.length - 1; i >= 0; i--) { + const builder = builders[i]; + const { interrupt } = builder.options; + if (interrupt === "immediate") { + const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update); + const remaining = builders.slice(i + 1); + builder.update = () => { + batchedUpdates.forEach((update) => update()); + }; + // Put the current builder at the front, followed by any "wait" builders + builders = [builder, ...remaining]; + break; + } + } + if (!current || builders[0]?.options.interrupt === "immediate") { + next(); + } + } + function addToQueue(builder) { + builders.push(builder); + microtask.render(processQueue); + } + + class ViewTransitionBuilder { + constructor(update, options = {}) { + this.currentSubject = "root"; + this.targets = new Map(); + this.notifyReady = motionUtils.noop; + this.readyPromise = new Promise((resolve) => { + this.notifyReady = resolve; + }); + this.update = update; + this.options = { + interrupt: "wait", + ...options, + }; + addToQueue(this); + } + get(subject) { + this.currentSubject = subject; + return this; + } + layout(keyframes, options) { + this.updateTarget("layout", keyframes, options); + return this; + } + new(keyframes, options) { + this.updateTarget("new", keyframes, options); + return this; + } + old(keyframes, options) { + this.updateTarget("old", keyframes, options); + return this; + } + enter(keyframes, options) { + this.updateTarget("enter", keyframes, options); + return this; + } + exit(keyframes, options) { + this.updateTarget("exit", keyframes, options); + return this; + } + crossfade(options) { + this.updateTarget("enter", { opacity: 1 }, options); + this.updateTarget("exit", { opacity: 0 }, options); + return this; + } + updateTarget(target, keyframes, options = {}) { + const { currentSubject, targets } = this; + if (!targets.has(currentSubject)) { + targets.set(currentSubject, {}); + } + const targetData = targets.get(currentSubject); + targetData[target] = { keyframes, options }; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + } + function animateView(update, defaultOptions = {}) { + return new ViewTransitionBuilder(update, defaultOptions); + } + + const createAxisDelta = () => ({ + translate: 0, + scale: 1, + origin: 0, + originPoint: 0, + }); + const createDelta = () => ({ + x: createAxisDelta(), + y: createAxisDelta(), + }); + const createAxis = () => ({ min: 0, max: 0 }); + const createBox = () => ({ + x: createAxis(), + y: createAxis(), + }); + + const visualElementStore = new WeakMap(); + + function isAnimationControls(v) { + return (v !== null && + typeof v === "object" && + typeof v.start === "function"); + } + + /** + * Decides if the supplied variable is variant label + */ + function isVariantLabel(v) { + return typeof v === "string" || Array.isArray(v); + } + + const variantPriorityOrder = [ + "animate", + "whileInView", + "whileFocus", + "whileHover", + "whileTap", + "whileDrag", + "exit", + ]; + const variantProps = ["initial", ...variantPriorityOrder]; + + function isControllingVariants(props) { + return (isAnimationControls(props.animate) || + variantProps.some((name) => isVariantLabel(props[name]))); + } + function isVariantNode(props) { + return Boolean(isControllingVariants(props) || props.variants); + } + + /** + * Updates motion values from props changes. + * Uses `any` type for element to avoid circular dependencies with VisualElement. + */ + function updateMotionValuesFromProps(element, next, prev) { + for (const key in next) { + const nextValue = next[key]; + const prevValue = prev[key]; + if (isMotionValue(nextValue)) { + /** + * If this is a motion value found in props or style, we want to add it + * to our visual element's motion value map. + */ + element.addValue(key, nextValue); + } + else if (isMotionValue(prevValue)) { + /** + * If we're swapping from a motion value to a static value, + * create a new motion value from that + */ + element.addValue(key, motionValue(nextValue, { owner: element })); + } + else if (prevValue !== nextValue) { + /** + * If this is a flat value that has changed, update the motion value + * or create one if it doesn't exist. We only want to do this if we're + * not handling the value with our animation state. + */ + if (element.hasValue(key)) { + const existingValue = element.getValue(key); + if (existingValue.liveStyle === true) { + existingValue.jump(nextValue); + } + else if (!existingValue.hasAnimated) { + existingValue.set(nextValue); + } + } + else { + const latestValue = element.getStaticValue(key); + element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element })); + } + } + } + // Handle removed values + for (const key in prev) { + if (next[key] === undefined) + element.removeValue(key); + } + return next; + } + + // Does this device prefer reduced motion? Returns `null` server-side. + const prefersReducedMotion = { current: null }; + const hasReducedMotionListener = { current: false }; + + const isBrowser = typeof window !== "undefined"; + function initPrefersReducedMotion() { + hasReducedMotionListener.current = true; + if (!isBrowser) + return; + if (window.matchMedia) { + const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); + const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches); + motionMediaQuery.addEventListener("change", setReducedMotionPreferences); + setReducedMotionPreferences(); + } + else { + prefersReducedMotion.current = false; + } + } + + const propEventHandlers = [ + "AnimationStart", + "AnimationComplete", + "Update", + "BeforeLayoutMeasure", + "LayoutMeasure", + "LayoutAnimationStart", + "LayoutAnimationComplete", + ]; + /** + * Static feature definitions - can be injected by framework layer + */ + let featureDefinitions = {}; + /** + * Set feature definitions for all VisualElements. + * This should be called by the framework layer (e.g., framer-motion) during initialization. + */ + function setFeatureDefinitions(definitions) { + featureDefinitions = definitions; + } + /** + * Get the current feature definitions + */ + function getFeatureDefinitions() { + return featureDefinitions; + } + /** + * A VisualElement is an imperative abstraction around UI elements such as + * HTMLElement, SVGElement, Three.Object3D etc. + */ + class VisualElement { + /** + * This method takes React props and returns found MotionValues. For example, HTML + * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. + * + * This isn't an abstract method as it needs calling in the constructor, but it is + * intended to be one. + */ + scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { + return {}; + } + constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) { + /** + * A reference to the current underlying Instance, e.g. a HTMLElement + * or Three.Mesh etc. + */ + this.current = null; + /** + * A set containing references to this VisualElement's children. + */ + this.children = new Set(); + /** + * Determine what role this visual element should take in the variant tree. + */ + this.isVariantNode = false; + this.isControllingVariants = false; + /** + * Decides whether this VisualElement should animate in reduced motion + * mode. + * + * TODO: This is currently set on every individual VisualElement but feels + * like it could be set globally. + */ + this.shouldReduceMotion = null; + /** + * Decides whether animations should be skipped for this VisualElement. + * Useful for E2E tests and visual regression testing. + */ + this.shouldSkipAnimations = false; + /** + * A map of all motion values attached to this visual element. Motion + * values are source of truth for any given animated value. A motion + * value might be provided externally by the component via props. + */ + this.values = new Map(); + this.KeyframeResolver = KeyframeResolver; + /** + * Cleanup functions for active features (hover/tap/exit etc) + */ + this.features = {}; + /** + * A map of every subscription that binds the provided or generated + * motion values onChange listeners to this visual element. + */ + this.valueSubscriptions = new Map(); + /** + * A reference to the previously-provided motion values as returned + * from scrapeMotionValuesFromProps. We use the keys in here to determine + * if any motion values need to be removed after props are updated. + */ + this.prevMotionValues = {}; + /** + * Track whether this element has been mounted before, to detect + * remounts after Suspense unmount/remount cycles. + */ + this.hasBeenMounted = false; + /** + * An object containing a SubscriptionManager for each active event. + */ + this.events = {}; + /** + * An object containing an unsubscribe function for each prop event subscription. + * For example, every "Update" event can have multiple subscribers via + * VisualElement.on(), but only one of those can be defined via the onUpdate prop. + */ + this.propEventSubscriptions = {}; + this.notifyUpdate = () => this.notify("Update", this.latestValues); + this.render = () => { + if (!this.current) + return; + this.triggerBuild(); + this.renderInstance(this.current, this.renderState, this.props.style, this.projection); + }; + this.renderScheduledAt = 0.0; + this.scheduleRender = () => { + const now = time.now(); + if (this.renderScheduledAt < now) { + this.renderScheduledAt = now; + frame.render(this.render, false, true); + } + }; + const { latestValues, renderState } = visualState; + this.latestValues = latestValues; + this.baseTarget = { ...latestValues }; + this.initialValues = props.initial ? { ...latestValues } : {}; + this.renderState = renderState; + this.parent = parent; + this.props = props; + this.presenceContext = presenceContext; + this.depth = parent ? parent.depth + 1 : 0; + this.reducedMotionConfig = reducedMotionConfig; + this.skipAnimationsConfig = skipAnimations; + this.options = options; + this.blockInitialAnimation = Boolean(blockInitialAnimation); + this.isControllingVariants = isControllingVariants(props); + this.isVariantNode = isVariantNode(props); + if (this.isVariantNode) { + this.variantChildren = new Set(); + } + this.manuallyAnimateOnMount = Boolean(parent && parent.current); + /** + * Any motion values that are provided to the element when created + * aren't yet bound to the element, as this would technically be impure. + * However, we iterate through the motion values and set them to the + * initial values for this component. + * + * TODO: This is impure and we should look at changing this to run on mount. + * Doing so will break some tests but this isn't necessarily a breaking change, + * more a reflection of the test. + */ + const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this); + for (const key in initialMotionValues) { + const value = initialMotionValues[key]; + if (latestValues[key] !== undefined && isMotionValue(value)) { + value.set(latestValues[key]); + } + } + } + mount(instance) { + /** + * If this element has been mounted before (e.g. after a Suspense + * unmount/remount), reset motion values to their initial state + * so animations replay correctly from initial → animate. + */ + if (this.hasBeenMounted) { + for (const key in this.initialValues) { + this.values.get(key)?.jump(this.initialValues[key]); + this.latestValues[key] = this.initialValues[key]; + } + } + this.current = instance; + visualElementStore.set(instance, this); + if (this.projection && !this.projection.instance) { + this.projection.mount(instance); + } + if (this.parent && this.isVariantNode && !this.isControllingVariants) { + this.removeFromVariantTree = this.parent.addVariantChild(this); + } + this.values.forEach((value, key) => this.bindToMotionValue(key, value)); + /** + * Determine reduced motion preference. Only initialize the matchMedia + * listener if we actually need the dynamic value (i.e., when config + * is neither "never" nor "always"). + */ + if (this.reducedMotionConfig === "never") { + this.shouldReduceMotion = false; + } + else if (this.reducedMotionConfig === "always") { + this.shouldReduceMotion = true; + } + else { + if (!hasReducedMotionListener.current) { + initPrefersReducedMotion(); + } + this.shouldReduceMotion = prefersReducedMotion.current; + } + { + motionUtils.warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"); + } + /** + * Set whether animations should be skipped based on the config. + */ + this.shouldSkipAnimations = this.skipAnimationsConfig ?? false; + this.parent?.addChild(this); + this.update(this.props, this.presenceContext); + this.hasBeenMounted = true; + } + unmount() { + this.projection && this.projection.unmount(); + cancelFrame(this.notifyUpdate); + cancelFrame(this.render); + this.valueSubscriptions.forEach((remove) => remove()); + this.valueSubscriptions.clear(); + this.removeFromVariantTree && this.removeFromVariantTree(); + this.parent?.removeChild(this); + for (const key in this.events) { + this.events[key].clear(); + } + for (const key in this.features) { + const feature = this.features[key]; + if (feature) { + feature.unmount(); + feature.isMounted = false; + } + } + this.current = null; + } + addChild(child) { + this.children.add(child); + this.enteringChildren ?? (this.enteringChildren = new Set()); + this.enteringChildren.add(child); + } + removeChild(child) { + this.children.delete(child); + this.enteringChildren && this.enteringChildren.delete(child); + } + bindToMotionValue(key, value) { + if (this.valueSubscriptions.has(key)) { + this.valueSubscriptions.get(key)(); + } + if (value.accelerate && + acceleratedValues.has(key) && + this.current instanceof HTMLElement) { + const { factory, keyframes, times, ease, duration } = value.accelerate; + const animation = new NativeAnimation({ + element: this.current, + name: key, + keyframes, + times, + ease, + duration: motionUtils.secondsToMilliseconds(duration), + }); + const cleanup = factory(animation); + this.valueSubscriptions.set(key, () => { + cleanup(); + animation.cancel(); + }); + return; + } + const valueIsTransform = transformProps.has(key); + if (valueIsTransform && this.onBindTransform) { + this.onBindTransform(); + } + const removeOnChange = value.on("change", (latestValue) => { + this.latestValues[key] = latestValue; + this.props.onUpdate && frame.preRender(this.notifyUpdate); + if (valueIsTransform && this.projection) { + this.projection.isTransformDirty = true; + } + this.scheduleRender(); + }); + let removeSyncCheck; + if (typeof window !== "undefined" && + window.MotionCheckAppearSync) { + removeSyncCheck = window.MotionCheckAppearSync(this, key, value); + } + this.valueSubscriptions.set(key, () => { + removeOnChange(); + if (removeSyncCheck) + removeSyncCheck(); + if (value.owner) + value.stop(); + }); + } + sortNodePosition(other) { + /** + * If these nodes aren't even of the same type we can't compare their depth. + */ + if (!this.current || + !this.sortInstanceNodePosition || + this.type !== other.type) { + return 0; + } + return this.sortInstanceNodePosition(this.current, other.current); + } + updateFeatures() { + let key = "animation"; + for (key in featureDefinitions) { + const featureDefinition = featureDefinitions[key]; + if (!featureDefinition) + continue; + const { isEnabled, Feature: FeatureConstructor } = featureDefinition; + /** + * If this feature is enabled but not active, make a new instance. + */ + if (!this.features[key] && + FeatureConstructor && + isEnabled(this.props)) { + this.features[key] = new FeatureConstructor(this); + } + /** + * If we have a feature, mount or update it. + */ + if (this.features[key]) { + const feature = this.features[key]; + if (feature.isMounted) { + feature.update(); + } + else { + feature.mount(); + feature.isMounted = true; + } + } + } + } + triggerBuild() { + this.build(this.renderState, this.latestValues, this.props); + } + /** + * Measure the current viewport box with or without transforms. + * Only measures axis-aligned boxes, rotate and skew must be manually + * removed with a re-render to work. + */ + measureViewportBox() { + return this.current + ? this.measureInstanceViewportBox(this.current, this.props) + : createBox(); + } + getStaticValue(key) { + return this.latestValues[key]; + } + setStaticValue(key, value) { + this.latestValues[key] = value; + } + /** + * Update the provided props. Ensure any newly-added motion values are + * added to our map, old ones removed, and listeners updated. + */ + update(props, presenceContext) { + if (props.transformTemplate || this.props.transformTemplate) { + this.scheduleRender(); + } + this.prevProps = this.props; + this.props = props; + this.prevPresenceContext = this.presenceContext; + this.presenceContext = presenceContext; + /** + * Update prop event handlers ie onAnimationStart, onAnimationComplete + */ + for (let i = 0; i < propEventHandlers.length; i++) { + const key = propEventHandlers[i]; + if (this.propEventSubscriptions[key]) { + this.propEventSubscriptions[key](); + delete this.propEventSubscriptions[key]; + } + const listenerName = ("on" + key); + const listener = props[listenerName]; + if (listener) { + this.propEventSubscriptions[key] = this.on(key, listener); + } + } + this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues); + if (this.handleChildMotionValue) { + this.handleChildMotionValue(); + } + } + getProps() { + return this.props; + } + /** + * Returns the variant definition with a given name. + */ + getVariant(name) { + return this.props.variants ? this.props.variants[name] : undefined; + } + /** + * Returns the defined default transition on this component. + */ + getDefaultTransition() { + return this.props.transition; + } + getTransformPagePoint() { + return this.props.transformPagePoint; + } + getClosestVariantNode() { + return this.isVariantNode + ? this + : this.parent + ? this.parent.getClosestVariantNode() + : undefined; + } + /** + * Add a child visual element to our set of children. + */ + addVariantChild(child) { + const closestVariantNode = this.getClosestVariantNode(); + if (closestVariantNode) { + closestVariantNode.variantChildren && + closestVariantNode.variantChildren.add(child); + return () => closestVariantNode.variantChildren.delete(child); + } + } + /** + * Add a motion value and bind it to this visual element. + */ + addValue(key, value) { + // Remove existing value if it exists + const existingValue = this.values.get(key); + if (value !== existingValue) { + if (existingValue) + this.removeValue(key); + this.bindToMotionValue(key, value); + this.values.set(key, value); + this.latestValues[key] = value.get(); + } + } + /** + * Remove a motion value and unbind any active subscriptions. + */ + removeValue(key) { + this.values.delete(key); + const unsubscribe = this.valueSubscriptions.get(key); + if (unsubscribe) { + unsubscribe(); + this.valueSubscriptions.delete(key); + } + delete this.latestValues[key]; + this.removeValueFromRenderState(key, this.renderState); + } + /** + * Check whether we have a motion value for this key + */ + hasValue(key) { + return this.values.has(key); + } + getValue(key, defaultValue) { + if (this.props.values && this.props.values[key]) { + return this.props.values[key]; + } + let value = this.values.get(key); + if (value === undefined && defaultValue !== undefined) { + value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this }); + this.addValue(key, value); + } + return value; + } + /** + * If we're trying to animate to a previously unencountered value, + * we need to check for it in our state and as a last resort read it + * directly from the instance (which might have performance implications). + */ + readValue(key, target) { + let value = this.latestValues[key] !== undefined || !this.current + ? this.latestValues[key] + : this.getBaseTargetFromProps(this.props, key) ?? + this.readValueFromInstance(this.current, key, this.options); + if (value !== undefined && value !== null) { + if (typeof value === "string" && + (motionUtils.isNumericalString(value) || motionUtils.isZeroValueString(value))) { + // If this is a number read as a string, ie "0" or "200", convert it to a number + value = parseFloat(value); + } + else if (!findValueType(value) && complex.test(target)) { + value = getAnimatableNone(key, target); + } + this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); + } + return isMotionValue(value) ? value.get() : value; + } + /** + * Set the base target to later animate back to. This is currently + * only hydrated on creation and when we first read a value. + */ + setBaseTarget(key, value) { + this.baseTarget[key] = value; + } + /** + * Find the base target for a value thats been removed from all animation + * props. + */ + getBaseTarget(key) { + const { initial } = this.props; + let valueFromInitial; + if (typeof initial === "string" || typeof initial === "object") { + const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom); + if (variant) { + valueFromInitial = variant[key]; + } + } + /** + * If this value still exists in the current initial variant, read that. + */ + if (initial && valueFromInitial !== undefined) { + return valueFromInitial; + } + /** + * Alternatively, if this VisualElement config has defined a getBaseTarget + * so we can read the value from an alternative source, try that. + */ + const target = this.getBaseTargetFromProps(this.props, key); + if (target !== undefined && !isMotionValue(target)) + return target; + /** + * If the value was initially defined on initial, but it doesn't any more, + * return undefined. Otherwise return the value as initially read from the DOM. + */ + return this.initialValues[key] !== undefined && + valueFromInitial === undefined + ? undefined + : this.baseTarget[key]; + } + on(eventName, callback) { + if (!this.events[eventName]) { + this.events[eventName] = new motionUtils.SubscriptionManager(); + } + return this.events[eventName].add(callback); + } + notify(eventName, ...args) { + if (this.events[eventName]) { + this.events[eventName].notify(...args); + } + } + scheduleRenderMicrotask() { + microtask.render(this.render); + } + } + + class DOMVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.KeyframeResolver = DOMKeyframesResolver; + } + sortInstanceNodePosition(a, b) { + /** + * compareDocumentPosition returns a bitmask, by using the bitwise & + * we're returning true if 2 in that bitmask is set to true. 2 is set + * to true if b preceeds a. + */ + return a.compareDocumentPosition(b) & 2 ? 1 : -1; + } + getBaseTargetFromProps(props, key) { + const style = props.style; + return style ? style[key] : undefined; + } + removeValueFromRenderState(key, { vars, style }) { + delete vars[key]; + delete style[key]; + } + handleChildMotionValue() { + if (this.childSubscription) { + this.childSubscription(); + delete this.childSubscription; + } + const { children } = this.props; + if (isMotionValue(children)) { + this.childSubscription = children.on("change", (latest) => { + if (this.current) { + this.current.textContent = `${latest}`; + } + }); + } + } + } + + /** + * Feature base class for extending VisualElement functionality. + * Features are plugins that can be mounted/unmounted to add behavior + * like gestures, animations, or layout tracking. + */ + class Feature { + constructor(node) { + this.isMounted = false; + this.node = node; + } + update() { } + } + + /** + * Bounding boxes tend to be defined as top, left, right, bottom. For various operations + * it's easier to consider each axis individually. This function returns a bounding box + * as a map of single-axis min/max values. + */ + function convertBoundingBoxToBox({ top, left, right, bottom, }) { + return { + x: { min: left, max: right }, + y: { min: top, max: bottom }, + }; + } + function convertBoxToBoundingBox({ x, y }) { + return { top: y.min, right: x.max, bottom: y.max, left: x.min }; + } + /** + * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function + * provided by Framer to allow measured points to be corrected for device scaling. This is used + * when measuring DOM elements and DOM event points. + */ + function transformBoxPoints(point, transformPoint) { + if (!transformPoint) + return point; + const topLeft = transformPoint({ x: point.left, y: point.top }); + const bottomRight = transformPoint({ x: point.right, y: point.bottom }); + return { + top: topLeft.y, + left: topLeft.x, + bottom: bottomRight.y, + right: bottomRight.x, + }; + } + + function isIdentityScale(scale) { + return scale === undefined || scale === 1; + } + function hasScale({ scale, scaleX, scaleY }) { + return (!isIdentityScale(scale) || + !isIdentityScale(scaleX) || + !isIdentityScale(scaleY)); + } + function hasTransform(values) { + return (hasScale(values) || + has2DTranslate(values) || + values.z || + values.rotate || + values.rotateX || + values.rotateY || + values.skewX || + values.skewY); + } + function has2DTranslate(values) { + return is2DTranslate(values.x) || is2DTranslate(values.y); + } + function is2DTranslate(value) { + return value && value !== "0%"; + } + + /** + * Scales a point based on a factor and an originPoint + */ + function scalePoint(point, scale, originPoint) { + const distanceFromOrigin = point - originPoint; + const scaled = scale * distanceFromOrigin; + return originPoint + scaled; + } + /** + * Applies a translate/scale delta to a point + */ + function applyPointDelta(point, translate, scale, originPoint, boxScale) { + if (boxScale !== undefined) { + point = scalePoint(point, boxScale, originPoint); + } + return scalePoint(point, scale, originPoint) + translate; + } + /** + * Applies a translate/scale delta to an axis + */ + function applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) { + axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Applies a translate/scale delta to a box + */ + function applyBoxDelta(box, { x, y }) { + applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); + applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); + } + const TREE_SCALE_SNAP_MIN = 0.999999999999; + const TREE_SCALE_SNAP_MAX = 1.0000000000001; + /** + * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms + * in a tree upon our box before then calculating how to project it into our desired viewport-relative box + * + * This is the final nested loop within updateLayoutDelta for future refactoring + */ + function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { + const treeLength = treePath.length; + if (!treeLength) + return; + // Reset the treeScale + treeScale.x = treeScale.y = 1; + let node; + let delta; + for (let i = 0; i < treeLength; i++) { + node = treePath[i]; + delta = node.projectionDelta; + /** + * TODO: Prefer to remove this, but currently we have motion components with + * display: contents in Framer. + */ + const { visualElement } = node.options; + if (visualElement && + visualElement.props.style && + visualElement.props.style.display === "contents") { + continue; + } + if (isSharedTransition && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(box, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (delta) { + // Incoporate each ancestor's scale into a cumulative treeScale for this component + treeScale.x *= delta.x.scale; + treeScale.y *= delta.y.scale; + // Apply each ancestor's calculated delta into this component's recorded layout box + applyBoxDelta(box, delta); + } + if (isSharedTransition && hasTransform(node.latestValues)) { + transformBox(box, node.latestValues); + } + } + /** + * Snap tree scale back to 1 if it's within a non-perceivable threshold. + * This will help reduce useless scales getting rendered. + */ + if (treeScale.x < TREE_SCALE_SNAP_MAX && + treeScale.x > TREE_SCALE_SNAP_MIN) { + treeScale.x = 1.0; + } + if (treeScale.y < TREE_SCALE_SNAP_MAX && + treeScale.y > TREE_SCALE_SNAP_MIN) { + treeScale.y = 1.0; + } + } + function translateAxis(axis, distance) { + axis.min = axis.min + distance; + axis.max = axis.max + distance; + } + /** + * Apply a transform to an axis from the latest resolved motion values. + * This function basically acts as a bridge between a flat motion value map + * and applyAxisDelta + */ + function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { + const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); + // Apply the axis delta to the final axis + applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); + } + /** + * Apply a transform to a box from the latest resolved motion values. + */ + function transformBox(box, transform) { + transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX); + transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY); + } + + function measureViewportBox(instance, transformPoint) { + return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); + } + function measurePageBox(element, rootProjectionNode, transformPagePoint) { + const viewportBox = measureViewportBox(element, transformPagePoint); + const { scroll } = rootProjectionNode; + if (scroll) { + translateAxis(viewportBox.x, scroll.offset.x); + translateAxis(viewportBox.y, scroll.offset.y); + } + return viewportBox; + } + + const translateAlias = { + x: "translateX", + y: "translateY", + z: "translateZ", + transformPerspective: "perspective", + }; + const numTransforms = transformPropOrder.length; + /** + * Build a CSS transform style from individual x/y/scale etc properties. + * + * This outputs with a default order of transforms/scales/rotations, this can be customised by + * providing a transformTemplate function. + */ + function buildTransform(latestValues, transform, transformTemplate) { + // The transform string we're going to build into. + let transformString = ""; + let transformIsDefault = true; + /** + * Loop over all possible transforms in order, adding the ones that + * are present to the transform string. + */ + for (let i = 0; i < numTransforms; i++) { + const key = transformPropOrder[i]; + const value = latestValues[key]; + if (value === undefined) + continue; + let valueIsDefault = true; + if (typeof value === "number") { + valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); + } + else { + const parsed = parseFloat(value); + valueIsDefault = key.startsWith("scale") ? parsed === 1 : parsed === 0; + } + if (!valueIsDefault || transformTemplate) { + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (!valueIsDefault) { + transformIsDefault = false; + const transformName = translateAlias[key] || key; + transformString += `${transformName}(${valueAsType}) `; + } + if (transformTemplate) { + transform[key] = valueAsType; + } + } + } + transformString = transformString.trim(); + // If we have a custom `transform` template, pass our transform values and + // generated transformString to that before returning + if (transformTemplate) { + transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); + } + else if (transformIsDefault) { + transformString = "none"; + } + return transformString; + } + + function buildHTMLStyles(state, latestValues, transformTemplate) { + const { style, vars, transformOrigin } = state; + // Track whether we encounter any transform or transformOrigin values. + let hasTransform = false; + let hasTransformOrigin = false; + /** + * Loop over all our latest animated values and decide whether to handle them + * as a style or CSS variable. + * + * Transforms and transform origins are kept separately for further processing. + */ + for (const key in latestValues) { + const value = latestValues[key]; + if (transformProps.has(key)) { + // If this is a transform, flag to enable further transform processing + hasTransform = true; + continue; + } + else if (isCSSVariableName(key)) { + vars[key] = value; + continue; + } + else { + // Convert the value to its default value type, ie 0 -> "0px" + const valueAsType = getValueAsType(value, numberValueTypes[key]); + if (key.startsWith("origin")) { + // If this is a transform origin, flag and enable further transform-origin processing + hasTransformOrigin = true; + transformOrigin[key] = + valueAsType; + } + else { + style[key] = valueAsType; + } + } + } + if (!latestValues.transform) { + if (hasTransform || transformTemplate) { + style.transform = buildTransform(latestValues, state.transform, transformTemplate); + } + else if (style.transform) { + /** + * If we have previously created a transform but currently don't have any, + * reset transform style to none. + */ + style.transform = "none"; + } + } + /** + * Build a transformOrigin style. Uses the same defaults as the browser for + * undefined origins. + */ + if (hasTransformOrigin) { + const { originX = "50%", originY = "50%", originZ = 0, } = transformOrigin; + style.transformOrigin = `${originX} ${originY} ${originZ}`; + } + } + + function renderHTML(element, { style, vars }, styleProp, projection) { + const elementStyle = element.style; + let key; + for (key in style) { + // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type. + elementStyle[key] = style[key]; + } + // Write projection styles directly to element style + projection?.applyProjectionStyles(elementStyle, styleProp); + for (key in vars) { + // Loop over any CSS variables and assign those. + // They can only be assigned using `setProperty`. + elementStyle.setProperty(key, vars[key]); + } + } + + function pixelsToPercent(pixels, axis) { + if (axis.max === axis.min) + return 0; + return (pixels / (axis.max - axis.min)) * 100; + } + /** + * We always correct borderRadius as a percentage rather than pixels to reduce paints. + * For example, if you are projecting a box that is 100px wide with a 10px borderRadius + * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% + * borderRadius in both states. If we animate between the two in pixels that will trigger + * a paint each time. If we animate between the two in percentage we'll avoid a paint. + */ + const correctBorderRadius = { + correct: (latest, node) => { + if (!node.target) + return latest; + /** + * If latest is a string, if it's a percentage we can return immediately as it's + * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. + */ + if (typeof latest === "string") { + if (px.test(latest)) { + latest = parseFloat(latest); + } + else { + return latest; + } + } + /** + * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that + * pixel value as a percentage of each axis + */ + const x = pixelsToPercent(latest, node.target.x); + const y = pixelsToPercent(latest, node.target.y); + return `${x}% ${y}%`; + }, + }; + + const correctBoxShadow = { + correct: (latest, { treeScale, projectionDelta }) => { + const original = latest; + const shadow = complex.parse(latest); + // TODO: Doesn't support multiple shadows + if (shadow.length > 5) + return original; + const template = complex.createTransformer(latest); + const offset = typeof shadow[0] !== "number" ? 1 : 0; + // Calculate the overall context scale + const xScale = projectionDelta.x.scale * treeScale.x; + const yScale = projectionDelta.y.scale * treeScale.y; + shadow[0 + offset] /= xScale; + shadow[1 + offset] /= yScale; + /** + * Ideally we'd correct x and y scales individually, but because blur and + * spread apply to both we have to take a scale average and apply that instead. + * We could potentially improve the outcome of this by incorporating the ratio between + * the two scales. + */ + const averageScale = mixNumber$1(xScale, yScale, 0.5); + // Blur + if (typeof shadow[2 + offset] === "number") + shadow[2 + offset] /= averageScale; + // Spread + if (typeof shadow[3 + offset] === "number") + shadow[3 + offset] /= averageScale; + return template(shadow); + }, + }; + + const scaleCorrectors = { + borderRadius: { + ...correctBorderRadius, + applyTo: [ + "borderTopLeftRadius", + "borderTopRightRadius", + "borderBottomLeftRadius", + "borderBottomRightRadius", + ], + }, + borderTopLeftRadius: correctBorderRadius, + borderTopRightRadius: correctBorderRadius, + borderBottomLeftRadius: correctBorderRadius, + borderBottomRightRadius: correctBorderRadius, + boxShadow: correctBoxShadow, + }; + function addScaleCorrector(correctors) { + for (const key in correctors) { + scaleCorrectors[key] = correctors[key]; + if (isCSSVariableName(key)) { + scaleCorrectors[key].isCSSVariable = true; + } + } + } + + function isForcedMotionValue(key, { layout, layoutId }) { + return (transformProps.has(key) || + key.startsWith("origin") || + ((layout || layoutId !== undefined) && + (!!scaleCorrectors[key] || key === "opacity"))); + } + + function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { + const style = props.style; + const prevStyle = prevProps?.style; + const newValues = {}; + if (!style) + return newValues; + for (const key in style) { + if (isMotionValue(style[key]) || + (prevStyle && isMotionValue(prevStyle[key])) || + isForcedMotionValue(key, props) || + visualElement?.getValue(key)?.liveStyle !== undefined) { + newValues[key] = style[key]; + } + } + return newValues; + } + + function getComputedStyle$1(element) { + return window.getComputedStyle(element); + } + class HTMLVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "html"; + this.renderInstance = renderHTML; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + return this.projection?.isProjecting + ? defaultTransformValue(key) + : readTransformValue(instance, key); + } + else { + const computedStyle = getComputedStyle$1(instance); + const value = (isCSSVariableName(key) + ? computedStyle.getPropertyValue(key) + : computedStyle[key]) || 0; + return typeof value === "string" ? value.trim() : value; + } + } + measureInstanceViewportBox(instance, { transformPagePoint }) { + return measureViewportBox(instance, transformPagePoint); + } + build(renderState, latestValues, props) { + buildHTMLStyles(renderState, latestValues, props.transformTemplate); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + } + } + + function isObjectKey(key, object) { + return key in object; + } + class ObjectVisualElement extends VisualElement { + constructor() { + super(...arguments); + this.type = "object"; + } + readValueFromInstance(instance, key) { + if (isObjectKey(key, instance)) { + const value = instance[key]; + if (typeof value === "string" || typeof value === "number") { + return value; + } + } + return undefined; + } + getBaseTargetFromProps() { + return undefined; + } + removeValueFromRenderState(key, renderState) { + delete renderState.output[key]; + } + measureInstanceViewportBox() { + return createBox(); + } + build(renderState, latestValues) { + Object.assign(renderState.output, latestValues); + } + renderInstance(instance, { output }) { + Object.assign(instance, output); + } + sortInstanceNodePosition() { + return 0; + } + } + + const dashKeys = { + offset: "stroke-dashoffset", + array: "stroke-dasharray", + }; + const camelKeys = { + offset: "strokeDashoffset", + array: "strokeDasharray", + }; + /** + * Build SVG path properties. Uses the path's measured length to convert + * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset + * and stroke-dasharray attributes. + * + * This function is mutative to reduce per-frame GC. + * + * Note: We use unitless values for stroke-dasharray and stroke-dashoffset + * because Safari incorrectly scales px values when the page is zoomed. + */ + function buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) { + // Normalise path length by setting SVG attribute pathLength to 1 + attrs.pathLength = 1; + // We use dash case when setting attributes directly to the DOM node and camel case + // when defining props on a React component. + const keys = useDashCase ? dashKeys : camelKeys; + // Build the dash offset (unitless to avoid Safari zoom bug) + attrs[keys.offset] = `${-offset}`; + // Build the dash array (unitless to avoid Safari zoom bug) + attrs[keys.array] = `${length} ${spacing}`; + } + + /** + * CSS Motion Path properties that should remain as CSS styles on SVG elements. + */ + const cssMotionPathProperties = [ + "offsetDistance", + "offsetPath", + "offsetRotate", + "offsetAnchor", + ]; + /** + * Build SVG visual attributes, like cx and style.transform + */ + function buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, + // This is object creation, which we try to avoid per-frame. + ...latest }, isSVGTag, transformTemplate, styleProp) { + buildHTMLStyles(state, latest, transformTemplate); + /** + * For svg tags we just want to make sure viewBox is animatable and treat all the styles + * as normal HTML tags. + */ + if (isSVGTag) { + if (state.style.viewBox) { + state.attrs.viewBox = state.style.viewBox; + } + return; + } + state.attrs = state.style; + state.style = {}; + const { attrs, style } = state; + /** + * However, we apply transforms as CSS transforms. + * So if we detect a transform, transformOrigin we take it from attrs and copy it into style. + */ + if (attrs.transform) { + style.transform = attrs.transform; + delete attrs.transform; + } + if (style.transform || attrs.transformOrigin) { + style.transformOrigin = attrs.transformOrigin ?? "50% 50%"; + delete attrs.transformOrigin; + } + if (style.transform) { + /** + * SVG's element transform-origin uses its own median as a reference. + * Therefore, transformBox becomes a fill-box + */ + style.transformBox = styleProp?.transformBox ?? "fill-box"; + delete attrs.transformBox; + } + for (const key of cssMotionPathProperties) { + if (attrs[key] !== undefined) { + style[key] = attrs[key]; + delete attrs[key]; + } + } + // Render attrX/attrY/attrScale as attributes + if (attrX !== undefined) + attrs.x = attrX; + if (attrY !== undefined) + attrs.y = attrY; + if (attrScale !== undefined) + attrs.scale = attrScale; + // Build SVG path if one has been defined + if (pathLength !== undefined) { + buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); + } + } + + /** + * A set of attribute names that are always read/written as camel case. + */ + const camelCaseAttributes = new Set([ + "baseFrequency", + "diffuseConstant", + "kernelMatrix", + "kernelUnitLength", + "keySplines", + "keyTimes", + "limitingConeAngle", + "markerHeight", + "markerWidth", + "numOctaves", + "targetX", + "targetY", + "surfaceScale", + "specularConstant", + "specularExponent", + "stdDeviation", + "tableValues", + "viewBox", + "gradientTransform", + "pathLength", + "startOffset", + "textLength", + "lengthAdjust", + ]); + + const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; + + function renderSVG(element, renderState, _styleProp, projection) { + renderHTML(element, renderState, undefined, projection); + for (const key in renderState.attrs) { + element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); + } + } + + function scrapeMotionValuesFromProps(props, prevProps, visualElement) { + const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); + for (const key in props) { + if (isMotionValue(props[key]) || + isMotionValue(prevProps[key])) { + const targetKey = transformPropOrder.indexOf(key) !== -1 + ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) + : key; + newValues[targetKey] = props[key]; + } + } + return newValues; + } + + class SVGVisualElement extends DOMVisualElement { + constructor() { + super(...arguments); + this.type = "svg"; + this.isSVGTag = false; + this.measureInstanceViewportBox = createBox; + } + getBaseTargetFromProps(props, key) { + return props[key]; + } + readValueFromInstance(instance, key) { + if (transformProps.has(key)) { + const defaultType = getDefaultValueType(key); + return defaultType ? defaultType.default || 0 : 0; + } + key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; + return instance.getAttribute(key); + } + scrapeMotionValuesFromProps(props, prevProps, visualElement) { + return scrapeMotionValuesFromProps(props, prevProps, visualElement); + } + build(renderState, latestValues, props) { + buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style); + } + renderInstance(instance, renderState, styleProp, projection) { + renderSVG(instance, renderState, styleProp, projection); + } + mount(instance) { + this.isSVGTag = isSVGTag(instance.tagName); + super.mount(instance); + } + } + + const numVariantProps = variantProps.length; + /** + * Get variant context from a visual element's parent chain. + * Uses `any` type for visualElement to avoid circular dependencies. + */ + function getVariantContext(visualElement) { + if (!visualElement) + return undefined; + if (!visualElement.isControllingVariants) { + const context = visualElement.parent + ? getVariantContext(visualElement.parent) || {} + : {}; + if (visualElement.props.initial !== undefined) { + context.initial = visualElement.props.initial; + } + return context; + } + const context = {}; + for (let i = 0; i < numVariantProps; i++) { + const name = variantProps[i]; + const prop = visualElement.props[name]; + if (isVariantLabel(prop) || prop === false) { + context[name] = prop; + } + } + return context; + } + + function shallowCompare(next, prev) { + if (!Array.isArray(prev)) + return false; + const prevLength = prev.length; + if (prevLength !== next.length) + return false; + for (let i = 0; i < prevLength; i++) { + if (prev[i] !== next[i]) + return false; + } + return true; + } + + const reversePriorityOrder = [...variantPriorityOrder].reverse(); + const numAnimationTypes = variantPriorityOrder.length; + function createAnimateFunction(visualElement) { + return (animations) => { + return Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options))); + }; + } + function createAnimationState(visualElement) { + let animate = createAnimateFunction(visualElement); + let state = createState(); + let isInitialRender = true; + /** + * This function will be used to reduce the animation definitions for + * each active animation type into an object of resolved values for it. + */ + const buildResolvedTypeValues = (type) => (acc, definition) => { + const resolved = resolveVariant(visualElement, definition, type === "exit" + ? visualElement.presenceContext?.custom + : undefined); + if (resolved) { + const { transition, transitionEnd, ...target } = resolved; + acc = { ...acc, ...target, ...transitionEnd }; + } + return acc; + }; + /** + * This just allows us to inject mocked animation functions + * @internal + */ + function setAnimateFunction(makeAnimator) { + animate = makeAnimator(visualElement); + } + /** + * When we receive new props, we need to: + * 1. Create a list of protected keys for each type. This is a directory of + * value keys that are currently being "handled" by types of a higher priority + * so that whenever an animation is played of a given type, these values are + * protected from being animated. + * 2. Determine if an animation type needs animating. + * 3. Determine if any values have been removed from a type and figure out + * what to animate those to. + */ + function animateChanges(changedActiveType) { + const { props } = visualElement; + const context = getVariantContext(visualElement.parent) || {}; + /** + * A list of animations that we'll build into as we iterate through the animation + * types. This will get executed at the end of the function. + */ + const animations = []; + /** + * Keep track of which values have been removed. Then, as we hit lower priority + * animation types, we can check if they contain removed values and animate to that. + */ + const removedKeys = new Set(); + /** + * A dictionary of all encountered keys. This is an object to let us build into and + * copy it without iteration. Each time we hit an animation type we set its protected + * keys - the keys its not allowed to animate - to the latest version of this object. + */ + let encounteredKeys = {}; + /** + * If a variant has been removed at a given index, and this component is controlling + * variant animations, we want to ensure lower-priority variants are forced to animate. + */ + let removedVariantIndex = Infinity; + /** + * Iterate through all animation types in reverse priority order. For each, we want to + * detect which values it's handling and whether or not they've changed (and therefore + * need to be animated). If any values have been removed, we want to detect those in + * lower priority props and flag for animation. + */ + for (let i = 0; i < numAnimationTypes; i++) { + const type = reversePriorityOrder[i]; + const typeState = state[type]; + const prop = props[type] !== undefined + ? props[type] + : context[type]; + const propIsVariant = isVariantLabel(prop); + /** + * If this type has *just* changed isActive status, set activeDelta + * to that status. Otherwise set to null. + */ + const activeDelta = type === changedActiveType ? typeState.isActive : null; + if (activeDelta === false) + removedVariantIndex = i; + /** + * If this prop is an inherited variant, rather than been set directly on the + * component itself, we want to make sure we allow the parent to trigger animations. + * + * TODO: Can probably change this to a !isControllingVariants check + */ + let isInherited = prop === context[type] && + prop !== props[type] && + propIsVariant; + if (isInherited && + isInitialRender && + visualElement.manuallyAnimateOnMount) { + isInherited = false; + } + /** + * Set all encountered keys so far as the protected keys for this type. This will + * be any key that has been animated or otherwise handled by active, higher-priortiy types. + */ + typeState.protectedKeys = { ...encounteredKeys }; + // Check if we can skip analysing this prop early + if ( + // If it isn't active and hasn't *just* been set as inactive + (!typeState.isActive && activeDelta === null) || + // If we didn't and don't have any defined prop for this animation type + (!prop && !typeState.prevProp) || + // Or if the prop doesn't define an animation + isAnimationControls(prop) || + typeof prop === "boolean") { + continue; + } + /** + * If exit is already active and wasn't just activated, skip + * re-processing to prevent interrupting running exit animations. + * Re-resolving exit with a changed custom value can start new + * value animations that stop the originals, leaving the exit + * animation promise unresolved and the component stuck in the DOM. + */ + if (type === "exit" && typeState.isActive && activeDelta !== true) { + if (typeState.prevResolvedValues) { + encounteredKeys = { + ...encounteredKeys, + ...typeState.prevResolvedValues, + }; + } + continue; + } + /** + * As we go look through the values defined on this type, if we detect + * a changed value or a value that was removed in a higher priority, we set + * this to true and add this prop to the animation list. + */ + const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); + let shouldAnimateType = variantDidChange || + // If we're making this variant active, we want to always make it active + (type === changedActiveType && + typeState.isActive && + !isInherited && + propIsVariant) || + // If we removed a higher-priority variant (i is in reverse order) + (i > removedVariantIndex && propIsVariant); + let handledRemovedValues = false; + /** + * As animations can be set as variant lists, variants or target objects, we + * coerce everything to an array if it isn't one already + */ + const definitionList = Array.isArray(prop) ? prop : [prop]; + /** + * Build an object of all the resolved values. We'll use this in the subsequent + * animateChanges calls to determine whether a value has changed. + */ + let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); + if (activeDelta === false) + resolvedValues = {}; + /** + * Now we need to loop through all the keys in the prev prop and this prop, + * and decide: + * 1. If the value has changed, and needs animating + * 2. If it has been removed, and needs adding to the removedKeys set + * 3. If it has been removed in a higher priority type and needs animating + * 4. If it hasn't been removed in a higher priority but hasn't changed, and + * needs adding to the type's protectedKeys list. + */ + const { prevResolvedValues = {} } = typeState; + const allKeys = { + ...prevResolvedValues, + ...resolvedValues, + }; + const markToAnimate = (key) => { + shouldAnimateType = true; + if (removedKeys.has(key)) { + handledRemovedValues = true; + removedKeys.delete(key); + } + typeState.needsAnimating[key] = true; + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = false; + }; + for (const key in allKeys) { + const next = resolvedValues[key]; + const prev = prevResolvedValues[key]; + // If we've already handled this we can just skip ahead + if (encounteredKeys.hasOwnProperty(key)) + continue; + /** + * If the value has changed, we probably want to animate it. + */ + let valueHasChanged = false; + if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { + valueHasChanged = !shallowCompare(next, prev); + } + else { + valueHasChanged = next !== prev; + } + if (valueHasChanged) { + if (next !== undefined && next !== null) { + // If next is defined and doesn't equal prev, it needs animating + markToAnimate(key); + } + else { + // If it's undefined, it's been removed. + removedKeys.add(key); + } + } + else if (next !== undefined && removedKeys.has(key)) { + /** + * If next hasn't changed and it isn't undefined, we want to check if it's + * been removed by a higher priority + */ + markToAnimate(key); + } + else { + /** + * If it hasn't changed, we add it to the list of protected values + * to ensure it doesn't get animated. + */ + typeState.protectedKeys[key] = true; + } + } + /** + * Update the typeState so next time animateChanges is called we can compare the + * latest prop and resolvedValues to these. + */ + typeState.prevProp = prop; + typeState.prevResolvedValues = resolvedValues; + if (typeState.isActive) { + encounteredKeys = { ...encounteredKeys, ...resolvedValues }; + } + if (isInitialRender && visualElement.blockInitialAnimation) { + shouldAnimateType = false; + } + /** + * If this is an inherited prop we want to skip this animation + * unless the inherited variants haven't changed on this render. + */ + const willAnimateViaParent = isInherited && variantDidChange; + const needsAnimating = !willAnimateViaParent || handledRemovedValues; + if (shouldAnimateType && needsAnimating) { + animations.push(...definitionList.map((animation) => { + const options = { type }; + /** + * If we're performing the initial animation, but we're not + * rendering at the same time as the variant-controlling parent, + * we want to use the parent's transition to calculate the stagger. + */ + if (typeof animation === "string" && + isInitialRender && + !willAnimateViaParent && + visualElement.manuallyAnimateOnMount && + visualElement.parent) { + const { parent } = visualElement; + const parentVariant = resolveVariant(parent, animation); + if (parent.enteringChildren && parentVariant) { + const { delayChildren } = parentVariant.transition || {}; + options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren); + } + } + return { + animation: animation, + options, + }; + })); + } + } + /** + * If there are some removed value that haven't been dealt with, + * we need to create a new animation that falls back either to the value + * defined in the style prop, or the last read value. + */ + if (removedKeys.size) { + const fallbackAnimation = {}; + /** + * If the initial prop contains a transition we can use that, otherwise + * allow the animation function to use the visual element's default. + */ + if (typeof props.initial !== "boolean") { + const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial) + ? props.initial[0] + : props.initial); + if (initialTransition && initialTransition.transition) { + fallbackAnimation.transition = initialTransition.transition; + } + } + removedKeys.forEach((key) => { + const fallbackTarget = visualElement.getBaseTarget(key); + const motionValue = visualElement.getValue(key); + if (motionValue) + motionValue.liveStyle = true; + // @ts-expect-error - @mattgperry to figure if we should do something here + fallbackAnimation[key] = fallbackTarget ?? null; + }); + animations.push({ animation: fallbackAnimation }); + } + let shouldAnimate = Boolean(animations.length); + if (isInitialRender && + (props.initial === false || props.initial === props.animate) && + !visualElement.manuallyAnimateOnMount) { + shouldAnimate = false; + } + isInitialRender = false; + return shouldAnimate ? animate(animations) : Promise.resolve(); + } + /** + * Change whether a certain animation type is active. + */ + function setActive(type, isActive) { + // If the active state hasn't changed, we can safely do nothing here + if (state[type].isActive === isActive) + return Promise.resolve(); + // Propagate active change to children + visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive)); + state[type].isActive = isActive; + const animations = animateChanges(type); + for (const key in state) { + state[key].protectedKeys = {}; + } + return animations; + } + return { + animateChanges, + setActive, + setAnimateFunction, + getState: () => state, + reset: () => { + state = createState(); + /** + * Temporarily disabling resetting this flag as it prevents components + * with initial={false} from animating after being remounted, for instance + * as the child of an Activity component. + */ + // isInitialRender = true + }, + }; + } + function checkVariantsDidChange(prev, next) { + if (typeof next === "string") { + return next !== prev; + } + else if (Array.isArray(next)) { + return !shallowCompare(next, prev); + } + return false; + } + function createTypeState(isActive = false) { + return { + isActive, + protectedKeys: {}, + needsAnimating: {}, + prevResolvedValues: {}, + }; + } + function createState() { + return { + animate: createTypeState(true), + whileInView: createTypeState(), + whileHover: createTypeState(), + whileTap: createTypeState(), + whileDrag: createTypeState(), + whileFocus: createTypeState(), + exit: createTypeState(), + }; + } + + /** + * Reset an axis to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisInto(axis, originAxis) { + axis.min = originAxis.min; + axis.max = originAxis.max; + } + /** + * Reset a box to the provided origin box. + * + * This is a mutative operation. + */ + function copyBoxInto(box, originBox) { + copyAxisInto(box.x, originBox.x); + copyAxisInto(box.y, originBox.y); + } + /** + * Reset a delta to the provided origin box. + * + * This is a mutative operation. + */ + function copyAxisDeltaInto(delta, originDelta) { + delta.translate = originDelta.translate; + delta.scale = originDelta.scale; + delta.originPoint = originDelta.originPoint; + delta.origin = originDelta.origin; + } + + const SCALE_PRECISION = 0.0001; + const SCALE_MIN = 1 - SCALE_PRECISION; + const SCALE_MAX = 1 + SCALE_PRECISION; + const TRANSLATE_PRECISION = 0.01; + const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; + const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; + function calcLength(axis) { + return axis.max - axis.min; + } + function isNear(value, target, maxDistance) { + return Math.abs(value - target) <= maxDistance; + } + function calcAxisDelta(delta, source, target, origin = 0.5) { + delta.origin = origin; + delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); + delta.scale = calcLength(target) / calcLength(source); + delta.translate = + mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; + if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) || + isNaN(delta.scale)) { + delta.scale = 1.0; + } + if ((delta.translate >= TRANSLATE_MIN && + delta.translate <= TRANSLATE_MAX) || + isNaN(delta.translate)) { + delta.translate = 0.0; + } + } + function calcBoxDelta(delta, source, target, origin) { + calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined); + calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined); + } + function calcRelativeAxis(target, relative, parent) { + target.min = parent.min + relative.min; + target.max = target.min + calcLength(relative); + } + function calcRelativeBox(target, relative, parent) { + calcRelativeAxis(target.x, relative.x, parent.x); + calcRelativeAxis(target.y, relative.y, parent.y); + } + function calcRelativeAxisPosition(target, layout, parent) { + target.min = layout.min - parent.min; + target.max = target.min + calcLength(layout); + } + function calcRelativePosition(target, layout, parent) { + calcRelativeAxisPosition(target.x, layout.x, parent.x); + calcRelativeAxisPosition(target.y, layout.y, parent.y); + } + + /** + * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse + */ + function removePointDelta(point, translate, scale, originPoint, boxScale) { + point -= translate; + point = scalePoint(point, 1 / scale, originPoint); + if (boxScale !== undefined) { + point = scalePoint(point, 1 / boxScale, originPoint); + } + return point; + } + /** + * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse + */ + function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { + if (percent.test(translate)) { + translate = parseFloat(translate); + const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); + translate = relativeProgress - sourceAxis.min; + } + if (typeof translate !== "number") + return; + let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin); + if (axis === originAxis) + originPoint -= translate; + axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); + axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); + } + /** + * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) { + removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); + } + /** + * The names of the motion values we want to apply as translation, scale and origin. + */ + const xKeys = ["x", "scaleX", "originX"]; + const yKeys = ["y", "scaleY", "originY"]; + /** + * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse + * and acts as a bridge between motion values and removeAxisDelta + */ + function removeBoxTransforms(box, transforms, originBox, sourceBox) { + removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined); + removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined); + } + + function isAxisDeltaZero(delta) { + return delta.translate === 0 && delta.scale === 1; + } + function isDeltaZero(delta) { + return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); + } + function axisEquals(a, b) { + return a.min === b.min && a.max === b.max; + } + function boxEquals(a, b) { + return axisEquals(a.x, b.x) && axisEquals(a.y, b.y); + } + function axisEqualsRounded(a, b) { + return (Math.round(a.min) === Math.round(b.min) && + Math.round(a.max) === Math.round(b.max)); + } + function boxEqualsRounded(a, b) { + return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y); + } + function aspectRatio(box) { + return calcLength(box.x) / calcLength(box.y); + } + function axisDeltaEquals(a, b) { + return (a.translate === b.translate && + a.scale === b.scale && + a.originPoint === b.originPoint); + } + + function eachAxis(callback) { + return [callback("x"), callback("y")]; + } + + function buildProjectionTransform(delta, treeScale, latestTransform) { + let transform = ""; + /** + * The translations we use to calculate are always relative to the viewport coordinate space. + * But when we apply scales, we also scale the coordinate space of an element and its children. + * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need + * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. + */ + const xTranslate = delta.x.translate / treeScale.x; + const yTranslate = delta.y.translate / treeScale.y; + const zTranslate = latestTransform?.z || 0; + if (xTranslate || yTranslate || zTranslate) { + transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; + } + /** + * Apply scale correction for the tree transform. + * This will apply scale to the screen-orientated axes. + */ + if (treeScale.x !== 1 || treeScale.y !== 1) { + transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; + } + if (latestTransform) { + const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform; + if (transformPerspective) + transform = `perspective(${transformPerspective}px) ${transform}`; + if (rotate) + transform += `rotate(${rotate}deg) `; + if (rotateX) + transform += `rotateX(${rotateX}deg) `; + if (rotateY) + transform += `rotateY(${rotateY}deg) `; + if (skewX) + transform += `skewX(${skewX}deg) `; + if (skewY) + transform += `skewY(${skewY}deg) `; + } + /** + * Apply scale to match the size of the element to the size we want it. + * This will apply scale to the element-orientated axes. + */ + const elementScaleX = delta.x.scale * treeScale.x; + const elementScaleY = delta.y.scale * treeScale.y; + if (elementScaleX !== 1 || elementScaleY !== 1) { + transform += `scale(${elementScaleX}, ${elementScaleY})`; + } + return transform || "none"; + } + + const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; + const numBorders = borders.length; + const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; + const isPx = (value) => typeof value === "number" || px.test(value); + function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { + if (shouldCrossfadeOpacity) { + target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress)); + target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress)); + } + else if (isOnlyMember) { + target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress); + } + /** + * Mix border radius + */ + for (let i = 0; i < numBorders; i++) { + const borderLabel = `border${borders[i]}Radius`; + let followRadius = getRadius(follow, borderLabel); + let leadRadius = getRadius(lead, borderLabel); + if (followRadius === undefined && leadRadius === undefined) + continue; + followRadius || (followRadius = 0); + leadRadius || (leadRadius = 0); + const canMix = followRadius === 0 || + leadRadius === 0 || + isPx(followRadius) === isPx(leadRadius); + if (canMix) { + target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress), 0); + if (percent.test(leadRadius) || percent.test(followRadius)) { + target[borderLabel] += "%"; + } + } + else { + target[borderLabel] = leadRadius; + } + } + /** + * Mix rotation + */ + if (follow.rotate || lead.rotate) { + target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress); + } + } + function getRadius(values, radiusName) { + return values[radiusName] !== undefined + ? values[radiusName] + : values.borderRadius; + } + const easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, motionUtils.circOut); + const easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, motionUtils.noop); + function compress(min, max, easing) { + return (p) => { + // Could replace ifs with clamp + if (p < min) + return 0; + if (p > max) + return 1; + return easing(motionUtils.progress(min, max, p)); + }; + } + + function animateSingleValue(value, keyframes, options) { + const motionValue$1 = isMotionValue(value) ? value : motionValue(value); + motionValue$1.start(animateMotionValue("", motionValue$1, keyframes, options)); + return motionValue$1.animation; + } + + function addDomEvent(target, eventName, handler, options = { passive: true }) { + target.addEventListener(eventName, handler, options); + return () => target.removeEventListener(eventName, handler); + } + + const compareByDepth = (a, b) => a.depth - b.depth; + + class FlatTree { + constructor() { + this.children = []; + this.isDirty = false; + } + add(child) { + motionUtils.addUniqueItem(this.children, child); + this.isDirty = true; + } + remove(child) { + motionUtils.removeItem(this.children, child); + this.isDirty = true; + } + forEach(callback) { + this.isDirty && this.children.sort(compareByDepth); + this.isDirty = false; + this.children.forEach(callback); + } + } + + /** + * Timeout defined in ms + */ + function delay(callback, timeout) { + const start = time.now(); + const checkElapsed = ({ timestamp }) => { + const elapsed = timestamp - start; + if (elapsed >= timeout) { + cancelFrame(checkElapsed); + callback(elapsed - timeout); + } + }; + frame.setup(checkElapsed, true); + return () => cancelFrame(checkElapsed); + } + function delayInSeconds(callback, timeout) { + return delay(callback, motionUtils.secondsToMilliseconds(timeout)); + } + + /** + * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself + */ + function resolveMotionValue(value) { + return isMotionValue(value) ? value.get() : value; + } + + class NodeStack { + constructor() { + this.members = []; + } + add(node) { + motionUtils.addUniqueItem(this.members, node); + for (let i = this.members.length - 1; i >= 0; i--) { + const m = this.members[i]; + if (m === node || m === this.lead || m === this.prevLead) + continue; + const inst = m.instance; + if (inst && inst.isConnected === false && m.isPresent !== false && !m.snapshot) { + motionUtils.removeItem(this.members, m); + } + } + node.scheduleRender(); + } + remove(node) { + motionUtils.removeItem(this.members, node); + if (node === this.prevLead) { + this.prevLead = undefined; + } + if (node === this.lead) { + const prevLead = this.members[this.members.length - 1]; + if (prevLead) { + this.promote(prevLead); + } + } + } + relegate(node) { + const indexOfNode = this.members.findIndex((member) => node === member); + if (indexOfNode === 0) + return false; + /** + * Find the next projection node that is present + */ + let prevLead; + for (let i = indexOfNode; i >= 0; i--) { + const member = this.members[i]; + const inst = member.instance; + if (member.isPresent !== false && (!inst || inst.isConnected !== false)) { + prevLead = member; + break; + } + } + if (prevLead) { + this.promote(prevLead); + return true; + } + else { + return false; + } + } + promote(node, preserveFollowOpacity) { + const prevLead = this.lead; + if (node === prevLead) + return; + this.prevLead = prevLead; + this.lead = node; + node.show(); + if (prevLead) { + prevLead.instance && prevLead.scheduleRender(); + node.scheduleRender(); + /** + * If both the new and previous lead have the same defined layoutDependency, + * skip the shared layout animation. This allows components with layoutId + * to opt-out of animations when their layoutDependency hasn't changed, + * even when the component unmounts and remounts in a different location. + */ + const prevDep = prevLead.options.layoutDependency; + const nextDep = node.options.layoutDependency; + const dependencyMatches = prevDep !== undefined && + nextDep !== undefined && + prevDep === nextDep; + if (!dependencyMatches) { + const prevInstance = prevLead.instance; + const isStale = prevInstance && prevInstance.isConnected === false && !prevLead.snapshot; + if (!isStale) { + node.resumeFrom = prevLead; + if (preserveFollowOpacity) { + node.resumeFrom.preserveOpacity = true; + } + if (prevLead.snapshot) { + node.snapshot = prevLead.snapshot; + node.snapshot.latestValues = + prevLead.animationValues || prevLead.latestValues; + } + if (node.root && node.root.isUpdating) { + node.isLayoutDirty = true; + } + } + } + const { crossfade } = node.options; + if (crossfade === false) { + prevLead.hide(); + } + } + } + exitAnimationComplete() { + this.members.forEach((node) => { + const { options, resumingFrom } = node; + options.onExitComplete && options.onExitComplete(); + if (resumingFrom) { + resumingFrom.options.onExitComplete && + resumingFrom.options.onExitComplete(); + } + }); + } + scheduleRender() { + this.members.forEach((node) => { + node.instance && node.scheduleRender(false); + }); + } + /** + * Clear any leads that have been removed this render to prevent them from being + * used in future animations and to prevent memory leaks + */ + removeLeadSnapshot() { + if (this.lead && this.lead.snapshot) { + this.lead.snapshot = undefined; + } + } + } + + /** + * This should only ever be modified on the client otherwise it'll + * persist through server requests. If we need instanced states we + * could lazy-init via root. + */ + const globalProjectionState = { + /** + * Global flag as to whether the tree has animated since the last time + * we resized the window + */ + hasAnimatedSinceResize: true, + /** + * We set this to true once, on the first update. Any nodes added to the tree beyond that + * update will be given a `data-projection-id` attribute. + */ + hasEverUpdated: false, + }; + + const metrics = { + nodes: 0, + calculatedTargetDeltas: 0, + calculatedProjections: 0, + }; + const transformAxes = ["", "X", "Y", "Z"]; + /** + * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 + * which has a noticeable difference in spring animations + */ + const animationTarget = 1000; + let id = 0; + function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { + const { latestValues } = visualElement; + // Record the distorting transform and then temporarily set it to 0 + if (latestValues[key]) { + values[key] = latestValues[key]; + visualElement.setStaticValue(key, 0); + if (sharedAnimationValues) { + sharedAnimationValues[key] = 0; + } + } + } + function cancelTreeOptimisedTransformAnimations(projectionNode) { + projectionNode.hasCheckedOptimisedAppear = true; + if (projectionNode.root === projectionNode) + return; + const { visualElement } = projectionNode.options; + if (!visualElement) + return; + const appearId = getOptimisedAppearId(visualElement); + if (window.MotionHasOptimisedAnimation(appearId, "transform")) { + const { layout, layoutId } = projectionNode.options; + window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout || layoutId)); + } + const { parent } = projectionNode; + if (parent && !parent.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(parent); + } + } + function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) { + return class ProjectionNode { + constructor(latestValues = {}, parent = defaultParent?.()) { + /** + * A unique ID generated for every projection node. + */ + this.id = id++; + /** + * An id that represents a unique session instigated by startUpdate. + */ + this.animationId = 0; + this.animationCommitId = 0; + /** + * A Set containing all this component's children. This is used to iterate + * through the children. + * + * TODO: This could be faster to iterate as a flat array stored on the root node. + */ + this.children = new Set(); + /** + * Options for the node. We use this to configure what kind of layout animations + * we should perform (if any). + */ + this.options = {}; + /** + * We use this to detect when its safe to shut down part of a projection tree. + * We have to keep projecting children for scale correction and relative projection + * until all their parents stop performing layout animations. + */ + this.isTreeAnimating = false; + this.isAnimationBlocked = false; + /** + * Flag to true if we think this layout has been changed. We can't always know this, + * currently we set it to true every time a component renders, or if it has a layoutDependency + * if that has changed between renders. Additionally, components can be grouped by LayoutGroup + * and if one node is dirtied, they all are. + */ + this.isLayoutDirty = false; + /** + * Flag to true if we think the projection calculations for this node needs + * recalculating as a result of an updated transform or layout animation. + */ + this.isProjectionDirty = false; + /** + * Flag to true if the layout *or* transform has changed. This then gets propagated + * throughout the projection tree, forcing any element below to recalculate on the next frame. + */ + this.isSharedProjectionDirty = false; + /** + * Flag transform dirty. This gets propagated throughout the whole tree but is only + * respected by shared nodes. + */ + this.isTransformDirty = false; + /** + * Block layout updates for instant layout transitions throughout the tree. + */ + this.updateManuallyBlocked = false; + this.updateBlockedByResize = false; + /** + * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` + * call. + */ + this.isUpdating = false; + /** + * If this is an SVG element we currently disable projection transforms + */ + this.isSVG = false; + /** + * Flag to true (during promotion) if a node doing an instant layout transition needs to reset + * its projection styles. + */ + this.needsReset = false; + /** + * Flags whether this node should have its transform reset prior to measuring. + */ + this.shouldResetTransform = false; + /** + * Store whether this node has been checked for optimised appear animations. As + * effects fire bottom-up, and we want to look up the tree for appear animations, + * this makes sure we only check each path once, stopping at nodes that + * have already been checked. + */ + this.hasCheckedOptimisedAppear = false; + /** + * An object representing the calculated contextual/accumulated/tree scale. + * This will be used to scale calculcated projection transforms, as these are + * calculated in screen-space but need to be scaled for elements to layoutly + * make it to their calculated destinations. + * + * TODO: Lazy-init + */ + this.treeScale = { x: 1, y: 1 }; + /** + * + */ + this.eventHandlers = new Map(); + this.hasTreeAnimated = false; + this.layoutVersion = 0; + // Note: Currently only running on root node + this.updateScheduled = false; + this.scheduleUpdate = () => this.update(); + this.projectionUpdateScheduled = false; + this.checkUpdateFailed = () => { + if (this.isUpdating) { + this.isUpdating = false; + this.clearAllSnapshots(); + } + }; + /** + * This is a multi-step process as shared nodes might be of different depths. Nodes + * are sorted by depth order, so we need to resolve the entire tree before moving to + * the next step. + */ + this.updateProjection = () => { + this.projectionUpdateScheduled = false; + /** + * Reset debug counts. Manually resetting rather than creating a new + * object each frame. + */ + if (statsBuffer.value) { + metrics.nodes = + metrics.calculatedTargetDeltas = + metrics.calculatedProjections = + 0; + } + this.nodes.forEach(propagateDirtyNodes); + this.nodes.forEach(resolveTargetDelta); + this.nodes.forEach(calcProjection); + this.nodes.forEach(cleanDirtyNodes); + if (statsBuffer.addProjectionMetrics) { + statsBuffer.addProjectionMetrics(metrics); + } + }; + /** + * Frame calculations + */ + this.resolvedRelativeTargetAt = 0.0; + this.linkedParentVersion = 0; + this.hasProjected = false; + this.isVisible = true; + this.animationProgress = 0; + /** + * Shared layout + */ + // TODO Only running on root node + this.sharedNodes = new Map(); + this.latestValues = latestValues; + this.root = parent ? parent.root || parent : this; + this.path = parent ? [...parent.path, parent] : []; + this.parent = parent; + this.depth = parent ? parent.depth + 1 : 0; + for (let i = 0; i < this.path.length; i++) { + this.path[i].shouldResetTransform = true; + } + if (this.root === this) + this.nodes = new FlatTree(); + } + addEventListener(name, handler) { + if (!this.eventHandlers.has(name)) { + this.eventHandlers.set(name, new motionUtils.SubscriptionManager()); + } + return this.eventHandlers.get(name).add(handler); + } + notifyListeners(name, ...args) { + const subscriptionManager = this.eventHandlers.get(name); + subscriptionManager && subscriptionManager.notify(...args); + } + hasListeners(name) { + return this.eventHandlers.has(name); + } + /** + * Lifecycles + */ + mount(instance) { + if (this.instance) + return; + this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance); + this.instance = instance; + const { layoutId, layout, visualElement } = this.options; + if (visualElement && !visualElement.current) { + visualElement.mount(instance); + } + this.root.nodes.add(this); + this.parent && this.parent.children.add(this); + if (this.root.hasTreeAnimated && (layout || layoutId)) { + this.isLayoutDirty = true; + } + if (attachResizeListener) { + let cancelDelay; + let innerWidth = 0; + const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false); + // Set initial innerWidth in a frame.read callback to batch the read + frame.read(() => { + innerWidth = window.innerWidth; + }); + attachResizeListener(instance, () => { + const newInnerWidth = window.innerWidth; + if (newInnerWidth === innerWidth) + return; + innerWidth = newInnerWidth; + this.root.updateBlockedByResize = true; + cancelDelay && cancelDelay(); + cancelDelay = delay(resizeUnblockUpdate, 250); + if (globalProjectionState.hasAnimatedSinceResize) { + globalProjectionState.hasAnimatedSinceResize = false; + this.nodes.forEach(finishAnimation); + } + }); + } + if (layoutId) { + this.root.registerSharedNode(layoutId, this); + } + // Only register the handler if it requires layout animation + if (this.options.animate !== false && + visualElement && + (layoutId || layout)) { + this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => { + if (this.isTreeAnimationBlocked()) { + this.target = undefined; + this.relativeTarget = undefined; + return; + } + // TODO: Check here if an animation exists + const layoutTransition = this.options.transition || + visualElement.getDefaultTransition() || + defaultLayoutTransition; + const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps(); + /** + * The target layout of the element might stay the same, + * but its position relative to its parent has changed. + */ + const hasTargetChanged = !this.targetLayout || + !boxEqualsRounded(this.targetLayout, newLayout); + /* + * Note: Disabled to fix relative animations always triggering new + * layout animations. If this causes further issues, we can try + * a different approach to detecting relative target changes. + */ + // || hasRelativeLayoutChanged + /** + * If the layout hasn't seemed to have changed, it might be that the + * element is visually in the same place in the document but its position + * relative to its parent has indeed changed. So here we check for that. + */ + const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged; + if (this.options.layoutRoot || + this.resumeFrom || + hasOnlyRelativeTargetChanged || + (hasLayoutChanged && + (hasTargetChanged || !this.currentAnimation))) { + if (this.resumeFrom) { + this.resumingFrom = this.resumeFrom; + this.resumingFrom.resumingFrom = undefined; + } + const animationOptions = { + ...getValueTransition(layoutTransition, "layout"), + onPlay: onLayoutAnimationStart, + onComplete: onLayoutAnimationComplete, + }; + if (visualElement.shouldReduceMotion || + this.options.layoutRoot) { + animationOptions.delay = 0; + animationOptions.type = false; + } + this.startAnimation(animationOptions); + /** + * Set animation origin after starting animation to avoid layout jump + * caused by stopping previous layout animation + */ + this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); + } + else { + /** + * If the layout hasn't changed and we have an animation that hasn't started yet, + * finish it immediately. Otherwise it will be animating from a location + * that was probably never committed to screen and look like a jumpy box. + */ + if (!hasLayoutChanged) { + finishAnimation(this); + } + if (this.isLead() && this.options.onExitComplete) { + this.options.onExitComplete(); + } + } + this.targetLayout = newLayout; + }); + } + } + unmount() { + this.options.layoutId && this.willUpdate(); + this.root.nodes.remove(this); + const stack = this.getStack(); + stack && stack.remove(this); + this.parent && this.parent.children.delete(this); + this.instance = undefined; + this.eventHandlers.clear(); + cancelFrame(this.updateProjection); + } + // only on the root + blockUpdate() { + this.updateManuallyBlocked = true; + } + unblockUpdate() { + this.updateManuallyBlocked = false; + } + isUpdateBlocked() { + return this.updateManuallyBlocked || this.updateBlockedByResize; + } + isTreeAnimationBlocked() { + return (this.isAnimationBlocked || + (this.parent && this.parent.isTreeAnimationBlocked()) || + false); + } + // Note: currently only running on root node + startUpdate() { + if (this.isUpdateBlocked()) + return; + this.isUpdating = true; + this.nodes && this.nodes.forEach(resetSkewAndRotation); + this.animationId++; + } + getTransformTemplate() { + const { visualElement } = this.options; + return visualElement && visualElement.getProps().transformTemplate; + } + willUpdate(shouldNotifyListeners = true) { + this.root.hasTreeAnimated = true; + if (this.root.isUpdateBlocked()) { + this.options.onExitComplete && this.options.onExitComplete(); + return; + } + /** + * If we're running optimised appear animations then these must be + * cancelled before measuring the DOM. This is so we can measure + * the true layout of the element rather than the WAAPI animation + * which will be unaffected by the resetSkewAndRotate step. + * + * Note: This is a DOM write. Worst case scenario is this is sandwiched + * between other snapshot reads which will cause unnecessary style recalculations. + * This has to happen here though, as we don't yet know which nodes will need + * snapshots in startUpdate(), but we only want to cancel optimised animations + * if a layout animation measurement is actually going to be affected by them. + */ + if (window.MotionCancelOptimisedAnimation && + !this.hasCheckedOptimisedAppear) { + cancelTreeOptimisedTransformAnimations(this); + } + !this.root.isUpdating && this.root.startUpdate(); + if (this.isLayoutDirty) + return; + this.isLayoutDirty = true; + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.shouldResetTransform = true; + node.updateScroll("snapshot"); + if (node.options.layoutRoot) { + node.willUpdate(false); + } + } + const { layoutId, layout } = this.options; + if (layoutId === undefined && !layout) + return; + const transformTemplate = this.getTransformTemplate(); + this.prevTransformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + this.updateSnapshot(); + shouldNotifyListeners && this.notifyListeners("willUpdate"); + } + update() { + this.updateScheduled = false; + const updateWasBlocked = this.isUpdateBlocked(); + // When doing an instant transition, we skip the layout update, + // but should still clean up the measurements so that the next + // snapshot could be taken correctly. + if (updateWasBlocked) { + this.unblockUpdate(); + this.clearAllSnapshots(); + this.nodes.forEach(clearMeasurements); + return; + } + /** + * If this is a repeat of didUpdate then ignore the animation. + */ + if (this.animationId <= this.animationCommitId) { + this.nodes.forEach(clearIsLayoutDirty); + return; + } + this.animationCommitId = this.animationId; + if (!this.isUpdating) { + this.nodes.forEach(clearIsLayoutDirty); + } + else { + this.isUpdating = false; + /** + * Write + */ + this.nodes.forEach(resetTransformStyle); + /** + * Read ================== + */ + // Update layout measurements of updated children + this.nodes.forEach(updateLayout); + /** + * Write + */ + // Notify listeners that the layout is updated + this.nodes.forEach(notifyLayoutUpdate); + } + this.clearAllSnapshots(); + /** + * Manually flush any pending updates. Ideally + * we could leave this to the following requestAnimationFrame but this seems + * to leave a flash of incorrectly styled content. + */ + const now = time.now(); + frameData.delta = motionUtils.clamp(0, 1000 / 60, now - frameData.timestamp); + frameData.timestamp = now; + frameData.isProcessing = true; + frameSteps.update.process(frameData); + frameSteps.preRender.process(frameData); + frameSteps.render.process(frameData); + frameData.isProcessing = false; + } + didUpdate() { + if (!this.updateScheduled) { + this.updateScheduled = true; + microtask.read(this.scheduleUpdate); + } + } + clearAllSnapshots() { + this.nodes.forEach(clearSnapshot); + this.sharedNodes.forEach(removeLeadSnapshots); + } + scheduleUpdateProjection() { + if (!this.projectionUpdateScheduled) { + this.projectionUpdateScheduled = true; + frame.preRender(this.updateProjection, false, true); + } + } + scheduleCheckAfterUnmount() { + /** + * If the unmounting node is in a layoutGroup and did trigger a willUpdate, + * we manually call didUpdate to give a chance to the siblings to animate. + * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. + */ + frame.postRender(() => { + if (this.isLayoutDirty) { + this.root.didUpdate(); + } + else { + this.root.checkUpdateFailed(); + } + }); + } + /** + * Update measurements + */ + updateSnapshot() { + if (this.snapshot || !this.instance) + return; + this.snapshot = this.measure(); + if (this.snapshot && + !calcLength(this.snapshot.measuredBox.x) && + !calcLength(this.snapshot.measuredBox.y)) { + this.snapshot = undefined; + } + } + updateLayout() { + if (!this.instance) + return; + this.updateScroll(); + if (!(this.options.alwaysMeasureLayout && this.isLead()) && + !this.isLayoutDirty) { + return; + } + /** + * When a node is mounted, it simply resumes from the prevLead's + * snapshot instead of taking a new one, but the ancestors scroll + * might have updated while the prevLead is unmounted. We need to + * update the scroll again to make sure the layout we measure is + * up to date. + */ + if (this.resumeFrom && !this.resumeFrom.instance) { + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + node.updateScroll(); + } + } + const prevLayout = this.layout; + this.layout = this.measure(false); + this.layoutVersion++; + this.layoutCorrected = createBox(); + this.isLayoutDirty = false; + this.projectionDelta = undefined; + this.notifyListeners("measure", this.layout.layoutBox); + const { visualElement } = this.options; + visualElement && + visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined); + } + updateScroll(phase = "measure") { + let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); + if (this.scroll && + this.scroll.animationId === this.root.animationId && + this.scroll.phase === phase) { + needsMeasurement = false; + } + if (needsMeasurement && this.instance) { + const isRoot = checkIsScrollRoot(this.instance); + this.scroll = { + animationId: this.root.animationId, + phase, + isRoot, + offset: measureScroll(this.instance), + wasRoot: this.scroll ? this.scroll.isRoot : isRoot, + }; + } + } + resetTransform() { + if (!resetTransform) + return; + const isResetRequested = this.isLayoutDirty || + this.shouldResetTransform || + this.options.alwaysMeasureLayout; + const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); + const transformTemplate = this.getTransformTemplate(); + const transformTemplateValue = transformTemplate + ? transformTemplate(this.latestValues, "") + : undefined; + const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; + if (isResetRequested && + this.instance && + (hasProjection || + hasTransform(this.latestValues) || + transformTemplateHasChanged)) { + resetTransform(this.instance, transformTemplateValue); + this.shouldResetTransform = false; + this.scheduleRender(); + } + } + measure(removeTransform = true) { + const pageBox = this.measurePageBox(); + let layoutBox = this.removeElementScroll(pageBox); + /** + * Measurements taken during the pre-render stage + * still have transforms applied so we remove them + * via calculation. + */ + if (removeTransform) { + layoutBox = this.removeTransform(layoutBox); + } + roundBox(layoutBox); + return { + animationId: this.root.animationId, + measuredBox: pageBox, + layoutBox, + latestValues: {}, + source: this.id, + }; + } + measurePageBox() { + const { visualElement } = this.options; + if (!visualElement) + return createBox(); + const box = visualElement.measureViewportBox(); + const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot); + if (!wasInScrollRoot) { + // Remove viewport scroll to give page-relative coordinates + const { scroll } = this.root; + if (scroll) { + translateAxis(box.x, scroll.offset.x); + translateAxis(box.y, scroll.offset.y); + } + } + return box; + } + removeElementScroll(box) { + const boxWithoutScroll = createBox(); + copyBoxInto(boxWithoutScroll, box); + if (this.scroll?.wasRoot) { + return boxWithoutScroll; + } + /** + * Performance TODO: Keep a cumulative scroll offset down the tree + * rather than loop back up the path. + */ + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + const { scroll, options } = node; + if (node !== this.root && scroll && options.layoutScroll) { + /** + * If this is a new scroll root, we want to remove all previous scrolls + * from the viewport box. + */ + if (scroll.wasRoot) { + copyBoxInto(boxWithoutScroll, box); + } + translateAxis(boxWithoutScroll.x, scroll.offset.x); + translateAxis(boxWithoutScroll.y, scroll.offset.y); + } + } + return boxWithoutScroll; + } + applyTransform(box, transformOnly = false) { + const withTransforms = createBox(); + copyBoxInto(withTransforms, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!transformOnly && + node.options.layoutScroll && + node.scroll && + node !== node.root) { + transformBox(withTransforms, { + x: -node.scroll.offset.x, + y: -node.scroll.offset.y, + }); + } + if (!hasTransform(node.latestValues)) + continue; + transformBox(withTransforms, node.latestValues); + } + if (hasTransform(this.latestValues)) { + transformBox(withTransforms, this.latestValues); + } + return withTransforms; + } + removeTransform(box) { + const boxWithoutTransform = createBox(); + copyBoxInto(boxWithoutTransform, box); + for (let i = 0; i < this.path.length; i++) { + const node = this.path[i]; + if (!node.instance) + continue; + if (!hasTransform(node.latestValues)) + continue; + hasScale(node.latestValues) && node.updateSnapshot(); + const sourceBox = createBox(); + const nodeBox = node.measurePageBox(); + copyBoxInto(sourceBox, nodeBox); + removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox); + } + if (hasTransform(this.latestValues)) { + removeBoxTransforms(boxWithoutTransform, this.latestValues); + } + return boxWithoutTransform; + } + setTargetDelta(delta) { + this.targetDelta = delta; + this.root.scheduleUpdateProjection(); + this.isProjectionDirty = true; + } + setOptions(options) { + this.options = { + ...this.options, + ...options, + crossfade: options.crossfade !== undefined ? options.crossfade : true, + }; + } + clearMeasurements() { + this.scroll = undefined; + this.layout = undefined; + this.snapshot = undefined; + this.prevTransformTemplateValue = undefined; + this.targetDelta = undefined; + this.target = undefined; + this.isLayoutDirty = false; + } + forceRelativeParentToResolveTarget() { + if (!this.relativeParent) + return; + /** + * If the parent target isn't up-to-date, force it to update. + * This is an unfortunate de-optimisation as it means any updating relative + * projection will cause all the relative parents to recalculate back + * up the tree. + */ + if (this.relativeParent.resolvedRelativeTargetAt !== + frameData.timestamp) { + this.relativeParent.resolveTargetDelta(true); + } + } + resolveTargetDelta(forceRecalculation = false) { + /** + * Once the dirty status of nodes has been spread through the tree, we also + * need to check if we have a shared node of a different depth that has itself + * been dirtied. + */ + const lead = this.getLead(); + this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); + this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); + this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); + const isShared = Boolean(this.resumingFrom) || this !== lead; + /** + * We don't use transform for this step of processing so we don't + * need to check whether any nodes have changed transform. + */ + const canSkip = !(forceRecalculation || + (isShared && this.isSharedProjectionDirty) || + this.isProjectionDirty || + this.parent?.isProjectionDirty || + this.attemptToResolveRelativeTarget || + this.root.updateBlockedByResize); + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If we have no layout, we can't perform projection, so early return + */ + if (!this.layout || !(layout || layoutId)) + return; + this.resolvedRelativeTargetAt = frameData.timestamp; + const relativeParent = this.getClosestProjectingParent(); + if (relativeParent && + this.linkedParentVersion !== relativeParent.layoutVersion && + !relativeParent.options.layoutRoot) { + this.removeRelativeTarget(); + } + /** + * If we don't have a targetDelta but do have a layout, we can attempt to resolve + * a relativeParent. This will allow a component to perform scale correction + * even if no animation has started. + */ + if (!this.targetDelta && !this.relativeTarget) { + if (relativeParent && relativeParent.layout) { + this.createRelativeTarget(relativeParent, this.layout.layoutBox, relativeParent.layout.layoutBox); + } + else { + this.removeRelativeTarget(); + } + } + /** + * If we have no relative target or no target delta our target isn't valid + * for this frame. + */ + if (!this.relativeTarget && !this.targetDelta) + return; + /** + * Lazy-init target data structure + */ + if (!this.target) { + this.target = createBox(); + this.targetWithTransforms = createBox(); + } + /** + * If we've got a relative box for this component, resolve it into a target relative to the parent. + */ + if (this.relativeTarget && + this.relativeTargetOrigin && + this.relativeParent && + this.relativeParent.target) { + this.forceRelativeParentToResolveTarget(); + calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); + /** + * If we've only got a targetDelta, resolve it into a target + */ + } + else if (this.targetDelta) { + if (Boolean(this.resumingFrom)) { + // TODO: This is creating a new object every frame + this.target = this.applyTransform(this.layout.layoutBox); + } + else { + copyBoxInto(this.target, this.layout.layoutBox); + } + applyBoxDelta(this.target, this.targetDelta); + } + else { + /** + * If no target, use own layout as target + */ + copyBoxInto(this.target, this.layout.layoutBox); + } + /** + * If we've been told to attempt to resolve a relative target, do so. + */ + if (this.attemptToResolveRelativeTarget) { + this.attemptToResolveRelativeTarget = false; + if (relativeParent && + Boolean(relativeParent.resumingFrom) === + Boolean(this.resumingFrom) && + !relativeParent.options.layoutScroll && + relativeParent.target && + this.animationProgress !== 1) { + this.createRelativeTarget(relativeParent, this.target, relativeParent.target); + } + else { + this.relativeParent = this.relativeTarget = undefined; + } + } + /** + * Increase debug counter for resolved target deltas + */ + if (statsBuffer.value) { + metrics.calculatedTargetDeltas++; + } + } + getClosestProjectingParent() { + if (!this.parent || + hasScale(this.parent.latestValues) || + has2DTranslate(this.parent.latestValues)) { + return undefined; + } + if (this.parent.isProjecting()) { + return this.parent; + } + else { + return this.parent.getClosestProjectingParent(); + } + } + isProjecting() { + return Boolean((this.relativeTarget || + this.targetDelta || + this.options.layoutRoot) && + this.layout); + } + createRelativeTarget(relativeParent, layout, parentLayout) { + this.relativeParent = relativeParent; + this.linkedParentVersion = relativeParent.layoutVersion; + this.forceRelativeParentToResolveTarget(); + this.relativeTarget = createBox(); + this.relativeTargetOrigin = createBox(); + calcRelativePosition(this.relativeTargetOrigin, layout, parentLayout); + copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); + } + removeRelativeTarget() { + this.relativeParent = this.relativeTarget = undefined; + } + calcProjection() { + const lead = this.getLead(); + const isShared = Boolean(this.resumingFrom) || this !== lead; + let canSkip = true; + /** + * If this is a normal layout animation and neither this node nor its nearest projecting + * is dirty then we can't skip. + */ + if (this.isProjectionDirty || this.parent?.isProjectionDirty) { + canSkip = false; + } + /** + * If this is a shared layout animation and this node's shared projection is dirty then + * we can't skip. + */ + if (isShared && + (this.isSharedProjectionDirty || this.isTransformDirty)) { + canSkip = false; + } + /** + * If we have resolved the target this frame we must recalculate the + * projection to ensure it visually represents the internal calculations. + */ + if (this.resolvedRelativeTargetAt === frameData.timestamp) { + canSkip = false; + } + if (canSkip) + return; + const { layout, layoutId } = this.options; + /** + * If this section of the tree isn't animating we can + * delete our target sources for the following frame. + */ + this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) || + this.currentAnimation || + this.pendingAnimation); + if (!this.isTreeAnimating) { + this.targetDelta = this.relativeTarget = undefined; + } + if (!this.layout || !(layout || layoutId)) + return; + /** + * Reset the corrected box with the latest values from box, as we're then going + * to perform mutative operations on it. + */ + copyBoxInto(this.layoutCorrected, this.layout.layoutBox); + /** + * Record previous tree scales before updating. + */ + const prevTreeScaleX = this.treeScale.x; + const prevTreeScaleY = this.treeScale.y; + /** + * Apply all the parent deltas to this box to produce the corrected box. This + * is the layout box, as it will appear on screen as a result of the transforms of its parents. + */ + applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); + /** + * If this layer needs to perform scale correction but doesn't have a target, + * use the layout as the target. + */ + if (lead.layout && + !lead.target && + (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { + lead.target = lead.layout.layoutBox; + lead.targetWithTransforms = createBox(); + } + const { target } = lead; + if (!target) { + /** + * If we don't have a target to project into, but we were previously + * projecting, we want to remove the stored transform and schedule + * a render to ensure the elements reflect the removed transform. + */ + if (this.prevProjectionDelta) { + this.createProjectionDeltas(); + this.scheduleRender(); + } + return; + } + if (!this.projectionDelta || !this.prevProjectionDelta) { + this.createProjectionDeltas(); + } + else { + copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); + copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); + } + /** + * Update the delta between the corrected box and the target box before user-set transforms were applied. + * This will allow us to calculate the corrected borderRadius and boxShadow to compensate + * for our layout reprojection, but still allow them to be scaled correctly by the user. + * It might be that to simplify this we may want to accept that user-set scale is also corrected + * and we wouldn't have to keep and calc both deltas, OR we could support a user setting + * to allow people to choose whether these styles are corrected based on just the + * layout reprojection or the final bounding box. + */ + calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); + if (this.treeScale.x !== prevTreeScaleX || + this.treeScale.y !== prevTreeScaleY || + !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || + !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { + this.hasProjected = true; + this.scheduleRender(); + this.notifyListeners("projectionUpdate", target); + } + /** + * Increase debug counter for recalculated projections + */ + if (statsBuffer.value) { + metrics.calculatedProjections++; + } + } + hide() { + this.isVisible = false; + // TODO: Schedule render + } + show() { + this.isVisible = true; + // TODO: Schedule render + } + scheduleRender(notifyAll = true) { + this.options.visualElement?.scheduleRender(); + if (notifyAll) { + const stack = this.getStack(); + stack && stack.scheduleRender(); + } + if (this.resumingFrom && !this.resumingFrom.instance) { + this.resumingFrom = undefined; + } + } + createProjectionDeltas() { + this.prevProjectionDelta = createDelta(); + this.projectionDelta = createDelta(); + this.projectionDeltaWithTransform = createDelta(); + } + setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { + const snapshot = this.snapshot; + const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; + const mixedValues = { ...this.latestValues }; + const targetDelta = createDelta(); + if (!this.relativeParent || + !this.relativeParent.options.layoutRoot) { + this.relativeTarget = this.relativeTargetOrigin = undefined; + } + this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; + const relativeLayout = createBox(); + const snapshotSource = snapshot ? snapshot.source : undefined; + const layoutSource = this.layout ? this.layout.source : undefined; + const isSharedLayoutAnimation = snapshotSource !== layoutSource; + const stack = this.getStack(); + const isOnlyMember = !stack || stack.members.length <= 1; + const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && + !isOnlyMember && + this.options.crossfade === true && + !this.path.some(hasOpacityCrossfade)); + this.animationProgress = 0; + let prevRelativeTarget; + this.mixTargetDelta = (latest) => { + const progress = latest / 1000; + mixAxisDelta(targetDelta.x, delta.x, progress); + mixAxisDelta(targetDelta.y, delta.y, progress); + this.setTargetDelta(targetDelta); + if (this.relativeTarget && + this.relativeTargetOrigin && + this.layout && + this.relativeParent && + this.relativeParent.layout) { + calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); + mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress); + /** + * If this is an unchanged relative target we can consider the + * projection not dirty. + */ + if (prevRelativeTarget && + boxEquals(this.relativeTarget, prevRelativeTarget)) { + this.isProjectionDirty = false; + } + if (!prevRelativeTarget) + prevRelativeTarget = createBox(); + copyBoxInto(prevRelativeTarget, this.relativeTarget); + } + if (isSharedLayoutAnimation) { + this.animationValues = mixedValues; + mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); + } + this.root.scheduleUpdateProjection(); + this.scheduleRender(); + this.animationProgress = progress; + }; + this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0); + } + startAnimation(options) { + this.notifyListeners("animationStart"); + this.currentAnimation?.stop(); + this.resumingFrom?.currentAnimation?.stop(); + if (this.pendingAnimation) { + cancelFrame(this.pendingAnimation); + this.pendingAnimation = undefined; + } + /** + * Start the animation in the next frame to have a frame with progress 0, + * where the target is the same as when the animation started, so we can + * calculate the relative positions correctly for instant transitions. + */ + this.pendingAnimation = frame.update(() => { + globalProjectionState.hasAnimatedSinceResize = true; + activeAnimations.layout++; + this.motionValue || (this.motionValue = motionValue(0)); + this.motionValue.jump(0, false); + this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], { + ...options, + velocity: 0, + isSync: true, + onUpdate: (latest) => { + this.mixTargetDelta(latest); + options.onUpdate && options.onUpdate(latest); + }, + onStop: () => { + activeAnimations.layout--; + }, + onComplete: () => { + activeAnimations.layout--; + options.onComplete && options.onComplete(); + this.completeAnimation(); + }, + }); + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = this.currentAnimation; + } + this.pendingAnimation = undefined; + }); + } + completeAnimation() { + if (this.resumingFrom) { + this.resumingFrom.currentAnimation = undefined; + this.resumingFrom.preserveOpacity = undefined; + } + const stack = this.getStack(); + stack && stack.exitAnimationComplete(); + this.resumingFrom = + this.currentAnimation = + this.animationValues = + undefined; + this.notifyListeners("animationComplete"); + } + finishAnimation() { + if (this.currentAnimation) { + this.mixTargetDelta && this.mixTargetDelta(animationTarget); + this.currentAnimation.stop(); + } + this.completeAnimation(); + } + applyTransformsToTarget() { + const lead = this.getLead(); + let { targetWithTransforms, target, layout, latestValues } = lead; + if (!targetWithTransforms || !target || !layout) + return; + /** + * If we're only animating position, and this element isn't the lead element, + * then instead of projecting into the lead box we instead want to calculate + * a new target that aligns the two boxes but maintains the layout shape. + */ + if (this !== lead && + this.layout && + layout && + shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) { + target = this.target || createBox(); + const xLength = calcLength(this.layout.layoutBox.x); + target.x.min = lead.target.x.min; + target.x.max = target.x.min + xLength; + const yLength = calcLength(this.layout.layoutBox.y); + target.y.min = lead.target.y.min; + target.y.max = target.y.min + yLength; + } + copyBoxInto(targetWithTransforms, target); + /** + * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. + * This is the final box that we will then project into by calculating a transform delta and + * applying it to the corrected box. + */ + transformBox(targetWithTransforms, latestValues); + /** + * Update the delta between the corrected box and the final target box, after + * user-set transforms are applied to it. This will be used by the renderer to + * create a transform style that will reproject the element from its layout layout + * into the desired bounding box. + */ + calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); + } + registerSharedNode(layoutId, node) { + if (!this.sharedNodes.has(layoutId)) { + this.sharedNodes.set(layoutId, new NodeStack()); + } + const stack = this.sharedNodes.get(layoutId); + stack.add(node); + const config = node.options.initialPromotionConfig; + node.promote({ + transition: config ? config.transition : undefined, + preserveFollowOpacity: config && config.shouldPreserveFollowOpacity + ? config.shouldPreserveFollowOpacity(node) + : undefined, + }); + } + isLead() { + const stack = this.getStack(); + return stack ? stack.lead === this : true; + } + getLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.lead || this : this; + } + getPrevLead() { + const { layoutId } = this.options; + return layoutId ? this.getStack()?.prevLead : undefined; + } + getStack() { + const { layoutId } = this.options; + if (layoutId) + return this.root.sharedNodes.get(layoutId); + } + promote({ needsReset, transition, preserveFollowOpacity, } = {}) { + const stack = this.getStack(); + if (stack) + stack.promote(this, preserveFollowOpacity); + if (needsReset) { + this.projectionDelta = undefined; + this.needsReset = true; + } + if (transition) + this.setOptions({ transition }); + } + relegate() { + const stack = this.getStack(); + if (stack) { + return stack.relegate(this); + } + else { + return false; + } + } + resetSkewAndRotation() { + const { visualElement } = this.options; + if (!visualElement) + return; + // If there's no detected skew or rotation values, we can early return without a forced render. + let hasDistortingTransform = false; + /** + * An unrolled check for rotation values. Most elements don't have any rotation and + * skipping the nested loop and new object creation is 50% faster. + */ + const { latestValues } = visualElement; + if (latestValues.z || + latestValues.rotate || + latestValues.rotateX || + latestValues.rotateY || + latestValues.rotateZ || + latestValues.skewX || + latestValues.skewY) { + hasDistortingTransform = true; + } + // If there's no distorting values, we don't need to do any more. + if (!hasDistortingTransform) + return; + const resetValues = {}; + if (latestValues.z) { + resetDistortingTransform("z", visualElement, resetValues, this.animationValues); + } + // Check the skew and rotate value of all axes and reset to 0 + for (let i = 0; i < transformAxes.length; i++) { + resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues); + } + // Force a render of this element to apply the transform with all skews and rotations + // set to 0. + visualElement.render(); + // Put back all the values we reset + for (const key in resetValues) { + visualElement.setStaticValue(key, resetValues[key]); + if (this.animationValues) { + this.animationValues[key] = resetValues[key]; + } + } + // Schedule a render for the next frame. This ensures we won't visually + // see the element with the reset rotate value applied. + visualElement.scheduleRender(); + } + applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties + styleProp) { + if (!this.instance || this.isSVG) + return; + if (!this.isVisible) { + targetStyle.visibility = "hidden"; + return; + } + const transformTemplate = this.getTransformTemplate(); + if (this.needsReset) { + this.needsReset = false; + targetStyle.visibility = ""; + targetStyle.opacity = ""; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + targetStyle.transform = transformTemplate + ? transformTemplate(this.latestValues, "") + : "none"; + return; + } + const lead = this.getLead(); + if (!this.projectionDelta || !this.layout || !lead.target) { + if (this.options.layoutId) { + targetStyle.opacity = + this.latestValues.opacity !== undefined + ? this.latestValues.opacity + : 1; + targetStyle.pointerEvents = + resolveMotionValue(styleProp?.pointerEvents) || ""; + } + if (this.hasProjected && !hasTransform(this.latestValues)) { + targetStyle.transform = transformTemplate + ? transformTemplate({}, "") + : "none"; + this.hasProjected = false; + } + return; + } + targetStyle.visibility = ""; + const valuesToRender = lead.animationValues || lead.latestValues; + this.applyTransformsToTarget(); + let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); + if (transformTemplate) { + transform = transformTemplate(valuesToRender, transform); + } + targetStyle.transform = transform; + const { x, y } = this.projectionDelta; + targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`; + if (lead.animationValues) { + /** + * If the lead component is animating, assign this either the entering/leaving + * opacity + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity ?? + this.latestValues.opacity ?? + 1 + : this.preserveOpacity + ? this.latestValues.opacity + : valuesToRender.opacityExit; + } + else { + /** + * Or we're not animating at all, set the lead component to its layout + * opacity and other components to hidden. + */ + targetStyle.opacity = + lead === this + ? valuesToRender.opacity !== undefined + ? valuesToRender.opacity + : "" + : valuesToRender.opacityExit !== undefined + ? valuesToRender.opacityExit + : 0; + } + /** + * Apply scale correction + */ + for (const key in scaleCorrectors) { + if (valuesToRender[key] === undefined) + continue; + const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]; + /** + * Only apply scale correction to the value if we have an + * active projection transform. Otherwise these values become + * vulnerable to distortion if the element changes size without + * a corresponding layout animation. + */ + const corrected = transform === "none" + ? valuesToRender[key] + : correct(valuesToRender[key], lead); + if (applyTo) { + const num = applyTo.length; + for (let i = 0; i < num; i++) { + targetStyle[applyTo[i]] = corrected; + } + } + else { + // If this is a CSS variable, set it directly on the instance. + // Replacing this function from creating styles to setting them + // would be a good place to remove per frame object creation + if (isCSSVariable) { + this.options.visualElement.renderState.vars[key] = corrected; + } + else { + targetStyle[key] = corrected; + } + } + } + /** + * Disable pointer events on follow components. This is to ensure + * that if a follow component covers a lead component it doesn't block + * pointer events on the lead. + */ + if (this.options.layoutId) { + targetStyle.pointerEvents = + lead === this + ? resolveMotionValue(styleProp?.pointerEvents) || "" + : "none"; + } + } + clearSnapshot() { + this.resumeFrom = this.snapshot = undefined; + } + // Only run on root + resetTree() { + this.root.nodes.forEach((node) => node.currentAnimation?.stop()); + this.root.nodes.forEach(clearMeasurements); + this.root.sharedNodes.clear(); + } + }; + } + function updateLayout(node) { + node.updateLayout(); + } + function notifyLayoutUpdate(node) { + const snapshot = node.resumeFrom?.snapshot || node.snapshot; + if (node.isLead() && + node.layout && + snapshot && + node.hasListeners("didUpdate")) { + const { layoutBox: layout, measuredBox: measuredLayout } = node.layout; + const { animationType } = node.options; + const isShared = snapshot.source !== node.layout.source; + // TODO Maybe we want to also resize the layout snapshot so we don't trigger + // animations for instance if layout="size" and an element has only changed position + if (animationType === "size") { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(axisSnapshot); + axisSnapshot.min = layout[axis].min; + axisSnapshot.max = axisSnapshot.min + length; + }); + } + else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) { + eachAxis((axis) => { + const axisSnapshot = isShared + ? snapshot.measuredBox[axis] + : snapshot.layoutBox[axis]; + const length = calcLength(layout[axis]); + axisSnapshot.max = axisSnapshot.min + length; + /** + * Ensure relative target gets resized and rerendererd + */ + if (node.relativeTarget && !node.currentAnimation) { + node.isProjectionDirty = true; + node.relativeTarget[axis].max = + node.relativeTarget[axis].min + length; + } + }); + } + const layoutDelta = createDelta(); + calcBoxDelta(layoutDelta, layout, snapshot.layoutBox); + const visualDelta = createDelta(); + if (isShared) { + calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox); + } + else { + calcBoxDelta(visualDelta, layout, snapshot.layoutBox); + } + const hasLayoutChanged = !isDeltaZero(layoutDelta); + let hasRelativeLayoutChanged = false; + if (!node.resumeFrom) { + const relativeParent = node.getClosestProjectingParent(); + /** + * If the relativeParent is itself resuming from a different element then + * the relative snapshot is not relavent + */ + if (relativeParent && !relativeParent.resumeFrom) { + const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; + if (parentSnapshot && parentLayout) { + const relativeSnapshot = createBox(); + calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); + const relativeLayout = createBox(); + calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox); + if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { + hasRelativeLayoutChanged = true; + } + if (relativeParent.options.layoutRoot) { + node.relativeTarget = relativeLayout; + node.relativeTargetOrigin = relativeSnapshot; + node.relativeParent = relativeParent; + } + } + } + } + node.notifyListeners("didUpdate", { + layout, + snapshot, + delta: visualDelta, + layoutDelta, + hasLayoutChanged, + hasRelativeLayoutChanged, + }); + } + else if (node.isLead()) { + const { onExitComplete } = node.options; + onExitComplete && onExitComplete(); + } + /** + * Clearing transition + * TODO: Investigate why this transition is being passed in as {type: false } from Framer + * and why we need it at all + */ + node.options.transition = undefined; + } + function propagateDirtyNodes(node) { + /** + * Increase debug counter for nodes encountered this frame + */ + if (statsBuffer.value) { + metrics.nodes++; + } + if (!node.parent) + return; + /** + * If this node isn't projecting, propagate isProjectionDirty. It will have + * no performance impact but it will allow the next child that *is* projecting + * but *isn't* dirty to just check its parent to see if *any* ancestor needs + * correcting. + */ + if (!node.isProjecting()) { + node.isProjectionDirty = node.parent.isProjectionDirty; + } + /** + * Propagate isSharedProjectionDirty and isTransformDirty + * throughout the whole tree. A future revision can take another look at + * this but for safety we still recalcualte shared nodes. + */ + node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty || + node.parent.isProjectionDirty || + node.parent.isSharedProjectionDirty)); + node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty); + } + function cleanDirtyNodes(node) { + node.isProjectionDirty = + node.isSharedProjectionDirty = + node.isTransformDirty = + false; + } + function clearSnapshot(node) { + node.clearSnapshot(); + } + function clearMeasurements(node) { + node.clearMeasurements(); + } + function clearIsLayoutDirty(node) { + node.isLayoutDirty = false; + } + function resetTransformStyle(node) { + const { visualElement } = node.options; + if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { + visualElement.notify("BeforeLayoutMeasure"); + } + node.resetTransform(); + } + function finishAnimation(node) { + node.finishAnimation(); + node.targetDelta = node.relativeTarget = node.target = undefined; + node.isProjectionDirty = true; + } + function resolveTargetDelta(node) { + node.resolveTargetDelta(); + } + function calcProjection(node) { + node.calcProjection(); + } + function resetSkewAndRotation(node) { + node.resetSkewAndRotation(); + } + function removeLeadSnapshots(stack) { + stack.removeLeadSnapshot(); + } + function mixAxisDelta(output, delta, p) { + output.translate = mixNumber$1(delta.translate, 0, p); + output.scale = mixNumber$1(delta.scale, 1, p); + output.origin = delta.origin; + output.originPoint = delta.originPoint; + } + function mixAxis(output, from, to, p) { + output.min = mixNumber$1(from.min, to.min, p); + output.max = mixNumber$1(from.max, to.max, p); + } + function mixBox(output, from, to, p) { + mixAxis(output.x, from.x, to.x, p); + mixAxis(output.y, from.y, to.y, p); + } + function hasOpacityCrossfade(node) { + return (node.animationValues && node.animationValues.opacityExit !== undefined); + } + const defaultLayoutTransition = { + duration: 0.45, + ease: [0.4, 0, 0.1, 1], + }; + const userAgentContains = (string) => typeof navigator !== "undefined" && + navigator.userAgent && + navigator.userAgent.toLowerCase().includes(string); + /** + * Measured bounding boxes must be rounded in Safari and + * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements + * can appear to jump. + */ + const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") + ? Math.round + : motionUtils.noop; + function roundAxis(axis) { + // Round to the nearest .5 pixels to support subpixel layouts + axis.min = roundPoint(axis.min); + axis.max = roundPoint(axis.max); + } + function roundBox(box) { + roundAxis(box.x); + roundAxis(box.y); + } + function shouldAnimatePositionOnly(animationType, snapshot, layout) { + return (animationType === "position" || + (animationType === "preserve-aspect" && + !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))); + } + function checkNodeWasScrollRoot(node) { + return node !== node.root && node.scroll?.wasRoot; + } + + const DocumentProjectionNode = createProjectionNode({ + attachResizeListener: (ref, notify) => addDomEvent(ref, "resize", notify), + measureScroll: () => ({ + x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0, + y: document.documentElement.scrollTop || document.body?.scrollTop || 0, + }), + checkIsScrollRoot: () => true, + }); + + const notify = (node) => !node.isLayoutDirty && node.willUpdate(false); + function nodeGroup() { + const nodes = new Set(); + const subscriptions = new WeakMap(); + const dirtyAll = () => nodes.forEach(notify); + return { + add: (node) => { + nodes.add(node); + subscriptions.set(node, node.addEventListener("willUpdate", dirtyAll)); + }, + remove: (node) => { + nodes.delete(node); + const unsubscribe = subscriptions.get(node); + if (unsubscribe) { + unsubscribe(); + subscriptions.delete(node); + } + dirtyAll(); + }, + dirty: dirtyAll, + }; + } + + const rootProjectionNode = { + current: undefined, + }; + const HTMLProjectionNode = createProjectionNode({ + measureScroll: (instance) => ({ + x: instance.scrollLeft, + y: instance.scrollTop, + }), + defaultParent: () => { + if (!rootProjectionNode.current) { + const documentNode = new DocumentProjectionNode({}); + documentNode.mount(window); + documentNode.setOptions({ layoutScroll: true }); + rootProjectionNode.current = documentNode; + } + return rootProjectionNode.current; + }, + resetTransform: (instance, value) => { + instance.style.transform = value !== undefined ? value : "none"; + }, + checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed"), + }); + + const layoutSelector = "[data-layout], [data-layout-id]"; + const noop = () => { }; + function snapshotFromTarget(projection) { + const target = projection.targetWithTransforms || projection.target; + if (!target) + return undefined; + const measuredBox = createBox(); + const layoutBox = createBox(); + copyBoxInto(measuredBox, target); + copyBoxInto(layoutBox, target); + return { + animationId: projection.root?.animationId ?? 0, + measuredBox, + layoutBox, + latestValues: projection.animationValues || projection.latestValues || {}, + source: projection.id, + }; + } + class LayoutAnimationBuilder { + constructor(scope, updateDom, defaultOptions) { + this.sharedTransitions = new Map(); + this.notifyReady = noop; + this.rejectReady = noop; + this.scope = scope; + this.updateDom = updateDom; + this.defaultOptions = defaultOptions; + this.readyPromise = new Promise((resolve, reject) => { + this.notifyReady = resolve; + this.rejectReady = reject; + }); + frame.postRender(() => { + this.start().then(this.notifyReady).catch(this.rejectReady); + }); + } + shared(id, transition) { + this.sharedTransitions.set(id, transition); + return this; + } + then(resolve, reject) { + return this.readyPromise.then(resolve, reject); + } + async start() { + const beforeElements = collectLayoutElements(this.scope); + const beforeRecords = this.buildRecords(beforeElements); + beforeRecords.forEach(({ projection }) => { + const hasCurrentAnimation = Boolean(projection.currentAnimation); + const isSharedLayout = Boolean(projection.options.layoutId); + if (hasCurrentAnimation && isSharedLayout) { + const snapshot = snapshotFromTarget(projection); + if (snapshot) { + projection.snapshot = snapshot; + } + else if (projection.snapshot) { + projection.snapshot = undefined; + } + } + else if (projection.snapshot && + (projection.currentAnimation || projection.isProjecting())) { + projection.snapshot = undefined; + } + projection.isPresent = true; + projection.willUpdate(); + }); + await this.updateDom(); + const afterElements = collectLayoutElements(this.scope); + const afterRecords = this.buildRecords(afterElements); + this.handleExitingElements(beforeRecords, afterRecords); + afterRecords.forEach(({ projection }) => { + const instance = projection.instance; + const resumeFromInstance = projection.resumeFrom + ?.instance; + if (!instance || !resumeFromInstance) + return; + if (!("style" in instance)) + return; + const currentTransform = instance.style.transform; + const resumeFromTransform = resumeFromInstance.style.transform; + if (currentTransform && + resumeFromTransform && + currentTransform === resumeFromTransform) { + instance.style.transform = ""; + instance.style.transformOrigin = ""; + } + }); + afterRecords.forEach(({ projection }) => { + projection.isPresent = true; + }); + const root = getProjectionRoot(afterRecords, beforeRecords); + root?.didUpdate(); + await new Promise((resolve) => { + frame.postRender(() => resolve()); + }); + const animations = collectAnimations(afterRecords); + const animation = new GroupAnimation(animations); + return animation; + } + buildRecords(elements) { + const records = []; + const recordMap = new Map(); + for (const element of elements) { + const parentRecord = findParentRecord(element, recordMap, this.scope); + const { layout, layoutId } = readLayoutAttributes(element); + const override = layoutId + ? this.sharedTransitions.get(layoutId) + : undefined; + const transition = override || this.defaultOptions; + const record = getOrCreateRecord(element, parentRecord?.projection, { + layout, + layoutId, + animationType: typeof layout === "string" ? layout : "both", + transition: transition, + }); + recordMap.set(element, record); + records.push(record); + } + return records; + } + handleExitingElements(beforeRecords, afterRecords) { + const afterElementsSet = new Set(afterRecords.map((record) => record.element)); + beforeRecords.forEach((record) => { + if (afterElementsSet.has(record.element)) + return; + // For shared layout elements, relegate to set up resumeFrom + // so the remaining element animates from this position + if (record.projection.options.layoutId) { + record.projection.isPresent = false; + record.projection.relegate(); + } + record.visualElement.unmount(); + visualElementStore.delete(record.element); + }); + // Clear resumeFrom on EXISTING nodes that point to unmounted projections + // This prevents crossfade animation when the source element was removed entirely + // But preserve resumeFrom for NEW nodes so they can animate from the old position + // Also preserve resumeFrom for lead nodes that were just promoted via relegate + const beforeElementsSet = new Set(beforeRecords.map((record) => record.element)); + afterRecords.forEach(({ element, projection }) => { + if (beforeElementsSet.has(element) && + projection.resumeFrom && + !projection.resumeFrom.instance && + !projection.isLead()) { + projection.resumeFrom = undefined; + projection.snapshot = undefined; + } + }); + } + } + function parseAnimateLayoutArgs(scopeOrUpdateDom, updateDomOrOptions, options) { + // animateLayout(updateDom) + if (typeof scopeOrUpdateDom === "function") { + return { + scope: document, + updateDom: scopeOrUpdateDom, + defaultOptions: updateDomOrOptions, + }; + } + // animateLayout(scope, updateDom, options?) + const elements = resolveElements(scopeOrUpdateDom); + const scope = elements[0] || document; + return { + scope, + updateDom: updateDomOrOptions, + defaultOptions: options, + }; + } + function collectLayoutElements(scope) { + const elements = Array.from(scope.querySelectorAll(layoutSelector)); + if (scope instanceof Element && scope.matches(layoutSelector)) { + if (!elements.includes(scope)) { + elements.unshift(scope); + } + } + return elements; + } + function readLayoutAttributes(element) { + const layoutId = element.getAttribute("data-layout-id") || undefined; + const rawLayout = element.getAttribute("data-layout"); + let layout; + if (rawLayout === "" || rawLayout === "true") { + layout = true; + } + else if (rawLayout) { + layout = rawLayout; + } + return { + layout, + layoutId, + }; + } + function createVisualState() { + return { + latestValues: {}, + renderState: { + transform: {}, + transformOrigin: {}, + style: {}, + vars: {}, + }, + }; + } + function getOrCreateRecord(element, parentProjection, projectionOptions) { + const existing = visualElementStore.get(element); + const visualElement = existing ?? + new HTMLVisualElement({ + props: {}, + presenceContext: null, + visualState: createVisualState(), + }, { allowProjection: true }); + if (!existing || !visualElement.projection) { + visualElement.projection = new HTMLProjectionNode(visualElement.latestValues, parentProjection); + } + visualElement.projection.setOptions({ + ...projectionOptions, + visualElement, + }); + if (!visualElement.current) { + visualElement.mount(element); + } + else if (!visualElement.projection.instance) { + // Mount projection if VisualElement is already mounted but projection isn't + // This happens when animate() was called before animateLayout() + visualElement.projection.mount(element); + } + if (!existing) { + visualElementStore.set(element, visualElement); + } + return { + element, + visualElement, + projection: visualElement.projection, + }; + } + function findParentRecord(element, recordMap, scope) { + let parent = element.parentElement; + while (parent) { + const record = recordMap.get(parent); + if (record) + return record; + if (parent === scope) + break; + parent = parent.parentElement; + } + return undefined; + } + function getProjectionRoot(afterRecords, beforeRecords) { + const record = afterRecords[0] || beforeRecords[0]; + return record?.projection.root; + } + function collectAnimations(afterRecords) { + const animations = new Set(); + afterRecords.forEach((record) => { + const animation = record.projection.currentAnimation; + if (animation) + animations.add(animation); + }); + return Array.from(animations); + } + + /** + * @deprecated + * + * Import as `frame` instead. + */ + const sync = frame; + /** + * @deprecated + * + * Use cancelFrame(callback) instead. + */ + const cancelSync = stepsOrder.reduce((acc, key) => { + acc[key] = (process) => cancelFrame(process); + return acc; + }, {}); + + exports.AsyncMotionValueAnimation = AsyncMotionValueAnimation; + exports.DOMKeyframesResolver = DOMKeyframesResolver; + exports.DOMVisualElement = DOMVisualElement; + exports.DocumentProjectionNode = DocumentProjectionNode; + exports.Feature = Feature; + exports.FlatTree = FlatTree; + exports.GroupAnimation = GroupAnimation; + exports.GroupAnimationWithThen = GroupAnimationWithThen; + exports.HTMLProjectionNode = HTMLProjectionNode; + exports.HTMLVisualElement = HTMLVisualElement; + exports.JSAnimation = JSAnimation; + exports.KeyframeResolver = KeyframeResolver; + exports.LayoutAnimationBuilder = LayoutAnimationBuilder; + exports.MotionValue = MotionValue; + exports.NativeAnimation = NativeAnimation; + exports.NativeAnimationExtended = NativeAnimationExtended; + exports.NativeAnimationWrapper = NativeAnimationWrapper; + exports.NodeStack = NodeStack; + exports.ObjectVisualElement = ObjectVisualElement; + exports.SVGVisualElement = SVGVisualElement; + exports.ViewTransitionBuilder = ViewTransitionBuilder; + exports.VisualElement = VisualElement; + exports.acceleratedValues = acceleratedValues; + exports.activeAnimations = activeAnimations; + exports.addAttrValue = addAttrValue; + exports.addDomEvent = addDomEvent; + exports.addScaleCorrector = addScaleCorrector; + exports.addStyleValue = addStyleValue; + exports.addValueToWillChange = addValueToWillChange; + exports.alpha = alpha; + exports.analyseComplexValue = analyseComplexValue; + exports.animateMotionValue = animateMotionValue; + exports.animateSingleValue = animateSingleValue; + exports.animateTarget = animateTarget; + exports.animateValue = animateValue; + exports.animateVariant = animateVariant; + exports.animateView = animateView; + exports.animateVisualElement = animateVisualElement; + exports.animationMapKey = animationMapKey; + exports.applyAxisDelta = applyAxisDelta; + exports.applyBoxDelta = applyBoxDelta; + exports.applyGeneratorOptions = applyGeneratorOptions; + exports.applyPointDelta = applyPointDelta; + exports.applyPxDefaults = applyPxDefaults; + exports.applyTreeDeltas = applyTreeDeltas; + exports.aspectRatio = aspectRatio; + exports.attachFollow = attachFollow; + exports.attachSpring = attachSpring; + exports.attrEffect = attrEffect; + exports.axisDeltaEquals = axisDeltaEquals; + exports.axisEquals = axisEquals; + exports.axisEqualsRounded = axisEqualsRounded; + exports.boxEquals = boxEquals; + exports.boxEqualsRounded = boxEqualsRounded; + exports.buildHTMLStyles = buildHTMLStyles; + exports.buildProjectionTransform = buildProjectionTransform; + exports.buildSVGAttrs = buildSVGAttrs; + exports.buildSVGPath = buildSVGPath; + exports.buildTransform = buildTransform; + exports.calcAxisDelta = calcAxisDelta; + exports.calcBoxDelta = calcBoxDelta; + exports.calcChildStagger = calcChildStagger; + exports.calcGeneratorDuration = calcGeneratorDuration; + exports.calcLength = calcLength; + exports.calcRelativeAxis = calcRelativeAxis; + exports.calcRelativeAxisPosition = calcRelativeAxisPosition; + exports.calcRelativeBox = calcRelativeBox; + exports.calcRelativePosition = calcRelativePosition; + exports.camelCaseAttributes = camelCaseAttributes; + exports.camelToDash = camelToDash; + exports.cancelFrame = cancelFrame; + exports.cancelMicrotask = cancelMicrotask; + exports.cancelSync = cancelSync; + exports.checkVariantsDidChange = checkVariantsDidChange; + exports.cleanDirtyNodes = cleanDirtyNodes; + exports.collectMotionValues = collectMotionValues; + exports.color = color; + exports.compareByDepth = compareByDepth; + exports.complex = complex; + exports.containsCSSVariable = containsCSSVariable; + exports.convertBoundingBoxToBox = convertBoundingBoxToBox; + exports.convertBoxToBoundingBox = convertBoxToBoundingBox; + exports.convertOffsetToTimes = convertOffsetToTimes; + exports.copyAxisDeltaInto = copyAxisDeltaInto; + exports.copyAxisInto = copyAxisInto; + exports.copyBoxInto = copyBoxInto; + exports.correctBorderRadius = correctBorderRadius; + exports.correctBoxShadow = correctBoxShadow; + exports.createAnimationState = createAnimationState; + exports.createAxis = createAxis; + exports.createAxisDelta = createAxisDelta; + exports.createBox = createBox; + exports.createDelta = createDelta; + exports.createGeneratorEasing = createGeneratorEasing; + exports.createProjectionNode = createProjectionNode; + exports.createRenderBatcher = createRenderBatcher; + exports.cubicBezierAsString = cubicBezierAsString; + exports.defaultEasing = defaultEasing; + exports.defaultOffset = defaultOffset; + exports.defaultTransformValue = defaultTransformValue; + exports.defaultValueTypes = defaultValueTypes; + exports.degrees = degrees; + exports.delay = delay; + exports.delayInSeconds = delayInSeconds; + exports.dimensionValueTypes = dimensionValueTypes; + exports.eachAxis = eachAxis; + exports.fillOffset = fillOffset; + exports.fillWildcards = fillWildcards; + exports.findDimensionValueType = findDimensionValueType; + exports.findValueType = findValueType; + exports.flushKeyframeResolvers = flushKeyframeResolvers; + exports.followValue = followValue; + exports.frame = frame; + exports.frameData = frameData; + exports.frameSteps = frameSteps; + exports.generateLinearEasing = generateLinearEasing; + exports.getAnimatableNone = getAnimatableNone; + exports.getAnimationMap = getAnimationMap; + exports.getComputedStyle = getComputedStyle$2; + exports.getDefaultTransition = getDefaultTransition; + exports.getDefaultValueType = getDefaultValueType; + exports.getFeatureDefinitions = getFeatureDefinitions; + exports.getFinalKeyframe = getFinalKeyframe; + exports.getMixer = getMixer; + exports.getOptimisedAppearId = getOptimisedAppearId; + exports.getOriginIndex = getOriginIndex; + exports.getValueAsType = getValueAsType; + exports.getValueTransition = getValueTransition; + exports.getVariableValue = getVariableValue; + exports.getVariantContext = getVariantContext; + exports.getViewAnimationLayerInfo = getViewAnimationLayerInfo; + exports.getViewAnimations = getViewAnimations; + exports.globalProjectionState = globalProjectionState; + exports.has2DTranslate = has2DTranslate; + exports.hasReducedMotionListener = hasReducedMotionListener; + exports.hasScale = hasScale; + exports.hasTransform = hasTransform; + exports.hex = hex; + exports.hover = hover; + exports.hsla = hsla; + exports.hslaToRgba = hslaToRgba; + exports.inertia = inertia; + exports.initPrefersReducedMotion = initPrefersReducedMotion; + exports.interpolate = interpolate; + exports.invisibleValues = invisibleValues; + exports.isAnimationControls = isAnimationControls; + exports.isCSSVariableName = isCSSVariableName; + exports.isCSSVariableToken = isCSSVariableToken; + exports.isControllingVariants = isControllingVariants; + exports.isDeltaZero = isDeltaZero; + exports.isDragActive = isDragActive; + exports.isDragging = isDragging; + exports.isElementKeyboardAccessible = isElementKeyboardAccessible; + exports.isElementTextInput = isElementTextInput; + exports.isForcedMotionValue = isForcedMotionValue; + exports.isGenerator = isGenerator; + exports.isHTMLElement = isHTMLElement; + exports.isKeyframesTarget = isKeyframesTarget; + exports.isMotionValue = isMotionValue; + exports.isNear = isNear; + exports.isNodeOrChild = isNodeOrChild; + exports.isPrimaryPointer = isPrimaryPointer; + exports.isSVGElement = isSVGElement; + exports.isSVGSVGElement = isSVGSVGElement; + exports.isSVGTag = isSVGTag; + exports.isTransitionDefined = isTransitionDefined; + exports.isVariantLabel = isVariantLabel; + exports.isVariantNode = isVariantNode; + exports.isWaapiSupportedEasing = isWaapiSupportedEasing; + exports.isWillChangeMotionValue = isWillChangeMotionValue; + exports.keyframes = keyframes; + exports.makeAnimationInstant = makeAnimationInstant; + exports.mapEasingToNativeEasing = mapEasingToNativeEasing; + exports.mapValue = mapValue; + exports.maxGeneratorDuration = maxGeneratorDuration; + exports.measurePageBox = measurePageBox; + exports.measureViewportBox = measureViewportBox; + exports.microtask = microtask; + exports.mix = mix; + exports.mixArray = mixArray; + exports.mixColor = mixColor; + exports.mixComplex = mixComplex; + exports.mixImmediate = mixImmediate; + exports.mixLinearColor = mixLinearColor; + exports.mixNumber = mixNumber$1; + exports.mixObject = mixObject; + exports.mixValues = mixValues; + exports.mixVisibility = mixVisibility; + exports.motionValue = motionValue; + exports.nodeGroup = nodeGroup; + exports.number = number; + exports.numberValueTypes = numberValueTypes; + exports.observeTimeline = observeTimeline; + exports.optimizedAppearDataAttribute = optimizedAppearDataAttribute; + exports.optimizedAppearDataId = optimizedAppearDataId; + exports.parseAnimateLayoutArgs = parseAnimateLayoutArgs; + exports.parseCSSVariable = parseCSSVariable; + exports.parseValueFromTransform = parseValueFromTransform; + exports.percent = percent; + exports.pixelsToPercent = pixelsToPercent; + exports.positionalKeys = positionalKeys; + exports.prefersReducedMotion = prefersReducedMotion; + exports.press = press; + exports.progressPercentage = progressPercentage; + exports.propEffect = propEffect; + exports.propagateDirtyNodes = propagateDirtyNodes; + exports.px = px; + exports.readTransformValue = readTransformValue; + exports.recordStats = recordStats; + exports.removeAxisDelta = removeAxisDelta; + exports.removeAxisTransforms = removeAxisTransforms; + exports.removeBoxTransforms = removeBoxTransforms; + exports.removePointDelta = removePointDelta; + exports.renderHTML = renderHTML; + exports.renderSVG = renderSVG; + exports.resize = resize; + exports.resolveElements = resolveElements; + exports.resolveMotionValue = resolveMotionValue; + exports.resolveTransition = resolveTransition; + exports.resolveVariant = resolveVariant; + exports.resolveVariantFromProps = resolveVariantFromProps; + exports.rgbUnit = rgbUnit; + exports.rgba = rgba; + exports.rootProjectionNode = rootProjectionNode; + exports.scale = scale; + exports.scaleCorrectors = scaleCorrectors; + exports.scalePoint = scalePoint; + exports.scrapeHTMLMotionValuesFromProps = scrapeMotionValuesFromProps$1; + exports.scrapeSVGMotionValuesFromProps = scrapeMotionValuesFromProps; + exports.setDragLock = setDragLock; + exports.setFeatureDefinitions = setFeatureDefinitions; + exports.setStyle = setStyle; + exports.setTarget = setTarget; + exports.spring = spring; + exports.springValue = springValue; + exports.stagger = stagger; + exports.startWaapiAnimation = startWaapiAnimation; + exports.statsBuffer = statsBuffer; + exports.styleEffect = styleEffect; + exports.supportedWaapiEasing = supportedWaapiEasing; + exports.supportsBrowserAnimation = supportsBrowserAnimation; + exports.supportsFlags = supportsFlags; + exports.supportsLinearEasing = supportsLinearEasing; + exports.supportsPartialKeyframes = supportsPartialKeyframes; + exports.supportsScrollTimeline = supportsScrollTimeline; + exports.svgEffect = svgEffect; + exports.sync = sync; + exports.testValueType = testValueType; + exports.time = time; + exports.transform = transform; + exports.transformAxis = transformAxis; + exports.transformBox = transformBox; + exports.transformBoxPoints = transformBoxPoints; + exports.transformPropOrder = transformPropOrder; + exports.transformProps = transformProps; + exports.transformValue = transformValue; + exports.transformValueTypes = transformValueTypes; + exports.translateAxis = translateAxis; + exports.updateMotionValuesFromProps = updateMotionValuesFromProps; + exports.variantPriorityOrder = variantPriorityOrder; + exports.variantProps = variantProps; + exports.vh = vh; + exports.visualElementStore = visualElementStore; + exports.vw = vw; + +})); diff --git a/node_modules/motion-dom/dist/motion-dom.js b/node_modules/motion-dom/dist/motion-dom.js new file mode 100644 index 00000000..013e2913 --- /dev/null +++ b/node_modules/motion-dom/dist/motion-dom.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],i={value:null,addProjectionMetrics:null};function s(t,s){let o=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>o=!0,c=n.reduce((t,e)=>(t[e]=function(t,e){let n=new Set,s=new Set,o=!1,r=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(e){a.has(e)&&(h.schedule(e),t()),c++,e(l)}const h={schedule:(t,e=!1,i=!1)=>{const r=i&&o?n:s;return e&&a.add(t),r.has(t)||r.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{l=t,o?r=!0:(o=!0,[n,s]=[s,n],n.forEach(u),e&&i.value&&i.value.frameloop[e].push(c),c=0,n.clear(),o=!1,r&&(r=!1,h.process(t)))}};return h}(l,s?e:void 0),t),{}),{setup:u,read:h,resolveKeyframes:d,preUpdate:p,update:m,preRender:f,render:y,postRender:g}=c,v=()=>{const n=e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now();o=!1,e.MotionGlobalConfig.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(n-a.timestamp,40),1)),a.timestamp=n,a.isProcessing=!0,u.process(a),h.process(a),d.process(a),p.process(a),m.process(a),f.process(a),y.process(a),g.process(a),a.isProcessing=!1,o&&s&&(r=!1,t(v))};return{schedule:n.reduce((e,n)=>{const i=c[n];return e[n]=(e,n=!1,s=!1)=>(o||(o=!0,r=!0,a.isProcessing||t(v)),i.schedule(e,n,s)),e},{}),cancel:t=>{for(let e=0;e(void 0===c&&h.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),c),set:t=>{c=t,queueMicrotask(u)}},d={layout:0,mainThread:0,waapi:0},p=t=>e=>"string"==typeof e&&e.startsWith(t),m=p("--"),f=p("var(--"),y=t=>!!f(t)&&g.test(t.split("/*")[0].trim()),g=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function v(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},T={...x,transform:t=>e.clamp(0,1,t)},w={...x,default:1},b=t=>Math.round(1e5*t)/1e5,S=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const V=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,A=(t,e)=>n=>Boolean("string"==typeof n&&V.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),P=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(S);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},M={...x,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},E={test:A("rgb","red"),parse:P("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+M.transform(t)+", "+M.transform(e)+", "+M.transform(n)+", "+b(T.transform(i))+")"};const D={test:A("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:E.transform},k=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),R=k("deg"),C=k("%"),B=k("px"),j=k("vh"),L=k("vw"),F=(()=>({...C,parse:t=>C.parse(t)/100,transform:t=>C.transform(100*t)}))(),O={test:A("hsl","hue"),parse:P("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+C.transform(b(e))+", "+C.transform(b(n))+", "+b(T.transform(i))+")"},I={test:t=>E.test(t)||D.test(t)||O.test(t),parse:t=>E.test(t)?E.parse(t):O.test(t)?O.parse(t):D.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?E.transform(t):O.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},U=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const N="number",$="color",W=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function K(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(W,t=>(I.test(t)?(i.color.push(o),s.push($),n.push(I.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(N),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function z(t){return K(t).values}function Y(t){const{split:e,types:n}=K(t),i=e.length;return t=>{let s="";for(let o=0;o"number"==typeof t?0:I.test(t)?I.getAnimatableNone(t):t;const G={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(S)?.length||0)+(t.match(U)?.length||0)>0},parse:z,createTransformer:Y,getAnimatableNone:function(t){const e=z(t);return Y(t)(e.map(X))}};function q(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function H({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=q(a,i,t+1/3),o=q(a,i,t),r=q(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Z(t,e){return n=>n>0?e:t}const _=(t,e,n)=>t+(e-t)*n,J=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Q=[D,E,O];function tt(t){const n=(i=t,Q.find(t=>t.test(i)));var i;if(e.warning(Boolean(n),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(t);return n===O&&(s=H(s)),s}const et=(t,e)=>{const n=tt(t),i=tt(e);if(!n||!i)return Z(t,e);const s={...n};return t=>(s.red=J(n.red,i.red,t),s.green=J(n.green,i.green,t),s.blue=J(n.blue,i.blue,t),s.alpha=_(n.alpha,i.alpha,t),E.transform(s))},nt=new Set(["none","hidden"]);function it(t,e){return nt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function st(t,e){return n=>_(t,e,n)}function ot(t){return"number"==typeof t?st:"string"==typeof t?y(t)?Z:I.test(t)?et:lt:Array.isArray(t)?rt:"object"==typeof t?I.test(t)?et:at:Z}function rt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>ot(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const lt=(t,n)=>{const i=G.createTransformer(n),s=K(t),o=K(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?nt.has(t)&&!o.values.length||nt.has(n)&&!s.values.length?it(t,n):e.pipe(rt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>o.update(e,t),stop:()=>r(e),now:()=>a.isProcessing?a.timestamp:h.now()}},ht=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e=dt?1/0:e}function mt(t,n=100,i){const s=i({...t,keyframes:[0,n]}),o=Math.min(pt(s),dt);return{type:"keyframes",ease:t=>s.next(o*t).value/n,duration:e.millisecondsToSeconds(o)}}function ft(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}const yt=100,gt=10,vt=1,xt=0,Tt=800,wt=.3,bt=.3,St={granular:.01,default:2},Vt={granular:.005,default:.5},At=.01,Pt=10,Mt=.05,Et=1,Dt=.001;function kt({duration:t=Tt,bounce:n=wt,velocity:i=xt,mass:s=vt}){let o,r;e.warning(t<=e.secondsToMilliseconds(Pt),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=e.clamp(Mt,Et,a),t=e.clamp(At,Pt,e.millisecondsToSeconds(t)),a<1?(o=e=>{const n=e*a,s=n*t,o=n-i,r=Ct(e,a),l=Math.exp(-s);return Dt-o/r*l},r=e=>{const n=e*a*t,s=n*i+i,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-n),c=Ct(Math.pow(e,2),a);return(-o(e)+Dt>0?-1:1)*((s-r)*l)/c}):(o=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,n){let i=n;for(let n=1;nvoid 0!==t[e])}function Ft(t=bt,n=wt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:s,restDelta:o}=i;const r=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let n={velocity:xt,stiffness:yt,damping:gt,mass:vt,isResolvedFromDuration:!1,...t};if(!Lt(t,jt)&&Lt(t,Bt))if(t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),o=s*s,r=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(o);n={...n,mass:vt,stiffness:o,damping:r}}else{const e=kt(t);n={...n,...e,mass:vt},n.isResolvedFromDuration=!0}return n}({...i,velocity:-e.millisecondsToSeconds(i.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(c*h)),g=a-r,v=e.millisecondsToSeconds(Math.sqrt(c/h)),x=Math.abs(g)<5;let T;if(s||(s=x?St.granular:St.default),o||(o=x?Vt.granular:Vt.default),y<1){const t=Ct(v,y);T=e=>{const n=Math.exp(-y*v*e);return a-n*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);T=e=>{const n=Math.exp(-y*v*e),i=Math.min(t*e,300);return a-n*((f+y*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const w={calculatedDuration:m&&d||null,next:t=>{const n=T(t);if(m)l.done=t>=d;else{let i=0===t?f:0;y<1&&(i=0===t?e.secondsToMilliseconds(f):ft(T,t,n));const r=Math.abs(i)<=s,c=Math.abs(a-n)<=o;l.done=r&&c}return l.value=l.done?a:n,l},toString:()=>{const t=Math.min(pt(w),dt),e=ht(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function Ot({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,w=Ft({keyframes:[d.value,p(d.value)],velocity:ft(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function It(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||ct,r=t.length-1;for(let i=0;i{if(a&&i1)for(;su(e.clamp(t[0],t[r-1],n)):u}function Ut(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(_(i,1,o))}}function Nt(t){const e=[0];return Ut(e,t.length-1),e}function $t(t,e){return t.map(t=>t*e)}function Wt(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Kt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),r={done:!1,value:n[0]},a=It($t(i&&i.length===n.length?i:Nt(n),t),n,{ease:Array.isArray(o)?o:Wt(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Ft.applyToOptions=t=>{const n=mt(t,100,Ft);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};const zt=t=>null!==t;function Yt(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(zt),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Xt={decay:Ot,inertia:Ot,tween:Kt,keyframes:Kt,spring:Ft};function Gt(t){"string"==typeof t.type&&(t.type=Xt[t.type])}class qt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ht=t=>t/100;class Zt extends qt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==h.now()&&this.tick(h.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},d.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Gt(t);const{type:n=Kt,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||Kt;l!==Kt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Ht,ct(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=pt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x=this.currentTime,T=i;if(h){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(T=r)),x=e.clamp(0,1,i)*a}const w=v?{done:!1,value:u[0]}:T.next(x);o&&(w.value=o(w.value));let{done:b}=w;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Ot&&(w.value=Yt(u,this.options,y,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(h.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ut,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(h.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,d.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function _t(t){for(let e=1;e180*t/Math.PI,Qt=t=>{const e=Jt(Math.atan2(t[1],t[0]));return ee(e)},te={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qt,rotateZ:Qt,skewX:t=>Jt(Math.atan(t[1])),skewY:t=>Jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ee=t=>((t%=360)<0&&(t+=360),t),ne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ie=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),se={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ne,scaleY:ie,scale:t=>(ne(t)+ie(t))/2,rotateX:t=>ee(Jt(Math.atan2(t[6],t[5]))),rotateY:t=>ee(Jt(Math.atan2(-t[2],t[0]))),rotateZ:Qt,rotate:Qt,skewX:t=>Jt(Math.atan(t[4])),skewY:t=>Jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function oe(t){return t.includes("scale")?1:0}function re(t,e){if(!t||"none"===t)return oe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=se,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=te,s=e}if(!s)return oe(e);const o=i[e],r=s[1].split(",").map(le);return"function"==typeof o?o(r):r[o]}const ae=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return re(n,e)};function le(t){return parseFloat(t.trim())}const ce=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ue=(()=>new Set(ce))(),he=t=>t===x||t===B,de=new Set(["x","y","z"]),pe=ce.filter(t=>!de.has(t));const me={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>re(e,"x"),y:(t,{transform:e})=>re(e,"y")};me.translateX=me.x,me.translateY=me.y;const fe=new Set;let ye=!1,ge=!1,ve=!1;function xe(){if(ge){const t=Array.from(fe).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return pe.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ge=!1,ye=!1,fe.forEach(t=>t.complete(ve)),fe.clear()}function Te(){fe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ge=!0)})}function we(){ve=!0,Te(),xe(),ve=!1}class be{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(fe.add(this),ye||(ye=!0,o.read(Te),o.resolveKeyframes(xe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}_t(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),fe.delete(this)}cancel(){"scheduled"===this.state&&(fe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Se=t=>t.startsWith("--");function Ve(t,e,n){Se(e)?t.style.setProperty(e,n):t.style[e]=n}const Ae={};function Pe(t,n){const i=e.memo(t);return()=>Ae[n]??i()}const Me=Pe(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ee=Pe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),De=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ke={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:De([0,.65,.55,1]),circOut:De([.55,0,1,.45]),backIn:De([.31,.01,.66,-.59]),backOut:De([.33,1.53,.69,.99])};function Re(t,n){return t?"function"==typeof t?Ee()?ht(t,n):"ease-out":e.isBezierDefinition(t)?De(t):Array.isArray(t)?t.map(t=>Re(t,n)||ke.easeOut):ke[t]:void 0}function Ce(t,e,n,{delay:s=0,duration:o=300,repeat:r=0,repeatType:a="loop",ease:l="easeOut",times:c}={},u=void 0){const h={[e]:n};c&&(h.offset=c);const p=Re(l,o);Array.isArray(p)&&(h.easing=p),i.value&&d.waapi++;const m={delay:s,duration:o,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(m.pseudoElement=u);const f=t.animate(h,m);return i.value&&f.finished.finally(()=>{d.waapi--}),f}function Be(t){return"function"==typeof t&&"applyToOptions"in t}function je({type:t,...e}){return Be(t)&&Ee()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Le extends qt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=je(t);this.animation=Ce(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Yt(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):Ve(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Me()?(this.animation.timeline=t,e.noop):n(this)}}const Fe={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Oe(t){"string"==typeof t.ease&&t.ease in Fe&&(t.ease=Fe[t.ease])}class Ie extends Le{constructor(t){Oe(t),Gt(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:o,...r}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const a=new Zt({...r,autoplay:!1}),l=Math.max(10,h.now()-this.startTime),c=e.clamp(0,10,l-10);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const Ue=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!G.test(t)&&"0"!==t||t.startsWith("url(")));function Ne(t){t.duration=0,t.type="keyframes"}const $e=new Set(["opacity","clipPath","filter","transform"]),We=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ke(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return We()&&n&&$e.has(n)&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class ze extends qt{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=h.now();const d={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},p=c?.KeyframeResolver||be;this.keyframeResolver=new p(r,(t,e,n)=>this.onKeyframesResolved(t,e,d,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=h.now(),function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=Ue(o,n),l=Ue(r,n);return e.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},p=!c&&Ke(d),m=d.motionValue?.owner?.current,f=p?new Ie({...d,element:m}):new Zt(d);f.finished.then(()=>{this.notifyFinished()}).catch(e.noop),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),we()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Ye{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Xe(this.animations,"duration")}get iterationDuration(){return Xe(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Xe(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Ge extends Le{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const qe=new WeakMap;function He(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const Ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _e(t){const e=Ze.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Je(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=_e(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return y(o)?Je(o,n,i+1):o}const Qe={type:"spring",stiffness:500,damping:25,restSpeed:10},tn={type:"keyframes",duration:.8},en={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nn=(t,{keyframes:e})=>e.length>2?tn:ue.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qe:en,sn=t=>null!==t;function on(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(sn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}function rn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function an(t,e){const n=t?.[e]??t?.default??t;return n!==t?rn(n,t):n}function ln({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const cn=(t,n,i,s={},r,a)=>l=>{const c=an(s,t)||{},u=c.delay||s.delay||0;let{elapsed:h=0}=s;h-=e.secondsToMilliseconds(u);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...c,delay:-h,onUpdate:t=>{n.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:t,motionValue:n,element:a?void 0:r};ln(c)||Object.assign(d,nn(t,d)),d.duration&&(d.duration=e.secondsToMilliseconds(d.duration)),d.repeatDelay&&(d.repeatDelay=e.secondsToMilliseconds(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(Ne(d),0===d.delay&&(p=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||r?.shouldSkipAnimations)&&(p=!0,Ne(d),d.delay=0),d.allowFlatten=!c.type&&!c.ease,p&&!a&&void 0!==n.get()){const t=on(d.keyframes,c);if(void 0!==t)return void o.update(()=>{d.onUpdate(t),d.onComplete()})}return c.isSync?new Zt(d):new ze(d)};function un(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function hn(t,e,n,i){if("function"==typeof e){const[s,o]=un(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=un(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function dn(t,e,n){const i=t.getProps();return hn(i,e,void 0!==n?n:i.custom,t)}const pn=new Set(["width","height","top","left","right","bottom",...ce]),mn={current:void 0};class fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=h.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=h.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new e.SubscriptionManager);const i=this.events[t].add(n);return"change"===t?()=>{i(),o.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return mn.current&&mn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=h.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yn(t,e){return new fn(t,e)}const gn=t=>Array.isArray(t);function vn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yn(n))}function xn(t){return gn(t)?t[t.length-1]||0:t}function Tn(t,e){const n=dn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){vn(t,e,xn(o[e]))}}const wn=t=>Boolean(t&&t.getVelocity);function bn(t){return Boolean(wn(t)&&t.add)}function Sn(t,n){const i=t.getValue("willChange");if(bn(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function Vn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const An="framerAppearId",Pn="data-"+Vn(An);function Mn(t){return t.props[Pn]}function En({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Dn(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:a,...l}=e;const c=t.getDefaultTransition();r=r?rn(r,c):c;const u=r?.reduceMotion;i&&(r=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,t.latestValues[e]??null),s=l[e];if(void 0===s||d&&En(d,e))continue;const a={delay:n,...an(r||{},e)},c=i.get();if(void 0!==c&&!i.isAnimating&&!Array.isArray(s)&&s===c&&!a.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const n=Mn(t);if(n){const t=window.MotionHandoffAnimation(n,e,o);null!==t&&(a.startTime=t,p=!0)}}Sn(t,e);const m=u??t.shouldReduceMotion;i.start(cn(e,i,s,m&&pn.has(e)?{type:!1}:a,t,p));const f=i.animation;f&&h.push(f)}if(a){const e=()=>o.update(()=>{a&&Tn(t,a)});h.length?Promise.all(h).then(e):e()}return h}function kn(t,e,n={}){const i=dn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Dn(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(kn(l,e,{...r,delay:n+("function"==typeof i?0:i)+He(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function Rn(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>kn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=kn(t,e,n);else{const s="function"==typeof e?dn(t,e,n.custom):e;i=Promise.all(Dn(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Cn=t=>e=>e.test(t),Bn=[x,B,C,R,L,j,{test:t=>"auto"===t,parse:t=>t}],jn=t=>Bn.find(Cn(t));function Ln(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const Fn=new Set(["brightness","contrast","saturate","opacity"]);function On(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(S)||[];if(!i)return t;const s=n.replace(i,"");let o=Fn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const In=/\b([a-z-]*)\(.*?\)/gu,Un={...G,getAnimatableNone:t=>{const e=t.match(In);return e?e.map(On).join(" "):t}},Nn={...G,getAnimatableNone:t=>{const e=G.parse(t);return G.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},$n={...x,transform:Math.round},Wn={rotate:R,rotateX:R,rotateY:R,rotateZ:R,scale:w,scaleX:w,scaleY:w,scaleZ:w,skew:R,skewX:R,skewY:R,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:T,originX:F,originY:F,originZ:B},Kn={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...Wn,zIndex:$n,fillOpacity:T,strokeOpacity:T,numOctaves:$n},zn={...Kn,color:I,backgroundColor:I,outlineColor:I,fill:I,stroke:I,borderColor:I,borderTopColor:I,borderRightColor:I,borderBottomColor:I,borderLeftColor:I,filter:Un,WebkitFilter:Un,mask:Nn,WebkitMask:Nn},Yn=t=>zn[t],Xn=new Set([Un,Nn]);function Gn(t,e){let n=Yn(t);return Xn.has(n)||(n=G),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const qn=new Set(["auto","none","0"]);class Hn extends be{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Zn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);const _n=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Jn=new Set(["opacity","clipPath","filter","transform"]);function Qn(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function ti(t){return(e,n)=>{const i=Qn(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const ei=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ni{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const i=e.get();this.latest[t]=s?ei(i,Kn[t]):i,n&&o.render(n)};l();const c=e.on("change",l);i&&e.addDependent(i);const u=()=>{c(),n&&r(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:u}),u}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function ii(t){const e=new WeakMap,n=[];return(i,s)=>{const o=e.get(i)??new ni;e.set(i,o);for(const e in s){const r=s[e],a=t(i,o,e,r);n.push(a)}return()=>{for(const t of n)t()}}}const si=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),o=s?n:n.startsWith("data")||n.startsWith("aria")?Vn(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},oi=ti(ii(si)),ri=ii((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function ai(t){return e.isObject(t)&&"offsetHeight"in t}const li={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const ci=new Set(["originX","originY","originZ"]),ui=(t,e,n,i)=>{let s,o;return ue.has(n)?(e.get("transform")||(ai(t)||e.get("transformBox")||ui(t,e,"transformBox",new fn("fill-box")),e.set("transform",new fn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Se(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},hi=ti(ii(ui));const di=ti(ii((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return o.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new fn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return si(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?ui:si)(t,e,n,i)}));const{schedule:pi,cancel:mi}=s(queueMicrotask,!1),fi={x:!1,y:!1};function yi(){return fi.x||fi.y}function gi(t,e){const n=Qn(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const vi=(t,e)=>!!e&&(t===e||vi(t,e.parentElement)),xi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ti=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wi(t){return Ti.has(t.tagName)||!0===t.isContentEditable}const bi=new Set(["INPUT","SELECT","TEXTAREA"]);const Si=new WeakSet;function Vi(t){return e=>{"Enter"===e.key&&t(e)}}function Ai(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Pi(t){return xi(t)&&!yi()}const Mi=new WeakSet;function Ei(t){return e.isObject(t)&&"ownerSVGElement"in t}const Di=new WeakMap;let ki;const Ri=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ei(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ci=Ri("inline","width","offsetWidth"),Bi=Ri("block","height","offsetHeight");function ji({target:t,borderBoxSize:e}){Di.get(t)?.forEach(n=>{n(t,{get width(){return Ci(t,e)},get height(){return Bi(t,e)}})})}function Li(t){t.forEach(ji)}function Fi(t,e){ki||"undefined"!=typeof ResizeObserver&&(ki=new ResizeObserver(Li));const n=Qn(t);return n.forEach(t=>{let n=Di.get(t);n||(n=new Set,Di.set(t,n)),n.add(e),ki?.observe(t)}),()=>{n.forEach(t=>{const n=Di.get(t);n?.delete(e),n?.size||ki?.unobserve(t)})}}const Oi=new Set;let Ii;function Ui(t){return Oi.add(t),Ii||(Ii=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Oi.forEach(e=>e(t))},window.addEventListener("resize",Ii)),()=>{Oi.delete(t),Oi.size||"function"!=typeof Ii||(window.removeEventListener("resize",Ii),Ii=void 0)}}function Ni(){const{value:t}=i;null!==t?(t.frameloop.rate.push(a.delta),t.animations.mainThread.push(d.mainThread),t.animations.waapi.push(d.waapi),t.animations.layout.push(d.layout)):r(Ni)}function $i(t){return t.reduce((t,e)=>t+e,0)/t.length}function Wi(t,e=$i){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Ki=t=>Math.round(1e3/t);function zi(){i.value=null,i.addProjectionMetrics=null}function Yi(){const{value:t}=i;if(!t)throw new Error("Stats are not being measured");zi(),r(Ni);const e={frameloop:{setup:Wi(t.frameloop.setup),rate:Wi(t.frameloop.rate),read:Wi(t.frameloop.read),resolveKeyframes:Wi(t.frameloop.resolveKeyframes),preUpdate:Wi(t.frameloop.preUpdate),update:Wi(t.frameloop.update),preRender:Wi(t.frameloop.preRender),render:Wi(t.frameloop.render),postRender:Wi(t.frameloop.postRender)},animations:{mainThread:Wi(t.animations.mainThread),waapi:Wi(t.animations.waapi),layout:Wi(t.animations.layout)},layoutProjection:{nodes:Wi(t.layoutProjection.nodes),calculatedTargetDeltas:Wi(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:Wi(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Ki(n.min),n.max=Ki(n.max),n.avg=Ki(n.avg),[n.min,n.max]=[n.max,n.min],e}function Xi(t){return Ei(t)&&"svg"===t.tagName}function Gi(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function qi(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=It(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function Hi(t,e){const n=yn(wn(t)?t.get():t);return Zi(n,t,e),n}function Zi(t,e,n={}){const i=t.get();let s,r=null,a=i;const l="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,c=()=>{r&&(r.stop(),r=null)};if(t.attach((e,i)=>{a=e,s=t=>i(_i(t,l)),o.postRender(()=>{(()=>{c();const e=Ji(t.get()),i=Ji(a);e!==i&&(r=new Zt({keyframes:[e,i],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}))})(),t.events.animationStart?.notify(),r?.then(()=>{t.events.animationComplete?.notify()})})},c),wn(e)){const n=e.on("change",e=>t.set(_i(e,l))),i=t.on("destroy",n);return()=>{n(),i()}}return c}function _i(t,e){return e?t+e:t}function Ji(t){return"number"==typeof t?t:parseFloat(t)}function Qi(t){const e=[];mn.current=e;const n=t();mn.current=void 0;const i=yn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>o.preRender(i,!1,!0),a=t.map(t=>t.on("change",s));e.on("destroy",()=>{a.forEach(t=>t()),r(i)})}(e,i,t),i}const ts=[...Bn,I,G],es=t=>ts.find(Cn(t));function ns(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let is={},ss=null;const os=(t,e)=>{is[t]=e},rs=()=>{ss||(ss=document.createElement("style"),ss.id="motion-view");let t="";for(const e in is){const n=is[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}ss.textContent=t,document.head.appendChild(ss),is={}},as=()=>{ss&&ss.parentElement&&ss.parentElement.removeChild(ss)};function ls(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function cs(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function us(){return document.getAnimations().filter(cs)}const hs=["layout","enter","exit","new","old"];function ds(t){const{update:n,targets:i,options:s}=t;if(!document.startViewTransition)return new Promise(async t=>{await n(),t(new Ye([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||os(":root",{"view-transition-name":"none"}),os("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),rs();const o=document.startViewTransition(async()=>{await n()});return o.finished.finally(()=>{as()}),new Promise(t=>{o.ready.then(()=>{const n=us(),o=[];i.forEach((t,n)=>{for(const i of hs){if(!t[i])continue;const{keyframes:r,options:a}=t[i];for(let[t,l]of Object.entries(r)){if(!l)continue;const r={...an(s,t),...an(a,t)},c=ns(i);if("opacity"===t&&!Array.isArray(l)){l=["new"===c?0:1,l]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r.delay&&(r.delay=e.secondsToMilliseconds(r.delay));const u=new Le({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${c}(${n})`,keyframes:l});o.push(u)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=ls(r);if(!a)continue;const l=i.get(a.layer);if(l)ps(l,"enter")&&ps(l,"exit")&&n.getKeyframes().some(t=>t.mixBlendMode)?o.push(new Ge(t)):t.cancel();else{const i="group"===a.type?"layout":"";let r={...an(s,i)};r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r=je(r);const l=Re(r.ease,r.duration);n.updateTiming({delay:e.secondsToMilliseconds(r.delay??0),duration:r.duration,easing:l}),o.push(new Ge(t))}}t(new Ye(o))})})}function ps(t,e){return t?.[e]?.keyframes.opacity}let ms=[],fs=null;function ys(){fs=null;const[t]=ms;var n;t&&(n=t,e.removeItem(ms,n),fs=n,ds(n).then(t=>{n.notifyReady(t),t.finished.finally(ys)}))}function gs(){for(let t=ms.length-1;t>=0;t--){const e=ms[t],{interrupt:n}=e.options;if("immediate"===n){const n=ms.slice(0,t+1).map(t=>t.update),i=ms.slice(t+1);e.update=()=>{n.forEach(t=>t())},ms=[e,...i];break}}fs&&"immediate"!==ms[0]?.options.interrupt||ys()}class vs{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.notifyReady=e.noop,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...n},i=this,ms.push(i),pi.render(gs)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const xs=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ts=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),ws=()=>({min:0,max:0}),bs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ss=new WeakMap;function Vs(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function As(t){return"string"==typeof t||Array.isArray(t)}const Ps=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ms=["initial",...Ps];function Es(t){return Vs(t.animate)||Ms.some(e=>As(t[e]))}function Ds(t){return Boolean(Es(t)||t.variants)}function ks(t,e,n){for(const i in e){const s=e[i],o=n[i];if(wn(s))t.addValue(i,s);else if(wn(o))t.addValue(i,yn(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,yn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Rs={current:null},Cs={current:!1},Bs="undefined"!=typeof window;function js(){if(Cs.current=!0,Bs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Rs.current=t.matches;t.addEventListener("change",e),e()}else Rs.current=!1}const Ls=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Fs={};class Os{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=be,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=h.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Cs.current||js(),this.shouldReduceMotion=Rs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),r(this.notifyUpdate),r(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Jn.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new Le({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=ue.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&o.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Fs){const e=Fs[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=yn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):!es(i)&&G.test(n)&&(i=Gn(t,n)),this.setBaseTarget(t,wn(i)?i.get():i)),wn(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=hn(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||wn(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){pi.render(this.render)}}class Is extends Os{constructor(){super(...arguments),this.KeyframeResolver=Hn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;wn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Us({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ns(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function $s(t){return void 0===t||1===t}function Ws({scale:t,scaleX:e,scaleY:n}){return!$s(t)||!$s(e)||!$s(n)}function Ks(t){return Ws(t)||zs(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function zs(t){return Ys(t.x)||Ys(t.y)}function Ys(t){return t&&"0%"!==t}function Xs(t,e,n){return n+e*(t-n)}function Gs(t,e,n,i,s){return void 0!==s&&(t=Xs(t,s,i)),Xs(t,n,i)+e}function qs(t,e=0,n=1,i,s){t.min=Gs(t.min,e,n,i,s),t.max=Gs(t.max,e,n,i,s)}function Hs(t,{x:e,y:n}){qs(t.x,e.translate,e.scale,e.originPoint),qs(t.y,n.translate,n.scale,n.originPoint)}const Zs=.999999999999,_s=1.0000000000001;function Js(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;aZs&&(e.x=1),e.y<_s&&e.y>Zs&&(e.y=1)}function Qs(t,e){t.min=t.min+e,t.max=t.max+e}function to(t,e,n,i,s=.5){qs(t,e,n,_(t.min,t.max,s),i)}function eo(t,e){to(t.x,e.x,e.scaleX,e.scale,e.originX),to(t.y,e.y,e.scaleY,e.scale,e.originY)}function no(t,e){return Us(Ns(t.getBoundingClientRect(),e))}const io={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},so=ce.length;function oo(t,e,n){let i="",s=!0;for(let o=0;o{if(!e.target)return t;if("string"==typeof t){if(!B.test(t))return t;t=parseFloat(t)}return`${lo(t,e.target.x)}% ${lo(t,e.target.y)}%`}},uo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=G.parse(t);if(s.length>5)return i;const o=G.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=_(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},ho={borderRadius:{...co,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:co,borderTopRightRadius:co,borderBottomLeftRadius:co,borderBottomRightRadius:co,boxShadow:uo};function po(t,{layout:e,layoutId:n}){return ue.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ho[t]||"opacity"===t)}function mo(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(wn(i[e])||s&&wn(s[e])||po(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class fo extends Is{constructor(){super(...arguments),this.type="html",this.renderInstance=ao}readValueFromInstance(t,e){if(ue.has(e))return this.projection?.isProjecting?oe(e):ae(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(m(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return no(t,e)}build(t,e,n){ro(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return mo(t,e,n)}}const yo={offset:"stroke-dashoffset",array:"stroke-dasharray"},go={offset:"strokeDashoffset",array:"strokeDasharray"};function vo(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?yo:go;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const xo=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function To(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(ro(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const t of xo)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&vo(h,s,o,r,!1)}const wo=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),bo=t=>"string"==typeof t&&"svg"===t.toLowerCase();function So(t,e,n,i){ao(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(wo.has(n)?n:Vn(n),e.attrs[n])}function Vo(t,e,n){const i=mo(t,e,n);for(const n in t)if(wn(t[n])||wn(e[n])){i[-1!==ce.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Ao=Ms.length;function Po(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Po(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Uo(t,e,n,i){Io(t.x,e.x,n.x,i?i.originX:void 0),Io(t.y,e.y,n.y,i?i.originY:void 0)}function No(t,e,n){t.min=n.min+e.min,t.max=t.min+Fo(e)}function $o(t,e,n){No(t.x,e.x,n.x),No(t.y,e.y,n.y)}function Wo(t,e,n){t.min=e.min-n.min,t.max=t.min+Fo(e)}function Ko(t,e,n){Wo(t.x,e.x,n.x),Wo(t.y,e.y,n.y)}function zo(t,e,n,i,s){return t=Xs(t-=e,1/n,i),void 0!==s&&(t=Xs(t,1/s,i)),t}function Yo(t,e=0,n=1,i=.5,s,o=t,r=t){if(C.test(e)){e=parseFloat(e);e=_(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=_(o.min,o.max,i);t===o&&(a-=e),t.min=zo(t.min,e,n,a,s),t.max=zo(t.max,e,n,a,s)}function Xo(t,e,[n,i,s],o,r){Yo(t,e[n],e[i],e[s],e.scale,o,r)}const Go=["x","scaleX","originX"],qo=["y","scaleY","originY"];function Ho(t,e,n,i){Xo(t.x,e,Go,n?n.x:void 0,i?i.x:void 0),Xo(t.y,e,qo,n?n.y:void 0,i?i.y:void 0)}function Zo(t){return 0===t.translate&&1===t.scale}function _o(t){return Zo(t.x)&&Zo(t.y)}function Jo(t,e){return t.min===e.min&&t.max===e.max}function Qo(t,e){return Jo(t.x,e.x)&&Jo(t.y,e.y)}function tr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function er(t,e){return tr(t.x,e.x)&&tr(t.y,e.y)}function nr(t){return Fo(t.x)/Fo(t.y)}function ir(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function sr(t){return[t("x"),t("y")]}function or(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const rr=["TopLeft","TopRight","BottomLeft","BottomRight"],ar=rr.length,lr=t=>"string"==typeof t?parseFloat(t):t,cr=t=>"number"==typeof t||B.test(t);function ur(t,e,n,i,s,o){s?(t.opacity=_(0,n.opacity??1,dr(i)),t.opacityExit=_(e.opacity??1,0,pr(i))):o&&(t.opacity=_(e.opacity??1,n.opacity??1,i));for(let s=0;ssn?1:i(e.progress(t,n,s))}function fr(t,e,n){const i=wn(t)?t:yn(t);return i.start(cn("",i,e,n)),i.animation}function yr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const gr=(t,e)=>t.depth-e.depth;class vr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gr),this.isDirty=!1,this.children.forEach(t)}}function xr(t,e){const n=h.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(r(i),t(o-e))};return o.setup(i,!0),()=>r(i)}function Tr(t){return wn(t)?t.get():t}class wr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1===s.isConnected&&!1!==i.isPresent&&!i.snapshot&&e.removeItem(this.members,i)}t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t],i=e.instance;if(!1!==e.isPresent&&(!i||!1!==i.isConnected)){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender();const i=n.options.layoutDependency,s=t.options.layoutDependency;if(!(void 0!==i&&void 0!==s&&i===s)){const i=n.instance;i&&!1===i.isConnected&&!n.snapshot||(t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:o}=t.options;!1===o&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const br={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Vr=["","X","Y","Z"];let Ar=0;function Pr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Mr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Mn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",o,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Mr(i)}function Er({attachResizeListener:t,defaultParent:n,measureScroll:s,checkIsScrollRoot:c,resetTransform:u}){return class{constructor(t={},e=n?.()){this.id=Ar++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,i.value&&(Sr.nodes=Sr.calculatedTargetDeltas=Sr.calculatedProjections=0),this.nodes.forEach(Rr),this.nodes.forEach(Ir),this.nodes.forEach(Ur),this.nodes.forEach(Cr),i.addProjectionMetrics&&i.addProjectionMetrics(Sr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;o.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=xr(s,250),br.hasAnimatedSinceResize&&(br.hasAnimatedSinceResize=!1,this.nodes.forEach(Or)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Yr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!er(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...an(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||Or(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),r(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Nr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Mr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Fo(this.snapshot.measuredBox.x)||Fo(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t{const n=e/1e3;var l,d,p,m;Wr(o.x,t.x,n),Wr(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ko(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=n,Kr(l.x,d.x,p.x,m),Kr(l.y,d.y,p.y,m),h&&Qo(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),jo(h,this.relativeTarget)),a&&(this.animationValues=s,ur(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(r(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=o.update(()=>{br.hasAnimatedSinceResize=!0,d.layout++,this.motionValue||(this.motionValue=yn(0)),this.motionValue.jump(0,!1),this.currentAnimation=fr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{d.layout--},onComplete:()=>{d.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Hr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Fo(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Fo(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}jo(e,n),eo(e,s),Uo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new wr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Pr("z",t,i,this.animationValues);for(let e=0;et.currentAnimation?.stop()),this.root.nodes.forEach(jr),this.root.sharedNodes.clear()}}}function Dr(t){t.updateLayout()}function kr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?sr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Fo(i);i.min=n[t].min,i.max=i.min+s}):Hr(s,e.layoutBox,n)&&sr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Fo(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Uo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Uo(a,t.applyTransform(i,!0),e.measuredBox):Uo(a,n,e.layoutBox);const l=!_o(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ko(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ko(a,n,o.layoutBox),er(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Rr(t){i.value&&Sr.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Cr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Br(t){t.clearSnapshot()}function jr(t){t.clearMeasurements()}function Lr(t){t.isLayoutDirty=!1}function Fr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Or(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ir(t){t.resolveTargetDelta()}function Ur(t){t.calcProjection()}function Nr(t){t.resetSkewAndRotation()}function $r(t){t.removeLeadSnapshot()}function Wr(t,e,n){t.translate=_(e.translate,0,n),t.scale=_(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Kr(t,e,n,i){t.min=_(e.min,n.min,i),t.max=_(e.max,n.max,i)}function zr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Yr={duration:.45,ease:[.4,0,.1,1]},Xr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gr=Xr("applewebkit/")&&!Xr("chrome/")?Math.round:e.noop;function qr(t){t.min=Gr(t.min),t.max=Gr(t.max)}function Hr(t,e,n){return"position"===t||"preserve-aspect"===t&&!Oo(nr(e),nr(n),.2)}function Zr(t){return t!==t.root&&t.scroll?.wasRoot}const _r=Er({attachResizeListener:(t,e)=>yr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Jr=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Qr={current:void 0},ta=Er({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Qr.current){const t=new _r({});t.mount(window),t.setOptions({layoutScroll:!0}),Qr.current=t}return Qr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ea="[data-layout], [data-layout-id]",na=()=>{};function ia(t){const e=Array.from(t.querySelectorAll(ea));return t instanceof Element&&t.matches(ea)&&(e.includes(t)||e.unshift(t)),e}function sa(t){const e=t.getAttribute("data-layout-id")||void 0,n=t.getAttribute("data-layout");let i;return""===n||"true"===n?i=!0:n&&(i=n),{layout:i,layoutId:e}}function oa(t,e,n){const i=Ss.get(t),s=i??new fo({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0});return i&&s.projection||(s.projection=new ta(s.latestValues,e)),s.projection.setOptions({...n,visualElement:s}),s.current?s.projection.instance||s.projection.mount(t):s.mount(t),i||Ss.set(t,s),{element:t,visualElement:s,projection:s.projection}}function ra(t,e,n){let i=t.parentElement;for(;i;){const t=e.get(i);if(t)return t;if(i===n)break;i=i.parentElement}}const aa=o,la=n.reduce((t,e)=>(t[e]=t=>r(t),t),{});t.AsyncMotionValueAnimation=ze,t.DOMKeyframesResolver=Hn,t.DOMVisualElement=Is,t.DocumentProjectionNode=_r,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=vr,t.GroupAnimation=Ye,t.GroupAnimationWithThen=class extends Ye{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=ta,t.HTMLVisualElement=fo,t.JSAnimation=Zt,t.KeyframeResolver=be,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.sharedTransitions=new Map,this.notifyReady=na,this.rejectReady=na,this.scope=t,this.updateDom=e,this.defaultOptions=n,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),o.postRender(()=>{this.start().then(this.notifyReady).catch(this.rejectReady)})}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}async start(){const t=ia(this.scope),e=this.buildRecords(t);e.forEach(({projection:t})=>{const e=Boolean(t.currentAnimation),n=Boolean(t.options.layoutId);if(e&&n){const e=function(t){const e=t.targetWithTransforms||t.target;if(!e)return;const n={x:{min:0,max:0},y:{min:0,max:0}},i={x:{min:0,max:0},y:{min:0,max:0}};return jo(n,e),jo(i,e),{animationId:t.root?.animationId??0,measuredBox:n,layoutBox:i,latestValues:t.animationValues||t.latestValues||{},source:t.id}}(t);e?t.snapshot=e:t.snapshot&&(t.snapshot=void 0)}else t.snapshot&&(t.currentAnimation||t.isProjecting())&&(t.snapshot=void 0);t.isPresent=!0,t.willUpdate()}),await this.updateDom();const n=ia(this.scope),i=this.buildRecords(n);this.handleExitingElements(e,i),i.forEach(({projection:t})=>{const e=t.instance,n=t.resumeFrom?.instance;if(!e||!n)return;if(!("style"in e))return;const i=e.style.transform,s=n.style.transform;i&&s&&i===s&&(e.style.transform="",e.style.transformOrigin="")}),i.forEach(({projection:t})=>{t.isPresent=!0});const s=function(t,e){const n=t[0]||e[0];return n?.projection.root}(i,e);s?.didUpdate(),await new Promise(t=>{o.postRender(()=>t())});const r=function(t){const e=new Set;return t.forEach(t=>{const n=t.projection.currentAnimation;n&&e.add(n)}),Array.from(e)}(i);return new Ye(r)}buildRecords(t){const e=[],n=new Map;for(const i of t){const t=ra(i,n,this.scope),{layout:s,layoutId:o}=sa(i),r=(o?this.sharedTransitions.get(o):void 0)||this.defaultOptions,a=oa(i,t?.projection,{layout:s,layoutId:o,animationType:"string"==typeof s?s:"both",transition:r});n.set(i,a),e.push(a)}return e}handleExitingElements(t,e){const n=new Set(e.map(t=>t.element));t.forEach(t=>{n.has(t.element)||(t.projection.options.layoutId&&(t.projection.isPresent=!1,t.projection.relegate()),t.visualElement.unmount(),Ss.delete(t.element))});const i=new Set(t.map(t=>t.element));e.forEach(({element:t,projection:e})=>{i.has(t)&&e.resumeFrom&&!e.resumeFrom.instance&&!e.isLead()&&(e.resumeFrom=void 0,e.snapshot=void 0)})}},t.MotionValue=fn,t.NativeAnimation=Le,t.NativeAnimationExtended=Ie,t.NativeAnimationWrapper=Ge,t.NodeStack=wr,t.ObjectVisualElement=class extends Os{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.SVGVisualElement=class extends Is{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ue.has(e)){const t=Yn(e);return t&&t.default||0}return e=wo.has(e)?e:Vn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Vo(t,e,n)}build(t,e,n){To(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){So(t,e,0,i)}mount(t){this.isSVGTag=bo(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=vs,t.VisualElement=Os,t.acceleratedValues=Jn,t.activeAnimations=d,t.addAttrValue=si,t.addDomEvent=yr,t.addScaleCorrector=function(t){for(const e in t)ho[e]=t[e],m(e)&&(ho[e].isCSSVariable=!0)},t.addStyleValue=ui,t.addValueToWillChange=Sn,t.alpha=T,t.analyseComplexValue=K,t.animateMotionValue=cn,t.animateSingleValue=fr,t.animateTarget=Dn,t.animateValue=function(t){return new Zt(t)},t.animateVariant=kn,t.animateView=function(t,e={}){return new vs(t,e)},t.animateVisualElement=Rn,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=qs,t.applyBoxDelta=Hs,t.applyGeneratorOptions=je,t.applyPointDelta=Gs,t.applyPxDefaults=function(t,e){for(let n=0;nPromise.all(e.map(({animation:e,options:n})=>Rn(t,e,n)))}(t),n=Co(),i=!0;const s=e=>(n,i)=>{const s=dn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=Po(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;eh&&f,T=!1;const w=Array.isArray(m)?m:[m];let b=w.reduce(s(d),{});!1===y&&(b={});const{prevResolvedValues:S={}}=p,V={...S,...b},A=e=>{x=!0,c.has(e)&&(T=!0,c.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in V){const e=b[t],n=S[t];if(u.hasOwnProperty(t))continue;let i=!1;i=gn(e)&&gn(n)?!Mo(e,n):e!==n,i?null!=e?A(t):c.add(t):void 0!==e&&c.has(t)?A(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=b,p.isActive&&(u={...u,...b}),i&&t.blockInitialAnimation&&(x=!1);const P=g&&v;x&&(!P||T)&&l.push(...w.map(e=>{const n={type:d};if("string"==typeof e&&i&&!P&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=dn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=He(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof r.initial){const n=dn(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Co()}}},t.createAxis=ws,t.createAxisDelta=xs,t.createBox=bs,t.createDelta=Ts,t.createGeneratorEasing=mt,t.createProjectionNode=Er,t.createRenderBatcher=s,t.cubicBezierAsString=De,t.defaultEasing=Wt,t.defaultOffset=Nt,t.defaultTransformValue=oe,t.defaultValueTypes=zn,t.degrees=R,t.delay=xr,t.delayInSeconds=function(t,n){return xr(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=Bn,t.eachAxis=sr,t.fillOffset=Ut,t.fillWildcards=_t,t.findDimensionValueType=jn,t.findValueType=es,t.flushKeyframeResolvers=we,t.followValue=Hi,t.frame=o,t.frameData=a,t.frameSteps=l,t.generateLinearEasing=ht,t.getAnimatableNone=Gn,t.getAnimationMap=function(t){const e=qe.get(t)||new Map;return qe.set(t,e),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return Se(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=nn,t.getDefaultValueType=Yn,t.getFeatureDefinitions=function(){return Fs},t.getFinalKeyframe=on,t.getMixer=ot,t.getOptimisedAppearId=Mn,t.getOriginIndex=Gi,t.getValueAsType=ei,t.getValueTransition=an,t.getVariableValue=Je,t.getVariantContext=Po,t.getViewAnimationLayerInfo=ls,t.getViewAnimations=us,t.globalProjectionState=br,t.has2DTranslate=zs,t.hasReducedMotionListener=Cs,t.hasScale=Ws,t.hasTransform=Ks,t.hex=D,t.hover=function(t,e,n={}){const[i,s,o]=gi(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||yi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=O,t.hslaToRgba=H,t.inertia=Ot,t.initPrefersReducedMotion=js,t.interpolate=It,t.invisibleValues=nt,t.isAnimationControls=Vs,t.isCSSVariableName=m,t.isCSSVariableToken=y,t.isControllingVariants=Es,t.isDeltaZero=_o,t.isDragActive=yi,t.isDragging=fi,t.isElementKeyboardAccessible=wi,t.isElementTextInput=function(t){return bi.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=po,t.isGenerator=Be,t.isHTMLElement=ai,t.isKeyframesTarget=gn,t.isMotionValue=wn,t.isNear=Oo,t.isNodeOrChild=vi,t.isPrimaryPointer=xi,t.isSVGElement=Ei,t.isSVGSVGElement=Xi,t.isSVGTag=bo,t.isTransitionDefined=ln,t.isVariantLabel=As,t.isVariantNode=Ds,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&Ee()||!n||"string"==typeof n&&(n in ke||Ee())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=bn,t.keyframes=Kt,t.makeAnimationInstant=Ne,t.mapEasingToNativeEasing=Re,t.mapValue=function(t,e,n,i){const s=qi(e,n,i);return Qi(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,n){const i=no(t,n),{scroll:s}=e;return s&&(Qs(i.x,s.offset.x),Qs(i.y,s.offset.y)),i},t.measureViewportBox=no,t.microtask=pi,t.mix=ct,t.mixArray=rt,t.mixColor=et,t.mixComplex=lt,t.mixImmediate=Z,t.mixLinearColor=J,t.mixNumber=_,t.mixObject=at,t.mixValues=ur,t.mixVisibility=it,t.motionValue=yn,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Jr);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=x,t.numberValueTypes=Kn,t.observeTimeline=function(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return o.preUpdate(i,!0),()=>r(i)},t.optimizedAppearDataAttribute=Pn,t.optimizedAppearDataId=An,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:Qn(t)[0]||document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=_e,t.parseValueFromTransform=re,t.percent=C,t.pixelsToPercent=lo,t.positionalKeys=pn,t.prefersReducedMotion=Rs,t.press=function(t,e,n={}){const[i,s,o]=gi(t,n),r=t=>{const i=t.currentTarget;if(!Pi(t))return;if(Mi.has(t))return;Si.add(i),n.stopPropagation&&Mi.add(t);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Si.has(i)&&Si.delete(i),Pi(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||vi(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ai(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Vi(()=>{if(Si.has(n))return;Ai(n,"down");const t=Vi(()=>{Ai(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ai(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),wi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=F,t.propEffect=ri,t.propagateDirtyNodes=Rr,t.px=B,t.readTransformValue=ae,t.recordStats=function(){if(i.value)throw zi(),new Error("Stats are already being measured");const t=i;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},o.postRender(Ni,!0),Yi},t.removeAxisDelta=Yo,t.removeAxisTransforms=Xo,t.removeBoxTransforms=Ho,t.removePointDelta=zo,t.renderHTML=ao,t.renderSVG=So,t.resize=function(t,e){return"function"==typeof t?Ui(t):Fi(t,e)},t.resolveElements=Qn,t.resolveMotionValue=Tr,t.resolveTransition=rn,t.resolveVariant=dn,t.resolveVariantFromProps=hn,t.rgbUnit=M,t.rgba=E,t.rootProjectionNode=Qr,t.scale=w,t.scaleCorrectors=ho,t.scalePoint=Xs,t.scrapeHTMLMotionValuesFromProps=mo,t.scrapeSVGMotionValuesFromProps=Vo,t.setDragLock=function(t){return"x"===t||"y"===t?fi[t]?null:(fi[t]=!0,()=>{fi[t]=!1}):fi.x||fi.y?null:(fi.x=fi.y=!0,()=>{fi.x=fi.y=!1})},t.setFeatureDefinitions=function(t){Fs=t},t.setStyle=Ve,t.setTarget=Tn,t.spring=Ft,t.springValue=function(t,e){return Hi(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:Gi(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=Ce,t.statsBuffer=i,t.styleEffect=hi,t.supportedWaapiEasing=ke,t.supportsBrowserAnimation=Ke,t.supportsFlags=Ae,t.supportsLinearEasing=Ee,t.supportsPartialKeyframes=_n,t.supportsScrollTimeline=Me,t.svgEffect=di,t.sync=aa,t.testValueType=Cn,t.time=h,t.transform=qi,t.transformAxis=to,t.transformBox=eo,t.transformBoxPoints=Ns,t.transformPropOrder=ce,t.transformProps=ue,t.transformValue=Qi,t.transformValueTypes=Wn,t.translateAxis=Qs,t.updateMotionValuesFromProps=ks,t.variantPriorityOrder=Ps,t.variantProps=Ms,t.vh=j,t.visualElementStore=Ss,t.vw=L}); diff --git a/node_modules/motion-dom/dist/size-rollup-motion-value.js b/node_modules/motion-dom/dist/size-rollup-motion-value.js new file mode 100644 index 00000000..9797ccd8 --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-motion-value.js @@ -0,0 +1,2 @@ +const t={};class e{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;nr=!0,h=s.reduce((t,e)=>(t[e]=function(t,e){let s=new Set,n=new Set,r=!1,a=!1;const o=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1},h=0;function p(e){o.has(e)&&(d.schedule(e),t()),h++,e(c)}const d={schedule:(t,e=!1,i=!1)=>{const a=i&&r?s:n;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{c=t,r?a=!0:(r=!0,[s,n]=[n,s],s.forEach(p),e&&i.value&&i.value.frameloop[e].push(h),h=0,s.clear(),r=!1,a&&(a=!1,d.process(t)))}};return d}(c,e),t),{}),{setup:p,read:d,resolveKeyframes:u,preUpdate:l,update:v,preRender:m,render:f,postRender:g}=h,y=()=>{const s=t.useManualTiming?o.timestamp:performance.now();r=!1,t.useManualTiming||(o.delta=a?1e3/60:Math.max(Math.min(s-o.timestamp,40),1)),o.timestamp=s,o.isProcessing=!0,p.process(o),d.process(o),u.process(o),l.process(o),v.process(o),m.process(o),f.process(o),g.process(o),o.isProcessing=!1,r&&n&&(a=!1,e(y))};return{schedule:s.reduce((t,s)=>{const i=h[s];return t[s]=(t,s=!1,n=!1)=>(r||(r=!0,a=!0,o.isProcessing||e(y)),i.schedule(t,s,n)),t},{}),cancel:t=>{for(let e=0;et,!0);let h;function p(){h=void 0}const d={now:()=>(void 0===h&&d.set(o.isProcessing||t.useManualTiming?o.timestamp:performance.now()),h),set:t=>{h=t,queueMicrotask(p)}},u={current:void 0};class l{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=d.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=d.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new e);const i=this.events[t].add(s);return"change"===t?()=>{i(),r.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return u.current&&u.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=d.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(i=e)?s*(1e3/i):0;var s,i}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function v(t,e){return new l(t,e)}export{l as MotionValue,u as collectMotionValues,v as motionValue}; +//# sourceMappingURL=size-rollup-motion-value.js.map diff --git a/node_modules/motion-dom/dist/size-rollup-motion-value.js.map b/node_modules/motion-dom/dist/size-rollup-motion-value.js.map new file mode 100644 index 00000000..edcfea33 --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-motion-value.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-motion-value.js","sources":["../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/stats/buffer.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs"],"sourcesContent":["const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","export const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n//# sourceMappingURL=buffer.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","import { statsBuffer } from \"../stats/buffer\";\nexport function createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n"],"names":["MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","statsBuffer","value","addProjectionMetrics","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","stepName","thisFrame","Set","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","numCalls","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","forEach","frameloop","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","cancelFrame","frameSteps","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","collectMotionValues","current","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","motionValue"],"mappings":"AAAA,MAAMA,EAAqB,CAAE,ECE7B,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACxB,CACD,GAAAC,CAAIC,GCNR,IAAuBC,EAAKC,EDQpB,OCReD,EDODJ,KAAKC,cCPCI,EDOcF,GCNX,IAAvBC,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,GDMF,ICJf,SAAoBD,EAAKC,GACrB,MAAMG,EAAQJ,EAAIE,QAAQD,GACtBG,GAAS,GACTJ,EAAIK,OAAOD,EAAO,EAC1B,CDAqBE,CAAWV,KAAKC,cAAeE,EAC/C,CACD,MAAAQ,CAAOC,EAAGC,EAAGC,GACT,MAAMC,EAAmBf,KAAKC,cAAce,OAC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file diff --git a/node_modules/motion-dom/dist/size-rollup-style-effect.js b/node_modules/motion-dom/dist/size-rollup-style-effect.js new file mode 100644 index 00000000..1175f733 --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-style-effect.js @@ -0,0 +1,2 @@ +const t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],e=(()=>new Set(t))();const s={};class n{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;in=!0,d=i.reduce((t,e)=>(t[e]=function(t,e){let s=new Set,n=new Set,i=!1,a=!1;const o=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1},d=0;function l(e){o.has(e)&&(h.schedule(e),t()),d++,e(c)}const h={schedule:(t,e=!1,r=!1)=>{const a=r&&i?s:n;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{c=t,i?a=!0:(i=!0,[s,n]=[n,s],s.forEach(l),e&&r.value&&r.value.frameloop[e].push(d),d=0,s.clear(),i=!1,a&&(a=!1,h.process(t)))}};return h}(c,e),t),{}),{setup:l,read:h,resolveKeyframes:p,preUpdate:u,update:f,preRender:m,render:g,postRender:v}=d,y=()=>{const i=s.useManualTiming?o.timestamp:performance.now();n=!1,s.useManualTiming||(o.delta=a?1e3/60:Math.max(Math.min(i-o.timestamp,40),1)),o.timestamp=i,o.isProcessing=!0,l.process(o),h.process(o),p.process(o),u.process(o),f.process(o),m.process(o),g.process(o),v.process(o),o.isProcessing=!1,n&&e&&(a=!1,t(y))};return{schedule:i.reduce((e,s)=>{const i=d[s];return e[s]=(e,s=!1,r=!1)=>(n||(n=!0,a=!0,o.isProcessing||t(y)),i.schedule(e,s,r)),e},{}),cancel:t=>{for(let e=0;et,!0);let h;function p(){h=void 0}const u={now:()=>(void 0===h&&u.set(d.isProcessing||s.useManualTiming?d.timestamp:performance.now()),h),set:t=>{h=t,queueMicrotask(p)}};class f{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=u.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=u.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new n);const s=this.events[t].add(e);return"change"===t?()=>{s(),o.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=u.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(n=e)?s*(1e3/n):0;var s,n}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function m(t){return(e,s)=>{const n=function(t){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}(e),i=[];for(const e of n){const n=t(e,s);i.push(n)}return()=>{for(const t of i)t()}}}const g={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},v={...g,transform:t=>((t,e,s)=>s>e?e:s({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),k=b("deg"),A=b("%"),P=b("px"),S=(()=>({...A,parse:t=>A.parse(t)/100,transform:t=>A.transform(100*t)}))(),R={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...{rotate:k,rotateX:k,rotateY:k,rotateZ:k,scale:y,scaleX:y,scaleY:y,scaleZ:y,skew:k,skewX:k,skewY:k,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:v,originX:S,originY:S,originZ:P},zIndex:w,fillOpacity:v,strokeOpacity:v,numOctaves:w};class B{constructor(){this.latest={},this.values=new Map}set(t,e,s,n,i=!0){const r=this.values.get(t);r&&r.onRemove();const a=()=>{const n=e.get();this.latest[t]=i?((t,e)=>e&&"number"==typeof t?e.transform(t):t)(n,R[t]):n,s&&o.render(s)};a();const d=e.on("change",a);n&&e.addDependent(n);const l=()=>{d(),s&&c(s),this.values.delete(t),n&&e.removeDependent(n)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function E(t){const e=new WeakMap,s=[];return(n,i)=>{const r=e.get(n)??new B;e.set(n,r);for(const e in i){const a=i[e],o=t(n,r,e,a);s.push(o)}return()=>{for(const t of s)t()}}}const F={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const x=new Set(["originX","originY","originZ"]),T=(s,n,i,r)=>{let a,o;return e.has(i)?(n.get("transform")||(function(t){return"object"==typeof(e=t)&&null!==e&&"offsetHeight"in t;var e}(s)||n.get("transformBox")||T(s,n,"transformBox",new f("fill-box")),n.set("transform",new f("none"),()=>{s.style.transform=function(e){let s="",n=!0;for(let i=0;i{const t=n.latest.originX??"50%",e=n.latest.originY??"50%",i=n.latest.originZ??0;s.style.transformOrigin=`${t} ${e} ${i}`}),o=n.get("transformOrigin")):a=i.startsWith("--")?()=>{s.style.setProperty(i,n.latest[i])}:()=>{s.style[i]=n.latest[i]},n.set(i,r,a,o)},V=m(E(T));export{T as addStyleValue,V as styleEffect}; +//# sourceMappingURL=size-rollup-style-effect.js.map diff --git a/node_modules/motion-dom/dist/size-rollup-style-effect.js.map b/node_modules/motion-dom/dist/size-rollup-style-effect.js.map new file mode 100644 index 00000000..b7524547 --- /dev/null +++ b/node_modules/motion-dom/dist/size-rollup-style-effect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"size-rollup-style-effect.js","sources":["../lib/render/dom/is-css-var.js","../lib/render/utils/keys-transform.js","../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../lib/frameloop/order.js","../lib/stats/buffer.js","../lib/frameloop/batcher.js","../lib/frameloop/render-step.js","../lib/frameloop/frame.js","../../motion-utils/dist/es/noop.mjs","../lib/frameloop/sync-time.js","../lib/value/index.js","../../motion-utils/dist/es/velocity-per-second.mjs","../lib/effects/utils/create-dom-effect.js","../lib/utils/resolve-elements.js","../lib/value/types/numbers/index.js","../lib/value/types/int.js","../lib/value/types/numbers/units.js","../lib/value/types/maps/number.js","../lib/value/types/maps/transform.js","../lib/effects/MotionValueState.js","../lib/value/types/utils/get-as-type.js","../lib/effects/utils/create-effect.js","../lib/effects/style/transform.js","../lib/effects/style/index.js","../lib/utils/is-html-element.js","../../motion-utils/dist/es/is-object.mjs"],"sourcesContent":["export const isCSSVar = (name) => name.startsWith(\"--\");\n//# sourceMappingURL=is-css-var.js.map","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n//# sourceMappingURL=keys-transform.js.map","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","export const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n//# sourceMappingURL=order.js.map","export const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n//# sourceMappingURL=buffer.js.map","import { MotionGlobalConfig } from \"motion-utils\";\nimport { stepsOrder } from \"./order\";\nimport { createRenderStep } from \"./render-step\";\nconst maxElapsed = 40;\nexport function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n//# sourceMappingURL=batcher.js.map","import { statsBuffer } from \"../stats/buffer\";\nexport function createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n//# sourceMappingURL=render-step.js.map","import { noop } from \"motion-utils\";\nimport { createRenderBatcher } from \"./batcher\";\nexport const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n//# sourceMappingURL=frame.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\n","import { MotionGlobalConfig } from \"motion-utils\";\nimport { frameData } from \"./frame\";\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n//# sourceMappingURL=sync-time.js.map","import { SubscriptionManager, velocityPerSecond, warnOnce, } from \"motion-utils\";\nimport { frame } from \"../frameloop\";\nimport { time } from \"../frameloop/sync-time\";\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nexport const collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nexport function motionValue(init, options) {\n return new MotionValue(init, options);\n}\n//# sourceMappingURL=index.js.map","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { resolveElements, } from \"../../utils/resolve-elements\";\nexport function createSelectorEffect(subjectEffect) {\n return (subject, values) => {\n const elements = resolveElements(subject);\n const subscriptions = [];\n for (const element of elements) {\n const remove = subjectEffect(element, values);\n subscriptions.push(remove);\n }\n return () => {\n for (const remove of subscriptions)\n remove();\n };\n };\n}\n//# sourceMappingURL=create-dom-effect.js.map","export function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n//# sourceMappingURL=resolve-elements.js.map","import { clamp } from \"motion-utils\";\nexport const number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nexport const alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nexport const scale = {\n ...number,\n default: 1,\n};\n//# sourceMappingURL=index.js.map","import { number } from \"./numbers\";\nexport const int = {\n ...number,\n transform: Math.round,\n};\n//# sourceMappingURL=int.js.map","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\");\nexport const percent = /*@__PURE__*/ createUnitType(\"%\");\nexport const px = /*@__PURE__*/ createUnitType(\"px\");\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\");\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\");\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n//# sourceMappingURL=units.js.map","import { int } from \"../int\";\nimport { alpha } from \"../numbers\";\nimport { px } from \"../numbers/units\";\nimport { transformValueTypes } from \"./transform\";\nexport const numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n//# sourceMappingURL=number.js.map","import { alpha, scale } from \"../numbers\";\nimport { degrees, progressPercentage, px } from \"../numbers/units\";\nexport const transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n//# sourceMappingURL=transform.js.map","import { cancelFrame, frame } from \"../frameloop/frame\";\nimport { numberValueTypes } from \"../value/types/maps/number\";\nimport { getValueAsType } from \"../value/types/utils/get-as-type\";\nexport class MotionValueState {\n constructor() {\n this.latest = {};\n this.values = new Map();\n }\n set(name, value, render, computed, useDefaultValueType = true) {\n const existingValue = this.values.get(name);\n if (existingValue) {\n existingValue.onRemove();\n }\n const onChange = () => {\n const v = value.get();\n if (useDefaultValueType) {\n this.latest[name] = getValueAsType(v, numberValueTypes[name]);\n }\n else {\n this.latest[name] = v;\n }\n render && frame.render(render);\n };\n onChange();\n const cancelOnChange = value.on(\"change\", onChange);\n computed && value.addDependent(computed);\n const remove = () => {\n cancelOnChange();\n render && cancelFrame(render);\n this.values.delete(name);\n computed && value.removeDependent(computed);\n };\n this.values.set(name, { value, onRemove: remove });\n return remove;\n }\n get(name) {\n return this.values.get(name)?.value;\n }\n destroy() {\n for (const value of this.values.values()) {\n value.onRemove();\n }\n }\n}\n//# sourceMappingURL=MotionValueState.js.map","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n//# sourceMappingURL=get-as-type.js.map","import { MotionValueState } from \"../MotionValueState\";\nexport function createEffect(addValue) {\n const stateCache = new WeakMap();\n const subscriptions = [];\n return (subject, values) => {\n const state = stateCache.get(subject) ?? new MotionValueState();\n stateCache.set(subject, state);\n for (const key in values) {\n const value = values[key];\n const remove = addValue(subject, state, key, value);\n subscriptions.push(remove);\n }\n return () => {\n for (const cancel of subscriptions)\n cancel();\n };\n };\n}\n//# sourceMappingURL=create-effect.js.map","import { transformPropOrder } from \"../../render/utils/keys-transform\";\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nexport function buildTransform(state) {\n let transform = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < transformPropOrder.length; i++) {\n const key = transformPropOrder[i];\n const value = state.latest[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n const valueToRender = state.latest[key];\n transform += `${transformName}(${valueToRender}) `;\n }\n }\n return transformIsDefault ? \"none\" : transform.trim();\n}\n//# sourceMappingURL=transform.js.map","import { isCSSVar } from \"../../render/dom/is-css-var\";\nimport { transformProps } from \"../../render/utils/keys-transform\";\nimport { isHTMLElement } from \"../../utils/is-html-element\";\nimport { MotionValue } from \"../../value\";\nimport { createSelectorEffect } from \"../utils/create-dom-effect\";\nimport { createEffect } from \"../utils/create-effect\";\nimport { buildTransform } from \"./transform\";\nconst originProps = new Set([\"originX\", \"originY\", \"originZ\"]);\nexport const addStyleValue = (element, state, key, value) => {\n let render = undefined;\n let computed = undefined;\n if (transformProps.has(key)) {\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(element, state, \"transformBox\", new MotionValue(\"fill-box\"));\n }\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n element.style.transform = buildTransform(state);\n });\n }\n computed = state.get(\"transform\");\n }\n else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = state.latest.originX ?? \"50%\";\n const originY = state.latest.originY ?? \"50%\";\n const originZ = state.latest.originZ ?? 0;\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`;\n });\n }\n computed = state.get(\"transformOrigin\");\n }\n else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, state.latest[key]);\n };\n }\n else {\n render = () => {\n element.style[key] = state.latest[key];\n };\n }\n return state.set(key, value, render, computed);\n};\nexport const styleEffect = /*@__PURE__*/ createSelectorEffect(\n/*@__PURE__*/ createEffect(addStyleValue));\n//# sourceMappingURL=index.js.map","import { isObject } from \"motion-utils\";\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nexport function isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n//# sourceMappingURL=is-html-element.js.map","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n"],"names":["transformPropOrder","transformProps","Set","MotionGlobalConfig","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","index","splice","removeItem","notify","a","b","c","numSubscriptions","length","i","getSize","clear","stepsOrder","statsBuffer","value","addProjectionMetrics","createRenderBatcher","scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","reduce","acc","key","stepName","thisFrame","nextFrame","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","numCalls","triggerCallback","callback","has","step","schedule","keepAlive","immediate","queue","cancel","delete","process","frameData","forEach","frameloop","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","performance","now","Math","max","min","frame","cancelFrame","frameSteps","requestAnimationFrame","any","clearTime","undefined","time","set","newTime","queueMicrotask","MotionValue","init","options","canTrackVelocity","events","updateAndNotify","v","currentTime","updatedAt","setPrevFrameValue","prev","current","setCurrent","change","dependents","dependent","dirty","hasAnimated","owner","isNaN","parseFloat","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","unsubscribe","stop","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","setWithVelocity","jump","endAnimation","addDependent","removeDependent","get","getPrevious","getVelocity","velocity","frameDuration","start","startAnimation","Promise","resolve","animation","animationStart","then","animationComplete","clearAnimation","animationCancel","isAnimating","destroy","createSelectorEffect","subjectEffect","subject","values","elements","elementOrSelector","EventTarget","document","querySelectorAll","Array","from","filter","element","resolveElements","remove","number","test","parse","transform","alpha","clamp","scale","default","int","round","createUnitType","unit","endsWith","split","degrees","percent","px","progressPercentage","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","x","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","MotionValueState","latest","Map","name","computed","useDefaultValueType","existingValue","onRemove","type","getValueAsType","cancelOnChange","createEffect","addValue","stateCache","WeakMap","translateAlias","originProps","addStyleValue","isHTMLElement","style","transformIsDefault","valueIsDefault","startsWith","parsed","trim","buildTransform","transformOrigin","setProperty","styleEffect"],"mappings":"AAAO,MCGMA,EAAqB,CAC9B,uBACA,IACA,IACA,IACA,aACA,aACA,aACA,QACA,SACA,SACA,SACA,UACA,UACA,UACA,OACA,QACA,SAKSC,EAA+B,KAAO,IAAIC,IAAIF,GAAf,GCzB5C,MCAMG,EAAqB,CAAE,ECE7B,MAAMC,EACF,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GAAqB,EAGrBjH,GAAa,GAFS4G,EAAexO,IAAQA,KACvBR,EAAMkO,OAAO1N,OAG1C,CACD,OAAO6O,EAAqB,OAASjH,EAAUqH,MACnD,CChB0CC,CAAe1P,MAGjDqO,EAAWrO,EAAMiG,IAAI,cAEhBgJ,EAAY9N,IAAIX,IAChBR,EAAMiG,IAAI,oBACXjG,EAAMuD,IAAI,kBAAmB,IAAIG,EAAY,IAAK,KAC9C,MAAMgK,EAAU1N,EAAMkO,OAAOR,SAAW,MAClCC,EAAU3N,EAAMkO,OAAOP,SAAW,MAClCC,EAAU5N,EAAMkO,OAAON,SAAW,EACxC9F,EAAQsH,MAAMO,gBAAkB,GAAGjC,KAAWC,KAAWC,MAGjES,EAAWrO,EAAMiG,IAAI,oBAGrB3D,EADc9B,E1BnCiB+O,WAAW,M0BoCjC,KACLzH,EAAQsH,MAAMQ,YAAYpP,EAAKR,EAAMkO,OAAO1N,KAIvC,KACLsH,EAAQsH,MAAM5O,GAAOR,EAAMkO,OAAO1N,IAGnCR,EAAMuD,IAAI/C,EAAKf,EAAO6C,EAAQ+L,IAE5BwB,EAA4B3I,EAC3B0H,EAAaM"} \ No newline at end of file diff --git a/node_modules/motion-dom/package.json b/node_modules/motion-dom/package.json new file mode 100644 index 00000000..bc76a490 --- /dev/null +++ b/node_modules/motion-dom/package.json @@ -0,0 +1,40 @@ +{ + "name": "motion-dom", + "version": "12.34.2", + "author": "Matt Perry", + "license": "MIT", + "repository": "https://github.com/motiondivision/motion", + "main": "./dist/cjs/index.js", + "types": "./dist/index.d.ts", + "module": "./dist/es/index.mjs", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/es/index.mjs", + "default": "./dist/cjs/index.js" + } + }, + "dependencies": { + "motion-utils": "^12.29.2" + }, + "scripts": { + "clean": "rm -rf types dist lib", + "build": "yarn clean && tsc -p . && rollup -c && node ./scripts/check-bundle.js", + "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", + "test": "jest --config jest.config.json --max-workers=2", + "measure": "rollup -c ./rollup.size.config.mjs" + }, + "bundlesize": [ + { + "path": "./dist/size-rollup-style-effect.js", + "maxSize": "2.9 kB" + }, + { + "path": "./dist/size-rollup-motion-value.js", + "maxSize": "1.8 kB" + } + ], + "gitHead": "68283405093407c229adc25e4f939a8fc1a310da" +} diff --git a/node_modules/motion-utils/LICENSE.md b/node_modules/motion-utils/LICENSE.md new file mode 100644 index 00000000..81110442 --- /dev/null +++ b/node_modules/motion-utils/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 [Motion](https://motion.dev) B.V. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/motion-utils/dist/cjs/index.js b/node_modules/motion-utils/dist/cjs/index.js new file mode 100644 index 00000000..9eede1c7 --- /dev/null +++ b/node_modules/motion-utils/dist/cjs/index.js @@ -0,0 +1,346 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); +} +function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); +} +// Adapted from array-move +function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; +} + +const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; +}; + +function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; +} + +exports.warning = () => { }; +exports.invariant = () => { }; +if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + exports.warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + exports.invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; +} + +const MotionGlobalConfig = {}; + +/** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ +const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + +function isObject(value) { + return typeof value === "object" && value !== null; +} + +/** + * Check if the value is a zero value string like "0px" or "0%" + */ +const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + +/*#__NO_SIDE_EFFECTS__*/ +function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; +} + +/*#__NO_SIDE_EFFECTS__*/ +const noop = (any) => any; + +/** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ +const combineFunctions = (a, b) => (v) => b(a(v)); +const pipe = (...transformers) => transformers.reduce(combineFunctions); + +/* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. + + @param [number]: Lower limit + @param [number]: Upper limit + @param [number]: Value to find progress within given range + @return [number]: Progress of value within range as expressed 0-1 +*/ +/*#__NO_SIDE_EFFECTS__*/ +const progress = (from, to, value) => { + const toFromDifference = to - from; + return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; +}; + +class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } +} + +/** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ +/*#__NO_SIDE_EFFECTS__*/ +const secondsToMilliseconds = (seconds) => seconds * 1000; +/*#__NO_SIDE_EFFECTS__*/ +const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + +/* + Convert velocity into velocity per second + + @param [number]: Unit per frame + @param [number]: Frame duration in ms +*/ +function velocityPerSecond(velocity, frameDuration) { + return frameDuration ? velocity * (1000 / frameDuration) : 0; +} + +const warned = new Set(); +function hasWarned(message) { + return warned.has(message); +} +function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); +} + +const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; +}; + +/* + Bezier function generator + This has been modified from GaĆ«tan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... +*/ +// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. +const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; +const subdivisionPrecision = 0.0000001; +const subdivisionMaxIterations = 12; +function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; +} +function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); +} + +// Accepts an easing function and returns a new one that outputs mirrored values for +// the second half of the animation. Turns easeIn into easeInOut. +const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + +// Accepts an easing function and returns a new one that outputs reversed values. +// Turns easeIn into easeOut. +const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + +const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); +const backIn = /*@__PURE__*/ reverseEasing(backOut); +const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + +const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + +const circIn = (p) => 1 - Math.sin(Math.acos(p)); +const circOut = reverseEasing(circIn); +const circInOut = mirrorEasing(circIn); + +const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); +const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); +const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + +function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; +} + +const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; +}; + +function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; +} + +const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + +const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, +}; +const isValidEasing = (easing) => { + return typeof easing === "string"; +}; +const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; +}; + +exports.MotionGlobalConfig = MotionGlobalConfig; +exports.SubscriptionManager = SubscriptionManager; +exports.addUniqueItem = addUniqueItem; +exports.anticipate = anticipate; +exports.backIn = backIn; +exports.backInOut = backInOut; +exports.backOut = backOut; +exports.circIn = circIn; +exports.circInOut = circInOut; +exports.circOut = circOut; +exports.clamp = clamp; +exports.cubicBezier = cubicBezier; +exports.easeIn = easeIn; +exports.easeInOut = easeInOut; +exports.easeOut = easeOut; +exports.easingDefinitionToFunction = easingDefinitionToFunction; +exports.getEasingForSegment = getEasingForSegment; +exports.hasWarned = hasWarned; +exports.isBezierDefinition = isBezierDefinition; +exports.isEasingArray = isEasingArray; +exports.isNumericalString = isNumericalString; +exports.isObject = isObject; +exports.isZeroValueString = isZeroValueString; +exports.memo = memo; +exports.millisecondsToSeconds = millisecondsToSeconds; +exports.mirrorEasing = mirrorEasing; +exports.moveItem = moveItem; +exports.noop = noop; +exports.pipe = pipe; +exports.progress = progress; +exports.removeItem = removeItem; +exports.reverseEasing = reverseEasing; +exports.secondsToMilliseconds = secondsToMilliseconds; +exports.steps = steps; +exports.velocityPerSecond = velocityPerSecond; +exports.warnOnce = warnOnce; +exports.wrap = wrap; +//# sourceMappingURL=index.js.map diff --git a/node_modules/motion-utils/dist/cjs/index.js.map b/node_modules/motion-utils/dist/cjs/index.js.map new file mode 100644 index 00000000..b9d9d7ca --- /dev/null +++ b/node_modules/motion-utils/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../src/array.ts","../../src/clamp.ts","../../src/format-error-message.ts","../../src/errors.ts","../../src/global-config.ts","../../src/is-numerical-string.ts","../../src/is-object.ts","../../src/is-zero-value-string.ts","../../src/memo.ts","../../src/noop.ts","../../src/pipe.ts","../../src/progress.ts","../../src/subscription-manager.ts","../../src/time-conversion.ts","../../src/velocity-per-second.ts","../../src/warn-once.ts","../../src/wrap.ts","../../src/easing/cubic-bezier.ts","../../src/easing/modifiers/mirror.ts","../../src/easing/modifiers/reverse.ts","../../src/easing/back.ts","../../src/easing/anticipate.ts","../../src/easing/circ.ts","../../src/easing/ease.ts","../../src/easing/steps.ts","../../src/easing/utils/is-easing-array.ts","../../src/easing/utils/get-easing-for-segment.ts","../../src/easing/utils/is-bezier-definition.ts","../../src/easing/utils/map.ts"],"sourcesContent":["export function addUniqueItem(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n","export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n","export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n","import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n","export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: (a: T, b: T) => (p: number) => T\n} = {}\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n","export function isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null\n}\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n","/*#__NO_SIDE_EFFECTS__*/\nexport function memo(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n","/*#__NO_SIDE_EFFECTS__*/\nexport const noop = (any: T): T => any\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a: Function, b: Function) => (v: any) => b(a(v))\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce(combineFunctions)\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const toFromDifference = to - from\n\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference\n}\n","import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters[0],\n b?: Parameters[1],\n c?: Parameters[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const secondsToMilliseconds = (seconds: number) => seconds * 1000\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const millisecondsToSeconds = (milliseconds: number) =>\n milliseconds / 1000\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nexport function velocityPerSecond(velocity: number, frameDuration: number) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0\n}\n","import { formatErrorMessage } from \"./format-error-message\"\n\nconst warned = new Set()\n\nexport function hasWarned(message: string) {\n return warned.has(message)\n}\n\nexport function warnOnce(\n condition: boolean,\n message: string,\n errorCode?: string\n) {\n if (condition || warned.has(message)) return\n\n console.warn(formatErrorMessage(message, errorCode))\n warned.add(message)\n}\n","export const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n","/*\n Bezier function generator\n This has been modified from GaĆ«tan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n","// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n","import { cubicBezier } from \"./cubic-bezier\"\nimport { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\n\nexport const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99)\nexport const backIn = /*@__PURE__*/ reverseEasing(backOut)\nexport const backInOut = /*@__PURE__*/ mirrorEasing(backIn)\n","import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n","import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n","import { cubicBezier } from \"./cubic-bezier\"\n\nexport const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1)\nexport const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1)\nexport const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1)\n","import { clamp } from \"../clamp\"\nimport type { EasingFunction } from \"./types\"\n\n/*\n Create stepped version of 0-1 progress\n\n @param [int]: Number of steps\n @param [number]: Current value\n @return [number]: Stepped value\n*/\nexport type Direction = \"start\" | \"end\"\n\nexport function steps(\n numSteps: number,\n direction: Direction = \"end\"\n): EasingFunction {\n return (progress: number) => {\n progress =\n direction === \"end\"\n ? Math.min(progress, 0.999)\n : Math.max(progress, 0.001)\n const expanded = progress * numSteps\n const rounded =\n direction === \"end\" ? Math.floor(expanded) : Math.ceil(expanded)\n\n return clamp(0, 1, rounded / numSteps)\n }\n}\n","import { Easing } from \"../types\"\n\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n","import { wrap } from \"../../wrap\"\nimport { Easing } from \"../types\"\nimport { isEasingArray } from \"./is-easing-array\"\n\nexport function getEasingForSegment(\n easing: Easing | Easing[],\n i: number\n): Easing {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing\n}\n","import { BezierDefinition, Easing } from \"../types\"\n\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n","import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n"],"names":["warning","invariant"],"mappings":";;;;AAAgB,SAAA,aAAa,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC9C,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAAE,QAAA,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAChD,CAAC;AAEe,SAAA,UAAU,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/B,IAAI,KAAK,GAAG,CAAC,CAAC;AAAE,QAAA,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;AACxC,CAAC;AAED;AACM,SAAU,QAAQ,CAAI,CAAC,GAAG,GAAG,CAAM,EAAE,SAAiB,EAAE,OAAe,EAAA;AACzE,IAAA,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC,GAAG,GAAG,CAAC,MA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;;QAEhCA,iBAAS,CACL,UAAU,CAAC,MAAM,KAAK,CAAC,EACvB,CAAyD,uDAAA,CAAA,EACzD,qBAAqB,CACxB,CAAA;QAED,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU,CAAA;QACnC,OAAO,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;KACrC;AAAM,SAAA,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;;AAElC,QAAAA,iBAAS,CACL,YAAY,CAAC,UAAU,CAAC,KAAK,SAAS,EACtC,CAAA,qBAAA,EAAwB,UAAU,CAAA,CAAA,CAAG,EACrC,qBAAqB,CACxB,CAAA;AACD,QAAA,OAAO,YAAY,CAAC,UAAU,CAAC,CAAA;KAClC;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/array.mjs b/node_modules/motion-utils/dist/es/array.mjs new file mode 100644 index 00000000..773d47a1 --- /dev/null +++ b/node_modules/motion-utils/dist/es/array.mjs @@ -0,0 +1,22 @@ +function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); +} +function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); +} +// Adapted from array-move +function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; +} + +export { addUniqueItem, moveItem, removeItem }; +//# sourceMappingURL=array.mjs.map diff --git a/node_modules/motion-utils/dist/es/array.mjs.map b/node_modules/motion-utils/dist/es/array.mjs.map new file mode 100644 index 00000000..7a0e31b0 --- /dev/null +++ b/node_modules/motion-utils/dist/es/array.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"array.mjs","sources":["../../src/array.ts"],"sourcesContent":["export function addUniqueItem(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n"],"names":[],"mappings":"AAAgB,SAAA,aAAa,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC9C,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAAE,QAAA,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAChD,CAAC;AAEe,SAAA,UAAU,CAAI,GAAQ,EAAE,IAAO,EAAA;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/B,IAAI,KAAK,GAAG,CAAC,CAAC;AAAE,QAAA,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;AACxC,CAAC;AAED;AACM,SAAU,QAAQ,CAAI,CAAC,GAAG,GAAG,CAAM,EAAE,SAAiB,EAAE,OAAe,EAAA;AACzE,IAAA,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;IAErE,IAAI,UAAU,IAAI,CAAC,IAAI,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE;AAC5C,QAAA,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAE7D,QAAA,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;QACvC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;KAChC;AAED,IAAA,OAAO,GAAG,CAAA;AACd;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/clamp.mjs b/node_modules/motion-utils/dist/es/clamp.mjs new file mode 100644 index 00000000..1cfe2372 --- /dev/null +++ b/node_modules/motion-utils/dist/es/clamp.mjs @@ -0,0 +1,10 @@ +const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; +}; + +export { clamp }; +//# sourceMappingURL=clamp.mjs.map diff --git a/node_modules/motion-utils/dist/es/clamp.mjs.map b/node_modules/motion-utils/dist/es/clamp.mjs.map new file mode 100644 index 00000000..2f16970d --- /dev/null +++ b/node_modules/motion-utils/dist/es/clamp.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"clamp.mjs","sources":["../../src/clamp.ts"],"sourcesContent":["export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n"],"names":[],"mappings":"AAAa,MAAA,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,CAAS,KAAI;IACzD,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG,CAAA;IACvB,IAAI,CAAC,GAAG,GAAG;AAAE,QAAA,OAAO,GAAG,CAAA;AACvB,IAAA,OAAO,CAAC,CAAA;AACZ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/anticipate.mjs b/node_modules/motion-utils/dist/es/easing/anticipate.mjs new file mode 100644 index 00000000..a973496b --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/anticipate.mjs @@ -0,0 +1,6 @@ +import { backIn } from './back.mjs'; + +const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + +export { anticipate }; +//# sourceMappingURL=anticipate.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map b/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map new file mode 100644 index 00000000..d893700d --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/anticipate.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"anticipate.mjs","sources":["../../../src/easing/anticipate.ts"],"sourcesContent":["import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n"],"names":[],"mappings":";;MAEa,UAAU,GAAG,CAAC,CAAS,KAChC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/back.mjs b/node_modules/motion-utils/dist/es/easing/back.mjs new file mode 100644 index 00000000..74988003 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/back.mjs @@ -0,0 +1,10 @@ +import { cubicBezier } from './cubic-bezier.mjs'; +import { mirrorEasing } from './modifiers/mirror.mjs'; +import { reverseEasing } from './modifiers/reverse.mjs'; + +const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); +const backIn = /*@__PURE__*/ reverseEasing(backOut); +const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + +export { backIn, backInOut, backOut }; +//# sourceMappingURL=back.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/back.mjs.map b/node_modules/motion-utils/dist/es/easing/back.mjs.map new file mode 100644 index 00000000..2462713e --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/back.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"back.mjs","sources":["../../../src/easing/back.ts"],"sourcesContent":["import { cubicBezier } from \"./cubic-bezier\"\nimport { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\n\nexport const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99)\nexport const backIn = /*@__PURE__*/ reverseEasing(backOut)\nexport const backInOut = /*@__PURE__*/ mirrorEasing(backIn)\n"],"names":[],"mappings":";;;;AAIa,MAAA,OAAO,iBAAiB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC;AAC3D,MAAA,MAAM,iBAAiB,aAAa,CAAC,OAAO,EAAC;AAC7C,MAAA,SAAS,iBAAiB,YAAY,CAAC,MAAM;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/circ.mjs b/node_modules/motion-utils/dist/es/easing/circ.mjs new file mode 100644 index 00000000..5e24dc47 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/circ.mjs @@ -0,0 +1,9 @@ +import { mirrorEasing } from './modifiers/mirror.mjs'; +import { reverseEasing } from './modifiers/reverse.mjs'; + +const circIn = (p) => 1 - Math.sin(Math.acos(p)); +const circOut = reverseEasing(circIn); +const circInOut = mirrorEasing(circIn); + +export { circIn, circInOut, circOut }; +//# sourceMappingURL=circ.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/circ.mjs.map b/node_modules/motion-utils/dist/es/easing/circ.mjs.map new file mode 100644 index 00000000..d57952d6 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/circ.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"circ.mjs","sources":["../../../src/easing/circ.ts"],"sourcesContent":["import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n"],"names":[],"mappings":";;;MAIa,MAAM,GAAmB,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC;MAC1D,OAAO,GAAG,aAAa,CAAC,MAAM,EAAC;MAC/B,SAAS,GAAG,YAAY,CAAC,MAAM;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs new file mode 100644 index 00000000..15efac6b --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs @@ -0,0 +1,52 @@ +import { noop } from '../noop.mjs'; + +/* + Bezier function generator + This has been modified from GaĆ«tan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... +*/ +// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. +const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; +const subdivisionPrecision = 0.0000001; +const subdivisionMaxIterations = 12; +function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; +} +function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); +} + +export { cubicBezier }; +//# sourceMappingURL=cubic-bezier.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map new file mode 100644 index 00000000..b4a06fbe --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"cubic-bezier.mjs","sources":["../../../src/easing/cubic-bezier.ts"],"sourcesContent":["/*\n Bezier function generator\n This has been modified from GaĆ«tan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;AAgBE;AAIF;AACA,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,EAAU,EAAE,EAAU,KACjD,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE;AACzE,IAAA,CAAC,CAAA;AAEL,MAAM,oBAAoB,GAAG,SAAS,CAAA;AACtC,MAAM,wBAAwB,GAAG,EAAE,CAAA;AAEnC,SAAS,eAAe,CACpB,CAAS,EACT,UAAkB,EAClB,UAAkB,EAClB,GAAW,EACX,GAAW,EAAA;AAEX,IAAA,IAAI,QAAgB,CAAA;AACpB,IAAA,IAAI,QAAgB,CAAA;IACpB,IAAI,CAAC,GAAW,CAAC,CAAA;AAEjB,IAAA,GAAG;QACC,QAAQ,GAAG,UAAU,GAAG,CAAC,UAAU,GAAG,UAAU,IAAI,GAAG,CAAA;QACvD,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;AAC7C,QAAA,IAAI,QAAQ,GAAG,GAAG,EAAE;YAChB,UAAU,GAAG,QAAQ,CAAA;SACxB;aAAM;YACH,UAAU,GAAG,QAAQ,CAAA;SACxB;KACJ,QACG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,oBAAoB;QACzC,EAAE,CAAC,GAAG,wBAAwB,EACjC;AAED,IAAA,OAAO,QAAQ,CAAA;AACnB,CAAC;AAEK,SAAU,WAAW,CACvB,GAAW,EACX,GAAW,EACX,GAAW,EACX,GAAW,EAAA;;AAGX,IAAA,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG;AAAE,QAAA,OAAO,IAAI,CAAA;AAE3C,IAAA,MAAM,QAAQ,GAAG,CAAC,EAAU,KAAK,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;;AAGpE,IAAA,OAAO,CAAC,CAAS,KACb,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAClE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/ease.mjs b/node_modules/motion-utils/dist/es/easing/ease.mjs new file mode 100644 index 00000000..10cabac3 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/ease.mjs @@ -0,0 +1,8 @@ +import { cubicBezier } from './cubic-bezier.mjs'; + +const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); +const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); +const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + +export { easeIn, easeInOut, easeOut }; +//# sourceMappingURL=ease.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/ease.mjs.map b/node_modules/motion-utils/dist/es/easing/ease.mjs.map new file mode 100644 index 00000000..bb67f296 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/ease.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"ease.mjs","sources":["../../../src/easing/ease.ts"],"sourcesContent":["import { cubicBezier } from \"./cubic-bezier\"\n\nexport const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1)\nexport const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1)\nexport const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1)\n"],"names":[],"mappings":";;AAEa,MAAA,MAAM,iBAAiB,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC;AACjD,MAAA,OAAO,iBAAiB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAC;AAClD,MAAA,SAAS,iBAAiB,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs new file mode 100644 index 00000000..ce47170f --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs @@ -0,0 +1,6 @@ +// Accepts an easing function and returns a new one that outputs mirrored values for +// the second half of the animation. Turns easeIn into easeInOut. +const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + +export { mirrorEasing }; +//# sourceMappingURL=mirror.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map new file mode 100644 index 00000000..2239a345 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"mirror.mjs","sources":["../../../../src/easing/modifiers/mirror.ts"],"sourcesContent":["// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n"],"names":[],"mappings":"AAAA;AAIA;MACa,YAAY,GAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,KACtD,CAAC,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs new file mode 100644 index 00000000..057b2c5e --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs @@ -0,0 +1,6 @@ +// Accepts an easing function and returns a new one that outputs reversed values. +// Turns easeIn into easeOut. +const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + +export { reverseEasing }; +//# sourceMappingURL=reverse.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map new file mode 100644 index 00000000..c7378c32 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"reverse.mjs","sources":["../../../../src/easing/modifiers/reverse.ts"],"sourcesContent":["// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n"],"names":[],"mappings":"AAAA;AAIA;MACa,aAAa,GAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,KACvD,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/steps.mjs b/node_modules/motion-utils/dist/es/easing/steps.mjs new file mode 100644 index 00000000..d11a2cc8 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/steps.mjs @@ -0,0 +1,16 @@ +import { clamp } from '../clamp.mjs'; + +function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; +} + +export { steps }; +//# sourceMappingURL=steps.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/steps.mjs.map b/node_modules/motion-utils/dist/es/easing/steps.mjs.map new file mode 100644 index 00000000..1dd86a42 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/steps.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"steps.mjs","sources":["../../../src/easing/steps.ts"],"sourcesContent":["import { clamp } from \"../clamp\"\nimport type { EasingFunction } from \"./types\"\n\n/*\n Create stepped version of 0-1 progress\n\n @param [int]: Number of steps\n @param [number]: Current value\n @return [number]: Stepped value\n*/\nexport type Direction = \"start\" | \"end\"\n\nexport function steps(\n numSteps: number,\n direction: Direction = \"end\"\n): EasingFunction {\n return (progress: number) => {\n progress =\n direction === \"end\"\n ? Math.min(progress, 0.999)\n : Math.max(progress, 0.001)\n const expanded = progress * numSteps\n const rounded =\n direction === \"end\" ? Math.floor(expanded) : Math.ceil(expanded)\n\n return clamp(0, 1, rounded / numSteps)\n }\n}\n"],"names":[],"mappings":";;SAYgB,KAAK,CACjB,QAAgB,EAChB,YAAuB,KAAK,EAAA;IAE5B,OAAO,CAAC,QAAgB,KAAI;QACxB,QAAQ;AACJ,YAAA,SAAS,KAAK,KAAK;kBACb,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;kBACzB,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AACnC,QAAA,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;QACpC,MAAM,OAAO,GACT,SAAS,KAAK,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAEpE,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAA;AAC1C,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs new file mode 100644 index 00000000..825c1524 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs @@ -0,0 +1,9 @@ +import { wrap } from '../../wrap.mjs'; +import { isEasingArray } from './is-easing-array.mjs'; + +function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; +} + +export { getEasingForSegment }; +//# sourceMappingURL=get-easing-for-segment.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map new file mode 100644 index 00000000..f73e4daa --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/get-easing-for-segment.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"get-easing-for-segment.mjs","sources":["../../../../src/easing/utils/get-easing-for-segment.ts"],"sourcesContent":["import { wrap } from \"../../wrap\"\nimport { Easing } from \"../types\"\nimport { isEasingArray } from \"./is-easing-array\"\n\nexport function getEasingForSegment(\n easing: Easing | Easing[],\n i: number\n): Easing {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing\n}\n"],"names":[],"mappings":";;;AAIgB,SAAA,mBAAmB,CAC/B,MAAyB,EACzB,CAAS,EAAA;IAET,OAAO,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAA;AAC7E;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs new file mode 100644 index 00000000..f5f29a16 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs @@ -0,0 +1,4 @@ +const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + +export { isBezierDefinition }; +//# sourceMappingURL=is-bezier-definition.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map new file mode 100644 index 00000000..4ee09569 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-bezier-definition.mjs","sources":["../../../../src/easing/utils/is-bezier-definition.ts"],"sourcesContent":["import { BezierDefinition, Easing } from \"../types\"\n\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n"],"names":[],"mappings":"MAEa,kBAAkB,GAAG,CAC9B,MAAyB,KAEzB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs new file mode 100644 index 00000000..c9143e17 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs @@ -0,0 +1,6 @@ +const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; +}; + +export { isEasingArray }; +//# sourceMappingURL=is-easing-array.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map new file mode 100644 index 00000000..bec5f11b --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-easing-array.mjs","sources":["../../../../src/easing/utils/is-easing-array.ts"],"sourcesContent":["import { Easing } from \"../types\"\n\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n"],"names":[],"mappings":"AAEa,MAAA,aAAa,GAAG,CAAC,IAAS,KAAsB;AACzD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAA;AAC7D;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/easing/utils/map.mjs b/node_modules/motion-utils/dist/es/easing/utils/map.mjs new file mode 100644 index 00000000..08bf6876 --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/map.mjs @@ -0,0 +1,42 @@ +import { invariant } from '../../errors.mjs'; +import { noop } from '../../noop.mjs'; +import { anticipate } from '../anticipate.mjs'; +import { backIn, backInOut, backOut } from '../back.mjs'; +import { circIn, circInOut, circOut } from '../circ.mjs'; +import { cubicBezier } from '../cubic-bezier.mjs'; +import { easeIn, easeInOut, easeOut } from '../ease.mjs'; +import { isBezierDefinition } from './is-bezier-definition.mjs'; + +const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, +}; +const isValidEasing = (easing) => { + return typeof easing === "string"; +}; +const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; +}; + +export { easingDefinitionToFunction }; +//# sourceMappingURL=map.mjs.map diff --git a/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map b/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map new file mode 100644 index 00000000..07aa4e1c --- /dev/null +++ b/node_modules/motion-utils/dist/es/easing/utils/map.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"map.mjs","sources":["../../../../src/easing/utils/map.ts"],"sourcesContent":["import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n"],"names":[],"mappings":";;;;;;;;;AAUA,MAAM,YAAY,GAAG;AACjB,IAAA,MAAM,EAAE,IAAI;IACZ,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;CACb,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,MAAc,KAAyC;AAC1E,IAAA,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAA;AACrC,CAAC,CAAA;AAEY,MAAA,0BAA0B,GAAG,CACtC,UAAkB,KACF;AAChB,IAAA,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE;;QAEhC,SAAS,CACL,UAAU,CAAC,MAAM,KAAK,CAAC,EACvB,CAAyD,uDAAA,CAAA,EACzD,qBAAqB,CACxB,CAAA;QAED,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU,CAAA;QACnC,OAAO,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;KACrC;AAAM,SAAA,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;;AAElC,QAAA,SAAS,CACL,YAAY,CAAC,UAAU,CAAC,KAAK,SAAS,EACtC,CAAA,qBAAA,EAAwB,UAAU,CAAA,CAAA,CAAG,EACrC,qBAAqB,CACxB,CAAA;AACD,QAAA,OAAO,YAAY,CAAC,UAAU,CAAC,CAAA;KAClC;AAED,IAAA,OAAO,UAAU,CAAA;AACrB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/errors.mjs b/node_modules/motion-utils/dist/es/errors.mjs new file mode 100644 index 00000000..851adc94 --- /dev/null +++ b/node_modules/motion-utils/dist/es/errors.mjs @@ -0,0 +1,20 @@ +import { formatErrorMessage } from './format-error-message.mjs'; + +let warning = () => { }; +let invariant = () => { }; +if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; +} + +export { invariant, warning }; +//# sourceMappingURL=errors.mjs.map diff --git a/node_modules/motion-utils/dist/es/errors.mjs.map b/node_modules/motion-utils/dist/es/errors.mjs.map new file mode 100644 index 00000000..02cca99b --- /dev/null +++ b/node_modules/motion-utils/dist/es/errors.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.mjs","sources":["../../src/errors.ts"],"sourcesContent":["import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n"],"names":[],"mappings":";;AAQA,IAAI,OAAO,GAAe,MAAK,IAAG;AAClC,IAAI,SAAS,GAAe,MAAK,IAAG;AAEpC,IACI,OAAO,OAAO,KAAK,WAAW;AAC9B,IAAA,OAAO,CAAC,GAAG,EAAE,QAAQ,KAAK,YAAY,EACxC;IACE,OAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,KAAI;QACpC,IAAI,CAAC,KAAK,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;YAC1C,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;SACvD;AACL,KAAC,CAAA;IAED,SAAS,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,KAAI;QACtC,IAAI,CAAC,KAAK,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;SAC1D;AACL,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/format-error-message.mjs b/node_modules/motion-utils/dist/es/format-error-message.mjs new file mode 100644 index 00000000..dee97cc9 --- /dev/null +++ b/node_modules/motion-utils/dist/es/format-error-message.mjs @@ -0,0 +1,8 @@ +function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; +} + +export { formatErrorMessage }; +//# sourceMappingURL=format-error-message.mjs.map diff --git a/node_modules/motion-utils/dist/es/format-error-message.mjs.map b/node_modules/motion-utils/dist/es/format-error-message.mjs.map new file mode 100644 index 00000000..df5ad05e --- /dev/null +++ b/node_modules/motion-utils/dist/es/format-error-message.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"format-error-message.mjs","sources":["../../src/format-error-message.ts"],"sourcesContent":["export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n"],"names":[],"mappings":"AAAgB,SAAA,kBAAkB,CAAC,OAAe,EAAE,SAAkB,EAAA;AAClE,IAAA,OAAO,SAAS;AACZ,UAAE,CAAA,EAAG,OAAO,CAAA,uFAAA,EAA0F,SAAS,CAAE,CAAA;UAC/G,OAAO,CAAA;AACjB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/global-config.mjs b/node_modules/motion-utils/dist/es/global-config.mjs new file mode 100644 index 00000000..66ed5777 --- /dev/null +++ b/node_modules/motion-utils/dist/es/global-config.mjs @@ -0,0 +1,4 @@ +const MotionGlobalConfig = {}; + +export { MotionGlobalConfig }; +//# sourceMappingURL=global-config.mjs.map diff --git a/node_modules/motion-utils/dist/es/global-config.mjs.map b/node_modules/motion-utils/dist/es/global-config.mjs.map new file mode 100644 index 00000000..664cd854 --- /dev/null +++ b/node_modules/motion-utils/dist/es/global-config.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"global-config.mjs","sources":["../../src/global-config.ts"],"sourcesContent":["export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: (a: T, b: T) => (p: number) => T\n} = {}\n"],"names":[],"mappings":"AAAO,MAAM,kBAAkB,GAM3B;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/index.mjs b/node_modules/motion-utils/dist/es/index.mjs new file mode 100644 index 00000000..2f07b9a2 --- /dev/null +++ b/node_modules/motion-utils/dist/es/index.mjs @@ -0,0 +1,29 @@ +export { addUniqueItem, moveItem, removeItem } from './array.mjs'; +export { clamp } from './clamp.mjs'; +export { invariant, warning } from './errors.mjs'; +export { MotionGlobalConfig } from './global-config.mjs'; +export { isNumericalString } from './is-numerical-string.mjs'; +export { isObject } from './is-object.mjs'; +export { isZeroValueString } from './is-zero-value-string.mjs'; +export { memo } from './memo.mjs'; +export { noop } from './noop.mjs'; +export { pipe } from './pipe.mjs'; +export { progress } from './progress.mjs'; +export { SubscriptionManager } from './subscription-manager.mjs'; +export { millisecondsToSeconds, secondsToMilliseconds } from './time-conversion.mjs'; +export { velocityPerSecond } from './velocity-per-second.mjs'; +export { hasWarned, warnOnce } from './warn-once.mjs'; +export { wrap } from './wrap.mjs'; +export { anticipate } from './easing/anticipate.mjs'; +export { backIn, backInOut, backOut } from './easing/back.mjs'; +export { circIn, circInOut, circOut } from './easing/circ.mjs'; +export { cubicBezier } from './easing/cubic-bezier.mjs'; +export { easeIn, easeInOut, easeOut } from './easing/ease.mjs'; +export { mirrorEasing } from './easing/modifiers/mirror.mjs'; +export { reverseEasing } from './easing/modifiers/reverse.mjs'; +export { steps } from './easing/steps.mjs'; +export { getEasingForSegment } from './easing/utils/get-easing-for-segment.mjs'; +export { isBezierDefinition } from './easing/utils/is-bezier-definition.mjs'; +export { isEasingArray } from './easing/utils/is-easing-array.mjs'; +export { easingDefinitionToFunction } from './easing/utils/map.mjs'; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/motion-utils/dist/es/index.mjs.map b/node_modules/motion-utils/dist/es/index.mjs.map new file mode 100644 index 00000000..9b2660b7 --- /dev/null +++ b/node_modules/motion-utils/dist/es/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-numerical-string.mjs b/node_modules/motion-utils/dist/es/is-numerical-string.mjs new file mode 100644 index 00000000..cb4ce6ef --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-numerical-string.mjs @@ -0,0 +1,7 @@ +/** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ +const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + +export { isNumericalString }; +//# sourceMappingURL=is-numerical-string.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map b/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map new file mode 100644 index 00000000..f8a9eae1 --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-numerical-string.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-numerical-string.mjs","sources":["../../src/is-numerical-string.ts"],"sourcesContent":["/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,CAAS,KAAK,8BAA8B,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-object.mjs b/node_modules/motion-utils/dist/es/is-object.mjs new file mode 100644 index 00000000..acf3ca72 --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-object.mjs @@ -0,0 +1,6 @@ +function isObject(value) { + return typeof value === "object" && value !== null; +} + +export { isObject }; +//# sourceMappingURL=is-object.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-object.mjs.map b/node_modules/motion-utils/dist/es/is-object.mjs.map new file mode 100644 index 00000000..2c0e3c62 --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-object.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-object.mjs","sources":["../../src/is-object.ts"],"sourcesContent":["export function isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null\n}\n"],"names":[],"mappings":"AAAM,SAAU,QAAQ,CAAC,KAAc,EAAA;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAA;AACtD;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs new file mode 100644 index 00000000..ba89398b --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs @@ -0,0 +1,7 @@ +/** + * Check if the value is a zero value string like "0px" or "0%" + */ +const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + +export { isZeroValueString }; +//# sourceMappingURL=is-zero-value-string.mjs.map diff --git a/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map new file mode 100644 index 00000000..8c7f2afb --- /dev/null +++ b/node_modules/motion-utils/dist/es/is-zero-value-string.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"is-zero-value-string.mjs","sources":["../../src/is-zero-value-string.ts"],"sourcesContent":["/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,CAAS,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/memo.mjs b/node_modules/motion-utils/dist/es/memo.mjs new file mode 100644 index 00000000..d164ae43 --- /dev/null +++ b/node_modules/motion-utils/dist/es/memo.mjs @@ -0,0 +1,12 @@ +/*#__NO_SIDE_EFFECTS__*/ +function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; +} + +export { memo }; +//# sourceMappingURL=memo.mjs.map diff --git a/node_modules/motion-utils/dist/es/memo.mjs.map b/node_modules/motion-utils/dist/es/memo.mjs.map new file mode 100644 index 00000000..d590b675 --- /dev/null +++ b/node_modules/motion-utils/dist/es/memo.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"memo.mjs","sources":["../../src/memo.ts"],"sourcesContent":["/*#__NO_SIDE_EFFECTS__*/\nexport function memo(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n"],"names":[],"mappings":"AAAA;AACM,SAAU,IAAI,CAAgB,QAAiB,EAAA;AACjD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,OAAO,MAAK;QACR,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;AAC7C,QAAA,OAAO,MAAM,CAAA;AACjB,KAAC,CAAA;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/noop.mjs b/node_modules/motion-utils/dist/es/noop.mjs new file mode 100644 index 00000000..bd29da3b --- /dev/null +++ b/node_modules/motion-utils/dist/es/noop.mjs @@ -0,0 +1,5 @@ +/*#__NO_SIDE_EFFECTS__*/ +const noop = (any) => any; + +export { noop }; +//# sourceMappingURL=noop.mjs.map diff --git a/node_modules/motion-utils/dist/es/noop.mjs.map b/node_modules/motion-utils/dist/es/noop.mjs.map new file mode 100644 index 00000000..8912de2c --- /dev/null +++ b/node_modules/motion-utils/dist/es/noop.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"noop.mjs","sources":["../../src/noop.ts"],"sourcesContent":["/*#__NO_SIDE_EFFECTS__*/\nexport const noop = (any: T): T => any\n"],"names":[],"mappings":"AAAA;AACa,MAAA,IAAI,GAAG,CAAI,GAAM,KAAQ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/pipe.mjs b/node_modules/motion-utils/dist/es/pipe.mjs new file mode 100644 index 00000000..23cdf912 --- /dev/null +++ b/node_modules/motion-utils/dist/es/pipe.mjs @@ -0,0 +1,12 @@ +/** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ +const combineFunctions = (a, b) => (v) => b(a(v)); +const pipe = (...transformers) => transformers.reduce(combineFunctions); + +export { pipe }; +//# sourceMappingURL=pipe.mjs.map diff --git a/node_modules/motion-utils/dist/es/pipe.mjs.map b/node_modules/motion-utils/dist/es/pipe.mjs.map new file mode 100644 index 00000000..974a5103 --- /dev/null +++ b/node_modules/motion-utils/dist/es/pipe.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"pipe.mjs","sources":["../../src/pipe.ts"],"sourcesContent":["/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a: Function, b: Function) => (v: any) => b(a(v))\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce(combineFunctions)\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;AACH,MAAM,gBAAgB,GAAG,CAAC,CAAW,EAAE,CAAW,KAAK,CAAC,CAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7D,MAAA,IAAI,GAAG,CAAC,GAAG,YAAwB,KAC5C,YAAY,CAAC,MAAM,CAAC,gBAAgB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/progress.mjs b/node_modules/motion-utils/dist/es/progress.mjs new file mode 100644 index 00000000..fa8c6c06 --- /dev/null +++ b/node_modules/motion-utils/dist/es/progress.mjs @@ -0,0 +1,20 @@ +/* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. + + @param [number]: Lower limit + @param [number]: Upper limit + @param [number]: Value to find progress within given range + @return [number]: Progress of value within range as expressed 0-1 +*/ +/*#__NO_SIDE_EFFECTS__*/ +const progress = (from, to, value) => { + const toFromDifference = to - from; + return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; +}; + +export { progress }; +//# sourceMappingURL=progress.mjs.map diff --git a/node_modules/motion-utils/dist/es/progress.mjs.map b/node_modules/motion-utils/dist/es/progress.mjs.map new file mode 100644 index 00000000..fa7cbc10 --- /dev/null +++ b/node_modules/motion-utils/dist/es/progress.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"progress.mjs","sources":["../../src/progress.ts"],"sourcesContent":["/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const toFromDifference = to - from\n\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;AAWE;AACF;AACa,MAAA,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAU,EAAE,KAAa,KAAI;AAChE,IAAA,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAA;AAElC,IAAA,OAAO,gBAAgB,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,IAAI,gBAAgB,CAAA;AACzE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/subscription-manager.mjs b/node_modules/motion-utils/dist/es/subscription-manager.mjs new file mode 100644 index 00000000..7329b56a --- /dev/null +++ b/node_modules/motion-utils/dist/es/subscription-manager.mjs @@ -0,0 +1,41 @@ +import { addUniqueItem, removeItem } from './array.mjs'; + +class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } +} + +export { SubscriptionManager }; +//# sourceMappingURL=subscription-manager.mjs.map diff --git a/node_modules/motion-utils/dist/es/subscription-manager.mjs.map b/node_modules/motion-utils/dist/es/subscription-manager.mjs.map new file mode 100644 index 00000000..85c57882 --- /dev/null +++ b/node_modules/motion-utils/dist/es/subscription-manager.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"subscription-manager.mjs","sources":["../../src/subscription-manager.ts"],"sourcesContent":["import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters[0],\n b?: Parameters[1],\n c?: Parameters[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n"],"names":[],"mappings":";;MAIa,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;QACY,IAAa,CAAA,aAAA,GAAc,EAAE,CAAA;KAwCxC;AAtCG,IAAA,GAAG,CAAC,OAAgB,EAAA;AAChB,QAAA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;QAC1C,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;KACvD;AAED,IAAA,MAAM,CACF,CAA0B,EAC1B,CAA0B,EAC1B,CAA0B,EAAA;AAE1B,QAAA,MAAM,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAA;AAElD,QAAA,IAAI,CAAC,gBAAgB;YAAE,OAAM;AAE7B,QAAA,IAAI,gBAAgB,KAAK,CAAC,EAAE;AACxB;;AAEG;AACH,YAAA,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;SACjC;aAAM;AACH,YAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,EAAE,CAAC,EAAE,EAAE;AACvC;;;AAGG;gBACH,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;gBACrC,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;aAC9B;SACJ;KACJ;IAED,OAAO,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAA;KACnC;IAED,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAA;KAChC;AACJ;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/time-conversion.mjs b/node_modules/motion-utils/dist/es/time-conversion.mjs new file mode 100644 index 00000000..f7703994 --- /dev/null +++ b/node_modules/motion-utils/dist/es/time-conversion.mjs @@ -0,0 +1,13 @@ +/** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ +/*#__NO_SIDE_EFFECTS__*/ +const secondsToMilliseconds = (seconds) => seconds * 1000; +/*#__NO_SIDE_EFFECTS__*/ +const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + +export { millisecondsToSeconds, secondsToMilliseconds }; +//# sourceMappingURL=time-conversion.mjs.map diff --git a/node_modules/motion-utils/dist/es/time-conversion.mjs.map b/node_modules/motion-utils/dist/es/time-conversion.mjs.map new file mode 100644 index 00000000..87a5e846 --- /dev/null +++ b/node_modules/motion-utils/dist/es/time-conversion.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"time-conversion.mjs","sources":["../../src/time-conversion.ts"],"sourcesContent":["/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const secondsToMilliseconds = (seconds: number) => seconds * 1000\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const millisecondsToSeconds = (milliseconds: number) =>\n milliseconds / 1000\n"],"names":[],"mappings":"AAAA;;;;;AAKG;AAEH;AACO,MAAM,qBAAqB,GAAG,CAAC,OAAe,KAAK,OAAO,GAAG,KAAI;AAExE;AACO,MAAM,qBAAqB,GAAG,CAAC,YAAoB,KACtD,YAAY,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/velocity-per-second.mjs b/node_modules/motion-utils/dist/es/velocity-per-second.mjs new file mode 100644 index 00000000..05ae3e7f --- /dev/null +++ b/node_modules/motion-utils/dist/es/velocity-per-second.mjs @@ -0,0 +1,12 @@ +/* + Convert velocity into velocity per second + + @param [number]: Unit per frame + @param [number]: Frame duration in ms +*/ +function velocityPerSecond(velocity, frameDuration) { + return frameDuration ? velocity * (1000 / frameDuration) : 0; +} + +export { velocityPerSecond }; +//# sourceMappingURL=velocity-per-second.mjs.map diff --git a/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map b/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map new file mode 100644 index 00000000..7db34d8b --- /dev/null +++ b/node_modules/motion-utils/dist/es/velocity-per-second.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"velocity-per-second.mjs","sources":["../../src/velocity-per-second.ts"],"sourcesContent":["/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nexport function velocityPerSecond(velocity: number, frameDuration: number) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0\n}\n"],"names":[],"mappings":"AAAA;;;;;AAKE;AACc,SAAA,iBAAiB,CAAC,QAAgB,EAAE,aAAqB,EAAA;AACrE,IAAA,OAAO,aAAa,GAAG,QAAQ,IAAI,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;AAChE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/warn-once.mjs b/node_modules/motion-utils/dist/es/warn-once.mjs new file mode 100644 index 00000000..8d68e963 --- /dev/null +++ b/node_modules/motion-utils/dist/es/warn-once.mjs @@ -0,0 +1,15 @@ +import { formatErrorMessage } from './format-error-message.mjs'; + +const warned = new Set(); +function hasWarned(message) { + return warned.has(message); +} +function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); +} + +export { hasWarned, warnOnce }; +//# sourceMappingURL=warn-once.mjs.map diff --git a/node_modules/motion-utils/dist/es/warn-once.mjs.map b/node_modules/motion-utils/dist/es/warn-once.mjs.map new file mode 100644 index 00000000..1b480b06 --- /dev/null +++ b/node_modules/motion-utils/dist/es/warn-once.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"warn-once.mjs","sources":["../../src/warn-once.ts"],"sourcesContent":["import { formatErrorMessage } from \"./format-error-message\"\n\nconst warned = new Set()\n\nexport function hasWarned(message: string) {\n return warned.has(message)\n}\n\nexport function warnOnce(\n condition: boolean,\n message: string,\n errorCode?: string\n) {\n if (condition || warned.has(message)) return\n\n console.warn(formatErrorMessage(message, errorCode))\n warned.add(message)\n}\n"],"names":[],"mappings":";;AAEA,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAE1B,SAAU,SAAS,CAAC,OAAe,EAAA;AACrC,IAAA,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC;SAEe,QAAQ,CACpB,SAAkB,EAClB,OAAe,EACf,SAAkB,EAAA;AAElB,IAAA,IAAI,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAM;IAE5C,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;AACpD,IAAA,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;AACvB;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/es/wrap.mjs b/node_modules/motion-utils/dist/es/wrap.mjs new file mode 100644 index 00000000..5fc9fba9 --- /dev/null +++ b/node_modules/motion-utils/dist/es/wrap.mjs @@ -0,0 +1,7 @@ +const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; +}; + +export { wrap }; +//# sourceMappingURL=wrap.mjs.map diff --git a/node_modules/motion-utils/dist/es/wrap.mjs.map b/node_modules/motion-utils/dist/es/wrap.mjs.map new file mode 100644 index 00000000..c0321403 --- /dev/null +++ b/node_modules/motion-utils/dist/es/wrap.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"wrap.mjs","sources":["../../src/wrap.ts"],"sourcesContent":["export const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n"],"names":[],"mappings":"AAAa,MAAA,IAAI,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,CAAS,KAAI;AACxD,IAAA,MAAM,SAAS,GAAG,GAAG,GAAG,GAAG,CAAA;AAC3B,IAAA,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,GAAG,CAAA;AACpE;;;;"} \ No newline at end of file diff --git a/node_modules/motion-utils/dist/index.d.ts b/node_modules/motion-utils/dist/index.d.ts new file mode 100644 index 00000000..4eedffb0 --- /dev/null +++ b/node_modules/motion-utils/dist/index.d.ts @@ -0,0 +1,140 @@ +declare function addUniqueItem(arr: T[], item: T): void; +declare function removeItem(arr: T[], item: T): void; +declare function moveItem([...arr]: T[], fromIndex: number, toIndex: number): T[]; + +declare const clamp: (min: number, max: number, v: number) => number; + +type DevMessage = (check: boolean, message: string, errorCode?: string) => void; +declare let warning: DevMessage; +declare let invariant: DevMessage; + +declare const MotionGlobalConfig: { + skipAnimations?: boolean; + instantAnimations?: boolean; + useManualTiming?: boolean; + WillChange?: any; + mix?: (a: T, b: T) => (p: number) => T; +}; + +/** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ +declare const isNumericalString: (v: string) => boolean; + +declare function isObject(value: unknown): value is object; + +/** + * Check if the value is a zero value string like "0px" or "0%" + */ +declare const isZeroValueString: (v: string) => boolean; + +declare function memo(callback: () => T): () => T; + +declare const noop: (any: T) => T; + +declare const pipe: (...transformers: Function[]) => Function; + +declare const progress: (from: number, to: number, value: number) => number; + +type GenericHandler = (...args: any) => void; +declare class SubscriptionManager { + private subscriptions; + add(handler: Handler): VoidFunction; + notify(a?: Parameters[0], b?: Parameters[1], c?: Parameters[2]): void; + getSize(): number; + clear(): void; +} + +/** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ +declare const secondsToMilliseconds: (seconds: number) => number; +declare const millisecondsToSeconds: (milliseconds: number) => number; + +declare function velocityPerSecond(velocity: number, frameDuration: number): number; + +declare function hasWarned(message: string): boolean; +declare function warnOnce(condition: boolean, message: string, errorCode?: string): void; + +declare const wrap: (min: number, max: number, v: number) => number; + +declare const anticipate: (p: number) => number; + +declare const backOut: (t: number) => number; +declare const backIn: EasingFunction; +declare const backInOut: EasingFunction; + +type EasingFunction = (v: number) => number; +type EasingModifier = (easing: EasingFunction) => EasingFunction; +type BezierDefinition = readonly [number, number, number, number]; +type EasingDefinition = BezierDefinition | "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate"; +/** + * The easing function to use. Set as one of: + * + * - The name of an in-built easing function. + * - An array of four numbers to define a cubic bezier curve. + * - An easing function, that accepts and returns a progress value between `0` and `1`. + * + * @public + */ +type Easing = EasingDefinition | EasingFunction; + +declare const circIn: EasingFunction; +declare const circOut: EasingFunction; +declare const circInOut: EasingFunction; + +declare function cubicBezier(mX1: number, mY1: number, mX2: number, mY2: number): (t: number) => number; + +declare const easeIn: (t: number) => number; +declare const easeOut: (t: number) => number; +declare const easeInOut: (t: number) => number; + +declare const mirrorEasing: EasingModifier; + +declare const reverseEasing: EasingModifier; + +type Direction = "start" | "end"; +declare function steps(numSteps: number, direction?: Direction): EasingFunction; + +declare function getEasingForSegment(easing: Easing | Easing[], i: number): Easing; + +declare const isBezierDefinition: (easing: Easing | Easing[]) => easing is BezierDefinition; + +declare const isEasingArray: (ease: any) => ease is Easing[]; + +declare const easingDefinitionToFunction: (definition: Easing) => EasingFunction; + +interface Point { + x: number; + y: number; +} +interface Axis { + min: number; + max: number; +} +interface Box { + x: Axis; + y: Axis; +} +interface BoundingBox { + top: number; + right: number; + bottom: number; + left: number; +} +interface AxisDelta { + translate: number; + scale: number; + origin: number; + originPoint: number; +} +interface Delta { + x: AxisDelta; + y: AxisDelta; +} +type TransformPoint = (point: Point) => Point; + +export { type Axis, type AxisDelta, type BezierDefinition, type BoundingBox, type Box, type Delta, type DevMessage, type Direction, type Easing, type EasingDefinition, type EasingFunction, type EasingModifier, MotionGlobalConfig, type Point, SubscriptionManager, type TransformPoint, addUniqueItem, anticipate, backIn, backInOut, backOut, circIn, circInOut, circOut, clamp, cubicBezier, easeIn, easeInOut, easeOut, easingDefinitionToFunction, getEasingForSegment, hasWarned, invariant, isBezierDefinition, isEasingArray, isNumericalString, isObject, isZeroValueString, memo, millisecondsToSeconds, mirrorEasing, moveItem, noop, pipe, progress, removeItem, reverseEasing, secondsToMilliseconds, steps, velocityPerSecond, warnOnce, warning, wrap }; diff --git a/node_modules/motion-utils/dist/motion-utils.dev.js b/node_modules/motion-utils/dist/motion-utils.dev.js new file mode 100644 index 00000000..18f1f594 --- /dev/null +++ b/node_modules/motion-utils/dist/motion-utils.dev.js @@ -0,0 +1,349 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MotionUtils = {})); +})(this, (function (exports) { 'use strict'; + + function addUniqueItem(arr, item) { + if (arr.indexOf(item) === -1) + arr.push(item); + } + function removeItem(arr, item) { + const index = arr.indexOf(item); + if (index > -1) + arr.splice(index, 1); + } + // Adapted from array-move + function moveItem([...arr], fromIndex, toIndex) { + const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; + if (startIndex >= 0 && startIndex < arr.length) { + const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; + const [item] = arr.splice(fromIndex, 1); + arr.splice(endIndex, 0, item); + } + return arr; + } + + const clamp = (min, max, v) => { + if (v > max) + return max; + if (v < min) + return min; + return v; + }; + + function formatErrorMessage(message, errorCode) { + return errorCode + ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}` + : message; + } + + exports.warning = () => { }; + exports.invariant = () => { }; + if (typeof process !== "undefined" && + process.env?.NODE_ENV !== "production") { + exports.warning = (check, message, errorCode) => { + if (!check && typeof console !== "undefined") { + console.warn(formatErrorMessage(message, errorCode)); + } + }; + exports.invariant = (check, message, errorCode) => { + if (!check) { + throw new Error(formatErrorMessage(message, errorCode)); + } + }; + } + + const MotionGlobalConfig = {}; + + /** + * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" + */ + const isNumericalString = (v) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v); + + function isObject(value) { + return typeof value === "object" && value !== null; + } + + /** + * Check if the value is a zero value string like "0px" or "0%" + */ + const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v); + + /*#__NO_SIDE_EFFECTS__*/ + function memo(callback) { + let result; + return () => { + if (result === undefined) + result = callback(); + return result; + }; + } + + /*#__NO_SIDE_EFFECTS__*/ + const noop = (any) => any; + + /** + * Pipe + * Compose other transformers to run linearily + * pipe(min(20), max(40)) + * @param {...functions} transformers + * @return {function} + */ + const combineFunctions = (a, b) => (v) => b(a(v)); + const pipe = (...transformers) => transformers.reduce(combineFunctions); + + /* + Progress within given range + + Given a lower limit and an upper limit, we return the progress + (expressed as a number 0-1) represented by the given value, and + limit that progress to within 0-1. + + @param [number]: Lower limit + @param [number]: Upper limit + @param [number]: Value to find progress within given range + @return [number]: Progress of value within range as expressed 0-1 + */ + /*#__NO_SIDE_EFFECTS__*/ + const progress = (from, to, value) => { + const toFromDifference = to - from; + return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; + }; + + class SubscriptionManager { + constructor() { + this.subscriptions = []; + } + add(handler) { + addUniqueItem(this.subscriptions, handler); + return () => removeItem(this.subscriptions, handler); + } + notify(a, b, c) { + const numSubscriptions = this.subscriptions.length; + if (!numSubscriptions) + return; + if (numSubscriptions === 1) { + /** + * If there's only a single handler we can just call it without invoking a loop. + */ + this.subscriptions[0](a, b, c); + } + else { + for (let i = 0; i < numSubscriptions; i++) { + /** + * Check whether the handler exists before firing as it's possible + * the subscriptions were modified during this loop running. + */ + const handler = this.subscriptions[i]; + handler && handler(a, b, c); + } + } + } + getSize() { + return this.subscriptions.length; + } + clear() { + this.subscriptions.length = 0; + } + } + + /** + * Converts seconds to milliseconds + * + * @param seconds - Time in seconds. + * @return milliseconds - Converted time in milliseconds. + */ + /*#__NO_SIDE_EFFECTS__*/ + const secondsToMilliseconds = (seconds) => seconds * 1000; + /*#__NO_SIDE_EFFECTS__*/ + const millisecondsToSeconds = (milliseconds) => milliseconds / 1000; + + /* + Convert velocity into velocity per second + + @param [number]: Unit per frame + @param [number]: Frame duration in ms + */ + function velocityPerSecond(velocity, frameDuration) { + return frameDuration ? velocity * (1000 / frameDuration) : 0; + } + + const warned = new Set(); + function hasWarned(message) { + return warned.has(message); + } + function warnOnce(condition, message, errorCode) { + if (condition || warned.has(message)) + return; + console.warn(formatErrorMessage(message, errorCode)); + warned.add(message); + } + + const wrap = (min, max, v) => { + const rangeSize = max - min; + return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min; + }; + + /* + Bezier function generator + This has been modified from GaĆ«tan Renaudeau's BezierEasing + https://github.com/gre/bezier-easing/blob/master/src/index.js + https://github.com/gre/bezier-easing/blob/master/LICENSE + + I've removed the newtonRaphsonIterate algo because in benchmarking it + wasn't noticeably faster than binarySubdivision, indeed removing it + usually improved times, depending on the curve. + I also removed the lookup table, as for the added bundle size and loop we're + only cutting ~4 or so subdivision iterations. I bumped the max iterations up + to 12 to compensate and this still tended to be faster for no perceivable + loss in accuracy. + Usage + const easeOut = cubicBezier(.17,.67,.83,.67); + const x = easeOut(0.5); // returns 0.627... + */ + // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. + const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * + t; + const subdivisionPrecision = 0.0000001; + const subdivisionMaxIterations = 12; + function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { + let currentX; + let currentT; + let i = 0; + do { + currentT = lowerBound + (upperBound - lowerBound) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - x; + if (currentX > 0.0) { + upperBound = currentT; + } + else { + lowerBound = currentT; + } + } while (Math.abs(currentX) > subdivisionPrecision && + ++i < subdivisionMaxIterations); + return currentT; + } + function cubicBezier(mX1, mY1, mX2, mY2) { + // If this is a linear gradient, return linear easing + if (mX1 === mY1 && mX2 === mY2) + return noop; + const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); + // If animation is at start/end, return t without easing + return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); + } + + // Accepts an easing function and returns a new one that outputs mirrored values for + // the second half of the animation. Turns easeIn into easeInOut. + const mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; + + // Accepts an easing function and returns a new one that outputs reversed values. + // Turns easeIn into easeOut. + const reverseEasing = (easing) => (p) => 1 - easing(1 - p); + + const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99); + const backIn = /*@__PURE__*/ reverseEasing(backOut); + const backInOut = /*@__PURE__*/ mirrorEasing(backIn); + + const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); + + const circIn = (p) => 1 - Math.sin(Math.acos(p)); + const circOut = reverseEasing(circIn); + const circInOut = mirrorEasing(circIn); + + const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1); + const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1); + const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1); + + function steps(numSteps, direction = "end") { + return (progress) => { + progress = + direction === "end" + ? Math.min(progress, 0.999) + : Math.max(progress, 0.001); + const expanded = progress * numSteps; + const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); + return clamp(0, 1, rounded / numSteps); + }; + } + + const isEasingArray = (ease) => { + return Array.isArray(ease) && typeof ease[0] !== "number"; + }; + + function getEasingForSegment(easing, i) { + return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing; + } + + const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; + + const easingLookup = { + linear: noop, + easeIn, + easeInOut, + easeOut, + circIn, + circInOut, + circOut, + backIn, + backInOut, + backOut, + anticipate, + }; + const isValidEasing = (easing) => { + return typeof easing === "string"; + }; + const easingDefinitionToFunction = (definition) => { + if (isBezierDefinition(definition)) { + // If cubic bezier definition, create bezier curve + exports.invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, "cubic-bezier-length"); + const [x1, y1, x2, y2] = definition; + return cubicBezier(x1, y1, x2, y2); + } + else if (isValidEasing(definition)) { + // Else lookup from table + exports.invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, "invalid-easing-type"); + return easingLookup[definition]; + } + return definition; + }; + + exports.MotionGlobalConfig = MotionGlobalConfig; + exports.SubscriptionManager = SubscriptionManager; + exports.addUniqueItem = addUniqueItem; + exports.anticipate = anticipate; + exports.backIn = backIn; + exports.backInOut = backInOut; + exports.backOut = backOut; + exports.circIn = circIn; + exports.circInOut = circInOut; + exports.circOut = circOut; + exports.clamp = clamp; + exports.cubicBezier = cubicBezier; + exports.easeIn = easeIn; + exports.easeInOut = easeInOut; + exports.easeOut = easeOut; + exports.easingDefinitionToFunction = easingDefinitionToFunction; + exports.getEasingForSegment = getEasingForSegment; + exports.hasWarned = hasWarned; + exports.isBezierDefinition = isBezierDefinition; + exports.isEasingArray = isEasingArray; + exports.isNumericalString = isNumericalString; + exports.isObject = isObject; + exports.isZeroValueString = isZeroValueString; + exports.memo = memo; + exports.millisecondsToSeconds = millisecondsToSeconds; + exports.mirrorEasing = mirrorEasing; + exports.moveItem = moveItem; + exports.noop = noop; + exports.pipe = pipe; + exports.progress = progress; + exports.removeItem = removeItem; + exports.reverseEasing = reverseEasing; + exports.secondsToMilliseconds = secondsToMilliseconds; + exports.steps = steps; + exports.velocityPerSecond = velocityPerSecond; + exports.warnOnce = warnOnce; + exports.wrap = wrap; + +})); diff --git a/node_modules/motion-utils/dist/motion-utils.js b/node_modules/motion-utils/dist/motion-utils.js new file mode 100644 index 00000000..f71c15e8 --- /dev/null +++ b/node_modules/motion-utils/dist/motion-utils.js @@ -0,0 +1 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).MotionUtils={})}(this,function(n){"use strict";function t(n,t){-1===n.indexOf(t)&&n.push(t)}function e(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}const i=(n,t,e)=>e>t?t:e{},n.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n.warning=(n,t,e)=>{n||"undefined"==typeof console||console.warn(s(t,e))},n.invariant=(n,t,e)=>{if(!n)throw new Error(s(t,e))});const o=n=>n,r=(n,t)=>e=>t(n(e));const c=new Set;const u=(n,t,e)=>{const i=t-n;return((e-n)%i+i)%i+n},a=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n;function f(n,t,e,i){if(n===t&&e===i)return o;const s=t=>function(n,t,e,i,s){let o,r,c=0;do{r=t+(e-t)/2,o=a(r,i,s)-n,o>0?e=r:t=r}while(Math.abs(o)>1e-7&&++c<12);return r}(t,0,1,n,e);return n=>0===n||1===n?n:a(s(n),t,i)}const l=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,p=n=>t=>1-n(1-t),d=f(.33,1.53,.69,.99),h=p(d),g=l(h),b=n=>(n*=2)<1?.5*h(n):.5*(2-Math.pow(2,-10*(n-1))),m=n=>1-Math.sin(Math.acos(n)),y=p(m),v=l(m),O=f(.42,0,1,1),I=f(0,0,.58,1),M=f(.42,0,.58,1);const w=n=>Array.isArray(n)&&"number"!=typeof n[0];const S=n=>Array.isArray(n)&&"number"==typeof n[0],E={linear:o,easeIn:O,easeInOut:M,easeOut:I,circIn:m,circInOut:v,circOut:y,backIn:h,backInOut:g,backOut:d,anticipate:b};n.MotionGlobalConfig={},n.SubscriptionManager=class{constructor(){this.subscriptions=[]}add(n){return t(this.subscriptions,n),()=>e(this.subscriptions,n)}notify(n,t,e){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](n,t,e);else for(let s=0;s{if(S(t)){n.invariant(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,o]=t;return f(e,i,s,o)}return"string"==typeof t?(n.invariant(void 0!==E[t],`Invalid easing type '${t}'`,"invalid-easing-type"),E[t]):t},n.getEasingForSegment=function(n,t){return w(n)?n[u(0,n.length,t)]:n},n.hasWarned=function(n){return c.has(n)},n.isBezierDefinition=S,n.isEasingArray=w,n.isNumericalString=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),n.isObject=function(n){return"object"==typeof n&&null!==n},n.isZeroValueString=n=>/^0[^.\s]+$/u.test(n),n.memo=function(n){let t;return()=>(void 0===t&&(t=n()),t)},n.millisecondsToSeconds=n=>n/1e3,n.mirrorEasing=l,n.moveItem=function([...n],t,e){const i=t<0?n.length+t:t;if(i>=0&&in.reduce(r),n.progress=(n,t,e)=>{const i=t-n;return 0===i?1:(e-n)/i},n.removeItem=e,n.reverseEasing=p,n.secondsToMilliseconds=n=>1e3*n,n.steps=function(n,t="end"){return e=>{const s=(e="end"===t?Math.min(e,.999):Math.max(e,.001))*n,o="end"===t?Math.floor(s):Math.ceil(s);return i(0,1,o/n)}},n.velocityPerSecond=function(n,t){return t?n*(1e3/t):0},n.warnOnce=function(n,t,e){n||c.has(t)||(console.warn(s(t,e)),c.add(t))},n.wrap=u}); diff --git a/node_modules/motion-utils/package.json b/node_modules/motion-utils/package.json new file mode 100644 index 00000000..baad0aee --- /dev/null +++ b/node_modules/motion-utils/package.json @@ -0,0 +1,26 @@ +{ + "name": "motion-utils", + "version": "12.29.2", + "author": "Matt Perry", + "license": "MIT", + "repository": "https://github.com/motiondivision/motion", + "main": "./dist/cjs/index.js", + "types": "./dist/index.d.ts", + "module": "./dist/es/index.mjs", + "sideEffects": false, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/cjs/index.js", + "import": "./dist/es/index.mjs", + "default": "./dist/cjs/index.js" + } + }, + "scripts": { + "clean": "rm -rf types dist lib", + "build": "yarn clean && tsc -p . && rollup -c", + "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"", + "test": "jest --config jest.config.json --max-workers=2" + }, + "gitHead": "8f6ad46d8a1905084e9f5fba290d229d18d07b47" +} diff --git a/package-lock.json b/package-lock.json index 03369be9..2069d6aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "heartbeat-monitor", "version": "0.1.0", "dependencies": { + "framer-motion": "^12.34.2", "lucide-react": "^0.474.0", "next": "15.1.6", "react": "^19.0.0", @@ -1186,6 +1187,33 @@ "node": ">=8" } }, + "node_modules/framer-motion": { + "version": "12.34.2", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.34.2.tgz", + "integrity": "sha512-CcnYTzbRybm1/OE8QLXfXI8gR1cx5T4dF3D2kn5IyqsGNeLAKl2iFHb2BzFyXBGqESntDt6rPYl4Jhrb7tdB8g==", + "license": "MIT", + "dependencies": { + "motion-dom": "^12.34.2", + "motion-utils": "^12.29.2", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1402,6 +1430,21 @@ "node": ">=8.6" } }, + "node_modules/motion-dom": { + "version": "12.34.2", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.34.2.tgz", + "integrity": "sha512-n7gknp7gHcW7DUcmet0JVPLVHmE3j9uWwDp5VbE3IkCNnW5qdu0mOhjNYzXMkrQjrgr+h6Db3EDM2QBhW2qNxQ==", + "license": "MIT", + "dependencies": { + "motion-utils": "^12.29.2" + } + }, + "node_modules/motion-utils": { + "version": "12.29.2", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.29.2.tgz", + "integrity": "sha512-G3kc34H2cX2gI63RqU+cZq+zWRRPSsNIOjpdl9TN4AQwC4sgwYPl/Q/Obf/d53nOm569T0fYK+tcoSV50BWx8A==", + "license": "MIT" + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", diff --git a/package.json b/package.json index 2addd5e0..4b24f1a2 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "framer-motion": "^12.34.2", "lucide-react": "^0.474.0", "next": "15.1.6", "react": "^19.0.0",