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AAUjvB,GAC3B,OAAO8Q,GAAOkZ,EAAI1H,SAASvR,IAAI/Q,EACnC,EAIAkvB,qBAAsBkW,GAAgBjhC,EAAQ6lB,GAEtD,EAER,CAEA,IAAI6iB,GAxtEe,CACf,IACA,OACA,UACA,OACA,UACA,QACA,QACA,IACA,OACA,MACA,MACA,MACA,aACA,OACA,KACA,SACA,SACA,UACA,OACA,OACA,MACA,WACA,OACA,WACA,KACA,MACA,UACA,MACA,SACA,MACA,KACA,KACA,KACA,QACA,WACA,aACA,SACA,SACA,OACA,KACA,KACA,KACA,KACA,KACA,KACA,OACA,SACA,SACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,SACA,QACA,SACA,KACA,OACA,OACA,MACA,OACA,OACA,WACA,OACA,QACA,MACA,WACA,SACA,KACA,WACA,SACA,SACA,IACA,QACA,UACA,MACA,WACA,IACA,KACA,KACA,OACA,IACA,OACA,SACA,UACA,SACA,QACA,SACA,OACA,SACA,QACA,MACA,UACA,MACA,QACA,QACA,KACA,WACA,QACA,KACA,QACA,OACA,QACA,KACA,QACA,IACA,KACA,MACA,QACA,MACA,WAsmEoC/sC,QAAO,SAAUC,EAAKs+B,GAC1D,IAAI1V,EAASqjB,GAAsB3N,GAInC,OADAt+B,EAAIs+B,GAAa/I,GAAsB3M,GAChC5oB,CACX,GAAG,CAAC,GACA+sC,GAAsBvW,GAAYz2B,QAAO,SAAUC,EAAKs+B,GAIxD,OADAt+B,EAAIs+B,GAAa/I,GAAsB0W,GAAsB3N,IACtDt+B,CACX,GAAG,CAAC,GAoBAgtC,GAAS1vC,EAAS,CAgBlBmzB,OAAQ,SAAgB6N,GACpB,OAAO/I,GAAsB0W,GAAsB3N,GACvD,GAAKwO,GAAsBC,IAwJjBjjB,GAAY,GACZA,GAAY,GACJA,GAAY,GACZA,GAAY,GAiIlC,SAASmjB,KACL,IAAIC,EAAoBljB,IAAY,WAAc,OAAO,IAAImJ,EAAqB,IAKlF,OAJAnH,EAAAA,EAAAA,YAAU,WAEN,OADAkhB,EAAkB/hB,QACX,WAAc,OAAO+hB,EAAkB9hB,SAAW,CAC7D,GAAG,IACI8hB,CACX,CAqNA,IA+FIC,GAAuBrjB,GAAY,MACvC,GAAsB,qBAAXnrB,OACP,GAAIA,OAAOyuC,WAAY,CACnB,IAAIC,GAAqB1uC,OAAOyuC,WAAW,4BACvCE,GAA8B,WAC9B,OAAOH,GAAqBj8B,IAAIm8B,GAAmBE,QACvD,EACAF,GAAmBG,YAAYF,IAC/BA,IACJ,MAEIH,GAAqBj8B,KAAI","sources":["../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","../../../node_modules/@emotion/memoize/dist/memoize.browser.esm.js","../../../node_modules/framer-motion/node_modules/tslib/tslib.es6.js","../../../node_modules/hey-listen/dist/hey-listen.es.js","../../../node_modules/framesync/dist/framesync.es.js","../../../node_modules/style-value-types/node_modules/tslib/tslib.es6.js","../../../node_modules/style-value-types/dist/style-value-types.es.js","../../../node_modules/@popmotion/easing/dist/easing.es.js","../../../node_modules/@popmotion/popcorn/dist/popcorn.es.js","../../../node_modules/stylefire/node_modules/tslib/tslib.es6.js","../../../node_modules/stylefire/dist/stylefire.es.js","../../../node_modules/popmotion/node_modules/tslib/tslib.es6.js","../../../node_modules/popmotion/dist/popmotion.es.js","../../../node_modules/framer-motion/dist/framer-motion.es.js"],"sourcesContent":["import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","var warning = function () { };\r\nvar invariant = function () { };\r\nif (process.env.NODE_ENV !== 'production') {\r\n warning = function (check, message) {\r\n if (!check && typeof console !== 'undefined') {\r\n console.warn(message);\r\n }\r\n };\r\n invariant = function (check, message) {\r\n if (!check) {\r\n throw new Error(message);\r\n }\r\n };\r\n}\n\nexport { invariant, warning };\n","import { invariant } from 'hey-listen';\n\nvar prevTime = 0;\nvar onNextFrame = typeof window !== 'undefined' && window.requestAnimationFrame !== undefined ? function (callback) {\n return window.requestAnimationFrame(callback);\n} : function (callback) {\n var timestamp = Date.now();\n var timeToCall = Math.max(0, 16.7 - (timestamp - prevTime));\n prevTime = timestamp + timeToCall;\n setTimeout(function () {\n return callback(prevTime);\n }, timeToCall);\n};\n\nvar createStep = function (setRunNextFrame) {\n var processToRun = [];\n var processToRunNextFrame = [];\n var numThisFrame = 0;\n var isProcessing = false;\n var i = 0;\n var cancelled = new WeakSet();\n var toKeepAlive = new WeakSet();\n var renderStep = {\n cancel: function (process) {\n var indexOfCallback = processToRunNextFrame.indexOf(process);\n cancelled.add(process);\n if (indexOfCallback !== -1) {\n processToRunNextFrame.splice(indexOfCallback, 1);\n }\n },\n process: function (frame) {\n var _a;\n isProcessing = true;\n _a = [processToRunNextFrame, processToRun], processToRun = _a[0], processToRunNextFrame = _a[1];\n processToRunNextFrame.length = 0;\n numThisFrame = processToRun.length;\n if (numThisFrame) {\n var process_1;\n for (i = 0; i < numThisFrame; i++) {\n process_1 = processToRun[i];\n process_1(frame);\n if (toKeepAlive.has(process_1) === true && !cancelled.has(process_1)) {\n renderStep.schedule(process_1);\n setRunNextFrame(true);\n }\n }\n }\n isProcessing = false;\n },\n schedule: function (process, keepAlive, immediate) {\n if (keepAlive === void 0) {\n keepAlive = false;\n }\n if (immediate === void 0) {\n immediate = false;\n }\n invariant(typeof process === \"function\", \"Argument must be a function\");\n var addToCurrentBuffer = immediate && isProcessing;\n var buffer = addToCurrentBuffer ? processToRun : processToRunNextFrame;\n cancelled.delete(process);\n if (keepAlive) toKeepAlive.add(process);\n if (buffer.indexOf(process) === -1) {\n buffer.push(process);\n if (addToCurrentBuffer) numThisFrame = processToRun.length;\n }\n }\n };\n return renderStep;\n};\n\nvar maxElapsed = 40;\nvar defaultElapsed = 1 / 60 * 1000;\nvar useDefaultElapsed = true;\nvar willRunNextFrame = false;\nvar isProcessing = false;\nvar frame = {\n delta: 0,\n timestamp: 0\n};\nvar stepsOrder = [\"read\", \"update\", \"preRender\", \"render\", \"postRender\"];\nvar setWillRunNextFrame = function (willRun) {\n return willRunNextFrame = willRun;\n};\nvar steps = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {\n acc[key] = createStep(setWillRunNextFrame);\n return acc;\n}, {});\nvar sync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {\n var step = steps[key];\n acc[key] = function (process, keepAlive, immediate) {\n if (keepAlive === void 0) {\n keepAlive = false;\n }\n if (immediate === void 0) {\n immediate = false;\n }\n if (!willRunNextFrame) startLoop();\n step.schedule(process, keepAlive, immediate);\n return process;\n };\n return acc;\n}, {});\nvar cancelSync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {\n acc[key] = steps[key].cancel;\n return acc;\n}, {});\nvar processStep = function (stepId) {\n return steps[stepId].process(frame);\n};\nvar processFrame = function (timestamp) {\n willRunNextFrame = false;\n frame.delta = useDefaultElapsed ? defaultElapsed : Math.max(Math.min(timestamp - frame.timestamp, maxElapsed), 1);\n if (!useDefaultElapsed) defaultElapsed = frame.delta;\n frame.timestamp = timestamp;\n isProcessing = true;\n stepsOrder.forEach(processStep);\n isProcessing = false;\n if (willRunNextFrame) {\n useDefaultElapsed = false;\n onNextFrame(processFrame);\n }\n};\nvar startLoop = function () {\n willRunNextFrame = true;\n useDefaultElapsed = true;\n if (!isProcessing) onNextFrame(processFrame);\n};\nvar getFrameData = function () {\n return frame;\n};\n\nexport default sync;\nexport { cancelSync, getFrameData };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { __assign } from 'tslib';\n\nvar clamp = function (min, max) { return function (v) {\r\n return Math.max(Math.min(v, max), min);\r\n}; };\r\nvar sanitize = function (v) { return (v % 1 ? Number(v.toFixed(5)) : v); };\r\nvar floatRegex = /(-)?(\\d[\\d\\.]*)/g;\r\nvar colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2,3}\\s*\\/*\\s*[\\d\\.]+%?\\))/gi;\r\nvar singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2,3}\\s*\\/*\\s*[\\d\\.]+%?\\))$/i;\n\nvar number = {\r\n test: function (v) { return typeof v === 'number'; },\r\n parse: parseFloat,\r\n transform: function (v) { return v; }\r\n};\r\nvar alpha = __assign(__assign({}, number), { transform: clamp(0, 1) });\r\nvar scale = __assign(__assign({}, number), { default: 1 });\n\nvar createUnitType = function (unit) { return ({\r\n test: function (v) {\r\n return typeof v === 'string' && v.endsWith(unit) && v.split(' ').length === 1;\r\n },\r\n parse: parseFloat,\r\n transform: function (v) { return \"\" + v + unit; }\r\n}); };\r\nvar degrees = createUnitType('deg');\r\nvar percent = createUnitType('%');\r\nvar px = createUnitType('px');\r\nvar vh = createUnitType('vh');\r\nvar vw = createUnitType('vw');\r\nvar progressPercentage = __assign(__assign({}, percent), { parse: function (v) { return percent.parse(v) / 100; }, transform: function (v) { return percent.transform(v * 100); } });\n\nvar getValueFromFunctionString = function (value) {\r\n return value.substring(value.indexOf('(') + 1, value.lastIndexOf(')'));\r\n};\r\nvar clampRgbUnit = clamp(0, 255);\r\nvar isRgba = function (v) { return v.red !== undefined; };\r\nvar isHsla = function (v) { return v.hue !== undefined; };\r\nfunction getValuesAsArray(value) {\r\n return getValueFromFunctionString(value)\r\n .replace(/(,|\\/)/g, ' ')\r\n .split(/ \\s*/);\r\n}\r\nvar splitColorValues = function (terms) {\r\n return function (v) {\r\n if (typeof v !== 'string')\r\n return v;\r\n var values = {};\r\n var valuesArray = getValuesAsArray(v);\r\n for (var i = 0; i < 4; i++) {\r\n values[terms[i]] =\r\n valuesArray[i] !== undefined ? parseFloat(valuesArray[i]) : 1;\r\n }\r\n return values;\r\n };\r\n};\r\nvar rgbaTemplate = function (_a) {\r\n var red = _a.red, green = _a.green, blue = _a.blue, _b = _a.alpha, alpha = _b === void 0 ? 1 : _b;\r\n return \"rgba(\" + red + \", \" + green + \", \" + blue + \", \" + alpha + \")\";\r\n};\r\nvar hslaTemplate = function (_a) {\r\n var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha = _b === void 0 ? 1 : _b;\r\n return \"hsla(\" + hue + \", \" + saturation + \", \" + lightness + \", \" + alpha + \")\";\r\n};\r\nvar rgbUnit = __assign(__assign({}, number), { transform: function (v) { return Math.round(clampRgbUnit(v)); } });\r\nfunction isColorString(color, colorType) {\r\n return color.startsWith(colorType) && singleColorRegex.test(color);\r\n}\r\nvar rgba = {\r\n test: function (v) { return (typeof v === 'string' ? isColorString(v, 'rgb') : isRgba(v)); },\r\n parse: splitColorValues(['red', 'green', 'blue', 'alpha']),\r\n transform: function (_a) {\r\n var red = _a.red, green = _a.green, blue = _a.blue, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b;\r\n return rgbaTemplate({\r\n red: rgbUnit.transform(red),\r\n green: rgbUnit.transform(green),\r\n blue: rgbUnit.transform(blue),\r\n alpha: sanitize(alpha.transform(alpha$1))\r\n });\r\n }\r\n};\r\nvar hsla = {\r\n test: function (v) { return (typeof v === 'string' ? isColorString(v, 'hsl') : isHsla(v)); },\r\n parse: splitColorValues(['hue', 'saturation', 'lightness', 'alpha']),\r\n transform: function (_a) {\r\n var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b;\r\n return hslaTemplate({\r\n hue: Math.round(hue),\r\n saturation: percent.transform(sanitize(saturation)),\r\n lightness: percent.transform(sanitize(lightness)),\r\n alpha: sanitize(alpha.transform(alpha$1))\r\n });\r\n }\r\n};\r\nvar hex = __assign(__assign({}, rgba), { test: function (v) { return typeof v === 'string' && isColorString(v, '#'); }, parse: function (v) {\r\n var r = '';\r\n var g = '';\r\n var b = '';\r\n if (v.length > 4) {\r\n r = v.substr(1, 2);\r\n g = v.substr(3, 2);\r\n b = v.substr(5, 2);\r\n }\r\n else {\r\n r = v.substr(1, 1);\r\n g = v.substr(2, 1);\r\n b = v.substr(3, 1);\r\n r += r;\r\n g += g;\r\n b += b;\r\n }\r\n return {\r\n red: parseInt(r, 16),\r\n green: parseInt(g, 16),\r\n blue: parseInt(b, 16),\r\n alpha: 1\r\n };\r\n } });\r\nvar color = {\r\n test: function (v) {\r\n return (typeof v === 'string' && singleColorRegex.test(v)) ||\r\n isRgba(v) ||\r\n isHsla(v);\r\n },\r\n parse: function (v) {\r\n if (rgba.test(v)) {\r\n return rgba.parse(v);\r\n }\r\n else if (hsla.test(v)) {\r\n return hsla.parse(v);\r\n }\r\n else if (hex.test(v)) {\r\n return hex.parse(v);\r\n }\r\n return v;\r\n },\r\n transform: function (v) {\r\n if (isRgba(v)) {\r\n return rgba.transform(v);\r\n }\r\n else if (isHsla(v)) {\r\n return hsla.transform(v);\r\n }\r\n return v;\r\n }\r\n};\n\nvar COLOR_TOKEN = '${c}';\r\nvar NUMBER_TOKEN = '${n}';\r\nvar convertNumbersToZero = function (v) {\r\n return typeof v === 'number' ? 0 : v;\r\n};\r\nvar complex = {\r\n test: function (v) {\r\n if (typeof v !== 'string' || !isNaN(v))\r\n return false;\r\n var numValues = 0;\r\n var foundNumbers = v.match(floatRegex);\r\n var foundColors = v.match(colorRegex);\r\n if (foundNumbers)\r\n numValues += foundNumbers.length;\r\n if (foundColors)\r\n numValues += foundColors.length;\r\n return numValues > 0;\r\n },\r\n parse: function (v) {\r\n var input = v;\r\n var parsed = [];\r\n var foundColors = input.match(colorRegex);\r\n if (foundColors) {\r\n input = input.replace(colorRegex, COLOR_TOKEN);\r\n parsed.push.apply(parsed, foundColors.map(color.parse));\r\n }\r\n var foundNumbers = input.match(floatRegex);\r\n if (foundNumbers) {\r\n parsed.push.apply(parsed, foundNumbers.map(number.parse));\r\n }\r\n return parsed;\r\n },\r\n createTransformer: function (prop) {\r\n var template = prop;\r\n var token = 0;\r\n var foundColors = prop.match(colorRegex);\r\n var numColors = foundColors ? foundColors.length : 0;\r\n if (foundColors) {\r\n for (var i = 0; i < numColors; i++) {\r\n template = template.replace(foundColors[i], COLOR_TOKEN);\r\n token++;\r\n }\r\n }\r\n var foundNumbers = template.match(floatRegex);\r\n var numNumbers = foundNumbers ? foundNumbers.length : 0;\r\n if (foundNumbers) {\r\n for (var i = 0; i < numNumbers; i++) {\r\n template = template.replace(foundNumbers[i], NUMBER_TOKEN);\r\n token++;\r\n }\r\n }\r\n return function (v) {\r\n var output = template;\r\n for (var i = 0; i < token; i++) {\r\n output = output.replace(i < numColors ? COLOR_TOKEN : NUMBER_TOKEN, i < numColors ? color.transform(v[i]) : sanitize(v[i]));\r\n }\r\n return output;\r\n };\r\n },\r\n getAnimatableNone: function (target) {\r\n var parsedTarget = complex.parse(target);\r\n var targetTransformer = complex.createTransformer(target);\r\n return targetTransformer(parsedTarget.map(convertNumbersToZero));\r\n }\r\n};\n\nexport { alpha, color, complex, degrees, hex, hsla, number, percent, progressPercentage, px, rgbUnit, rgba, scale, vh, vw };\n","var DEFAULT_OVERSHOOT_STRENGTH = 1.525;\nvar reversed = function (easing) {\n return function (p) {\n return 1 - easing(1 - p);\n };\n};\nvar mirrored = function (easing) {\n return function (p) {\n return p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n };\n};\nvar createReversedEasing = reversed;\nvar createMirroredEasing = mirrored;\nvar createExpoIn = function (power) {\n return function (p) {\n return Math.pow(p, power);\n };\n};\nvar createBackIn = function (power) {\n return function (p) {\n return p * p * ((power + 1) * p - power);\n };\n};\nvar createAnticipateEasing = function (power) {\n var backEasing = createBackIn(power);\n return function (p) {\n return (p *= 2) < 1 ? 0.5 * backEasing(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n };\n};\nvar linear = function (p) {\n return p;\n};\nvar easeIn = /*#__PURE__*/createExpoIn(2);\nvar easeOut = /*#__PURE__*/reversed(easeIn);\nvar easeInOut = /*#__PURE__*/mirrored(easeIn);\nvar circIn = function (p) {\n return 1 - Math.sin(Math.acos(p));\n};\nvar circOut = /*#__PURE__*/reversed(circIn);\nvar circInOut = /*#__PURE__*/mirrored(circOut);\nvar backIn = /*#__PURE__*/createBackIn(DEFAULT_OVERSHOOT_STRENGTH);\nvar backOut = /*#__PURE__*/reversed(backIn);\nvar backInOut = /*#__PURE__*/mirrored(backIn);\nvar anticipate = /*#__PURE__*/createAnticipateEasing(DEFAULT_OVERSHOOT_STRENGTH);\nvar BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0;\nvar BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0;\nvar BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0;\nvar ca = 4356.0 / 361.0;\nvar cb = 35442.0 / 1805.0;\nvar cc = 16061.0 / 1805.0;\nvar bounceOut = function (p) {\n var p2 = p * p;\n return p < BOUNCE_FIRST_THRESHOLD ? 7.5625 * p2 : p < BOUNCE_SECOND_THRESHOLD ? 9.075 * p2 - 9.9 * p + 3.4 : p < BOUNCE_THIRD_THRESHOLD ? ca * p2 - cb * p + cc : 10.8 * p * p - 20.52 * p + 10.72;\n};\nvar bounceIn = function (p) {\n return 1.0 - bounceOut(1.0 - p);\n};\nvar bounceInOut = function (p) {\n return p < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0)) : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5;\n};\nvar NEWTON_ITERATIONS = 8;\nvar NEWTON_MIN_SLOPE = 0.001;\nvar SUBDIVISION_PRECISION = 0.0000001;\nvar SUBDIVISION_MAX_ITERATIONS = 10;\nvar K_SPLINE_TABLE_SIZE = 11;\nvar K_SAMPLE_STEP_SIZE = 1.0 / (K_SPLINE_TABLE_SIZE - 1.0);\nvar FLOAT_32_SUPPORTED = typeof Float32Array !== 'undefined';\nvar a = function (a1, a2) {\n return 1.0 - 3.0 * a2 + 3.0 * a1;\n};\nvar b = function (a1, a2) {\n return 3.0 * a2 - 6.0 * a1;\n};\nvar c = function (a1) {\n return 3.0 * a1;\n};\nvar getSlope = function (t, a1, a2) {\n return 3.0 * a(a1, a2) * t * t + 2.0 * b(a1, a2) * t + c(a1);\n};\nvar calcBezier = function (t, a1, a2) {\n return ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n};\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n var sampleValues = FLOAT_32_SUPPORTED ? new Float32Array(K_SPLINE_TABLE_SIZE) : new Array(K_SPLINE_TABLE_SIZE);\n var binarySubdivide = function (aX, aA, aB) {\n var i = 0;\n var currentX;\n var currentT;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n return currentT;\n };\n var newtonRaphsonIterate = function (aX, aGuessT) {\n var i = 0;\n var currentSlope = 0;\n var currentX;\n for (; i < NEWTON_ITERATIONS; ++i) {\n currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n };\n var calcSampleValues = function () {\n for (var i = 0; i < K_SPLINE_TABLE_SIZE; ++i) {\n sampleValues[i] = calcBezier(i * K_SAMPLE_STEP_SIZE, mX1, mX2);\n }\n };\n var getTForX = function (aX) {\n var intervalStart = 0.0;\n var currentSample = 1;\n var lastSample = K_SPLINE_TABLE_SIZE - 1;\n var dist = 0.0;\n var guessForT = 0.0;\n var initialSlope = 0.0;\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += K_SAMPLE_STEP_SIZE;\n }\n --currentSample;\n dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n guessForT = intervalStart + dist * K_SAMPLE_STEP_SIZE;\n initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + K_SAMPLE_STEP_SIZE);\n }\n };\n calcSampleValues();\n var resolver = function (aX) {\n var returnValue;\n if (mX1 === mY1 && mX2 === mY2) {\n returnValue = aX;\n } else if (aX === 0) {\n returnValue = 0;\n } else if (aX === 1) {\n returnValue = 1;\n } else {\n returnValue = calcBezier(getTForX(aX), mY1, mY2);\n }\n return returnValue;\n };\n return resolver;\n}\n\nexport { reversed, mirrored, createReversedEasing, createMirroredEasing, createExpoIn, createBackIn, createAnticipateEasing, linear, easeIn, easeOut, easeInOut, circIn, circOut, circInOut, backIn, backOut, backInOut, anticipate, bounceOut, bounceIn, bounceInOut, cubicBezier };\n","import { hsla, rgba, hex, color, complex } from 'style-value-types';\nimport { invariant } from 'hey-listen';\nimport { getFrameData } from 'framesync';\nimport { createAnticipateEasing, createBackIn, createExpoIn, cubicBezier, linear, easeIn, easeOut, easeInOut, circIn, circOut, circInOut, backIn, backOut, backInOut, anticipate, reversed, mirrored } from '@popmotion/easing';\nexport { createAnticipateEasing, createBackIn, createExpoIn, cubicBezier, linear, easeIn, easeOut, easeInOut, circIn, circOut, circInOut, backIn, backOut, backInOut, anticipate, reversed, mirrored } from '@popmotion/easing';\n\nvar zeroPoint = {\r\n x: 0,\r\n y: 0,\r\n z: 0\r\n};\r\nvar isNum = function (v) { return typeof v === 'number'; };\n\nvar radiansToDegrees = (function (radians) { return (radians * 180) / Math.PI; });\n\nvar angle = (function (a, b) {\r\n if (b === void 0) { b = zeroPoint; }\r\n return radiansToDegrees(Math.atan2(b.y - a.y, b.x - a.x));\r\n});\n\nvar applyOffset = (function (from, to) {\r\n var hasReceivedFrom = true;\r\n if (to === undefined) {\r\n to = from;\r\n hasReceivedFrom = false;\r\n }\r\n return function (v) {\r\n if (hasReceivedFrom) {\r\n return v - from + to;\r\n }\r\n else {\r\n from = v;\r\n hasReceivedFrom = true;\r\n return to;\r\n }\r\n };\r\n});\n\nvar curryRange = (function (func) { return function (min, max, v) { return (v !== undefined ? func(min, max, v) : function (cv) { return func(min, max, cv); }); }; });\n\nvar clamp = function (min, max, v) {\r\n return Math.min(Math.max(v, min), max);\r\n};\r\nvar clamp$1 = curryRange(clamp);\n\nvar conditional = (function (check, apply) { return function (v) {\r\n return check(v) ? apply(v) : v;\r\n}; });\n\nvar degreesToRadians = (function (degrees) { return (degrees * Math.PI) / 180; });\n\nvar isPoint = (function (point) {\r\n return point.hasOwnProperty('x') && point.hasOwnProperty('y');\r\n});\n\nvar isPoint3D = (function (point) {\r\n return isPoint(point) && point.hasOwnProperty('z');\r\n});\n\nvar distance1D = function (a, b) { return Math.abs(a - b); };\r\nvar distance = (function (a, b) {\r\n if (b === void 0) { b = zeroPoint; }\r\n if (isNum(a) && isNum(b)) {\r\n return distance1D(a, b);\r\n }\r\n else if (isPoint(a) && isPoint(b)) {\r\n var xDelta = distance1D(a.x, b.x);\r\n var yDelta = distance1D(a.y, b.y);\r\n var zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0;\r\n return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2));\r\n }\r\n return 0;\r\n});\n\nvar progress = (function (from, to, value) {\r\n var toFromDifference = to - from;\r\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\r\n});\n\nvar mix = (function (from, to, progress) {\r\n return -progress * from + progress * to + from;\r\n});\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar mixLinearColor = function (from, to, v) {\r\n var fromExpo = from * from;\r\n var toExpo = to * to;\r\n return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo));\r\n};\r\nvar colorTypes = [hex, rgba, hsla];\r\nvar getColorType = function (v) {\r\n return colorTypes.find(function (type) { return type.test(v); });\r\n};\r\nvar notAnimatable = function (color$$1) {\r\n return \"'\" + color$$1 + \"' is not an animatable color. Use the equivalent color code instead.\";\r\n};\r\nvar mixColor = (function (from, to) {\r\n var fromColorType = getColorType(from);\r\n var toColorType = getColorType(to);\r\n invariant(!!fromColorType, notAnimatable(from));\r\n invariant(!!toColorType, notAnimatable(to));\r\n invariant(fromColorType.transform === toColorType.transform, 'Both colors must be hex/RGBA, OR both must be HSLA.');\r\n var fromColor = fromColorType.parse(from);\r\n var toColor = toColorType.parse(to);\r\n var blended = __assign({}, fromColor);\r\n var mixFunc = fromColorType === hsla ? mix : mixLinearColor;\r\n return function (v) {\r\n for (var key in blended) {\r\n if (key !== 'alpha') {\r\n blended[key] = mixFunc(fromColor[key], toColor[key], v);\r\n }\r\n }\r\n blended.alpha = mix(fromColor.alpha, toColor.alpha, v);\r\n return fromColorType.transform(blended);\r\n };\r\n});\n\nvar combineFunctions = function (a, b) { return function (v) { return b(a(v)); }; };\r\nvar pipe = (function () {\r\n var transformers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n transformers[_i] = arguments[_i];\r\n }\r\n return transformers.reduce(combineFunctions);\r\n});\n\nfunction getMixer(origin, target) {\r\n if (isNum(origin)) {\r\n return function (v) { return mix(origin, target, v); };\r\n }\r\n else if (color.test(origin)) {\r\n return mixColor(origin, target);\r\n }\r\n else {\r\n return mixComplex(origin, target);\r\n }\r\n}\r\nvar mixArray = function (from, to) {\r\n var output = from.slice();\r\n var numValues = output.length;\r\n var blendValue = from.map(function (fromThis, i) { return getMixer(fromThis, to[i]); });\r\n return function (v) {\r\n for (var i = 0; i < numValues; i++) {\r\n output[i] = blendValue[i](v);\r\n }\r\n return output;\r\n };\r\n};\r\nvar mixObject = function (origin, target) {\r\n var output = __assign({}, origin, target);\r\n var blendValue = {};\r\n for (var key in output) {\r\n if (origin[key] !== undefined && target[key] !== undefined) {\r\n blendValue[key] = getMixer(origin[key], target[key]);\r\n }\r\n }\r\n return function (v) {\r\n for (var key in blendValue) {\r\n output[key] = blendValue[key](v);\r\n }\r\n return output;\r\n };\r\n};\r\nfunction analyse(value) {\r\n var parsed = complex.parse(value);\r\n var numValues = parsed.length;\r\n var numNumbers = 0;\r\n var numRGB = 0;\r\n var numHSL = 0;\r\n for (var i = 0; i < numValues; i++) {\r\n if (numNumbers || typeof parsed[i] === 'number') {\r\n numNumbers++;\r\n }\r\n else {\r\n if (parsed[i].hue !== undefined) {\r\n numHSL++;\r\n }\r\n else {\r\n numRGB++;\r\n }\r\n }\r\n }\r\n return { parsed: parsed, numNumbers: numNumbers, numRGB: numRGB, numHSL: numHSL };\r\n}\r\nvar mixComplex = function (origin, target) {\r\n var template = complex.createTransformer(target);\r\n var originStats = analyse(origin);\r\n var targetStats = analyse(target);\r\n invariant(originStats.numHSL === targetStats.numHSL &&\r\n originStats.numRGB === targetStats.numRGB &&\r\n originStats.numNumbers >= targetStats.numNumbers, \"Complex values '\" + origin + \"' and '\" + target + \"' too different to mix. Ensure all colors are of the same type.\");\r\n return pipe(mixArray(originStats.parsed, targetStats.parsed), template);\r\n};\n\nvar mixNumber = function (from, to) { return function (p) { return mix(from, to, p); }; };\r\nfunction detectMixerFactory(v) {\r\n if (typeof v === 'number') {\r\n return mixNumber;\r\n }\r\n else if (typeof v === 'string') {\r\n if (color.test(v)) {\r\n return mixColor;\r\n }\r\n else {\r\n return mixComplex;\r\n }\r\n }\r\n else if (Array.isArray(v)) {\r\n return mixArray;\r\n }\r\n else if (typeof v === 'object') {\r\n return mixObject;\r\n }\r\n}\r\nfunction createMixers(output, ease, customMixer) {\r\n var mixers = [];\r\n var mixerFactory = customMixer || detectMixerFactory(output[0]);\r\n var numMixers = output.length - 1;\r\n for (var i = 0; i < numMixers; i++) {\r\n var mixer = mixerFactory(output[i], output[i + 1]);\r\n if (ease) {\r\n var easingFunction = Array.isArray(ease) ? ease[i] : ease;\r\n mixer = pipe(easingFunction, mixer);\r\n }\r\n mixers.push(mixer);\r\n }\r\n return mixers;\r\n}\r\nfunction fastInterpolate(_a, _b) {\r\n var from = _a[0], to = _a[1];\r\n var mixer = _b[0];\r\n return function (v) { return mixer(progress(from, to, v)); };\r\n}\r\nfunction slowInterpolate(input, mixers) {\r\n var inputLength = input.length;\r\n var lastInputIndex = inputLength - 1;\r\n return function (v) {\r\n var mixerIndex = 0;\r\n var foundMixerIndex = false;\r\n if (v <= input[0]) {\r\n foundMixerIndex = true;\r\n }\r\n else if (v >= input[lastInputIndex]) {\r\n mixerIndex = lastInputIndex - 1;\r\n foundMixerIndex = true;\r\n }\r\n if (!foundMixerIndex) {\r\n var i = 1;\r\n for (; i < inputLength; i++) {\r\n if (input[i] > v || i === lastInputIndex) {\r\n break;\r\n }\r\n }\r\n mixerIndex = i - 1;\r\n }\r\n var progressInRange = progress(input[mixerIndex], input[mixerIndex + 1], v);\r\n return mixers[mixerIndex](progressInRange);\r\n };\r\n}\r\nfunction interpolate(input, output, _a) {\r\n var _b = _a === void 0 ? {} : _a, _c = _b.clamp, clamp = _c === void 0 ? true : _c, ease = _b.ease, mixer = _b.mixer;\r\n var inputLength = input.length;\r\n invariant(inputLength === output.length, 'Both input and output ranges must be the same length');\r\n invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.');\r\n if (input[0] > input[inputLength - 1]) {\r\n input = [].concat(input);\r\n output = [].concat(output);\r\n input.reverse();\r\n output.reverse();\r\n }\r\n var mixers = createMixers(output, ease, mixer);\r\n var interpolator = inputLength === 2\r\n ? fastInterpolate(input, mixers)\r\n : slowInterpolate(input, mixers);\r\n return clamp\r\n ? pipe(clamp$1(input[0], input[inputLength - 1]), interpolator)\r\n : interpolator;\r\n}\n\nvar pointFromVector = (function (origin, angle, distance) {\r\n angle = degreesToRadians(angle);\r\n return {\r\n x: distance * Math.cos(angle) + origin.x,\r\n y: distance * Math.sin(angle) + origin.y\r\n };\r\n});\n\nvar toDecimal = (function (num, precision) {\r\n if (precision === void 0) { precision = 2; }\r\n precision = Math.pow(10, precision);\r\n return Math.round(num * precision) / precision;\r\n});\n\nvar smoothFrame = (function (prevValue, nextValue, duration, smoothing) {\r\n if (smoothing === void 0) { smoothing = 0; }\r\n return toDecimal(prevValue +\r\n (duration * (nextValue - prevValue)) / Math.max(smoothing, duration));\r\n});\n\nvar smooth = (function (strength) {\r\n if (strength === void 0) { strength = 50; }\r\n var previousValue = 0;\r\n var lastUpdated = 0;\r\n return function (v) {\r\n var currentFramestamp = getFrameData().timestamp;\r\n var timeDelta = currentFramestamp !== lastUpdated ? currentFramestamp - lastUpdated : 0;\r\n var newValue = timeDelta\r\n ? smoothFrame(previousValue, v, timeDelta, strength)\r\n : previousValue;\r\n lastUpdated = currentFramestamp;\r\n previousValue = newValue;\r\n return newValue;\r\n };\r\n});\n\nvar snap = (function (points) {\r\n if (typeof points === 'number') {\r\n return function (v) { return Math.round(v / points) * points; };\r\n }\r\n else {\r\n var i_1 = 0;\r\n var numPoints_1 = points.length;\r\n return function (v) {\r\n var lastDistance = Math.abs(points[0] - v);\r\n for (i_1 = 1; i_1 < numPoints_1; i_1++) {\r\n var point = points[i_1];\r\n var distance = Math.abs(point - v);\r\n if (distance === 0)\r\n return point;\r\n if (distance > lastDistance)\r\n return points[i_1 - 1];\r\n if (i_1 === numPoints_1 - 1)\r\n return point;\r\n lastDistance = distance;\r\n }\r\n };\r\n }\r\n});\n\nvar identity = function (v) { return v; };\r\nvar springForce = function (alterDisplacement) {\r\n if (alterDisplacement === void 0) { alterDisplacement = identity; }\r\n return curryRange(function (constant, origin, v) {\r\n var displacement = origin - v;\r\n var springModifiedDisplacement = -(0 - constant + 1) * (0 - alterDisplacement(Math.abs(displacement)));\r\n return displacement <= 0\r\n ? origin + springModifiedDisplacement\r\n : origin - springModifiedDisplacement;\r\n });\r\n};\r\nvar springForceLinear = springForce();\r\nvar springForceExpo = springForce(Math.sqrt);\n\nvar velocityPerFrame = (function (xps, frameDuration) {\r\n return isNum(xps) ? xps / (1000 / frameDuration) : 0;\r\n});\n\nvar velocityPerSecond = (function (velocity, frameDuration) {\r\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\r\n});\n\nvar wrap = function (min, max, v) {\r\n var rangeSize = max - min;\r\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\r\n};\r\nvar wrap$1 = curryRange(wrap);\n\nvar clampProgress = clamp$1(0, 1);\r\nvar steps = (function (steps, direction) {\r\n if (direction === void 0) { direction = 'end'; }\r\n return function (progress) {\r\n progress =\r\n direction === 'end' ? Math.min(progress, 0.999) : Math.max(progress, 0.001);\r\n var expanded = progress * steps;\r\n var rounded = direction === 'end' ? Math.floor(expanded) : Math.ceil(expanded);\r\n return clampProgress(rounded / steps);\r\n };\r\n});\n\nexport { angle, applyOffset, clamp$1 as clamp, conditional, degreesToRadians, distance, interpolate, isPoint, isPoint3D, mix, mixArray, mixColor, mixComplex, mixObject, pipe, pointFromVector, progress, radiansToDegrees, smooth, smoothFrame, snap, springForce, springForceExpo, springForceLinear, steps, toDecimal, velocityPerFrame, velocityPerSecond, wrap$1 as wrap };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { __rest, __assign } from 'tslib';\nimport sync from 'framesync';\nimport { number, color, px, degrees, scale, alpha, progressPercentage } from 'style-value-types';\nimport { invariant } from 'hey-listen';\n\nvar createStyler = function (_a) {\n var onRead = _a.onRead,\n onRender = _a.onRender,\n _b = _a.uncachedValues,\n uncachedValues = _b === void 0 ? new Set() : _b,\n _c = _a.useCache,\n useCache = _c === void 0 ? true : _c;\n return function (_a) {\n if (_a === void 0) {\n _a = {};\n }\n var props = __rest(_a, []);\n var state = {};\n var changedValues = [];\n var hasChanged = false;\n function setValue(key, value) {\n if (key.startsWith('--')) {\n props.hasCSSVariable = true;\n }\n var currentValue = state[key];\n state[key] = value;\n if (state[key] === currentValue) return;\n if (changedValues.indexOf(key) === -1) {\n changedValues.push(key);\n }\n if (!hasChanged) {\n hasChanged = true;\n sync.render(styler.render);\n }\n }\n var styler = {\n get: function (key, forceRead) {\n if (forceRead === void 0) {\n forceRead = false;\n }\n var useCached = !forceRead && useCache && !uncachedValues.has(key) && state[key] !== undefined;\n return useCached ? state[key] : onRead(key, props);\n },\n set: function (values, value) {\n if (typeof values === 'string') {\n setValue(values, value);\n } else {\n for (var key in values) {\n setValue(key, values[key]);\n }\n }\n return this;\n },\n render: function (forceRender) {\n if (forceRender === void 0) {\n forceRender = false;\n }\n if (hasChanged || forceRender === true) {\n onRender(state, props, changedValues);\n hasChanged = false;\n changedValues.length = 0;\n }\n return this;\n }\n };\n return styler;\n };\n};\n\nvar CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g;\nvar REPLACE_TEMPLATE = '$1-$2';\nvar camelToDash = function (str) {\n return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase();\n};\n\nvar camelCache = /*#__PURE__*/new Map();\nvar dashCache = /*#__PURE__*/new Map();\nvar prefixes = ['Webkit', 'Moz', 'O', 'ms', ''];\nvar numPrefixes = prefixes.length;\nvar isBrowser = typeof document !== 'undefined';\nvar testElement;\nvar setDashPrefix = function (key, prefixed) {\n return dashCache.set(key, camelToDash(prefixed));\n};\nvar testPrefix = function (key) {\n testElement = testElement || document.createElement('div');\n for (var i = 0; i < numPrefixes; i++) {\n var prefix = prefixes[i];\n var noPrefix = prefix === '';\n var prefixedPropertyName = noPrefix ? key : prefix + key.charAt(0).toUpperCase() + key.slice(1);\n if (prefixedPropertyName in testElement.style || noPrefix) {\n if (noPrefix && key === 'clipPath' && dashCache.has(key)) {\n return;\n }\n camelCache.set(key, prefixedPropertyName);\n setDashPrefix(key, \"\" + (noPrefix ? '' : '-') + camelToDash(prefixedPropertyName));\n }\n }\n};\nvar setServerProperty = function (key) {\n return setDashPrefix(key, key);\n};\nvar prefixer = function (key, asDashCase) {\n if (asDashCase === void 0) {\n asDashCase = false;\n }\n var cache = asDashCase ? dashCache : camelCache;\n if (!cache.has(key)) {\n isBrowser ? testPrefix(key) : setServerProperty(key);\n }\n return cache.get(key) || key;\n};\n\nvar axes = ['', 'X', 'Y', 'Z'];\nvar order = ['translate', 'scale', 'rotate', 'skew', 'transformPerspective'];\nvar transformProps = /*#__PURE__*/order.reduce(function (acc, key) {\n return axes.reduce(function (axesAcc, axesKey) {\n axesAcc.push(key + axesKey);\n return axesAcc;\n }, acc);\n}, ['x', 'y', 'z']);\nvar transformPropDictionary = /*#__PURE__*/transformProps.reduce(function (dict, key) {\n dict[key] = true;\n return dict;\n}, {});\nfunction isTransformProp(key) {\n return transformPropDictionary[key] === true;\n}\nfunction sortTransformProps(a, b) {\n return transformProps.indexOf(a) - transformProps.indexOf(b);\n}\nvar transformOriginProps = /*#__PURE__*/new Set(['originX', 'originY', 'originZ']);\nfunction isTransformOriginProp(key) {\n return transformOriginProps.has(key);\n}\n\nvar int = /*#__PURE__*/__assign( /*#__PURE__*/__assign({}, number), { transform: Math.round });\nvar valueTypes = {\n color: color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n radius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n size: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale: 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 opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n zIndex: int,\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int\n};\nvar getValueType = function (key) {\n return valueTypes[key];\n};\nvar getValueAsType = function (value, type) {\n return type && typeof value === 'number' ? type.transform(value) : value;\n};\n\nvar SCROLL_LEFT = 'scrollLeft';\nvar SCROLL_TOP = 'scrollTop';\nvar scrollKeys = /*#__PURE__*/new Set([SCROLL_LEFT, SCROLL_TOP]);\n\nvar blacklist = /*#__PURE__*/new Set([SCROLL_LEFT, SCROLL_TOP, 'transform']);\nvar translateAlias = {\n x: 'translateX',\n y: 'translateY',\n z: 'translateZ'\n};\nfunction isCustomTemplate(v) {\n return typeof v === 'function';\n}\nfunction buildTransform(state, transform, transformKeys, transformIsDefault, enableHardwareAcceleration, allowTransformNone) {\n if (allowTransformNone === void 0) {\n allowTransformNone = true;\n }\n var transformString = '';\n var transformHasZ = false;\n transformKeys.sort(sortTransformProps);\n var numTransformKeys = transformKeys.length;\n for (var i = 0; i < numTransformKeys; i++) {\n var key = transformKeys[i];\n transformString += (translateAlias[key] || key) + \"(\" + transform[key] + \") \";\n transformHasZ = key === 'z' ? true : transformHasZ;\n }\n if (!transformHasZ && enableHardwareAcceleration) {\n transformString += 'translateZ(0)';\n } else {\n transformString = transformString.trim();\n }\n if (isCustomTemplate(state.transform)) {\n transformString = state.transform(transform, transformIsDefault ? '' : transformString);\n } else if (allowTransformNone && transformIsDefault) {\n transformString = 'none';\n }\n return transformString;\n}\nfunction buildStyleProperty(state, enableHardwareAcceleration, styles, transform, transformOrigin, transformKeys, isDashCase, allowTransformNone) {\n if (enableHardwareAcceleration === void 0) {\n enableHardwareAcceleration = true;\n }\n if (styles === void 0) {\n styles = {};\n }\n if (transform === void 0) {\n transform = {};\n }\n if (transformOrigin === void 0) {\n transformOrigin = {};\n }\n if (transformKeys === void 0) {\n transformKeys = [];\n }\n if (isDashCase === void 0) {\n isDashCase = false;\n }\n if (allowTransformNone === void 0) {\n allowTransformNone = true;\n }\n var transformIsDefault = true;\n var hasTransform = false;\n var hasTransformOrigin = false;\n for (var key in state) {\n var value = state[key];\n var valueType = getValueType(key);\n var valueAsType = getValueAsType(value, valueType);\n if (isTransformProp(key)) {\n hasTransform = true;\n transform[key] = valueAsType;\n transformKeys.push(key);\n if (transformIsDefault) {\n if (valueType.default && value !== valueType.default || !valueType.default && value !== 0) {\n transformIsDefault = false;\n }\n }\n } else if (isTransformOriginProp(key)) {\n transformOrigin[key] = valueAsType;\n hasTransformOrigin = true;\n } else if (!blacklist.has(key) || !isCustomTemplate(valueAsType)) {\n styles[prefixer(key, isDashCase)] = valueAsType;\n }\n }\n if (hasTransform || typeof state.transform === 'function') {\n styles.transform = buildTransform(state, transform, transformKeys, transformIsDefault, enableHardwareAcceleration, allowTransformNone);\n }\n if (hasTransformOrigin) {\n styles.transformOrigin = (transformOrigin.originX || '50%') + \" \" + (transformOrigin.originY || '50%') + \" \" + (transformOrigin.originZ || 0);\n }\n return styles;\n}\nfunction createStyleBuilder(_a) {\n var _b = _a === void 0 ? {} : _a,\n _c = _b.enableHardwareAcceleration,\n enableHardwareAcceleration = _c === void 0 ? true : _c,\n _d = _b.isDashCase,\n isDashCase = _d === void 0 ? true : _d,\n _e = _b.allowTransformNone,\n allowTransformNone = _e === void 0 ? true : _e;\n var styles = {};\n var transform = {};\n var transformOrigin = {};\n var transformKeys = [];\n return function (state) {\n transformKeys.length = 0;\n buildStyleProperty(state, enableHardwareAcceleration, styles, transform, transformOrigin, transformKeys, isDashCase, allowTransformNone);\n return styles;\n };\n}\n\nfunction onRead(key, options) {\n var element = options.element,\n preparseOutput = options.preparseOutput;\n var defaultValueType = getValueType(key);\n if (isTransformProp(key)) {\n return defaultValueType ? defaultValueType.default || 0 : 0;\n } else if (scrollKeys.has(key)) {\n return element[key];\n } else {\n var domValue = window.getComputedStyle(element, null).getPropertyValue(prefixer(key, true)) || 0;\n return preparseOutput && defaultValueType && defaultValueType.test(domValue) && defaultValueType.parse ? defaultValueType.parse(domValue) : domValue;\n }\n}\nfunction onRender(state, _a, changedValues) {\n var element = _a.element,\n buildStyles = _a.buildStyles,\n hasCSSVariable = _a.hasCSSVariable;\n Object.assign(element.style, buildStyles(state));\n if (hasCSSVariable) {\n var numChangedValues = changedValues.length;\n for (var i = 0; i < numChangedValues; i++) {\n var key = changedValues[i];\n if (key.startsWith('--')) {\n element.style.setProperty(key, state[key]);\n }\n }\n }\n if (changedValues.indexOf(SCROLL_LEFT) !== -1) {\n element[SCROLL_LEFT] = state[SCROLL_LEFT];\n }\n if (changedValues.indexOf(SCROLL_TOP) !== -1) {\n element[SCROLL_TOP] = state[SCROLL_TOP];\n }\n}\nvar cssStyler = /*#__PURE__*/createStyler({\n onRead: onRead,\n onRender: onRender,\n uncachedValues: scrollKeys\n});\nfunction createCssStyler(element, _a) {\n if (_a === void 0) {\n _a = {};\n }\n var enableHardwareAcceleration = _a.enableHardwareAcceleration,\n allowTransformNone = _a.allowTransformNone,\n props = __rest(_a, [\"enableHardwareAcceleration\", \"allowTransformNone\"]);\n return cssStyler(__assign({ element: element, buildStyles: createStyleBuilder({\n enableHardwareAcceleration: enableHardwareAcceleration,\n allowTransformNone: allowTransformNone\n }), preparseOutput: true }, props));\n}\n\nvar camelCaseAttributes = /*#__PURE__*/new Set(['baseFrequency', 'diffuseConstant', 'kernelMatrix', 'kernelUnitLength', 'keySplines', 'keyTimes', 'limitingConeAngle', 'markerHeight', 'markerWidth', 'numOctaves', 'targetX', 'targetY', 'surfaceScale', 'specularConstant', 'specularExponent', 'stdDeviation', 'tableValues']);\n\nvar defaultOrigin = 0.5;\nvar svgAttrsTemplate = function () {\n return {\n style: {}\n };\n};\nvar progressToPixels = function (progress, length) {\n return px.transform(progress * length);\n};\nvar unmeasured = { x: 0, y: 0, width: 0, height: 0 };\nfunction calcOrigin(origin, offset, size) {\n return typeof origin === 'string' ? origin : px.transform(offset + size * origin);\n}\nfunction calculateSVGTransformOrigin(dimensions, originX, originY) {\n return calcOrigin(originX, dimensions.x, dimensions.width) + \" \" + calcOrigin(originY, dimensions.y, dimensions.height);\n}\nvar svgStyleConfig = {\n enableHardwareAcceleration: false,\n isDashCase: false\n};\nfunction buildSVGAttrs(_a, dimensions, totalPathLength, cssBuilder, attrs, isDashCase) {\n if (dimensions === void 0) {\n dimensions = unmeasured;\n }\n if (cssBuilder === void 0) {\n cssBuilder = createStyleBuilder(svgStyleConfig);\n }\n if (attrs === void 0) {\n attrs = svgAttrsTemplate();\n }\n if (isDashCase === void 0) {\n isDashCase = true;\n }\n var attrX = _a.attrX,\n attrY = _a.attrY,\n originX = _a.originX,\n originY = _a.originY,\n pathLength = _a.pathLength,\n _b = _a.pathSpacing,\n pathSpacing = _b === void 0 ? 1 : _b,\n _c = _a.pathOffset,\n pathOffset = _c === void 0 ? 0 : _c,\n state = __rest(_a, [\"attrX\", \"attrY\", \"originX\", \"originY\", \"pathLength\", \"pathSpacing\", \"pathOffset\"]);\n var style = cssBuilder(state);\n for (var key in style) {\n if (key === 'transform') {\n attrs.style.transform = style[key];\n } else {\n var attrKey = isDashCase && !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n attrs[attrKey] = style[key];\n }\n }\n if (originX !== undefined || originY !== undefined || style.transform) {\n attrs.style.transformOrigin = calculateSVGTransformOrigin(dimensions, originX !== undefined ? originX : defaultOrigin, originY !== undefined ? originY : defaultOrigin);\n }\n if (attrX !== undefined) attrs.x = attrX;\n if (attrY !== undefined) attrs.y = attrY;\n if (totalPathLength !== undefined && pathLength !== undefined) {\n attrs[isDashCase ? 'stroke-dashoffset' : 'strokeDashoffset'] = progressToPixels(-pathOffset, totalPathLength);\n attrs[isDashCase ? 'stroke-dasharray' : 'strokeDasharray'] = progressToPixels(pathLength, totalPathLength) + \" \" + progressToPixels(pathSpacing, totalPathLength);\n }\n return attrs;\n}\nfunction createAttrBuilder(dimensions, totalPathLength, isDashCase) {\n if (isDashCase === void 0) {\n isDashCase = true;\n }\n var attrs = svgAttrsTemplate();\n var cssBuilder = createStyleBuilder(svgStyleConfig);\n return function (state) {\n return buildSVGAttrs(state, dimensions, totalPathLength, cssBuilder, attrs, isDashCase);\n };\n}\n\nvar getDimensions = function (element) {\n return typeof element.getBBox === 'function' ? element.getBBox() : element.getBoundingClientRect();\n};\nvar getSVGElementDimensions = function (element) {\n try {\n return getDimensions(element);\n } catch (e) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n};\n\nvar isPath = function (element) {\n return element.tagName === 'path';\n};\nvar svgStyler = /*#__PURE__*/createStyler({\n onRead: function (key, _a) {\n var element = _a.element;\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n if (!isTransformProp(key)) {\n return element.getAttribute(key);\n } else {\n var valueType = getValueType(key);\n return valueType ? valueType.default || 0 : 0;\n }\n },\n onRender: function (state, _a) {\n var element = _a.element,\n buildAttrs = _a.buildAttrs;\n var attrs = buildAttrs(state);\n for (var key in attrs) {\n if (key === 'style') {\n Object.assign(element.style, attrs.style);\n } else {\n element.setAttribute(key, attrs[key]);\n }\n }\n }\n});\nvar svg = function (element) {\n var dimensions = getSVGElementDimensions(element);\n var pathLength = isPath(element) && element.getTotalLength ? element.getTotalLength() : undefined;\n return svgStyler({\n element: element,\n buildAttrs: createAttrBuilder(dimensions, pathLength)\n });\n};\n\nvar viewport = /*#__PURE__*/createStyler({\n useCache: false,\n onRead: function (key) {\n return key === 'scrollTop' ? window.pageYOffset : window.pageXOffset;\n },\n onRender: function (_a) {\n var _b = _a.scrollTop,\n scrollTop = _b === void 0 ? 0 : _b,\n _c = _a.scrollLeft,\n scrollLeft = _c === void 0 ? 0 : _c;\n return window.scrollTo(scrollLeft, scrollTop);\n }\n});\n\nvar cache = /*#__PURE__*/new WeakMap();\nvar isHTMLElement = function (node) {\n return node instanceof HTMLElement || typeof node.click === 'function';\n};\nvar isSVGElement = function (node) {\n return node instanceof SVGElement || 'ownerSVGElement' in node;\n};\nvar createDOMStyler = function (node, props) {\n var styler;\n if (node === window) {\n styler = viewport(node);\n } else if (isHTMLElement(node)) {\n styler = createCssStyler(node, props);\n } else if (isSVGElement(node)) {\n styler = svg(node);\n }\n invariant(styler !== undefined, 'No valid node provided. Node must be HTMLElement, SVGElement or window.');\n cache.set(node, styler);\n return styler;\n};\nvar getStyler = function (node, props) {\n return cache.has(node) ? cache.get(node) : createDOMStyler(node, props);\n};\nfunction index(nodeOrSelector, props) {\n var node = typeof nodeOrSelector === 'string' ? document.querySelector(nodeOrSelector) : nodeOrSelector;\n return getStyler(node, props);\n}\n\nexport default index;\nexport { buildSVGAttrs, buildStyleProperty, createStyler as createStylerFactory, isTransformProp, transformProps };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { __rest, __assign, __extends } from 'tslib';\nimport { pipe, velocityPerSecond, mixComplex, mixColor, mix, clamp, progress, velocityPerFrame, distance, angle, applyOffset } from '@popmotion/popcorn';\nimport sync, { getFrameData, cancelSync } from 'framesync';\nimport { color, complex, px, percent, degrees, vh, vw, number } from 'style-value-types';\nimport { createReversedEasing, linear, easeOut, easeInOut } from '@popmotion/easing';\nimport { invariant } from 'hey-listen';\n\nvar Observer = /*#__PURE__*/function () {\n function Observer(_a, observer) {\n var _this = this;\n var middleware = _a.middleware,\n onComplete = _a.onComplete;\n this.isActive = true;\n this.update = function (v) {\n if (_this.observer.update) _this.updateObserver(v);\n };\n this.complete = function () {\n if (_this.observer.complete && _this.isActive) _this.observer.complete();\n if (_this.onComplete) _this.onComplete();\n _this.isActive = false;\n };\n this.error = function (err) {\n if (_this.observer.error && _this.isActive) _this.observer.error(err);\n _this.isActive = false;\n };\n this.observer = observer;\n this.updateObserver = function (v) {\n return observer.update(v);\n };\n this.onComplete = onComplete;\n if (observer.update && middleware && middleware.length) {\n middleware.forEach(function (m) {\n return _this.updateObserver = m(_this.updateObserver, _this.complete);\n });\n }\n }\n return Observer;\n}();\nvar createObserver = function (observerCandidate, _a, onComplete) {\n var middleware = _a.middleware;\n if (typeof observerCandidate === 'function') {\n return new Observer({ middleware: middleware, onComplete: onComplete }, { update: observerCandidate });\n } else {\n return new Observer({ middleware: middleware, onComplete: onComplete }, observerCandidate);\n }\n};\n\nvar Action = /*#__PURE__*/function () {\n function Action(props) {\n if (props === void 0) {\n props = {};\n }\n this.props = props;\n }\n Action.prototype.create = function (props) {\n return new Action(props);\n };\n Action.prototype.start = function (observerCandidate) {\n if (observerCandidate === void 0) {\n observerCandidate = {};\n }\n var isComplete = false;\n var subscription = {\n stop: function () {\n return undefined;\n }\n };\n var _a = this.props,\n init = _a.init,\n observerProps = __rest(_a, [\"init\"]);\n var observer = createObserver(observerCandidate, observerProps, function () {\n isComplete = true;\n subscription.stop();\n });\n var api = init(observer);\n subscription = api ? __assign({}, subscription, api) : subscription;\n if (isComplete) subscription.stop();\n return subscription;\n };\n Action.prototype.applyMiddleware = function (middleware) {\n return this.create(__assign({}, this.props, { middleware: this.props.middleware ? [middleware].concat(this.props.middleware) : [middleware] }));\n };\n Action.prototype.pipe = function () {\n var funcs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n funcs[_i] = arguments[_i];\n }\n var pipedUpdate = funcs.length === 1 ? funcs[0] : pipe.apply(void 0, funcs);\n return this.applyMiddleware(function (update) {\n return function (v) {\n return update(pipedUpdate(v));\n };\n });\n };\n return Action;\n}();\nvar action = function (init) {\n return new Action({ init: init });\n};\n\nvar Chainable = /*#__PURE__*/function () {\n function Chainable(props) {\n if (props === void 0) {\n props = {};\n }\n this.props = props;\n }\n Chainable.prototype.applyMiddleware = function (middleware) {\n return this.create(__assign({}, this.props, { middleware: this.props.middleware ? [middleware].concat(this.props.middleware) : [middleware] }));\n };\n Chainable.prototype.pipe = function () {\n var funcs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n funcs[_i] = arguments[_i];\n }\n var pipedUpdate = funcs.length === 1 ? funcs[0] : pipe.apply(void 0, funcs);\n return this.applyMiddleware(function (update) {\n return function (v) {\n return update(pipedUpdate(v));\n };\n });\n };\n Chainable.prototype.while = function (predicate) {\n return this.applyMiddleware(function (update, complete) {\n return function (v) {\n return predicate(v) ? update(v) : complete();\n };\n });\n };\n Chainable.prototype.filter = function (predicate) {\n return this.applyMiddleware(function (update) {\n return function (v) {\n return predicate(v) && update(v);\n };\n });\n };\n return Chainable;\n}();\n\nvar BaseMulticast = /*#__PURE__*/function (_super) {\n __extends(BaseMulticast, _super);\n function BaseMulticast() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.subscribers = [];\n return _this;\n }\n BaseMulticast.prototype.complete = function () {\n this.subscribers.forEach(function (subscriber) {\n return subscriber.complete();\n });\n };\n BaseMulticast.prototype.error = function (err) {\n this.subscribers.forEach(function (subscriber) {\n return subscriber.error(err);\n });\n };\n BaseMulticast.prototype.update = function (v) {\n for (var i = 0; i < this.subscribers.length; i++) {\n this.subscribers[i].update(v);\n }\n };\n BaseMulticast.prototype.subscribe = function (observerCandidate) {\n var _this = this;\n var observer = createObserver(observerCandidate, this.props);\n this.subscribers.push(observer);\n var subscription = {\n unsubscribe: function () {\n var index = _this.subscribers.indexOf(observer);\n if (index !== -1) _this.subscribers.splice(index, 1);\n }\n };\n return subscription;\n };\n BaseMulticast.prototype.stop = function () {\n if (this.parent) this.parent.stop();\n };\n return BaseMulticast;\n}(Chainable);\n\nvar Multicast = /*#__PURE__*/function (_super) {\n __extends(Multicast, _super);\n function Multicast() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Multicast.prototype.create = function (props) {\n return new Multicast(props);\n };\n return Multicast;\n}(BaseMulticast);\nvar multicast = function () {\n return new Multicast();\n};\n\nvar ValueReaction = /*#__PURE__*/function (_super) {\n __extends(ValueReaction, _super);\n function ValueReaction(props) {\n var _this = _super.call(this, props) || this;\n _this.scheduleVelocityCheck = function () {\n return sync.postRender(_this.velocityCheck);\n };\n _this.velocityCheck = function (_a) {\n var timestamp = _a.timestamp;\n if (timestamp !== _this.lastUpdated) {\n _this.prev = _this.current;\n }\n };\n _this.prev = _this.current = props.value || 0;\n _this.updateCurrent = function (v) {\n return _this.current = v;\n };\n _this.getVelocityOfCurrent = function () {\n return _this.getSingleVelocity(_this.current, _this.prev);\n };\n if (props.initialSubscription) _this.subscribe(props.initialSubscription);\n return _this;\n }\n ValueReaction.prototype.create = function (props) {\n return new ValueReaction(props);\n };\n ValueReaction.prototype.get = function () {\n return this.current;\n };\n ValueReaction.prototype.getVelocity = function () {\n return this.getVelocityOfCurrent();\n };\n ValueReaction.prototype.update = function (v) {\n _super.prototype.update.call(this, v);\n this.prev = this.current;\n this.updateCurrent(v);\n var _a = getFrameData(),\n delta = _a.delta,\n timestamp = _a.timestamp;\n this.timeDelta = delta;\n this.lastUpdated = timestamp;\n sync.postRender(this.scheduleVelocityCheck);\n };\n ValueReaction.prototype.subscribe = function (observerCandidate) {\n var sub = _super.prototype.subscribe.call(this, observerCandidate);\n this.subscribers[this.subscribers.length - 1].update(this.current);\n return sub;\n };\n ValueReaction.prototype.getSingleVelocity = function (current, prev) {\n return typeof current === 'number' && typeof prev === 'number' ? velocityPerSecond(current - prev, this.timeDelta) : velocityPerSecond(parseFloat(current) - parseFloat(prev), this.timeDelta) || 0;\n };\n return ValueReaction;\n}(BaseMulticast);\nvar value = function (value, initialSubscription) {\n return new ValueReaction({ value: value, initialSubscription: initialSubscription });\n};\n\nvar createVectorTests = function (typeTests) {\n var testNames = Object.keys(typeTests);\n var isVectorProp = function (prop, key) {\n return prop !== undefined && !typeTests[key](prop);\n };\n var getVectorKeys = function (props) {\n return testNames.reduce(function (vectorKeys, key) {\n if (isVectorProp(props[key], key)) vectorKeys.push(key);\n return vectorKeys;\n }, []);\n };\n var testVectorProps = function (props) {\n return props && testNames.some(function (key) {\n return isVectorProp(props[key], key);\n });\n };\n return { getVectorKeys: getVectorKeys, testVectorProps: testVectorProps };\n};\nvar unitTypes = [px, percent, degrees, vh, vw];\nvar findUnitType = function (prop) {\n return unitTypes.find(function (type) {\n return type.test(prop);\n });\n};\nvar isUnitProp = function (prop) {\n return Boolean(findUnitType(prop));\n};\nvar createAction = function (action, props) {\n return action(props);\n};\nvar createUnitAction = function (action, _a) {\n var from = _a.from,\n to = _a.to,\n props = __rest(_a, [\"from\", \"to\"]);\n var unitType = findUnitType(from) || findUnitType(to);\n var transform = unitType.transform,\n parse = unitType.parse;\n return action(__assign({}, props, { from: typeof from === 'string' ? parse(from) : from, to: typeof to === 'string' ? parse(to) : to })).pipe(transform);\n};\nvar createMixerAction = function (mixer) {\n return function (action, _a) {\n var from = _a.from,\n to = _a.to,\n props = __rest(_a, [\"from\", \"to\"]);\n return action(__assign({}, props, { from: 0, to: 1 })).pipe(mixer(from, to));\n };\n};\nvar createColorAction = /*#__PURE__*/createMixerAction(mixColor);\nvar createComplexAction = /*#__PURE__*/createMixerAction(mixComplex);\nvar createVectorAction = function (action, typeTests) {\n var _a = createVectorTests(typeTests),\n testVectorProps = _a.testVectorProps,\n getVectorKeys = _a.getVectorKeys;\n var vectorAction = function (props) {\n var isVector = testVectorProps(props);\n if (!isVector) return action(props);\n var vectorKeys = getVectorKeys(props);\n var testKey = vectorKeys[0];\n var testProp = props[testKey];\n return getActionCreator(testProp)(action, props, vectorKeys);\n };\n return vectorAction;\n};\nvar getActionCreator = function (prop) {\n if (typeof prop === 'number') {\n return createAction;\n } else if (isUnitProp(prop)) {\n return createUnitAction;\n } else if (color.test(prop)) {\n return createColorAction;\n } else if (complex.test(prop)) {\n return createComplexAction;\n } else {\n return createAction;\n }\n};\n\nvar decay = function (props) {\n if (props === void 0) {\n props = {};\n }\n return action(function (_a) {\n var complete = _a.complete,\n update = _a.update;\n var _b = props.velocity,\n velocity = _b === void 0 ? 0 : _b,\n _c = props.from,\n from = _c === void 0 ? 0 : _c,\n _d = props.power,\n power = _d === void 0 ? 0.8 : _d,\n _e = props.timeConstant,\n timeConstant = _e === void 0 ? 350 : _e,\n _f = props.restDelta,\n restDelta = _f === void 0 ? 0.5 : _f,\n modifyTarget = props.modifyTarget;\n var elapsed = 0;\n var amplitude = power * velocity;\n var idealTarget = Math.round(from + amplitude);\n var target = typeof modifyTarget === 'undefined' ? idealTarget : modifyTarget(idealTarget);\n var process = sync.update(function (_a) {\n var frameDelta = _a.delta;\n elapsed += frameDelta;\n var delta = -amplitude * Math.exp(-elapsed / timeConstant);\n var isMoving = delta > restDelta || delta < -restDelta;\n var current = isMoving ? target + delta : target;\n update(current);\n if (!isMoving) {\n cancelSync.update(process);\n complete();\n }\n }, true);\n return {\n stop: function () {\n return cancelSync.update(process);\n }\n };\n });\n};\nvar vectorDecay = /*#__PURE__*/createVectorAction(decay, {\n from: number.test,\n modifyTarget: function (func) {\n return typeof func === 'function';\n },\n velocity: number.test\n});\n\nvar spring = function (props) {\n if (props === void 0) {\n props = {};\n }\n return action(function (_a) {\n var update = _a.update,\n complete = _a.complete;\n var _b = props.velocity,\n velocity = _b === void 0 ? 0.0 : _b;\n var _c = props.from,\n from = _c === void 0 ? 0.0 : _c,\n _d = props.to,\n to = _d === void 0 ? 0.0 : _d,\n _e = props.stiffness,\n stiffness = _e === void 0 ? 100 : _e,\n _f = props.damping,\n damping = _f === void 0 ? 10 : _f,\n _g = props.mass,\n mass = _g === void 0 ? 1.0 : _g,\n _h = props.restSpeed,\n restSpeed = _h === void 0 ? 0.01 : _h,\n _j = props.restDelta,\n restDelta = _j === void 0 ? 0.01 : _j;\n var initialVelocity = velocity ? -(velocity / 1000) : 0.0;\n var t = 0;\n var delta = to - from;\n var position = from;\n var prevPosition = position;\n var process = sync.update(function (_a) {\n var timeDelta = _a.delta;\n t += timeDelta;\n var dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n var angularFreq = Math.sqrt(stiffness / mass) / 1000;\n prevPosition = position;\n if (dampingRatio < 1) {\n var envelope = Math.exp(-dampingRatio * angularFreq * t);\n var expoDecay = angularFreq * Math.sqrt(1.0 - dampingRatio * dampingRatio);\n position = to - envelope * ((initialVelocity + dampingRatio * angularFreq * delta) / expoDecay * Math.sin(expoDecay * t) + delta * Math.cos(expoDecay * t));\n } else {\n var envelope = Math.exp(-angularFreq * t);\n position = to - envelope * (delta + (initialVelocity + angularFreq * delta) * t);\n }\n velocity = velocityPerSecond(position - prevPosition, timeDelta);\n var isBelowVelocityThreshold = Math.abs(velocity) <= restSpeed;\n var isBelowDisplacementThreshold = Math.abs(to - position) <= restDelta;\n if (isBelowVelocityThreshold && isBelowDisplacementThreshold) {\n position = to;\n update(position);\n cancelSync.update(process);\n complete();\n } else {\n update(position);\n }\n }, true);\n return {\n stop: function () {\n return cancelSync.update(process);\n }\n };\n });\n};\nvar vectorSpring = /*#__PURE__*/createVectorAction(spring, {\n from: number.test,\n to: number.test,\n stiffness: number.test,\n damping: number.test,\n mass: number.test,\n velocity: number.test\n});\n\nvar inertia = function (_a) {\n var _b = _a.from,\n from = _b === void 0 ? 0 : _b,\n _c = _a.velocity,\n velocity = _c === void 0 ? 0 : _c,\n min = _a.min,\n max = _a.max,\n _d = _a.power,\n power = _d === void 0 ? 0.8 : _d,\n _e = _a.timeConstant,\n timeConstant = _e === void 0 ? 700 : _e,\n _f = _a.bounceStiffness,\n bounceStiffness = _f === void 0 ? 500 : _f,\n _g = _a.bounceDamping,\n bounceDamping = _g === void 0 ? 10 : _g,\n _h = _a.restDelta,\n restDelta = _h === void 0 ? 1 : _h,\n modifyTarget = _a.modifyTarget;\n return action(function (_a) {\n var update = _a.update,\n complete = _a.complete;\n var prev = from;\n var current = from;\n var activeAnimation;\n var isSpring = false;\n var isLessThanMin = function (v) {\n return min !== undefined && v <= min;\n };\n var isMoreThanMax = function (v) {\n return max !== undefined && v >= max;\n };\n var isOutOfBounds = function (v) {\n return isLessThanMin(v) || isMoreThanMax(v);\n };\n var isTravellingAwayFromBounds = function (v, currentVelocity) {\n return isLessThanMin(v) && currentVelocity < 0 || isMoreThanMax(v) && currentVelocity > 0;\n };\n var onUpdate = function (v) {\n update(v);\n prev = current;\n current = v;\n velocity = velocityPerSecond(current - prev, getFrameData().delta);\n if (activeAnimation && !isSpring && isTravellingAwayFromBounds(v, velocity)) {\n startSpring({ from: v, velocity: velocity });\n }\n };\n var startAnimation = function (animation, next) {\n activeAnimation && activeAnimation.stop();\n activeAnimation = animation.start({\n update: onUpdate,\n complete: function () {\n if (next) {\n next();\n return;\n }\n complete();\n }\n });\n };\n var startSpring = function (props) {\n isSpring = true;\n startAnimation(vectorSpring(__assign({}, props, { to: isLessThanMin(props.from) ? min : max, stiffness: bounceStiffness, damping: bounceDamping, restDelta: restDelta })));\n };\n if (isOutOfBounds(from)) {\n startSpring({ from: from, velocity: velocity });\n } else if (velocity !== 0) {\n var animation = vectorDecay({\n from: from,\n velocity: velocity,\n timeConstant: timeConstant,\n power: power,\n restDelta: isOutOfBounds(from) ? 20 : restDelta,\n modifyTarget: modifyTarget\n });\n startAnimation(animation, function () {\n if (isOutOfBounds(current)) {\n startSpring({ from: current, velocity: velocity });\n } else {\n complete();\n }\n });\n } else {\n complete();\n }\n return {\n stop: function () {\n return activeAnimation && activeAnimation.stop();\n }\n };\n });\n};\nvar index = /*#__PURE__*/createVectorAction(inertia, {\n from: number.test,\n velocity: number.test,\n min: number.test,\n max: number.test,\n damping: number.test,\n stiffness: number.test,\n modifyTarget: function (func) {\n return typeof func === 'function';\n }\n});\n\nvar frame = function () {\n return action(function (_a) {\n var update = _a.update;\n var initialTime = 0;\n var process = sync.update(function (_a) {\n var timestamp = _a.timestamp;\n if (!initialTime) initialTime = timestamp;\n update(timestamp - initialTime);\n }, true, true);\n return {\n stop: function () {\n return cancelSync.update(process);\n }\n };\n });\n};\n\nvar scrubber = function (_a) {\n var _b = _a.from,\n from = _b === void 0 ? 0 : _b,\n _c = _a.to,\n to = _c === void 0 ? 1 : _c,\n _d = _a.ease,\n ease = _d === void 0 ? linear : _d,\n _e = _a.reverseEase,\n reverseEase = _e === void 0 ? false : _e;\n if (reverseEase) {\n ease = createReversedEasing(ease);\n }\n return action(function (_a) {\n var update = _a.update;\n return {\n seek: function (progress) {\n return update(progress);\n }\n };\n }).pipe(ease, function (v) {\n return mix(from, to, v);\n });\n};\nvar vectorScrubber = /*#__PURE__*/createVectorAction(scrubber, {\n ease: function (func) {\n return typeof func === 'function';\n },\n from: number.test,\n to: number.test\n});\n\nvar clampProgress = /*#__PURE__*/clamp(0, 1);\nvar tween = function (props) {\n if (props === void 0) {\n props = {};\n }\n return action(function (_a) {\n var update = _a.update,\n complete = _a.complete;\n var _b = props.duration,\n duration = _b === void 0 ? 300 : _b,\n _c = props.ease,\n ease = _c === void 0 ? easeOut : _c,\n _d = props.flip,\n flip = _d === void 0 ? 0 : _d,\n _e = props.loop,\n loop = _e === void 0 ? 0 : _e,\n _f = props.yoyo,\n yoyo = _f === void 0 ? 0 : _f,\n _g = props.repeatDelay,\n repeatDelay = _g === void 0 ? 0 : _g;\n var _h = props.from,\n from = _h === void 0 ? 0 : _h,\n _j = props.to,\n to = _j === void 0 ? 1 : _j,\n _k = props.elapsed,\n elapsed = _k === void 0 ? 0 : _k,\n _l = props.flipCount,\n flipCount = _l === void 0 ? 0 : _l,\n _m = props.yoyoCount,\n yoyoCount = _m === void 0 ? 0 : _m,\n _o = props.loopCount,\n loopCount = _o === void 0 ? 0 : _o;\n var playhead = vectorScrubber({ from: from, to: to, ease: ease }).start(update);\n var currentProgress = 0;\n var process;\n var isActive = false;\n var reverseAnimation = function (reverseEase) {\n var _a;\n if (reverseEase === void 0) {\n reverseEase = false;\n }\n _a = [to, from], from = _a[0], to = _a[1];\n playhead = vectorScrubber({ from: from, to: to, ease: ease, reverseEase: reverseEase }).start(update);\n };\n var isTweenComplete = function () {\n var isComplete = isActive && elapsed > duration + repeatDelay;\n if (!isComplete) return false;\n if (isComplete && !loop && !flip && !yoyo) return true;\n var overtime = elapsed - duration;\n elapsed = overtime - repeatDelay;\n if (loop && loopCount < loop) {\n loopCount++;\n return false;\n } else if (flip && flipCount < flip) {\n flipCount++;\n reverseAnimation();\n return false;\n } else if (yoyo && yoyoCount < yoyo) {\n yoyoCount++;\n reverseAnimation(yoyoCount % 2 !== 0);\n return false;\n }\n return true;\n };\n var updateTween = function () {\n currentProgress = clampProgress(progress(0, duration, elapsed));\n playhead.seek(currentProgress);\n };\n var startTimer = function () {\n isActive = true;\n process = sync.update(function (_a) {\n var delta = _a.delta;\n elapsed += delta;\n updateTween();\n if (isTweenComplete()) {\n cancelSync.update(process);\n complete && sync.update(complete, false, true);\n }\n }, true);\n };\n var stopTimer = function () {\n isActive = false;\n if (process) cancelSync.update(process);\n };\n startTimer();\n return {\n isActive: function () {\n return isActive;\n },\n getElapsed: function () {\n return clamp(0, duration, elapsed);\n },\n getProgress: function () {\n return currentProgress;\n },\n stop: function () {\n stopTimer();\n },\n pause: function () {\n stopTimer();\n return this;\n },\n resume: function () {\n if (!isActive) startTimer();\n return this;\n },\n seek: function (newProgress) {\n elapsed = mix(0, duration, newProgress);\n sync.update(updateTween, false, true);\n return this;\n },\n reverse: function () {\n reverseAnimation();\n return this;\n }\n };\n });\n};\n\nvar clampProgress$1 = /*#__PURE__*/clamp(0, 1);\nvar defaultEasings = function (values, easing) {\n return values.map(function () {\n return easing || easeOut;\n }).splice(0, values.length - 1);\n};\nvar defaultTimings = function (values) {\n var numValues = values.length;\n return values.map(function (value, i) {\n return i !== 0 ? i / (numValues - 1) : 0;\n });\n};\nvar interpolateScrubbers = function (input, scrubbers, update) {\n var rangeLength = input.length;\n var finalInputIndex = rangeLength - 1;\n var finalScrubberIndex = finalInputIndex - 1;\n var subs = scrubbers.map(function (scrub) {\n return scrub.start(update);\n });\n return function (v) {\n if (v <= input[0]) {\n subs[0].seek(0);\n }\n if (v >= input[finalInputIndex]) {\n subs[finalScrubberIndex].seek(1);\n }\n var i = 1;\n for (; i < rangeLength; i++) {\n if (input[i] > v || i === finalInputIndex) break;\n }\n var progressInRange = progress(input[i - 1], input[i], v);\n subs[i - 1].seek(clampProgress$1(progressInRange));\n };\n};\nvar keyframes = function (_a) {\n var easings = _a.easings,\n _b = _a.ease,\n ease = _b === void 0 ? linear : _b,\n times = _a.times,\n values = _a.values,\n tweenProps = __rest(_a, [\"easings\", \"ease\", \"times\", \"values\"]);\n easings = Array.isArray(easings) ? easings : defaultEasings(values, easings);\n times = times || defaultTimings(values);\n var scrubbers = easings.map(function (easing, i) {\n return vectorScrubber({\n from: values[i],\n to: values[i + 1],\n ease: easing\n });\n });\n return tween(__assign({}, tweenProps, { ease: ease })).applyMiddleware(function (update) {\n return interpolateScrubbers(times, scrubbers, update);\n });\n};\n\nvar physics = function (props) {\n if (props === void 0) {\n props = {};\n }\n return action(function (_a) {\n var complete = _a.complete,\n update = _a.update;\n var _b = props.acceleration,\n acceleration = _b === void 0 ? 0 : _b,\n _c = props.friction,\n friction = _c === void 0 ? 0 : _c,\n _d = props.velocity,\n velocity = _d === void 0 ? 0 : _d,\n springStrength = props.springStrength,\n to = props.to;\n var _e = props.restSpeed,\n restSpeed = _e === void 0 ? 0.001 : _e,\n _f = props.from,\n from = _f === void 0 ? 0 : _f;\n var current = from;\n var process = sync.update(function (_a) {\n var delta = _a.delta;\n var elapsed = Math.max(delta, 16);\n if (acceleration) velocity += velocityPerFrame(acceleration, elapsed);\n if (friction) velocity *= Math.pow(1 - friction, elapsed / 100);\n if (springStrength !== undefined && to !== undefined) {\n var distanceToTarget = to - current;\n velocity += distanceToTarget * velocityPerFrame(springStrength, elapsed);\n }\n current += velocityPerFrame(velocity, elapsed);\n update(current);\n var isComplete = restSpeed !== false && (!velocity || Math.abs(velocity) <= restSpeed);\n if (isComplete) {\n cancelSync.update(process);\n complete();\n }\n }, true);\n return {\n set: function (v) {\n current = v;\n return this;\n },\n setAcceleration: function (v) {\n acceleration = v;\n return this;\n },\n setFriction: function (v) {\n friction = v;\n return this;\n },\n setSpringStrength: function (v) {\n springStrength = v;\n return this;\n },\n setSpringTarget: function (v) {\n to = v;\n return this;\n },\n setVelocity: function (v) {\n velocity = v;\n return this;\n },\n stop: function () {\n return cancelSync.update(process);\n }\n };\n });\n};\nvar vectorPhysics = /*#__PURE__*/createVectorAction(physics, {\n acceleration: number.test,\n friction: number.test,\n velocity: number.test,\n from: number.test,\n to: number.test,\n springStrength: number.test\n});\n\nvar multi = function (_a) {\n var getCount = _a.getCount,\n getFirst = _a.getFirst,\n getOutput = _a.getOutput,\n mapApi = _a.mapApi,\n setProp = _a.setProp,\n startActions = _a.startActions;\n return function (actions) {\n return action(function (_a) {\n var update = _a.update,\n complete = _a.complete,\n error = _a.error;\n var numActions = getCount(actions);\n var output = getOutput();\n var updateOutput = function () {\n return update(output);\n };\n var numCompletedActions = 0;\n var subs = startActions(actions, function (a, name) {\n var hasCompleted = false;\n return a.start({\n complete: function () {\n if (!hasCompleted) {\n hasCompleted = true;\n numCompletedActions++;\n if (numCompletedActions === numActions) sync.update(complete);\n }\n },\n error: error,\n update: function (v) {\n setProp(output, name, v);\n sync.update(updateOutput, false, true);\n }\n });\n });\n return Object.keys(getFirst(subs)).reduce(function (api, methodName) {\n api[methodName] = mapApi(subs, methodName);\n return api;\n }, {});\n });\n };\n};\n\nvar composite = /*#__PURE__*/multi({\n getOutput: function () {\n return {};\n },\n getCount: function (subs) {\n return Object.keys(subs).length;\n },\n getFirst: function (subs) {\n return subs[Object.keys(subs)[0]];\n },\n mapApi: function (subs, methodName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return Object.keys(subs).reduce(function (output, propKey) {\n var _a;\n if (subs[propKey][methodName]) {\n args[0] && args[0][propKey] !== undefined ? output[propKey] = subs[propKey][methodName](args[0][propKey]) : output[propKey] = (_a = subs[propKey])[methodName].apply(_a, args);\n }\n return output;\n }, {});\n };\n },\n setProp: function (output, name, v) {\n return output[name] = v;\n },\n startActions: function (actions, starter) {\n return Object.keys(actions).reduce(function (subs, key) {\n subs[key] = starter(actions[key], key);\n return subs;\n }, {});\n }\n});\n\nvar DEFAULT_DURATION = 300;\nvar flattenTimings = function (instructions) {\n var flatInstructions = [];\n var lastArg = instructions[instructions.length - 1];\n var isStaggered = typeof lastArg === 'number';\n var staggerDelay = isStaggered ? lastArg : 0;\n var segments = isStaggered ? instructions.slice(0, -1) : instructions;\n var numSegments = segments.length;\n var offset = 0;\n segments.forEach(function (item, i) {\n flatInstructions.push(item);\n if (i !== numSegments - 1) {\n var duration = item.duration || DEFAULT_DURATION;\n offset += staggerDelay;\n flatInstructions.push(\"-\" + (duration - offset));\n }\n });\n return flatInstructions;\n};\nvar flattenArrayInstructions = function (instructions, instruction) {\n Array.isArray(instruction) ? instructions.push.apply(instructions, flattenTimings(instruction)) : instructions.push(instruction);\n return instructions;\n};\nvar convertDefToProps = function (props, def, i) {\n var duration = props.duration,\n easings = props.easings,\n times = props.times,\n values = props.values;\n var numValues = values.length;\n var prevTimeTo = times[numValues - 1];\n var timeFrom = def.at === 0 ? 0 : def.at / duration;\n var timeTo = (def.at + def.duration) / duration;\n if (i === 0) {\n values.push(def.from);\n times.push(timeFrom);\n } else {\n if (prevTimeTo !== timeFrom) {\n if (def.from !== undefined) {\n values.push(values[numValues - 1]);\n times.push(timeFrom);\n easings.push(linear);\n }\n var from = def.from !== undefined ? def.from : values[numValues - 1];\n values.push(from);\n times.push(timeFrom);\n easings.push(linear);\n } else if (def.from !== undefined) {\n values.push(def.from);\n times.push(timeFrom);\n easings.push(linear);\n }\n }\n values.push(def.to);\n times.push(timeTo);\n easings.push(def.ease || easeInOut);\n return props;\n};\nvar timeline = function (instructions, _a) {\n var _b = _a === void 0 ? {} : _a,\n duration = _b.duration,\n elapsed = _b.elapsed,\n ease = _b.ease,\n loop = _b.loop,\n flip = _b.flip,\n yoyo = _b.yoyo;\n var playhead = 0;\n var calculatedDuration = 0;\n var flatInstructions = instructions.reduce(flattenArrayInstructions, []);\n var animationDefs = [];\n flatInstructions.forEach(function (instruction) {\n if (typeof instruction === 'string') {\n playhead += parseFloat(instruction);\n } else if (typeof instruction === 'number') {\n playhead = instruction;\n } else {\n var def = __assign({}, instruction, { at: playhead });\n def.duration = def.duration === undefined ? DEFAULT_DURATION : def.duration;\n animationDefs.push(def);\n playhead += def.duration;\n calculatedDuration = Math.max(calculatedDuration, def.at + def.duration);\n }\n });\n var tracks = {};\n var numDefs = animationDefs.length;\n for (var i = 0; i < numDefs; i++) {\n var def = animationDefs[i];\n var track = def.track;\n if (track === undefined) {\n throw new Error('No track defined');\n }\n if (!tracks.hasOwnProperty(track)) tracks[track] = [];\n tracks[track].push(def);\n }\n var trackKeyframes = {};\n for (var key in tracks) {\n if (tracks.hasOwnProperty(key)) {\n var keyframeProps = tracks[key].reduce(convertDefToProps, {\n duration: calculatedDuration,\n easings: [],\n times: [],\n values: []\n });\n trackKeyframes[key] = keyframes(__assign({}, keyframeProps, { duration: duration || calculatedDuration, ease: ease,\n elapsed: elapsed,\n loop: loop,\n yoyo: yoyo,\n flip: flip }));\n }\n }\n return composite(trackKeyframes);\n};\n\nvar listen = function (element, events, options) {\n return action(function (_a) {\n var update = _a.update;\n var eventNames = events.split(' ').map(function (eventName) {\n element.addEventListener(eventName, update, options);\n return eventName;\n });\n return {\n stop: function () {\n return eventNames.forEach(function (eventName) {\n return element.removeEventListener(eventName, update, options);\n });\n }\n };\n });\n};\n\nvar defaultPointerPos = function () {\n return {\n clientX: 0,\n clientY: 0,\n pageX: 0,\n pageY: 0,\n x: 0,\n y: 0\n };\n};\nvar eventToPoint = function (e, point) {\n if (point === void 0) {\n point = defaultPointerPos();\n }\n point.clientX = point.x = e.clientX;\n point.clientY = point.y = e.clientY;\n point.pageX = e.pageX;\n point.pageY = e.pageY;\n return point;\n};\n\nvar points = [/*#__PURE__*/defaultPointerPos()];\nvar isTouchDevice = false;\nif (typeof document !== 'undefined') {\n var updatePointsLocation = function (_a) {\n var touches = _a.touches;\n isTouchDevice = true;\n var numTouches = touches.length;\n points.length = 0;\n for (var i = 0; i < numTouches; i++) {\n var thisTouch = touches[i];\n points.push(eventToPoint(thisTouch));\n }\n };\n listen(document, 'touchstart touchmove', {\n passive: true,\n capture: true\n }).start(updatePointsLocation);\n}\nvar multitouch = function (_a) {\n var _b = _a === void 0 ? {} : _a,\n _c = _b.preventDefault,\n preventDefault = _c === void 0 ? true : _c,\n _d = _b.scale,\n scale = _d === void 0 ? 1.0 : _d,\n _e = _b.rotate,\n rotate = _e === void 0 ? 0.0 : _e;\n return action(function (_a) {\n var update = _a.update;\n var output = {\n touches: points,\n scale: scale,\n rotate: rotate\n };\n var initialDistance = 0.0;\n var initialRotation = 0.0;\n var isGesture = points.length > 1;\n if (isGesture) {\n var firstTouch = points[0],\n secondTouch = points[1];\n initialDistance = distance(firstTouch, secondTouch);\n initialRotation = angle(firstTouch, secondTouch);\n }\n var updatePoint = function () {\n if (isGesture) {\n var firstTouch = points[0],\n secondTouch = points[1];\n var newDistance = distance(firstTouch, secondTouch);\n var newRotation = angle(firstTouch, secondTouch);\n output.scale = scale * (newDistance / initialDistance);\n output.rotate = rotate + (newRotation - initialRotation);\n }\n update(output);\n };\n var onMove = function (e) {\n if (preventDefault || e.touches.length > 1) e.preventDefault();\n sync.update(updatePoint);\n };\n var updateOnMove = listen(document, 'touchmove', {\n passive: !preventDefault\n }).start(onMove);\n if (isTouchDevice) sync.update(updatePoint);\n return {\n stop: function () {\n cancelSync.update(updatePoint);\n updateOnMove.stop();\n }\n };\n });\n};\nvar getIsTouchDevice = function () {\n return isTouchDevice;\n};\n\nvar point = /*#__PURE__*/defaultPointerPos();\nvar isMouseDevice = false;\nif (typeof document !== 'undefined') {\n var updatePointLocation = function (e) {\n isMouseDevice = true;\n eventToPoint(e, point);\n };\n listen(document, 'mousedown mousemove', true).start(updatePointLocation);\n}\nvar mouse = function (_a) {\n var _b = (_a === void 0 ? {} : _a).preventDefault,\n preventDefault = _b === void 0 ? true : _b;\n return action(function (_a) {\n var update = _a.update;\n var updatePoint = function () {\n return update(point);\n };\n var onMove = function (e) {\n if (preventDefault) e.preventDefault();\n sync.update(updatePoint);\n };\n var updateOnMove = listen(document, 'mousemove').start(onMove);\n if (isMouseDevice) sync.update(updatePoint);\n return {\n stop: function () {\n cancelSync.update(updatePoint);\n updateOnMove.stop();\n }\n };\n });\n};\n\nvar getFirstTouch = function (_a) {\n var firstTouch = _a[0];\n return firstTouch;\n};\nvar pointer = function (props) {\n if (props === void 0) {\n props = {};\n }\n return getIsTouchDevice() ? multitouch(props).pipe(function (_a) {\n var touches = _a.touches;\n return touches;\n }, getFirstTouch) : mouse(props);\n};\nvar index$1 = function (_a) {\n if (_a === void 0) {\n _a = {};\n }\n var x = _a.x,\n y = _a.y,\n props = __rest(_a, [\"x\", \"y\"]);\n if (x !== undefined || y !== undefined) {\n var applyXOffset_1 = applyOffset(x || 0);\n var applyYOffset_1 = applyOffset(y || 0);\n var delta_1 = { x: 0, y: 0 };\n return pointer(props).pipe(function (point) {\n delta_1.x = applyXOffset_1(point.x);\n delta_1.y = applyYOffset_1(point.y);\n return delta_1;\n });\n } else {\n return pointer(props);\n }\n};\n\nvar chain = function () {\n var actions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n actions[_i] = arguments[_i];\n }\n return action(function (_a) {\n var update = _a.update,\n complete = _a.complete;\n var i = 0;\n var current;\n var playCurrent = function () {\n current = actions[i].start({\n complete: function () {\n i++;\n i >= actions.length ? complete() : playCurrent();\n },\n update: update\n });\n };\n playCurrent();\n return {\n stop: function () {\n return current && current.stop();\n }\n };\n });\n};\n\nvar parallel = /*#__PURE__*/multi({\n getOutput: function () {\n return [];\n },\n getCount: function (subs) {\n return subs.length;\n },\n getFirst: function (subs) {\n return subs[0];\n },\n mapApi: function (subs, methodName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return subs.map(function (sub, i) {\n if (sub[methodName]) {\n return Array.isArray(args[0]) ? sub[methodName](args[0][i]) : sub[methodName].apply(sub, args);\n }\n });\n };\n },\n setProp: function (output, name, v) {\n return output[name] = v;\n },\n startActions: function (actions, starter) {\n return actions.map(function (action, i) {\n return starter(action, i);\n });\n }\n});\nvar parallel$1 = function () {\n var actions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n actions[_i] = arguments[_i];\n }\n return parallel(actions);\n};\n\nvar crossfade = function (a, b) {\n return action(function (observer) {\n var balance = 0;\n var fadable = parallel$1(a, b).start(__assign({}, observer, { update: function (_a) {\n var va = _a[0],\n vb = _a[1];\n observer.update(mix(va, vb, balance));\n } }));\n return {\n setBalance: function (v) {\n return balance = v;\n },\n stop: function () {\n return fadable.stop();\n }\n };\n });\n};\n\nvar delay = function (timeToDelay) {\n return action(function (_a) {\n var complete = _a.complete;\n var timeout = setTimeout(complete, timeToDelay);\n return {\n stop: function () {\n return clearTimeout(timeout);\n }\n };\n });\n};\n\nvar merge = function () {\n var actions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n actions[_i] = arguments[_i];\n }\n return action(function (observer) {\n var subs = actions.map(function (thisAction) {\n return thisAction.start(observer);\n });\n return {\n stop: function () {\n return subs.forEach(function (sub) {\n return sub.stop();\n });\n }\n };\n });\n};\n\nvar schedule = function (scheduler, schedulee) {\n return action(function (_a) {\n var update = _a.update,\n complete = _a.complete;\n var latest;\n var schedulerSub = scheduler.start({\n update: function () {\n return latest !== undefined && update(latest);\n },\n complete: complete\n });\n var scheduleeSub = schedulee.start({\n update: function (v) {\n return latest = v;\n },\n complete: complete\n });\n return {\n stop: function () {\n schedulerSub.stop();\n scheduleeSub.stop();\n }\n };\n });\n};\n\nvar stagger = function (actions, interval) {\n var intervalIsNumber = typeof interval === 'number';\n var actionsWithDelay = actions.map(function (a, i) {\n var timeToDelay = intervalIsNumber ? interval * i : interval(i);\n return chain(delay(timeToDelay), a);\n });\n return parallel$1.apply(void 0, actionsWithDelay);\n};\n\nvar styler = function () {\n return invariant(false, 'styler has been removed from Popmotion in 9.0. Downgrade to 8.x or npm install stylefire');\n};\n\nexport { Action, ValueReaction, action, chain, composite, crossfade, vectorDecay as decay, delay, frame as everyFrame, index as inertia, keyframes, listen, merge, mouse, multicast, multitouch, parallel$1 as parallel, vectorPhysics as physics, index$1 as pointer, schedule, vectorSpring as spring, stagger, styler, timeline, tween, value };\n","import { __assign, __rest, __extends } from 'tslib';\nimport React__default, { useRef, memo, useEffect, createContext, useMemo, useContext, forwardRef, createElement, Fragment, useCallback, useState, cloneElement, Children, isValidElement } from 'react';\nimport sync, { getFrameData, cancelSync } from 'framesync';\nimport { velocityPerSecond, distance, mix, interpolate, wrap } from '@popmotion/popcorn';\nimport styler, { createStylerFactory, buildStyleProperty, isTransformProp, transformProps, buildSVGAttrs } from 'stylefire';\nimport { invariant, warning } from 'hey-listen';\nimport { number, px, percent, degrees, vw, vh, color, complex } from 'style-value-types';\nimport { action, delay, tween, spring, keyframes as keyframes$1, inertia } from 'popmotion';\nimport * as easingLookup from '@popmotion/easing';\nimport { cubicBezier, linear } from '@popmotion/easing';\n\nvar isFloat = function (value) {\r\n return !isNaN(parseFloat(value));\r\n};\r\n/**\r\n * `MotionValue` is used to track the state and velocity of motion values.\r\n *\r\n * @public\r\n */\r\nvar MotionValue = /** @class */ (function () {\r\n /**\r\n * @param init - The initiating value\r\n * @param config - Optional configuration options\r\n *\r\n * - `transformer`: A function to transform incoming values with.\r\n *\r\n * @internal\r\n */\r\n function MotionValue(init, _a) {\r\n var _this = this;\r\n var _b = _a === void 0 ? {} : _a, transformer = _b.transformer, parent = _b.parent;\r\n /**\r\n * Duration, in milliseconds, since last updating frame.\r\n *\r\n * @internal\r\n */\r\n this.timeDelta = 0;\r\n /**\r\n * Timestamp of the last time this `MotionValue` was updated.\r\n *\r\n * @internal\r\n */\r\n this.lastUpdated = 0;\r\n /**\r\n * Tracks whether this value can output a velocity. Currently this is only true\r\n * if the value is numerical, but we might be able to widen the scope here and support\r\n * other value types.\r\n *\r\n * @internal\r\n */\r\n this.canTrackVelocity = false;\r\n this.updateAndNotify = function (v, render) {\r\n if (render === void 0) { render = true; }\r\n _this.prev = _this.current;\r\n _this.current = _this.transformer ? _this.transformer(v) : v;\r\n if (_this.updateSubscribers && _this.prev !== _this.current) {\r\n _this.updateSubscribers.forEach(_this.notifySubscriber);\r\n }\r\n if (_this.children) {\r\n _this.children.forEach(_this.setChild);\r\n }\r\n if (render && _this.renderSubscribers) {\r\n _this.renderSubscribers.forEach(_this.notifySubscriber);\r\n }\r\n // Update timestamp\r\n var _a = getFrameData(), delta = _a.delta, timestamp = _a.timestamp;\r\n if (_this.lastUpdated !== timestamp) {\r\n _this.timeDelta = delta;\r\n _this.lastUpdated = timestamp;\r\n sync.postRender(_this.scheduleVelocityCheck);\r\n }\r\n };\r\n /**\r\n * Notify a subscriber with the latest value.\r\n *\r\n * This is an instanced and bound function to prevent generating a new\r\n * function once per frame.\r\n *\r\n * @param subscriber - The subscriber to notify.\r\n *\r\n * @internal\r\n */\r\n this.notifySubscriber = function (subscriber) {\r\n subscriber(_this.current);\r\n };\r\n /**\r\n * Schedule a velocity check for the next frame.\r\n *\r\n * This is an instanced and bound function to prevent generating a new\r\n * function once per frame.\r\n *\r\n * @internal\r\n */\r\n this.scheduleVelocityCheck = function () { return sync.postRender(_this.velocityCheck); };\r\n /**\r\n * Updates `prev` with `current` if the value hasn't been updated this frame.\r\n * This ensures velocity calculations return `0`.\r\n *\r\n * This is an instanced and bound function to prevent generating a new\r\n * function once per frame.\r\n *\r\n * @internal\r\n */\r\n this.velocityCheck = function (_a) {\r\n var timestamp = _a.timestamp;\r\n if (timestamp !== _this.lastUpdated) {\r\n _this.prev = _this.current;\r\n }\r\n };\r\n /**\r\n * Updates child `MotionValue`.\r\n *\r\n * @param child - Child `MotionValue`.\r\n *\r\n * @internal\r\n */\r\n this.setChild = function (child) { return child.set(_this.current); };\r\n this.parent = parent;\r\n this.transformer = transformer;\r\n this.set(init, false);\r\n this.canTrackVelocity = isFloat(this.current);\r\n }\r\n /**\r\n * Creates a new `MotionValue` that's subscribed to the output of this one.\r\n *\r\n * @param config - Optional configuration options\r\n *\r\n * - `transformer`: A function to transform incoming values with.\r\n *\r\n * @internal\r\n */\r\n MotionValue.prototype.addChild = function (config) {\r\n if (config === void 0) { config = {}; }\r\n var child = new MotionValue(this.current, __assign({ parent: this }, config));\r\n if (!this.children)\r\n this.children = new Set();\r\n this.children.add(child);\r\n return child;\r\n };\r\n /**\r\n * Stops a `MotionValue` from being subscribed to this one.\r\n *\r\n * @param child - The subscribed `MotionValue`\r\n *\r\n * @internal\r\n */\r\n MotionValue.prototype.removeChild = function (child) {\r\n if (!this.children) {\r\n return;\r\n }\r\n this.children.delete(child);\r\n };\r\n /**\r\n * Subscribes a subscriber function to a subscription list.\r\n *\r\n * @param subscriptions - A `Set` of subscribers.\r\n * @param subscription - A subscriber function.\r\n */\r\n MotionValue.prototype.subscribeTo = function (subscriptions, subscription) {\r\n var _this = this;\r\n var updateSubscriber = function () { return subscription(_this.current); };\r\n subscriptions.add(updateSubscriber);\r\n return function () { return subscriptions.delete(updateSubscriber); };\r\n };\r\n /**\r\n * Adds a function that will be notified when the `MotionValue` is updated.\r\n *\r\n * It returns a function that, when called, will cancel the subscription.\r\n *\r\n * When calling `onChange` inside a React component, it should be wrapped with the\r\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\r\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\r\n *\r\n * @library\r\n *\r\n * ```jsx\r\n * function MyComponent() {\r\n * const x = useMotionValue(0)\r\n * const y = useMotionValue(0)\r\n * const opacity = useMotionValue(1)\r\n *\r\n * useEffect(() => {\r\n * function updateOpacity() {\r\n * const maxXY = Math.max(x.get(), y.get())\r\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\r\n * opacity.set(newOpacity)\r\n * }\r\n *\r\n * const unsubscribeX = x.onChange(updateOpacity)\r\n * const unsubscribeY = y.onChange(updateOpacity)\r\n *\r\n * return () => {\r\n * unsubscribeX()\r\n * unsubscribeY()\r\n * }\r\n * }, [])\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @motion\r\n *\r\n * ```jsx\r\n * export const MyComponent = () => {\r\n * const x = useMotionValue(0)\r\n * const y = useMotionValue(0)\r\n * const opacity = useMotionValue(1)\r\n *\r\n * useEffect(() => {\r\n * function updateOpacity() {\r\n * const maxXY = Math.max(x.get(), y.get())\r\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\r\n * opacity.set(newOpacity)\r\n * }\r\n *\r\n * const unsubscribeX = x.onChange(updateOpacity)\r\n * const unsubscribeY = y.onChange(updateOpacity)\r\n *\r\n * return () => {\r\n * unsubscribeX()\r\n * unsubscribeY()\r\n * }\r\n * }, [])\r\n *\r\n * return \r\n * }\r\n * ```\r\n *\r\n * @internalremarks\r\n *\r\n * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.\r\n *\r\n * ```jsx\r\n * useOnChange(x, () => {})\r\n * ```\r\n *\r\n * @param subscriber - A function that receives the latest value.\r\n * @returns A function that, when called, will cancel this subscription.\r\n *\r\n * @public\r\n */\r\n MotionValue.prototype.onChange = function (subscription) {\r\n if (!this.updateSubscribers)\r\n this.updateSubscribers = new Set();\r\n return this.subscribeTo(this.updateSubscribers, subscription);\r\n };\r\n /**\r\n * Adds a function that will be notified when the `MotionValue` requests a render.\r\n *\r\n * @param subscriber - A function that's provided the latest value.\r\n * @returns A function that, when called, will cancel this subscription.\r\n *\r\n * @internal\r\n */\r\n MotionValue.prototype.onRenderRequest = function (subscription) {\r\n if (!this.renderSubscribers)\r\n this.renderSubscribers = new Set();\r\n // Render immediately\r\n this.notifySubscriber(subscription);\r\n return this.subscribeTo(this.renderSubscribers, subscription);\r\n };\r\n /**\r\n * Attaches a passive effect to the `MotionValue`.\r\n *\r\n * @internal\r\n */\r\n MotionValue.prototype.attach = function (passiveEffect) {\r\n this.passiveEffect = passiveEffect;\r\n };\r\n /**\r\n * Sets the state of the `MotionValue`.\r\n *\r\n * @remarks\r\n *\r\n * ```jsx\r\n * const x = useMotionValue(0)\r\n * x.set(10)\r\n * ```\r\n *\r\n * @param latest - Latest value to set.\r\n * @param render - Whether to notify render subscribers. Defaults to `true`\r\n *\r\n * @public\r\n */\r\n MotionValue.prototype.set = function (v, render) {\r\n if (render === void 0) { render = true; }\r\n if (!render || !this.passiveEffect) {\r\n this.updateAndNotify(v, render);\r\n }\r\n else {\r\n this.passiveEffect(v, this.updateAndNotify);\r\n }\r\n };\r\n /**\r\n * Returns the latest state of `MotionValue`\r\n *\r\n * @returns - The latest state of `MotionValue`\r\n *\r\n * @public\r\n */\r\n MotionValue.prototype.get = function () {\r\n return this.current;\r\n };\r\n /**\r\n * Returns the latest velocity of `MotionValue`\r\n *\r\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\r\n *\r\n * @public\r\n */\r\n MotionValue.prototype.getVelocity = function () {\r\n // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful\r\n return this.canTrackVelocity\r\n ? // These casts could be avoided if parseFloat would be typed better\r\n velocityPerSecond(parseFloat(this.current) -\r\n parseFloat(this.prev), this.timeDelta)\r\n : 0;\r\n };\r\n /**\r\n * Registers a new animation to control this `MotionValue`. Only one\r\n * animation can drive a `MotionValue` at one time.\r\n *\r\n * ```jsx\r\n * value.start()\r\n * ```\r\n *\r\n * @param animation - A function that starts the provided animation\r\n *\r\n * @internal\r\n */\r\n MotionValue.prototype.start = function (animation) {\r\n var _this = this;\r\n this.stop();\r\n return new Promise(function (resolve) {\r\n _this.stopAnimation = animation(resolve);\r\n }).then(function () { return _this.clearAnimation(); });\r\n };\r\n /**\r\n * Stop the currently active animation.\r\n *\r\n * @public\r\n */\r\n MotionValue.prototype.stop = function () {\r\n if (this.stopAnimation)\r\n this.stopAnimation();\r\n this.clearAnimation();\r\n };\r\n /**\r\n * Returns `true` if this value is currently animating.\r\n *\r\n * @public\r\n */\r\n MotionValue.prototype.isAnimating = function () {\r\n return !!this.stopAnimation;\r\n };\r\n MotionValue.prototype.clearAnimation = function () {\r\n this.stopAnimation = null;\r\n };\r\n /**\r\n * Destroy and clean up subscribers to this `MotionValue`.\r\n *\r\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\r\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\r\n * created a `MotionValue` via the `motionValue` function.\r\n *\r\n * @public\r\n */\r\n MotionValue.prototype.destroy = function () {\r\n this.updateSubscribers && this.updateSubscribers.clear();\r\n this.renderSubscribers && this.renderSubscribers.clear();\r\n this.parent && this.parent.removeChild(this);\r\n this.stop();\r\n };\r\n return MotionValue;\r\n}());\r\n/**\r\n * @internal\r\n */\r\nfunction motionValue(init, opts) {\r\n return new MotionValue(init, opts);\r\n}\n\n/**\r\n * Creates a constant value over the lifecycle of a component.\r\n *\r\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\r\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\r\n * you can ensure that initialisers don't execute twice or more.\r\n */\r\nfunction useConstant(init) {\r\n var ref = useRef(null);\r\n if (ref.current === null) {\r\n ref.current = init();\r\n }\r\n return ref.current;\r\n}\n\nvar isMotionValue = function (value) {\r\n return value instanceof MotionValue;\r\n};\n\n// Creating a styler factory for the `onUpdate` prop allows all values\r\n// to fire and the `onUpdate` prop will only fire once per frame\r\nvar updateStyler = createStylerFactory({\r\n onRead: function () { return null; },\r\n onRender: function (state, _a) {\r\n var onUpdate = _a.onUpdate;\r\n return onUpdate(state);\r\n },\r\n});\r\nvar MotionValuesMap = /** @class */ (function () {\r\n function MotionValuesMap() {\r\n this.hasMounted = false;\r\n this.values = new Map();\r\n this.unsubscribers = new Map();\r\n }\r\n MotionValuesMap.prototype.has = function (key) {\r\n return this.values.has(key);\r\n };\r\n MotionValuesMap.prototype.set = function (key, value) {\r\n this.values.set(key, value);\r\n if (this.hasMounted) {\r\n this.bindValueToOutput(key, value);\r\n }\r\n };\r\n MotionValuesMap.prototype.get = function (key, defaultValue) {\r\n var value = this.values.get(key);\r\n if (value === undefined && defaultValue !== undefined) {\r\n value = new MotionValue(defaultValue);\r\n this.set(key, value);\r\n }\r\n return value;\r\n };\r\n MotionValuesMap.prototype.forEach = function (callback) {\r\n return this.values.forEach(callback);\r\n };\r\n MotionValuesMap.prototype.bindValueToOutput = function (key, value) {\r\n var _this = this;\r\n var onRender = function (v) { return _this.output && _this.output(key, v); };\r\n var unsubscribeOnRender = value.onRenderRequest(onRender);\r\n var onChange = function (v) {\r\n _this.onUpdate && _this.onUpdate.set(key, v);\r\n };\r\n var unsubscribeOnChange = value.onChange(onChange);\r\n if (this.unsubscribers.has(key)) {\r\n this.unsubscribers.get(key)();\r\n }\r\n this.unsubscribers.set(key, function () {\r\n unsubscribeOnRender();\r\n unsubscribeOnChange();\r\n });\r\n };\r\n MotionValuesMap.prototype.setOnUpdate = function (onUpdate) {\r\n this.onUpdate = undefined;\r\n if (onUpdate) {\r\n this.onUpdate = updateStyler({ onUpdate: onUpdate });\r\n }\r\n };\r\n MotionValuesMap.prototype.setTransformTemplate = function (transformTemplate) {\r\n if (this.transformTemplate !== transformTemplate) {\r\n this.transformTemplate = transformTemplate;\r\n this.updateTransformTemplate();\r\n }\r\n };\r\n MotionValuesMap.prototype.getTransformTemplate = function () {\r\n return this.transformTemplate;\r\n };\r\n MotionValuesMap.prototype.updateTransformTemplate = function () {\r\n if (this.output) {\r\n this.output(\"transform\", this.transformTemplate);\r\n }\r\n };\r\n MotionValuesMap.prototype.mount = function (output) {\r\n var _this = this;\r\n this.hasMounted = true;\r\n if (output)\r\n this.output = output;\r\n this.values.forEach(function (value, key) { return _this.bindValueToOutput(key, value); });\r\n this.updateTransformTemplate();\r\n };\r\n MotionValuesMap.prototype.unmount = function () {\r\n var _this = this;\r\n this.values.forEach(function (_value, key) {\r\n var unsubscribe = _this.unsubscribers.get(key);\r\n unsubscribe && unsubscribe();\r\n });\r\n };\r\n return MotionValuesMap;\r\n}());\r\nvar specialMotionValueProps = new Set([\"dragOriginX\", \"dragOriginY\"]);\r\nvar useMotionValues = function (props) {\r\n var motionValues = useConstant(function () {\r\n var map = new MotionValuesMap();\r\n /**\r\n * Loop through every prop and add any detected `MotionValue`s. This is SVG-specific\r\n * code that should be extracted, perhaps considered hollistically with `useMotionStyles`.\r\n *\r\n * \r\n */\r\n for (var key in props) {\r\n if (isMotionValue(props[key]) &&\r\n !specialMotionValueProps.has(key)) {\r\n map.set(key, props[key]);\r\n }\r\n }\r\n return map;\r\n });\r\n motionValues.setOnUpdate(props.onUpdate);\r\n motionValues.setTransformTemplate(props.transformTemplate);\r\n return motionValues;\r\n};\n\nvar session = null;\r\nvar syncRenderSession = {\r\n isOpen: function () { return session !== null; },\r\n open: function () {\r\n invariant(!session, \"Sync render session already open\");\r\n session = [];\r\n },\r\n flush: function () {\r\n invariant(session !== null, \"No sync render session found\");\r\n session && session.forEach(function (styler) { return styler.render(); });\r\n session = null;\r\n },\r\n push: function (styler) {\r\n invariant(session !== null, \"No sync render session found\");\r\n session && session.push(styler);\r\n },\r\n};\n\n/**\r\n * `useEffect` gets resolved bottom-up. We defer some optional functionality to child\r\n * components, so to ensure everything runs correctly we export the ref-binding logic\r\n * to a new component rather than in `useMotionValues`.\r\n */\r\nvar MountComponent = function (_a) {\r\n var ref = _a.innerRef, values = _a.values, isStatic = _a.isStatic;\r\n useEffect(function () {\r\n invariant(ref.current instanceof Element, \"No `ref` found. Ensure components created with `motion.custom` forward refs using `React.forwardRef`\");\r\n var domStyler = styler(ref.current, {\r\n preparseOutput: false,\r\n enableHardwareAcceleration: !isStatic,\r\n });\r\n values.mount(function (key, value) {\r\n domStyler.set(key, value);\r\n if (syncRenderSession.isOpen()) {\r\n syncRenderSession.push(domStyler);\r\n }\r\n });\r\n return function () { return values.unmount(); };\r\n }, []);\r\n return null;\r\n};\r\nvar Mount = memo(MountComponent);\n\nvar createValueResolver = function (resolver) { return function (values) {\r\n var resolvedValues = {};\r\n values.forEach(function (value, key) { return (resolvedValues[key] = resolver(value)); });\r\n return resolvedValues;\r\n}; };\r\nvar resolveCurrent = createValueResolver(function (value) { return value.get(); });\n\nvar transformOriginProps = new Set([\"originX\", \"originY\", \"originZ\"]);\r\nvar isTransformOriginProp = function (key) { return transformOriginProps.has(key); };\r\nvar buildStyleAttr = function (values, styleProp, isStatic) {\r\n var motionValueStyles = resolveCurrent(values);\r\n var transformTemplate = values.getTransformTemplate();\r\n if (transformTemplate) {\r\n // If `transform` has been manually set as a string, pass that through the template\r\n // otherwise pass it forward to Stylefire's style property builder\r\n motionValueStyles.transform = styleProp.transform\r\n ? transformTemplate({}, styleProp.transform)\r\n : transformTemplate;\r\n }\r\n return buildStyleProperty(__assign({}, styleProp, motionValueStyles), !isStatic);\r\n};\r\nvar useMotionStyles = function (values, styleProp, isStatic, transformValues) {\r\n if (styleProp === void 0) { styleProp = {}; }\r\n var style = {};\r\n var prevMotionStyles = useRef({}).current;\r\n for (var key in styleProp) {\r\n var thisStyle = styleProp[key];\r\n if (isMotionValue(thisStyle)) {\r\n // If this is a motion value, add it to our MotionValuesMap\r\n values.set(key, thisStyle);\r\n }\r\n else if (!isStatic &&\r\n (isTransformProp(key) || isTransformOriginProp(key))) {\r\n // Or if it's a transform prop, create a motion value (or update an existing one)\r\n // to ensure Stylefire can reconcile all the transform values together.\r\n // A further iteration on this would be to create a single styler per component that gets\r\n // used in the DOM renderer's buildStyleAttr *and* animations, then we would only\r\n // have to convert animating values to `MotionValues` (we could probably remove this entire function).\r\n // The only architectural consideration is to allow Stylefire to have elements mounted after\r\n // a styler is created.\r\n if (!values.has(key)) {\r\n // If it doesn't exist as a motion value, create it\r\n values.set(key, motionValue(thisStyle));\r\n }\r\n else {\r\n // Otherwise only update it if it's changed from a previous render\r\n if (thisStyle !== prevMotionStyles[key]) {\r\n var value = values.get(key);\r\n value.set(thisStyle);\r\n }\r\n }\r\n prevMotionStyles[key] = thisStyle;\r\n }\r\n else {\r\n style[key] = thisStyle;\r\n }\r\n }\r\n return transformValues ? transformValues(style) : style;\r\n};\n\nvar isKeyframesTarget = function (v) {\r\n return Array.isArray(v);\r\n};\n\nvar isCustomValue = function (v) {\r\n return Boolean(v && typeof v === \"object\" && v.mix && v.toValue);\r\n};\r\nvar resolveFinalValueInKeyframes = function (v) {\r\n // TODO maybe throw if v.length - 1 is placeholder token?\r\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\r\n};\n\nvar auto = {\r\n test: function (v) { return v === \"auto\"; },\r\n parse: function (v) { return v; },\r\n};\r\nvar dimensionTypes = [number, px, percent, degrees, vw, vh, auto];\r\nvar valueTypes = dimensionTypes.concat([color, complex]);\r\nvar testValueType = function (v) { return function (type) { return type.test(v); }; };\r\nvar getDimensionValueType = function (v) {\r\n return dimensionTypes.find(testValueType(v));\r\n};\r\nvar getValueType = function (v) { return valueTypes.find(testValueType(v)); };\n\nvar underDampedSpring = function () { return ({\r\n type: \"spring\",\r\n stiffness: 500,\r\n damping: 25,\r\n restDelta: 0.5,\r\n restSpeed: 10,\r\n}); };\r\nvar overDampedSpring = function (to) { return ({\r\n type: \"spring\",\r\n stiffness: 700,\r\n damping: to === 0 ? 100 : 35,\r\n}); };\r\nvar linearTween = function () { return ({\r\n ease: \"linear\",\r\n duration: 0.3,\r\n}); };\r\nvar keyframes = function (values) { return ({\r\n type: \"keyframes\",\r\n duration: 0.8,\r\n values: values,\r\n}); };\r\nvar defaultTransitions = {\r\n x: underDampedSpring,\r\n y: underDampedSpring,\r\n z: underDampedSpring,\r\n rotate: underDampedSpring,\r\n rotateX: underDampedSpring,\r\n rotateY: underDampedSpring,\r\n rotateZ: underDampedSpring,\r\n scaleX: overDampedSpring,\r\n scaleY: overDampedSpring,\r\n scale: overDampedSpring,\r\n opacity: linearTween,\r\n backgroundColor: linearTween,\r\n color: linearTween,\r\n default: overDampedSpring,\r\n};\r\nvar getDefaultTransition = function (valueKey, to) {\r\n var transitionFactory;\r\n if (isKeyframesTarget(to)) {\r\n transitionFactory = keyframes;\r\n }\r\n else {\r\n transitionFactory =\r\n defaultTransitions[valueKey] || defaultTransitions.default;\r\n }\r\n return __assign({ to: to }, transitionFactory(to));\r\n};\n\n/**\r\n * A Popmotion action that accepts a single `to` prop. When it starts, it immediately\r\n * updates with `to` and then completes. By using this we can compose instant transitions\r\n * in with the same logic that applies `delay` or returns a `Promise` etc.\r\n *\r\n * Accepting `duration` is a little bit of a hack that simply defers the completetion of\r\n * the animation until after the duration finishes. This is for situations when you're **only**\r\n * animating non-animatable values and then setting something on `transitionEnd`. Really\r\n * you want this to fire after the \"animation\" finishes, rather than instantly.\r\n *\r\n * ```\r\n * animate={{\r\n * display: 'block',\r\n * transitionEnd: { display: 'none' }\r\n * }}\r\n * ```\r\n */\r\nvar just = function (_a) {\r\n var to = _a.to, duration = _a.duration;\r\n return action(function (_a) {\r\n var update = _a.update, complete = _a.complete;\r\n update(to);\r\n duration ? delay(duration).start({ complete: complete }) : complete();\r\n });\r\n};\n\nvar easingDefinitionToFunction = function (definition) {\r\n if (Array.isArray(definition)) {\r\n // If cubic bezier definition, create bezier curve\r\n invariant(definition.length === 4, \"Cubic bezier arrays must contain four numerical values.\");\r\n var x1 = definition[0], y1 = definition[1], x2 = definition[2], y2 = definition[3];\r\n return cubicBezier(x1, y1, x2, y2);\r\n }\r\n else if (typeof definition === \"string\") {\r\n // Else lookup from table\r\n invariant(easingLookup[definition] !== undefined, \"Invalid easing type '\" + definition + \"'\");\r\n return easingLookup[definition];\r\n }\r\n return definition;\r\n};\r\nvar isEasingArray = function (ease) {\r\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\r\n};\n\nvar isDurationAnimation = function (v) {\r\n return v.hasOwnProperty(\"duration\") || v.hasOwnProperty(\"repeatDelay\");\r\n};\n\n/**\r\n * Check if a value is animatable. Examples:\r\n *\r\n * ✅: 100, \"100px\", \"#fff\"\r\n * ❌: \"block\", \"url(2.jpg)\"\r\n * @param value\r\n *\r\n * @internal\r\n */\r\nvar isAnimatable = function (key, value) {\r\n // If the list of keys tat might be non-animatable grows, replace with Set\r\n if (key === \"zIndex\")\r\n return false;\r\n // If it's a number or a keyframes array, we can animate it. We might at some point\r\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\r\n // but for now lets leave it like this for performance reasons\r\n if (typeof value === \"number\" || Array.isArray(value))\r\n return true;\r\n if (typeof value === \"string\" && // It's animatable if we have a string\r\n complex.test(value) && // And it contains numbers and/or colors\r\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n};\n\n/**\r\n * Converts seconds to milliseconds\r\n *\r\n * @param seconds - Time in seconds.\r\n * @return milliseconds - Converted time in milliseconds.\r\n */\r\nvar secondsToMilliseconds = function (seconds) { return seconds * 1000; };\n\nvar transitions = { tween: tween, spring: spring, keyframes: keyframes$1, inertia: inertia, just: just };\r\nvar transitionOptionParser = {\r\n tween: function (opts) {\r\n if (opts.ease) {\r\n var ease = isEasingArray(opts.ease) ? opts.ease[0] : opts.ease;\r\n opts.ease = easingDefinitionToFunction(ease);\r\n }\r\n return opts;\r\n },\r\n keyframes: function (_a) {\r\n var from = _a.from, to = _a.to, velocity = _a.velocity, opts = __rest(_a, [\"from\", \"to\", \"velocity\"]);\r\n if (opts.values && opts.values[0] === null) {\r\n var values = opts.values.slice();\r\n values[0] = from;\r\n opts.values = values;\r\n }\r\n if (opts.ease) {\r\n opts.easings = isEasingArray(opts.ease)\r\n ? opts.ease.map(easingDefinitionToFunction)\r\n : easingDefinitionToFunction(opts.ease);\r\n }\r\n opts.ease = linear;\r\n return opts;\r\n },\r\n};\r\nvar isTransitionDefined = function (_a) {\r\n var when = _a.when, delay = _a.delay, delayChildren = _a.delayChildren, staggerChildren = _a.staggerChildren, staggerDirection = _a.staggerDirection, transition = __rest(_a, [\"when\", \"delay\", \"delayChildren\", \"staggerChildren\", \"staggerDirection\"]);\r\n return Object.keys(transition).length;\r\n};\r\nvar getTransitionDefinition = function (key, to, transitionDefinition) {\r\n var delay = transitionDefinition ? transitionDefinition.delay : 0;\r\n // If no object, return default transition\r\n // A better way to handle this would be to deconstruct out all the shared Orchestration props\r\n // and see if there's any props remaining\r\n if (transitionDefinition === undefined ||\r\n !isTransitionDefined(transitionDefinition)) {\r\n return __assign({ delay: delay }, getDefaultTransition(key, to));\r\n }\r\n var valueTransitionDefinition = transitionDefinition[key] ||\r\n transitionDefinition.default ||\r\n transitionDefinition;\r\n if (valueTransitionDefinition.type === false) {\r\n return {\r\n delay: valueTransitionDefinition.hasOwnProperty(\"delay\")\r\n ? valueTransitionDefinition.delay\r\n : delay,\r\n to: isKeyframesTarget(to)\r\n ? to[to.length - 1]\r\n : to,\r\n type: \"just\",\r\n };\r\n }\r\n else if (isKeyframesTarget(to)) {\r\n return __assign({ values: to, duration: 0.8, delay: delay, ease: \"linear\" }, valueTransitionDefinition, { \r\n // This animation must be keyframes if we're animating through an array\r\n type: \"keyframes\" });\r\n }\r\n else {\r\n return __assign({ type: \"tween\", to: to,\r\n delay: delay }, valueTransitionDefinition);\r\n }\r\n};\r\nvar preprocessOptions = function (type, opts) {\r\n return transitionOptionParser[type]\r\n ? transitionOptionParser[type](opts)\r\n : opts;\r\n};\r\nvar getAnimation = function (key, value, target, transition) {\r\n var origin = value.get();\r\n var isOriginAnimatable = isAnimatable(key, origin);\r\n var isTargetAnimatable = isAnimatable(key, target);\r\n // TODO we could probably improve this check to ensure both values are of the same type -\r\n // for instance 100 to #fff. This might live better in Popmotion.\r\n warning(isOriginAnimatable === isTargetAnimatable, \"You are trying to animate \" + key + \" from \\\"\" + origin + \"\\\" to \" + target + \". \\\"\" + origin + \"\\\" is not an animatable value - to enable this animation set \" + origin + \" to a value animatable to \" + target + \" via the `style` property.\");\r\n // Parse the `transition` prop and return options for the Popmotion animation\r\n var _a = getTransitionDefinition(key, target, transition), _b = _a.type, type = _b === void 0 ? \"tween\" : _b, transitionDefinition = __rest(_a, [\"type\"]);\r\n // If this is an animatable pair of values, return an animation, otherwise use `just`\r\n var actionFactory = isOriginAnimatable && isTargetAnimatable\r\n ? transitions[type]\r\n : just;\r\n var opts = preprocessOptions(type, __assign({ from: origin, velocity: value.getVelocity() }, transitionDefinition));\r\n // Convert duration from Framer Motion's seconds into Popmotion's milliseconds\r\n if (isDurationAnimation(opts)) {\r\n if (opts.duration) {\r\n opts.duration = secondsToMilliseconds(opts.duration);\r\n }\r\n if (opts.repeatDelay) {\r\n opts.repeatDelay = secondsToMilliseconds(opts.repeatDelay);\r\n }\r\n }\r\n return [actionFactory, opts];\r\n};\r\n/**\r\n * Start animation on a value. This function completely encapsulates Popmotion-specific logic.\r\n *\r\n * @internal\r\n */\r\nfunction startAnimation(key, value, target, _a) {\r\n var _b = _a.delay, delay$1 = _b === void 0 ? 0 : _b, transition = __rest(_a, [\"delay\"]);\r\n return value.start(function (complete) {\r\n var activeAnimation;\r\n var _a = getAnimation(key, value, target, transition), animationFactory = _a[0], _b = _a[1], valueDelay = _b.delay, options = __rest(_b, [\"delay\"]);\r\n if (valueDelay !== undefined) {\r\n delay$1 = valueDelay;\r\n }\r\n var animate = function () {\r\n var animation = animationFactory(options);\r\n // Bind animation opts to animation\r\n activeAnimation = animation.start({\r\n update: function (v) { return value.set(v); },\r\n complete: complete,\r\n });\r\n };\r\n // If we're delaying this animation, only resolve it **after** the delay to\r\n // ensure the value's resolve velocity is up-to-date.\r\n if (delay$1) {\r\n activeAnimation = delay(secondsToMilliseconds(delay$1)).start({\r\n complete: animate,\r\n });\r\n }\r\n else {\r\n animate();\r\n }\r\n return function () {\r\n if (activeAnimation)\r\n activeAnimation.stop();\r\n };\r\n });\r\n}\n\n/**\r\n * Get the current value of every `MotionValue`\r\n * @param values -\r\n */\r\nvar getCurrent = function (values) {\r\n var current = {};\r\n values.forEach(function (value, key) { return (current[key] = value.get()); });\r\n return current;\r\n};\r\n/**\r\n * Get the current velocity of every `MotionValue`\r\n * @param values -\r\n */\r\nvar getVelocity = function (values) {\r\n var velocity = {};\r\n values.forEach(function (value, key) { return (velocity[key] = value.getVelocity()); });\r\n return velocity;\r\n};\r\n/**\r\n * Check if value is a function that returns a `Target`. A generic typeof === 'function'\r\n * check, just helps with typing.\r\n * @param p -\r\n */\r\nvar isTargetResolver = function (p) {\r\n return typeof p === \"function\";\r\n};\r\n/**\r\n * Check if value is a list of variant labels\r\n * @param v -\r\n */\r\nvar isVariantLabels = function (v) { return Array.isArray(v); };\r\n/**\r\n * Check if value is a numerical string, ie \"100\" or \"100px\"\r\n */\r\nvar isNumericalString = function (v) { return /^\\d*\\.?\\d+$/.test(v); };\r\n/**\r\n * Control animations for a single component\r\n * @internal\r\n */\r\nvar ValueAnimationControls = /** @class */ (function () {\r\n function ValueAnimationControls(_a) {\r\n var _this = this;\r\n var values = _a.values, readValueFromSource = _a.readValueFromSource, makeTargetAnimatable = _a.makeTargetAnimatable;\r\n /**\r\n * A reference to the component's latest props. We could probably ditch this in\r\n * favour to a reference to the `custom` prop now we don't send all props through\r\n * to target resolvers.\r\n */\r\n this.props = {};\r\n /**\r\n * The component's variants, as provided by `variants`\r\n */\r\n this.variants = {};\r\n /**\r\n * A set of values that we animate back to when a value is cleared of all overrides.\r\n */\r\n this.baseTarget = {};\r\n /**\r\n * A series of target overrides that we can animate to/from when overrides are set/cleared.\r\n */\r\n this.overrides = [];\r\n /**\r\n * A series of target overrides as they were originally resolved.\r\n */\r\n this.resolvedOverrides = [];\r\n /**\r\n * A Set of currently active override indexes\r\n */\r\n this.activeOverrides = new Set();\r\n /**\r\n * A Set of value keys that are currently animating.\r\n */\r\n this.isAnimating = new Set();\r\n /**\r\n * Check if the associated `MotionValueMap` has a key with the provided string.\r\n * Pre-bound to the class so we can provide directly to the `filter` in `checkForNewValues`.\r\n */\r\n this.hasValue = function (key) { return !_this.values.has(key); };\r\n this.values = values;\r\n this.readValueFromSource = readValueFromSource;\r\n this.makeTargetAnimatable = makeTargetAnimatable;\r\n this.values.forEach(function (value, key) { return (_this.baseTarget[key] = value.get()); });\r\n }\r\n /**\r\n * Set the reference to the component's props.\r\n * @param props -\r\n */\r\n ValueAnimationControls.prototype.setProps = function (props) {\r\n this.props = props;\r\n };\r\n /**\r\n * Set the reference to the component's variants\r\n * @param variants -\r\n */\r\n ValueAnimationControls.prototype.setVariants = function (variants) {\r\n if (variants)\r\n this.variants = variants;\r\n };\r\n /**\r\n * Set the component's default transition\r\n * @param transition -\r\n */\r\n ValueAnimationControls.prototype.setDefaultTransition = function (transition) {\r\n if (transition)\r\n this.defaultTransition = transition;\r\n };\r\n /**\r\n * Set motion values without animation.\r\n *\r\n * @param definition\r\n * @param isActive -\r\n */\r\n ValueAnimationControls.prototype.setValues = function (definition, _a) {\r\n var _this = this;\r\n var _b = _a === void 0 ? {} : _a, _c = _b.isActive, isActive = _c === void 0 ? new Set() : _c, priority = _b.priority;\r\n var _d = this.resolveVariant(definition), target = _d.target, transitionEnd = _d.transitionEnd;\r\n target = this.transformValues(__assign({}, target, transitionEnd));\r\n return Object.keys(target).forEach(function (key) {\r\n if (isActive.has(key))\r\n return;\r\n isActive.add(key);\r\n if (target) {\r\n var targetValue = resolveFinalValueInKeyframes(target[key]);\r\n if (_this.values.has(key)) {\r\n var value = _this.values.get(key);\r\n value && value.set(targetValue);\r\n }\r\n else {\r\n _this.values.set(key, motionValue(targetValue));\r\n }\r\n if (!priority)\r\n _this.baseTarget[key] = targetValue;\r\n }\r\n });\r\n };\r\n /**\r\n * Allows `transformValues` to be set by a component that allows us to\r\n * transform the values in a given `Target`. This allows Framer Library\r\n * to extend Framer Motion to animate `Color` variables etc. Currently we have\r\n * to manually support these extended types here in Framer Motion.\r\n *\r\n * @param values -\r\n */\r\n ValueAnimationControls.prototype.transformValues = function (values) {\r\n var transformValues = this.props.transformValues;\r\n return transformValues ? transformValues(values) : values;\r\n };\r\n /**\r\n * Check a `Target` for new values we haven't animated yet, and add them\r\n * to the `MotionValueMap`.\r\n *\r\n * Currently there's functionality here that is DOM-specific, we should allow\r\n * this functionality to be injected by the factory that creates DOM-specific\r\n * components.\r\n *\r\n * @param target -\r\n */\r\n ValueAnimationControls.prototype.checkForNewValues = function (target) {\r\n var newValueKeys = Object.keys(target).filter(this.hasValue);\r\n var numNewValues = newValueKeys.length;\r\n if (!numNewValues)\r\n return;\r\n for (var i = 0; i < numNewValues; i++) {\r\n var key = newValueKeys[i];\r\n var targetValue = target[key];\r\n var value = null;\r\n // If this is a keyframes value, we can attempt to use the first value in the\r\n // array as that's going to be the first value of the animation anyway\r\n if (Array.isArray(targetValue)) {\r\n value = targetValue[0];\r\n }\r\n // If it isn't a keyframes or the first keyframes value was set as `null`, read the\r\n // value from the DOM. It might be worth investigating whether to check props (for SVG)\r\n // or props.style (for HTML) if the value exists there before attempting to read.\r\n if (value === null) {\r\n value = this.readValueFromSource(key);\r\n invariant(value !== null, \"No initial value for \\\"\" + key + \"\\\" can be inferred. Ensure an initial value for \\\"\" + key + \"\\\" is defined on the component.\");\r\n }\r\n if (typeof value === \"string\" && isNumericalString(value)) {\r\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\r\n value = parseFloat(value);\r\n }\r\n else if (!getValueType(value) && complex.test(targetValue)) {\r\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\r\n value = complex.getAnimatableNone(targetValue);\r\n }\r\n this.values.set(key, motionValue(value));\r\n this.baseTarget[key] = value;\r\n }\r\n };\r\n /**\r\n * Resolve a variant from its label or resolver into an actual `Target` we can animate to.\r\n * @param variant -\r\n */\r\n ValueAnimationControls.prototype.resolveVariant = function (variant) {\r\n if (!variant) {\r\n return {\r\n target: undefined,\r\n transition: undefined,\r\n transitionEnd: undefined,\r\n };\r\n }\r\n if (isTargetResolver(variant)) {\r\n // resolve current and velocity\r\n variant = variant(this.props.custom, getCurrent(this.values), getVelocity(this.values));\r\n }\r\n var _a = variant.transition, transition = _a === void 0 ? this.defaultTransition : _a, transitionEnd = variant.transitionEnd, target = __rest(variant, [\"transition\", \"transitionEnd\"]);\r\n return { transition: transition, transitionEnd: transitionEnd, target: target };\r\n };\r\n /**\r\n * Get the highest active override priority index\r\n */\r\n ValueAnimationControls.prototype.getHighestPriority = function () {\r\n if (!this.activeOverrides.size)\r\n return 0;\r\n return Math.max.apply(Math, Array.from(this.activeOverrides));\r\n };\r\n /**\r\n * Set an override. We add this layer of indirection so if, for instance, a tap gesture\r\n * starts and overrides a hover gesture, when we clear the tap gesture and fallback to the\r\n * hover gesture, if that hover gesture has changed in the meantime we can go to that rather\r\n * than the one that was resolved when the hover gesture animation started.\r\n *\r\n * @param definition -\r\n * @param overrideIndex -\r\n */\r\n ValueAnimationControls.prototype.setOverride = function (definition, overrideIndex) {\r\n this.overrides[overrideIndex] = definition;\r\n if (this.children) {\r\n this.children.forEach(function (child) {\r\n return child.setOverride(definition, overrideIndex);\r\n });\r\n }\r\n };\r\n /**\r\n * Start an override animation.\r\n * @param overrideIndex -\r\n */\r\n ValueAnimationControls.prototype.startOverride = function (overrideIndex) {\r\n var override = this.overrides[overrideIndex];\r\n if (override) {\r\n return this.start(override, { priority: overrideIndex });\r\n }\r\n };\r\n /**\r\n * Clear an override. We check every value we animated to in this override to see if\r\n * its present on any lower-priority overrides. If not, we animate it back to its base target.\r\n * @param overrideIndex -\r\n */\r\n ValueAnimationControls.prototype.clearOverride = function (overrideIndex) {\r\n var _this = this;\r\n if (this.children) {\r\n this.children.forEach(function (child) { return child.clearOverride(overrideIndex); });\r\n }\r\n var override = this.overrides[overrideIndex];\r\n if (!override)\r\n return;\r\n this.activeOverrides.delete(overrideIndex);\r\n var highest = this.getHighestPriority();\r\n this.resetIsAnimating();\r\n if (highest) {\r\n var highestOverride = this.overrides[highest];\r\n highestOverride && this.startOverride(highest);\r\n }\r\n // Figure out which remaining values were affected by the override and animate those\r\n var overrideTarget = this.resolvedOverrides[overrideIndex];\r\n if (!overrideTarget)\r\n return;\r\n var remainingValues = {};\r\n for (var key in this.baseTarget) {\r\n if (overrideTarget[key] !== undefined) {\r\n remainingValues[key] = this.baseTarget[key];\r\n }\r\n }\r\n this.onStart();\r\n this.animate(remainingValues).then(function () { return _this.onComplete(); });\r\n };\r\n /**\r\n * Apply a target/variant without any animation\r\n */\r\n ValueAnimationControls.prototype.apply = function (definition) {\r\n if (Array.isArray(definition)) {\r\n return this.applyVariantLabels(definition);\r\n }\r\n else if (typeof definition === \"string\") {\r\n return this.applyVariantLabels([definition]);\r\n }\r\n else {\r\n this.setValues(definition);\r\n }\r\n };\r\n /**\r\n * Apply variant labels without animation\r\n */\r\n ValueAnimationControls.prototype.applyVariantLabels = function (variantLabelList) {\r\n var _this = this;\r\n var isActive = new Set();\r\n var reversedList = variantLabelList.slice().reverse();\r\n reversedList.forEach(function (key) {\r\n var _a = _this.resolveVariant(_this.variants[key]), target = _a.target, transitionEnd = _a.transitionEnd;\r\n if (transitionEnd) {\r\n _this.setValues(transitionEnd, { isActive: isActive });\r\n }\r\n if (target) {\r\n _this.setValues(target, { isActive: isActive });\r\n }\r\n if (_this.children && _this.children.size) {\r\n _this.children.forEach(function (child) {\r\n return child.applyVariantLabels(variantLabelList);\r\n });\r\n }\r\n });\r\n };\r\n ValueAnimationControls.prototype.start = function (definition, opts) {\r\n var _this = this;\r\n if (opts === void 0) { opts = {}; }\r\n if (opts.priority) {\r\n this.activeOverrides.add(opts.priority);\r\n }\r\n this.resetIsAnimating(opts.priority);\r\n var animation;\r\n if (isVariantLabels(definition)) {\r\n animation = this.animateVariantLabels(definition, opts);\r\n }\r\n else if (typeof definition === \"string\") {\r\n animation = this.animateVariant(definition, opts);\r\n }\r\n else {\r\n animation = this.animate(definition, opts);\r\n }\r\n this.onStart();\r\n return animation.then(function () { return _this.onComplete(); });\r\n };\r\n ValueAnimationControls.prototype.animate = function (animationDefinition, _a) {\r\n var _this = this;\r\n var _b = _a === void 0 ? {} : _a, _c = _b.delay, delay = _c === void 0 ? 0 : _c, _d = _b.priority, priority = _d === void 0 ? 0 : _d, transitionOverride = _b.transitionOverride;\r\n var _e = this.resolveVariant(animationDefinition), target = _e.target, transition = _e.transition, transitionEnd = _e.transitionEnd;\r\n if (transitionOverride) {\r\n transition = transitionOverride;\r\n }\r\n if (!target)\r\n return Promise.resolve();\r\n target = this.transformValues(target);\r\n if (transitionEnd) {\r\n transitionEnd = this.transformValues(transitionEnd);\r\n }\r\n this.checkForNewValues(target);\r\n if (this.makeTargetAnimatable) {\r\n var animatable = this.makeTargetAnimatable(target, transitionEnd);\r\n target = animatable.target;\r\n transitionEnd = animatable.transitionEnd;\r\n }\r\n if (priority) {\r\n this.resolvedOverrides[priority] = target;\r\n }\r\n this.checkForNewValues(target);\r\n var animations = [];\r\n for (var key in target) {\r\n var value = this.values.get(key);\r\n if (!value || !target || target[key] === undefined)\r\n continue;\r\n var valueTarget = target[key];\r\n if (!priority) {\r\n this.baseTarget[key] = resolveFinalValueInKeyframes(valueTarget);\r\n }\r\n if (this.isAnimating.has(key))\r\n continue;\r\n this.isAnimating.add(key);\r\n animations.push(startAnimation(key, value, valueTarget, __assign({ delay: delay }, transition)));\r\n }\r\n var allAnimations = Promise.all(animations);\r\n return transitionEnd\r\n ? allAnimations.then(function () {\r\n _this.setValues(transitionEnd, { priority: priority });\r\n })\r\n : allAnimations;\r\n };\r\n ValueAnimationControls.prototype.animateVariantLabels = function (variantLabels, opts) {\r\n var _this = this;\r\n var animations = variantLabels.slice().reverse()\r\n .map(function (label) { return _this.animateVariant(label, opts); });\r\n return Promise.all(animations);\r\n };\r\n ValueAnimationControls.prototype.animateVariant = function (variantLabel, opts) {\r\n var _this = this;\r\n var when = false;\r\n var delayChildren = 0;\r\n var staggerChildren = 0;\r\n var staggerDirection = 1;\r\n var priority = (opts && opts.priority) || 0;\r\n var variant = this.variants[variantLabel];\r\n var getAnimations = variant\r\n ? function () { return _this.animate(variant, opts); }\r\n : function () { return Promise.resolve(); };\r\n var getChildrenAnimations = this.children\r\n ? function () {\r\n return _this.animateChildren(variantLabel, delayChildren, staggerChildren, staggerDirection, priority);\r\n }\r\n : function () { return Promise.resolve(); };\r\n if (variant && this.children) {\r\n var transition = this.resolveVariant(variant).transition;\r\n if (transition) {\r\n when = transition.when || when;\r\n delayChildren = transition.delayChildren || delayChildren;\r\n staggerChildren = transition.staggerChildren || staggerChildren;\r\n staggerDirection =\r\n transition.staggerDirection || staggerDirection;\r\n }\r\n }\r\n if (when) {\r\n var _a = when === \"beforeChildren\"\r\n ? [getAnimations, getChildrenAnimations]\r\n : [getChildrenAnimations, getAnimations], first = _a[0], last = _a[1];\r\n return first().then(last);\r\n }\r\n else {\r\n return Promise.all([getAnimations(), getChildrenAnimations()]);\r\n }\r\n };\r\n ValueAnimationControls.prototype.animateChildren = function (variantLabel, delayChildren, staggerChildren, staggerDirection, priority) {\r\n if (delayChildren === void 0) { delayChildren = 0; }\r\n if (staggerChildren === void 0) { staggerChildren = 0; }\r\n if (staggerDirection === void 0) { staggerDirection = 1; }\r\n if (priority === void 0) { priority = 0; }\r\n if (!this.children) {\r\n return Promise.resolve();\r\n }\r\n var animations = [];\r\n var maxStaggerDuration = (this.children.size - 1) * staggerChildren;\r\n var generateStaggerDuration = staggerDirection === 1\r\n ? function (i) { return i * staggerChildren; }\r\n : function (i) { return maxStaggerDuration - i * staggerChildren; };\r\n Array.from(this.children).forEach(function (childControls, i) {\r\n var animation = childControls.animateVariant(variantLabel, {\r\n priority: priority,\r\n delay: delayChildren + generateStaggerDuration(i),\r\n });\r\n animations.push(animation);\r\n });\r\n return Promise.all(animations);\r\n };\r\n ValueAnimationControls.prototype.onStart = function () {\r\n var onAnimationStart = this.props.onAnimationStart;\r\n onAnimationStart && onAnimationStart();\r\n };\r\n ValueAnimationControls.prototype.onComplete = function () {\r\n var onAnimationComplete = this.props.onAnimationComplete;\r\n onAnimationComplete && onAnimationComplete();\r\n };\r\n ValueAnimationControls.prototype.checkOverrideIsAnimating = function (priority) {\r\n var numOverrides = this.overrides.length;\r\n for (var i = priority + 1; i < numOverrides; i++) {\r\n var resolvedOverride = this.resolvedOverrides[i];\r\n if (resolvedOverride) {\r\n for (var key in resolvedOverride) {\r\n this.isAnimating.add(key);\r\n }\r\n }\r\n }\r\n };\r\n ValueAnimationControls.prototype.resetIsAnimating = function (priority) {\r\n if (priority === void 0) { priority = 0; }\r\n this.isAnimating.clear();\r\n // If this isn't the highest priority gesture, block the animation\r\n // of anything that's currently being animated\r\n if (priority < this.getHighestPriority()) {\r\n this.checkOverrideIsAnimating(priority);\r\n }\r\n if (this.children) {\r\n this.children.forEach(function (child) { return child.resetIsAnimating(priority); });\r\n }\r\n };\r\n ValueAnimationControls.prototype.stop = function () {\r\n this.values.forEach(function (value) { return value.stop(); });\r\n };\r\n /**\r\n * Add the controls of a child component.\r\n * @param controls -\r\n */\r\n ValueAnimationControls.prototype.addChild = function (controls) {\r\n if (!this.children) {\r\n this.children = new Set();\r\n }\r\n this.children.add(controls);\r\n // We set child overrides when `setOverride` is called, but also have to do it here\r\n // as the first time `setOverride` is called all the children might not have been added yet.\r\n this.overrides.forEach(function (override, i) {\r\n override && controls.setOverride(override, i);\r\n });\r\n };\r\n ValueAnimationControls.prototype.removeChild = function (controls) {\r\n if (!this.children) {\r\n return;\r\n }\r\n this.children.delete(controls);\r\n };\r\n ValueAnimationControls.prototype.resetChildren = function () {\r\n if (this.children)\r\n this.children.clear();\r\n };\r\n return ValueAnimationControls;\r\n}());\n\n/**\r\n * Use callback either only on the initial render or on all renders. In concurrent mode\r\n * the \"initial\" render might run multiple times\r\n *\r\n * @param callback - Callback to run\r\n * @param isInitialOnly - Set to `true` to only run on initial render, or `false` for all renders. Defaults to `false`.\r\n *\r\n * @public\r\n */\r\nfunction useInitialOrEveryRender(callback, isInitialOnly) {\r\n if (isInitialOnly === void 0) { isInitialOnly = false; }\r\n var isInitialRender = useRef(true);\r\n if (!isInitialOnly || (isInitialOnly && isInitialRender.current)) {\r\n callback();\r\n }\r\n isInitialRender.current = false;\r\n}\n\n/**\r\n * Control animations on one or more components.\r\n *\r\n * @public\r\n */\r\nvar AnimationControls = /** @class */ (function () {\r\n function AnimationControls() {\r\n /**\r\n * Track whether the host component has mounted.\r\n *\r\n * @internal\r\n */\r\n this.hasMounted = false;\r\n /**\r\n * Pending animations that are started before a component is mounted.\r\n *\r\n * @internal\r\n */\r\n this.pendingAnimations = [];\r\n /**\r\n * A collection of linked component animation controls.\r\n *\r\n * @internal\r\n */\r\n this.componentControls = new Set();\r\n }\r\n /**\r\n * Set variants on this and all child components.\r\n *\r\n * @param variants - The variants to set\r\n *\r\n * @internal\r\n */\r\n AnimationControls.prototype.setVariants = function (variants) {\r\n this.variants = variants;\r\n this.componentControls.forEach(function (controls) {\r\n return controls.setVariants(variants);\r\n });\r\n };\r\n /**\r\n * Set a default transition on this and all child components\r\n *\r\n * @param transition - The default transition to set\r\n *\r\n * @internal\r\n */\r\n AnimationControls.prototype.setDefaultTransition = function (transition) {\r\n this.defaultTransition = transition;\r\n this.componentControls.forEach(function (controls) {\r\n return controls.setDefaultTransition(transition);\r\n });\r\n };\r\n /**\r\n * Subscribes a component's animation controls to this.\r\n *\r\n * @param controls - The controls to subscribe\r\n * @returns An unsubscribe function.\r\n *\r\n * @internal\r\n */\r\n AnimationControls.prototype.subscribe = function (controls) {\r\n var _this = this;\r\n this.componentControls.add(controls);\r\n if (this.variants)\r\n controls.setVariants(this.variants);\r\n if (this.defaultTransition)\r\n controls.setDefaultTransition(this.defaultTransition);\r\n return function () { return _this.componentControls.delete(controls); };\r\n };\r\n /**\r\n * Starts an animation on all linked components.\r\n *\r\n * @remarks\r\n *\r\n * ```jsx\r\n * controls.start(\"variantLabel\")\r\n * controls.start({\r\n * x: 0,\r\n * transition: { duration: 1 }\r\n * })\r\n * ```\r\n *\r\n * @param definition - Properties or variant label to animate to\r\n * @param transition - Optional `transtion` to apply to a variant\r\n * @returns - A `Promise` that resolves when all animations have completed.\r\n *\r\n * @public\r\n */\r\n AnimationControls.prototype.start = function (definition, transitionOverride) {\r\n var _this = this;\r\n if (this.hasMounted) {\r\n var animations_1 = [];\r\n this.componentControls.forEach(function (controls) {\r\n var animation = controls.start(definition, {\r\n transitionOverride: transitionOverride,\r\n });\r\n animations_1.push(animation);\r\n });\r\n return Promise.all(animations_1);\r\n }\r\n else {\r\n return new Promise(function (resolve) {\r\n _this.pendingAnimations.push({\r\n animation: [definition, transitionOverride],\r\n resolve: resolve,\r\n });\r\n });\r\n }\r\n };\r\n /**\r\n * Instantly set to a set of properties or a variant.\r\n *\r\n * ```jsx\r\n * // With properties\r\n * controls.set({ opacity: 0 })\r\n *\r\n * // With variants\r\n * controls.set(\"hidden\")\r\n * ```\r\n *\r\n * @internalremarks\r\n * We could perform a similar trick to `.start` where this can be called before mount\r\n * and we maintain a list of of pending actions that get applied on mount. But the\r\n * expectation of `set` is that it happens synchronously and this would be difficult\r\n * to do before any children have even attached themselves. It's also poor practise\r\n * and we should discourage render-synchronous `.start` calls rather than lean into this.\r\n *\r\n * @public\r\n */\r\n AnimationControls.prototype.set = function (definition) {\r\n invariant(this.hasMounted, \"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.\");\r\n return this.componentControls.forEach(function (controls) {\r\n return controls.apply(definition);\r\n });\r\n };\r\n /**\r\n * Stops animations on all linked components.\r\n *\r\n * ```jsx\r\n * controls.stop()\r\n * ```\r\n *\r\n * @public\r\n */\r\n AnimationControls.prototype.stop = function () {\r\n this.componentControls.forEach(function (controls) { return controls.stop(); });\r\n };\r\n /**\r\n * Initialises the animation controls.\r\n *\r\n * @internal\r\n */\r\n AnimationControls.prototype.mount = function () {\r\n var _this = this;\r\n this.hasMounted = true;\r\n this.pendingAnimations.forEach(function (_a) {\r\n var animation = _a.animation, resolve = _a.resolve;\r\n return _this.start.apply(_this, animation).then(resolve);\r\n });\r\n };\r\n /**\r\n * Stops all child animations when the host component unmounts.\r\n *\r\n * @internal\r\n */\r\n AnimationControls.prototype.unmount = function () {\r\n this.hasMounted = false;\r\n this.stop();\r\n };\r\n return AnimationControls;\r\n}());\r\n/**\r\n * @internal\r\n */\r\nvar animationControls = function () { return new AnimationControls(); };\n\n/**\r\n * @internal\r\n */\r\nvar MotionContext = createContext({\r\n static: false,\r\n});\r\nvar isVariantLabel = function (v) {\r\n return typeof v === \"string\" || Array.isArray(v);\r\n};\r\nvar isAnimationControls = function (v) {\r\n return v instanceof AnimationControls;\r\n};\r\n/**\r\n * Set up the context for children motion components.\r\n *\r\n * We also use this opportunity to apply `initial` values\r\n */\r\nvar useMotionContext = function (parentContext, controls, values, isStatic, _a) {\r\n if (isStatic === void 0) { isStatic = false; }\r\n var initial = _a.initial, animate = _a.animate, variants = _a.variants, whileTap = _a.whileTap, whileHover = _a.whileHover;\r\n // Override initial with that from a parent context, if defined\r\n if (parentContext.exitProps &&\r\n parentContext.exitProps.initial !== undefined) {\r\n initial = parentContext.exitProps.initial;\r\n }\r\n var initialState;\r\n if (initial === false && !isAnimationControls(animate)) {\r\n initialState = animate;\r\n }\r\n else if (typeof initial !== \"boolean\") {\r\n initialState = initial;\r\n }\r\n // Track mounted status so children can detect whether they were present during their\r\n // parent's first render\r\n var hasMounted = useRef(false);\r\n // We propagate this component's ValueAnimationControls *if* we're being provided variants,\r\n // if we're being used to control variants, or if we're being passed animation controls.\r\n // Otherwise this component should be \"invisible\" to variant propagation. This is a slight concession\r\n // to Framer X where every `Frame` is a `motion` component and it might be if we change that in the future\r\n // that this restriction is removed.\r\n var shouldPropagateControls = variants ||\r\n isVariantLabel(animate) ||\r\n isVariantLabel(whileTap) ||\r\n isVariantLabel(whileHover) ||\r\n isAnimationControls(animate);\r\n // If this component's `initial` prop is a variant label, propagate it. Otherwise pass the parent's.\r\n var targetInitial = isVariantLabel(initialState)\r\n ? initialState\r\n : parentContext.initial;\r\n // If this is a variant tree we need to propagate the `animate` prop in case new children are added after\r\n // the tree initially animates.\r\n var targetAnimate = isVariantLabel(animate)\r\n ? animate\r\n : parentContext.animate;\r\n // Only allow `initial` to trigger context re-renders if this is a `static` component (ie we're on the Framer canvas)\r\n // or in another non-animation/interaction environment.\r\n var initialDependency = isStatic ? targetInitial : null;\r\n // Only allow `animate` to trigger context re-renders if it's a variant label. If this is an array of\r\n // variant labels there's probably an optimisation to deep-compare but it might be an over-optimisation.\r\n // We want to do this as we rely on React's component rendering order each render cycle to determine\r\n // the new order of any child components for the `staggerChildren` functionality.\r\n var animateDependency = shouldPropagateControls && isVariantLabel(targetAnimate)\r\n ? targetAnimate\r\n : null;\r\n // The context to provide to the child. We `useMemo` because although `controls` and `initial` are\r\n // unlikely to change, by making the context an object it'll be considered a new value every render.\r\n // So all child motion components will re-render as a result.\r\n var context = useMemo(function () { return ({\r\n controls: shouldPropagateControls\r\n ? controls\r\n : parentContext.controls,\r\n initial: targetInitial,\r\n animate: targetAnimate,\r\n values: values,\r\n hasMounted: hasMounted,\r\n isReducedMotion: parentContext.isReducedMotion,\r\n }); }, [initialDependency, animateDependency, parentContext.isReducedMotion]);\r\n // Update the `static` property every render. This is unlikely to change but also essentially free.\r\n context.static = isStatic;\r\n // Set initial state. If this is a static component (ie in Framer canvas), respond to updates\r\n // in `initial`.\r\n useInitialOrEveryRender(function () {\r\n var initialToApply = initialState || parentContext.initial;\r\n initialToApply && controls.apply(initialToApply);\r\n }, !isStatic);\r\n useEffect(function () {\r\n hasMounted.current = true;\r\n }, []);\r\n return context;\r\n};\n\n/**\r\n * Creates an imperative set of controls to trigger animations.\r\n *\r\n * This allows a consolidated, uniform API for animations, to be triggered by other APIs like the `animate` prop, or the gesture handlers.\r\n *\r\n * @param values\r\n * @param props\r\n * @param ref\r\n * @param subscribeToParentControls\r\n *\r\n * @internal\r\n */\r\nfunction useValueAnimationControls(config, props, subscribeToParentControls, parentContext) {\r\n var variants = props.variants, transition = props.transition;\r\n var parentControls = useContext(MotionContext).controls;\r\n var controls = useConstant(function () { return new ValueAnimationControls(config); });\r\n // Reset and resubscribe children every render to ensure stagger order is correct\r\n if (!parentContext ||\r\n !parentContext.exitProps ||\r\n !parentContext.exitProps.isExiting) {\r\n controls.resetChildren();\r\n controls.setProps(props);\r\n controls.setVariants(variants);\r\n controls.setDefaultTransition(transition);\r\n }\r\n // We have to subscribe to the parent controls within a useEffect rather than during render,\r\n // as\r\n useEffect(function () {\r\n if (subscribeToParentControls && parentControls) {\r\n parentControls.addChild(controls);\r\n }\r\n });\r\n useEffect(function () {\r\n return function () {\r\n // Remove reference to onAnimationComplete from controls. All the MotionValues\r\n // are unsubscribed from this component separately. We let animations run out\r\n // as they might be animating other components.\r\n var onAnimationComplete = props.onAnimationComplete, unmountProps = __rest(props, [\"onAnimationComplete\"]);\r\n controls.setProps(unmountProps);\r\n parentControls && parentControls.removeChild(controls);\r\n };\r\n }, []);\r\n return controls;\r\n}\n\nvar checkShouldInheritVariant = function (_a) {\r\n var animate = _a.animate, variants = _a.variants, _b = _a.inherit, inherit = _b === void 0 ? true : _b;\r\n return (inherit &&\r\n !!variants &&\r\n (!animate || animate instanceof AnimationControls));\r\n};\n\n/**\r\n * Uses the ref that is passed in, or creates a new one\r\n * @param external - External ref\r\n * @internal\r\n */\r\nfunction useExternalRef(externalRef) {\r\n // We're conditionally calling `useRef` here which is sort of naughty as hooks\r\n // shouldn't be called conditionally. However, Framer Motion will break if this\r\n // condition changes anyway. It might be possible to use an invariant here to\r\n // make it explicit, but I expect changing `ref` is not normal behaviour.\r\n var ref = !externalRef || typeof externalRef === \"function\"\r\n ? useRef(null)\r\n : externalRef;\r\n // Handle `ref` functions. Again, calling the hook conditionally is kind of naughty\r\n // but `ref` types changing between renders would break Motion anyway. If we receive\r\n // bug reports about this, we should track the provided ref and throw an invariant\r\n // rather than move the conditional to inside the useEffect as this will be fired\r\n // for every Frame component within Framer.\r\n if (externalRef && typeof externalRef === \"function\") {\r\n useEffect(function () {\r\n externalRef(ref.current);\r\n return function () { return externalRef(null); };\r\n }, []);\r\n }\r\n return ref;\r\n}\n\n/**\r\n * @internal\r\n */\r\nvar createMotionComponent = function (_a) {\r\n var getValueControlsConfig = _a.getValueControlsConfig, loadFunctionalityComponents = _a.loadFunctionalityComponents, renderComponent = _a.renderComponent;\r\n function MotionComponent(props, externalRef) {\r\n var ref = useExternalRef(externalRef);\r\n var parentContext = useContext(MotionContext);\r\n var isStatic = parentContext.static || props.static || false;\r\n var values = useMotionValues(props);\r\n var style = useMotionStyles(values, props.style, isStatic, props.transformValues);\r\n var shouldInheritVariant = checkShouldInheritVariant(props);\r\n var controlsConfig = useConstant(function () {\r\n return getValueControlsConfig(ref, values);\r\n });\r\n var controls = useValueAnimationControls(controlsConfig, props, shouldInheritVariant, parentContext);\r\n var context = useMotionContext(parentContext, controls, values, isStatic, props);\r\n var functionality = isStatic\r\n ? null\r\n : loadFunctionalityComponents(ref, values, props, parentContext, controls, shouldInheritVariant);\r\n var renderedComponent = renderComponent(ref, style, values, props, isStatic);\r\n return (createElement(Fragment, null,\r\n createElement(MotionContext.Provider, { value: context }, renderedComponent),\r\n createElement(Fragment, null,\r\n createElement(Mount, { innerRef: ref, values: values, isStatic: isStatic }),\r\n functionality)));\r\n }\r\n return forwardRef(MotionComponent);\r\n};\n\n/**\r\n * @internal\r\n */\r\nvar htmlElements = [\r\n \"a\",\r\n \"abbr\",\r\n \"address\",\r\n \"area\",\r\n \"article\",\r\n \"aside\",\r\n \"audio\",\r\n \"b\",\r\n \"base\",\r\n \"bdi\",\r\n \"bdo\",\r\n \"big\",\r\n \"blockquote\",\r\n \"body\",\r\n \"br\",\r\n \"button\",\r\n \"canvas\",\r\n \"caption\",\r\n \"cite\",\r\n \"code\",\r\n \"col\",\r\n \"colgroup\",\r\n \"data\",\r\n \"datalist\",\r\n \"dd\",\r\n \"del\",\r\n \"details\",\r\n \"dfn\",\r\n \"dialog\",\r\n \"div\",\r\n \"dl\",\r\n \"dt\",\r\n \"em\",\r\n \"embed\",\r\n \"fieldset\",\r\n \"figcaption\",\r\n \"figure\",\r\n \"footer\",\r\n \"form\",\r\n \"h1\",\r\n \"h2\",\r\n \"h3\",\r\n \"h4\",\r\n \"h5\",\r\n \"h6\",\r\n \"head\",\r\n \"header\",\r\n \"hgroup\",\r\n \"hr\",\r\n \"html\",\r\n \"i\",\r\n \"iframe\",\r\n \"img\",\r\n \"input\",\r\n \"ins\",\r\n \"kbd\",\r\n \"keygen\",\r\n \"label\",\r\n \"legend\",\r\n \"li\",\r\n \"link\",\r\n \"main\",\r\n \"map\",\r\n \"mark\",\r\n \"menu\",\r\n \"menuitem\",\r\n \"meta\",\r\n \"meter\",\r\n \"nav\",\r\n \"noscript\",\r\n \"object\",\r\n \"ol\",\r\n \"optgroup\",\r\n \"option\",\r\n \"output\",\r\n \"p\",\r\n \"param\",\r\n \"picture\",\r\n \"pre\",\r\n \"progress\",\r\n \"q\",\r\n \"rp\",\r\n \"rt\",\r\n \"ruby\",\r\n \"s\",\r\n \"samp\",\r\n \"script\",\r\n \"section\",\r\n \"select\",\r\n \"small\",\r\n \"source\",\r\n \"span\",\r\n \"strong\",\r\n \"style\",\r\n \"sub\",\r\n \"summary\",\r\n \"sup\",\r\n \"table\",\r\n \"tbody\",\r\n \"td\",\r\n \"textarea\",\r\n \"tfoot\",\r\n \"th\",\r\n \"thead\",\r\n \"time\",\r\n \"title\",\r\n \"tr\",\r\n \"track\",\r\n \"u\",\r\n \"ul\",\r\n \"var\",\r\n \"video\",\r\n \"wbr\",\r\n \"webview\",\r\n];\r\n/**\r\n * @internal\r\n */\r\nvar svgElements = [\r\n \"animate\",\r\n \"circle\",\r\n \"clipPath\",\r\n \"defs\",\r\n \"desc\",\r\n \"ellipse\",\r\n \"feBlend\",\r\n \"feColorMatrix\",\r\n \"feComponentTransfer\",\r\n \"feComposite\",\r\n \"feConvolveMatrix\",\r\n \"feDiffuseLighting\",\r\n \"feDisplacementMap\",\r\n \"feDistantLight\",\r\n \"feDropShadow\",\r\n \"feFlood\",\r\n \"feFuncA\",\r\n \"feFuncB\",\r\n \"feFuncG\",\r\n \"feFuncR\",\r\n \"feGaussianBlur\",\r\n \"feImage\",\r\n \"feMerge\",\r\n \"feMergeNode\",\r\n \"feMorphology\",\r\n \"feOffset\",\r\n \"fePointLight\",\r\n \"feSpecularLighting\",\r\n \"feSpotLight\",\r\n \"feTile\",\r\n \"feTurbulence\",\r\n \"filter\",\r\n \"foreignObject\",\r\n \"g\",\r\n \"image\",\r\n \"line\",\r\n \"linearGradient\",\r\n \"marker\",\r\n \"mask\",\r\n \"metadata\",\r\n \"path\",\r\n \"pattern\",\r\n \"polygon\",\r\n \"polyline\",\r\n \"radialGradient\",\r\n \"rect\",\r\n \"stop\",\r\n \"svg\",\r\n \"switch\",\r\n \"symbol\",\r\n \"text\",\r\n \"textPath\",\r\n \"tspan\",\r\n \"use\",\r\n \"view\",\r\n];\n\n/** @public */\r\nvar Point;\r\n(function (Point) {\r\n /** @beta */\r\n Point.subtract = function (a, b) {\r\n return { x: a.x - b.x, y: a.y - b.y };\r\n };\r\n /** @beta */\r\n Point.relativeTo = function (idOrElem) {\r\n var elem;\r\n var getElem = function () {\r\n // Caching element here could be leaky because of React lifecycle\r\n if (elem !== undefined)\r\n return elem;\r\n if (typeof idOrElem === \"string\") {\r\n elem = document.getElementById(idOrElem);\r\n }\r\n else {\r\n elem = idOrElem;\r\n }\r\n return elem;\r\n };\r\n return function (_a) {\r\n var x = _a.x, y = _a.y;\r\n var localElem = getElem();\r\n if (!localElem)\r\n return undefined;\r\n var rect = localElem.getBoundingClientRect();\r\n return {\r\n x: x - rect.left - window.scrollX,\r\n y: y - rect.top - window.scrollY,\r\n };\r\n };\r\n };\r\n})(Point || (Point = {}));\n\n/**\r\n * @internal\r\n */\r\nvar MotionPluginContext = createContext({\r\n transformPagePoint: function (p) { return p; },\r\n});\r\n/**\r\n * @internal\r\n * @internalremarks For now I think this should remain a private API for our own use\r\n * until we can figure out a nicer way of allowing people to add these\r\n */\r\nfunction MotionPlugins(_a) {\r\n var children = _a.children, props = __rest(_a, [\"children\"]);\r\n var pluginContext = useContext(MotionPluginContext);\r\n var value = useRef(__assign({}, pluginContext)).current;\r\n // Mutative to prevent triggering rerenders in all listening\r\n // components every time this component renders\r\n for (var key in props) {\r\n value[key] = props[key];\r\n }\r\n return (createElement(MotionPluginContext.Provider, { value: value }, children));\r\n}\n\nvar isViewportScrollBlocked = false;\r\nvar isBrowser = typeof window !== \"undefined\";\r\nif (isBrowser) {\r\n document.addEventListener(\"touchmove\", function (event) {\r\n if (isViewportScrollBlocked) {\r\n event.preventDefault();\r\n }\r\n }, { passive: false });\r\n}\r\nvar blockViewportScroll = function () { return (isViewportScrollBlocked = true); };\r\nvar unblockViewportScroll = function () { return (isViewportScrollBlocked = false); };\n\nfunction isMouseEvent(event) {\r\n // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check.\r\n if (typeof PointerEvent !== \"undefined\" && event instanceof PointerEvent) {\r\n return !!(event.pointerType === \"mouse\");\r\n }\r\n return event instanceof MouseEvent;\r\n}\r\nfunction isTouchEvent(event) {\r\n var hasTouches = !!event.touches;\r\n return hasTouches;\r\n}\n\nfunction useLatest(value) {\r\n var ref = useRef(value);\r\n useEffect(function () {\r\n ref.current = value;\r\n });\r\n return ref;\r\n}\n\nfunction useUnmountEffect(callback) {\r\n return useEffect(function () { return function () { return callback(); }; }, []);\r\n}\n\nfunction addDomEvent(target, eventName, handler, options) {\r\n if (!handler)\r\n return;\r\n target.addEventListener(eventName, handler, options);\r\n return function () { return target.removeEventListener(eventName, handler, options); };\r\n}\r\n/**\r\n * Attaches an event listener directly to the provided DOM element.\r\n *\r\n * Bypassing React's event system can be desirable, for instance when attaching non-passive\r\n * event handlers.\r\n *\r\n * ```jsx\r\n * const ref = useRef(null)\r\n *\r\n * useDomEvent(ref, 'wheel', onWheel, { passive: false })\r\n *\r\n * return
\r\n * ```\r\n *\r\n * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.\r\n * @param eventName - Name of the event you want listen for.\r\n * @param handler - Function to fire when receiving the event.\r\n * @param options - Options to pass to `Event.addEventListener`.\r\n *\r\n * @public\r\n */\r\nfunction useDomEvent(ref, eventName, handler, options) {\r\n useEffect(function () {\r\n var element = ref.current;\r\n if (handler && element) {\r\n return addDomEvent(element, eventName, handler, options);\r\n }\r\n }, [ref, eventName, handler, options]);\r\n}\n\n/**\r\n * Filters out events not attached to the primary pointer (currently left mouse button)\r\n * @param eventHandler\r\n */\r\nfunction filterPrimaryPointer(eventHandler) {\r\n if (!eventHandler)\r\n return undefined;\r\n return function (event) {\r\n var isMouseEvent = event instanceof MouseEvent;\r\n var isPrimaryPointer = !isMouseEvent ||\r\n (isMouseEvent && event.button === 0);\r\n if (isPrimaryPointer) {\r\n eventHandler(event);\r\n }\r\n };\r\n}\r\nvar defaultPagePoint = { pageX: 0, pageY: 0 };\r\nfunction pointFromTouch(e) {\r\n var primaryTouch = e.touches[0] || e.changedTouches[0];\r\n var _a = primaryTouch || defaultPagePoint, pageX = _a.pageX, pageY = _a.pageY;\r\n return { x: pageX, y: pageY };\r\n}\r\nfunction pointFromMouse(_a) {\r\n var _b = _a.pageX, pageX = _b === void 0 ? 0 : _b, _c = _a.pageY, pageY = _c === void 0 ? 0 : _c;\r\n return { x: pageX, y: pageY };\r\n}\r\nfunction extractEventInfo(event) {\r\n return {\r\n point: isTouchEvent(event)\r\n ? pointFromTouch(event)\r\n : pointFromMouse(event),\r\n };\r\n}\r\nvar wrapHandler = function (handler, shouldFilterPrimaryPointer) {\r\n if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; }\r\n if (!handler)\r\n return;\r\n var listener = function (event) { return handler(event, extractEventInfo(event)); };\r\n return shouldFilterPrimaryPointer\r\n ? filterPrimaryPointer(listener)\r\n : listener;\r\n};\n\nvar isBrowser$1 = typeof window !== \"undefined\";\r\n// We check for event support via functions in case they've been mocked by a testing suite.\r\nvar supportsPointerEvents = function () {\r\n return isBrowser$1 && window.onpointerdown === null;\r\n};\r\nvar supportsTouchEvents = function () {\r\n return isBrowser$1 && window.ontouchstart === null;\r\n};\r\nvar supportsMouseEvents = function () {\r\n return isBrowser$1 && window.onmousedown === null;\r\n};\n\nvar mouseEventNames = {\r\n pointerdown: \"mousedown\",\r\n pointermove: \"mousemove\",\r\n pointerup: \"mouseup\",\r\n pointercancel: \"mousecancel\",\r\n pointerover: \"mouseover\",\r\n pointerout: \"mouseout\",\r\n pointerenter: \"mouseenter\",\r\n pointerleave: \"mouseleave\",\r\n};\r\nvar touchEventNames = {\r\n pointerdown: \"touchstart\",\r\n pointermove: \"touchmove\",\r\n pointerup: \"touchend\",\r\n pointercancel: \"touchcancel\",\r\n};\r\nfunction getPointerEventName(name) {\r\n if (supportsPointerEvents()) {\r\n return name;\r\n }\r\n else if (supportsTouchEvents()) {\r\n return touchEventNames[name];\r\n }\r\n else if (supportsMouseEvents()) {\r\n return mouseEventNames[name];\r\n }\r\n return name;\r\n}\r\nfunction addPointerEvent(target, eventName, handler, options) {\r\n return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === \"pointerdown\"), options);\r\n}\r\nfunction usePointerEvent(ref, eventName, handler, options) {\r\n return useDomEvent(ref, getPointerEventName(eventName), wrapHandler(handler, eventName === \"pointerdown\"), options);\r\n}\n\nfunction startDevicePoint(session) {\r\n return session.pointHistory[0];\r\n}\r\nfunction lastDevicePoint(session) {\r\n return session.pointHistory[session.pointHistory.length - 1];\r\n}\r\nfunction getVelocity$1(session, timeDelta) {\r\n var pointHistory = session.pointHistory;\r\n if (pointHistory.length < 2) {\r\n return { x: 0, y: 0 };\r\n }\r\n var i = pointHistory.length - 1;\r\n var timestampedPoint = null;\r\n var lastPoint = lastDevicePoint(session);\r\n while (i >= 0) {\r\n timestampedPoint = pointHistory[i];\r\n if (lastPoint.timestamp - timestampedPoint.timestamp >\r\n secondsToMilliseconds(timeDelta)) {\r\n break;\r\n }\r\n i--;\r\n }\r\n if (!timestampedPoint) {\r\n return { x: 0, y: 0 };\r\n }\r\n var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000;\r\n if (time === 0) {\r\n return { x: 0, y: 0 };\r\n }\r\n var currentVelocity = {\r\n x: (lastPoint.x - timestampedPoint.x) / time,\r\n y: (lastPoint.y - timestampedPoint.y) / time,\r\n };\r\n if (currentVelocity.x === Infinity) {\r\n currentVelocity.x = 0;\r\n }\r\n if (currentVelocity.y === Infinity) {\r\n currentVelocity.y = 0;\r\n }\r\n return currentVelocity;\r\n}\r\n/**\r\n *\r\n * @param handlers -\r\n * @param ref -\r\n *\r\n * @internalremarks\r\n * Currently this sets new pan gesture functions every render. The memo route has been explored\r\n * in the past but ultimately we're still creating new functions every render. An optimisation\r\n * to explore is creating the pan gestures and loading them into a `ref`.\r\n *\r\n * @internal\r\n */\r\nfunction usePanGesture(_a, ref) {\r\n var onPan = _a.onPan, onPanStart = _a.onPanStart, onPanEnd = _a.onPanEnd, onPanSessionStart = _a.onPanSessionStart;\r\n var hasPanEvents = onPan || onPanStart || onPanEnd || onPanSessionStart;\r\n var session = useRef(null);\r\n var lastMoveEvent = useRef(null);\r\n var lastMoveEventInfo = useRef(null);\r\n var transformPagePoint = useContext(MotionPluginContext).transformPagePoint;\r\n var pointerEventSubscription = useRef(null);\r\n // Load the callbacks into mutable state to ensure that even if we don't create a new\r\n // gesture handler every render, we still reference the latest callbacks (which are almost certain to change per render)\r\n var handlersRef = useLatest({\r\n onPanSessionStart: onPanSessionStart,\r\n onPanStart: onPanStart,\r\n onPan: onPan,\r\n onPanEnd: onPanEnd,\r\n });\r\n function removePointerEvents() {\r\n pointerEventSubscription.current && pointerEventSubscription.current();\r\n pointerEventSubscription.current = null;\r\n }\r\n function getPanInfo(_a) {\r\n var point = _a.point;\r\n var currentPoint = session.current;\r\n // TODO: A potential optimisation here that might be a breaking change would be\r\n // to keep one mutable ref to a point that we update\r\n return {\r\n point: point,\r\n delta: Point.subtract(point, lastDevicePoint(currentPoint)),\r\n offset: Point.subtract(point, startDevicePoint(currentPoint)),\r\n velocity: getVelocity$1(currentPoint, 0.1),\r\n };\r\n }\r\n function transformPoint(info) {\r\n return { point: transformPagePoint(info.point) };\r\n }\r\n function cancelPan() {\r\n removePointerEvents();\r\n cancelSync.update(updatePoint);\r\n unblockViewportScroll();\r\n }\r\n function updatePoint() {\r\n if (!session.current ||\r\n !lastMoveEvent.current ||\r\n !lastMoveEventInfo.current) {\r\n warning(false, \"onPointerMove fired without pointer session\");\r\n cancelPan();\r\n return;\r\n }\r\n var info = getPanInfo(lastMoveEventInfo.current);\r\n var panStarted = session.current.startEvent !== undefined;\r\n // Only start panning if the offset is larger than 3 pixels. If we make it\r\n // any larger than this we'll want to reset the pointer history\r\n // on the first update to avoid visual snapping to the cursoe.\r\n var distancePastThreshold = distance(info.offset, { x: 0, y: 0 }) >= 3;\r\n if (!panStarted && !distancePastThreshold)\r\n return;\r\n var point = info.point;\r\n var timestamp = getFrameData().timestamp;\r\n session.current.pointHistory.push(__assign({}, point, { timestamp: timestamp }));\r\n var _a = handlersRef.current, onPanStart = _a.onPanStart, onPan = _a.onPan;\r\n if (!panStarted) {\r\n onPanStart && onPanStart(lastMoveEvent.current, info);\r\n session.current.startEvent = lastMoveEvent.current;\r\n }\r\n onPan && onPan(lastMoveEvent.current, info);\r\n }\r\n function onPointerMove(event, info) {\r\n lastMoveEvent.current = event;\r\n lastMoveEventInfo.current = transformPoint(info);\r\n // Because Safari doesn't trigger mouseup events when it's above a `