@nethesis/phone-island 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/App.js.map +1 -1
  3. package/dist/components/CallView/index.js +1 -1
  4. package/dist/components/CallView/index.js.map +1 -1
  5. package/dist/components/Socket.js +1 -1
  6. package/dist/components/Socket.js.map +1 -1
  7. package/dist/components/WebRTC.js +1 -1
  8. package/dist/components/WebRTC.js.map +1 -1
  9. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
  10. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
  11. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +1 -1
  12. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +1 -1
  13. package/dist/node_modules/js-base64/base64.mjs.js +1 -1
  14. package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
  15. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
  16. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js.map +1 -1
  17. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.js +1 -1
  18. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.mjs.js.map +1 -1
  19. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
  20. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
  21. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
  22. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
  23. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
  24. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
  25. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js +1 -1
  26. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs.js.map +1 -1
  27. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js +1 -1
  28. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
  29. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js +1 -1
  30. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.mjs.js.map +1 -1
  31. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.mjs.js +2 -0
  32. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.mjs.js.map +1 -0
  33. package/dist/package.json.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/node_modules/motion-dom/dist/es/stats/buffer.mjs.js +0 -2
  36. package/dist/node_modules/motion-dom/dist/es/stats/buffer.mjs.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PanSession.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs"],"sourcesContent":["import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n//# sourceMappingURL=PanSession.mjs.map\n"],"names":["overflowStyles","Set","transformPoint","info","transformPagePoint","point","subtractPoint","a","b","x","y","getPanInfo","_ref","history","delta","lastDevicePoint","offset","startDevicePoint","velocity","getVelocity","length","timeDelta","i","timestampedPoint","lastPoint","timestamp","secondsToMilliseconds","time","millisecondsToSeconds","currentVelocity","Infinity","constructor","event","handlers","contextWindow","window","dragSnapToOrigin","distanceThreshold","element","arguments","undefined","this","startEvent","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","Map","removeScrollListeners","onElementScroll","handleScroll","target","onWindowScroll","updatePoint","isPanStarted","isDistancePastThreshold","distance2D","frameData","push","onStart","onMove","handlePointerMove","frame","update","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","type","isPrimaryPointer","initialInfo","extractEventInfo","onSessionStart","removeListeners","pipe","addPointerEvent","startScrollTracking","current","parentElement","style","getComputedStyle","has","overflowX","overflowY","set","scrollLeft","scrollTop","scrollX","scrollY","addEventListener","capture","removeEventListener","initial","get","isWindow","updateHandl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B,QAAQ,GAAGJ,GAAKK,EACrB2B,KAAK5B,QAAQ,GAAGH,GAAKI,GAI7B2B,KAAKK,gBAAgBwC,IAAInC,EAAQ4B,GACjCjB,EAAAA,MAAMC,OAAOtB,KAAKY,aAAa,GACnC,CA0EA4C,cAAAA,CAAehE,GACXQ,KAAKR,SAAWA,CACpB,CAEAgC,GAAAA,GACIxB,KAAKkC,iBAAmBlC,KAAKkC,kBAC7BlC,KAAKO,uBAAyBP,KAAKO,wBACnCP,KAAKK,gBAAgBoD,QACrBC,cAAY1D,KAAKY,YACrB"}
1
+ {"version":3,"file":"PanSession.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs"],"sourcesContent":["import { frameData, frame, isPrimaryPointer, cancelFrame } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"]);\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, element, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n this.lastRawMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n this.scrollPositions = new Map();\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n this.removeScrollListeners = null;\n this.onElementScroll = (event) => {\n this.handleScroll(event.target);\n };\n this.onWindowScroll = () => {\n this.handleScroll(window);\n };\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint);\n }\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastRawMoveEventInfo = info;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation();\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n // Listen in the capture phase so a descendant calling\n // stopPropagation() (e.g. in its own pointerup handler) can't\n // prevent the gesture from ending. See #2794.\n const eventOptions = { passive: true, capture: true };\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove, eventOptions), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp, eventOptions), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp, eventOptions));\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element);\n }\n }\n /**\n * Start tracking scroll on ancestors and window.\n */\n startScrollTracking(element) {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement;\n while (current) {\n const style = getComputedStyle(current);\n if (overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n });\n }\n current = current.parentElement;\n }\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n });\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll);\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n });\n window.removeEventListener(\"scroll\", this.onWindowScroll);\n };\n }\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n handleScroll(target) {\n const initial = this.scrollPositions.get(target);\n if (!initial)\n return;\n const isWindow = target === window;\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: target.scrollLeft,\n y: target.scrollTop,\n };\n const delta = { x: current.x - initial.x, y: current.y - initial.y };\n if (delta.x === 0 && delta.y === 0)\n return;\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x;\n this.lastMoveEventInfo.point.y += delta.y;\n }\n }\n else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x;\n this.history[0].y -= delta.y;\n }\n }\n this.scrollPositions.set(target, current);\n frame.update(this.updatePoint, true);\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n this.removeScrollListeners && this.removeScrollListeners();\n this.scrollPositions.clear();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2) {\n timestampedPoint = history[1];\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n//# sourceMappingURL=PanSession.mjs.map\n"],"names":["overflowStyles","Set","transformPoint","info","transformPagePoint","point","subtractPoint","a","b","x","y","getPanInfo","_ref","history","delta","lastDevicePoint","offset","startDevicePoint","velocity","getVelocity","length","timeDelta","i","timestampedPoint","lastPoint","timestamp","secondsToMilliseconds","time","millisecondsToSeconds","currentVelocity","Infinity","constructor","event","handlers","contextWindow","window","dragSnapToOrigin","distanceThreshold","element","arguments","undefined","this","startEvent","lastMoveEvent","lastMoveEventInfo","lastRawMoveEventInfo","scrollPositions","Map","removeScrollListeners","onElementScroll","handleScroll","target","onWindowScroll","updatePoint","isPanStarted","isDistancePastThreshold","distance2D","frameData","push","onStart","onMove","handlePointerMove","frame","update","handlePointerUp","end","onEnd","onSessionEnd","resumeAnimation","panInfo","type","isPrimaryPointer","initialInfo","extractEventInfo","onSessionStart","eventOptions","passive","capture","removeListeners","pipe","addPointerEvent","startScrollTracking","current","parentElement","style","getComputedStyle","has","overflowX","overflowY","set","scrollLeft","scrollTop","scrollX","scrollY","addEventListener","removeEventListener","initial","get","isWindow","updateHandlers","clear","cancelFrame"],"mappings":"mfAuCA,MAAMA,EAA+B,IAAIC,IAAI,CAAC,OAAQ,WA2TtD,SAASC,EACLC,EACAC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,EACrB2B,KAAK5B,QAAQ,GAAGH,GAAKI,GAI7B2B,KAAKK,gBAAgB2C,IAAItC,EAAQ+B,GACjCpB,EAAAA,MAAMC,OAAOtB,KAAKY,aAAa,GACnC,CA0EA8C,cAAAA,CAAelE,GACXQ,KAAKR,SAAWA,CACpB,CAEAgC,GAAAA,GACIxB,KAAKqC,iBAAmBrC,KAAKqC,kBAC7BrC,KAAKO,uBAAyBP,KAAKO,wBACnCP,KAAKK,gBAAgBsD,QACrBC,cAAY5D,KAAKY,YACrB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="3.7.8",t=e,r="function"==typeof Buffer,o="function"==typeof TextDecoder?new TextDecoder:void 0,n="function"==typeof TextEncoder?new TextEncoder:void 0,a=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),i=(e=>{let t={};return a.forEach(((e,r)=>t[e]=r)),t})(),s=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),f="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),u=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),l=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),d=e=>{let t,r,o,n,i="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|o<<8|n,i+=a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},p="function"==typeof btoa?e=>btoa(e):r?e=>Buffer.from(e,"binary").toString("base64"):d,h=r?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,o=e.length;r<o;r+=4096)t.push(c.apply(null,e.subarray(r,r+4096)));return p(t.join(""))},x=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?u(h(e)):h(e)},A=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?c(192|t>>>6)+c(128|63&t):c(224|t>>>12&15)+c(128|t>>>6&63)+c(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return c(240|t>>>18&7)+c(128|t>>>12&63)+c(128|t>>>6&63)+c(128|63&t)},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=e=>e.replace(y,A),g=r?e=>Buffer.from(e,"utf8").toString("base64"):n?e=>h(n.encode(e)):e=>p(b(e)),B=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?u(g(e)):g(e)},C=e=>B(e,!0),U=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return c(55296+(t>>>10))+c(56320+(1023&t));case 3:return c((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return c((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},F=e=>e.replace(U,m),S=e=>{if(e=e.replace(/\s+/g,""),!s.test(e))throw new TypeError("malformed base64.");let t,r,o;e+="==".slice(2-(3&e.length));let n=[];for(let a=0;a<e.length;)t=i[e.charAt(a++)]<<18|i[e.charAt(a++)]<<12|(r=i[e.charAt(a++)])<<6|(o=i[e.charAt(a++)]),64===r?n.push(c(t>>16&255)):64===o?n.push(c(t>>16&255,t>>8&255)):n.push(c(t>>16&255,t>>8&255,255&t));return n.join("")},v="function"==typeof atob?e=>atob(l(e)):r?e=>Buffer.from(e,"base64").toString("binary"):S,R=r?e=>f(Buffer.from(e,"base64")):e=>f(v(e).split("").map((e=>e.charCodeAt(0)))),w=e=>R(D(e)),E=r?e=>Buffer.from(e,"base64").toString("utf8"):o?e=>o.decode(R(e)):e=>F(v(e)),D=e=>l(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),P=e=>E(D(e)),z=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},I=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),T=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,I(t));e("fromBase64",(function(){return P(this)})),e("toBase64",(function(e){return B(this,e)})),e("toBase64URI",(function(){return B(this,!0)})),e("toBase64URL",(function(){return B(this,!0)})),e("toUint8Array",(function(){return w(this)}))},Z=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,I(t));e("toBase64",(function(e){return x(this,e)})),e("toBase64URI",(function(){return x(this,!0)})),e("toBase64URL",(function(){return x(this,!0)}))},j=()=>{T(),Z()},O={version:e,VERSION:t,atob:v,atobPolyfill:S,btoa:p,btoaPolyfill:d,fromBase64:P,toBase64:B,encode:B,encodeURI:C,encodeURL:C,utob:b,btou:F,decode:P,isValid:z,fromUint8Array:x,toUint8Array:w,extendString:T,extendUint8Array:Z,extendBuiltins:j};exports.Base64=O,exports.VERSION=t,exports.atob=v,exports.atobPolyfill=S,exports.btoa=p,exports.btoaPolyfill=d,exports.btou=F,exports.decode=P,exports.encode=B,exports.encodeURI=C,exports.encodeURL=C,exports.extendBuiltins=j,exports.extendString=T,exports.extendUint8Array=Z,exports.fromBase64=P,exports.fromUint8Array=x,exports.isValid=z,exports.toBase64=B,exports.toUint8Array=w,exports.utob=b,exports.version=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="3.8.0",t=e,r="function"==typeof Buffer,o="function"==typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,n="function"==typeof TextEncoder?new TextEncoder:void 0,a=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),i=(e=>{let t={};return a.forEach(((e,r)=>t[e]=r)),t})(),s=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),f="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),u=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),l=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),d=e=>{let t,r,o,n,i="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|o<<8|n,i+=a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},p="function"==typeof btoa?e=>btoa(e):r?e=>Buffer.from(e,"binary").toString("base64"):d,h=r?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,o=e.length;r<o;r+=4096)t.push(c.apply(null,e.subarray(r,r+4096)));return p(t.join(""))},x=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?u(h(e)):h(e)},A=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?c(192|t>>>6)+c(128|63&t):c(224|t>>>12&15)+c(128|t>>>6&63)+c(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return c(240|t>>>18&7)+c(128|t>>>12&63)+c(128|t>>>6&63)+c(128|63&t)},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=e=>e.replace(y,A),g=r?e=>Buffer.from(e,"utf8").toString("base64"):n?e=>h(n.encode(e)):e=>p(b(e)),B=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?u(g(e)):g(e)},C=e=>B(e,!0),U=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return c(55296+(t>>>10))+c(56320+(1023&t));case 3:return c((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return c((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},F=e=>e.replace(U,m),S=e=>{if(e=e.replace(/\s+/g,""),!s.test(e))throw new TypeError("malformed base64.");let t,r,o;e+="==".slice(2-(3&e.length));let n=[];for(let a=0;a<e.length;)t=i[e.charAt(a++)]<<18|i[e.charAt(a++)]<<12|(r=i[e.charAt(a++)])<<6|(o=i[e.charAt(a++)]),64===r?n.push(c(t>>16&255)):64===o?n.push(c(t>>16&255,t>>8&255)):n.push(c(t>>16&255,t>>8&255,255&t));return n.join("")},v="function"==typeof atob?e=>atob(l(e)):r?e=>Buffer.from(e,"base64").toString("binary"):S,R=r?e=>f(Buffer.from(e,"base64")):e=>f(v(e).split("").map((e=>e.charCodeAt(0)))),w=e=>R(D(e)),E=r?e=>Buffer.from(e,"base64").toString("utf8"):o?e=>o.decode(R(e)):e=>F(v(e)),D=e=>l(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),P=e=>E(D(e)),z=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},I=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),O=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,I(t));e("fromBase64",(function(){return P(this)})),e("toBase64",(function(e){return B(this,e)})),e("toBase64URI",(function(){return B(this,!0)})),e("toBase64URL",(function(){return B(this,!0)})),e("toUint8Array",(function(){return w(this)}))},T=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,I(t));e("toBase64",(function(e){return x(this,e)})),e("toBase64URI",(function(){return x(this,!0)})),e("toBase64URL",(function(){return x(this,!0)}))},Z=()=>{O(),T()},j={version:e,VERSION:t,atob:v,atobPolyfill:S,btoa:p,btoaPolyfill:d,fromBase64:P,toBase64:B,encode:B,encodeURI:C,encodeURL:C,utob:b,btou:F,decode:P,isValid:z,fromUint8Array:x,toUint8Array:w,extendString:O,extendUint8Array:T,extendBuiltins:Z};exports.Base64=j,exports.VERSION=t,exports.atob=v,exports.atobPolyfill=S,exports.btoa=p,exports.btoaPolyfill=d,exports.btou=F,exports.decode=P,exports.encode=B,exports.encodeURI=C,exports.encodeURL=C,exports.extendBuiltins=Z,exports.extendString=O,exports.extendUint8Array=T,exports.fromBase64=P,exports.fromUint8Array=x,exports.isValid=z,exports.toBase64=B,exports.toUint8Array=w,exports.utob=b,exports.version=e;
2
2
  //# sourceMappingURL=base64.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base64.mjs.js","sources":["../../../node_modules/js-base64/base64.mjs"],"sourcesContent":["/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.8';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, r1, r2;\n let binArray = []; // use array to avoid minor gc in loop\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n if (r1 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255));\n }\n else if (r2 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));\n }\n else {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));\n }\n }\n return binArray.join('');\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n"],"names":["version","VERSION","_hasBuffer","Buffer","_TD","TextDecoder","undefined","_TE","TextEncoder","b64chs","Array","prototype","slice","call","b64tab","a","tab","forEach","c","i","b64re","_fromCC","String","fromCharCode","bind","_U8Afrom","Uint8Array","from","it","_mkUriSafe","src","replace","m0","_tidyB64","s","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","length","charCodeAt","TypeError","substring","_btoa","btoa","toString","_fromUint8Array","u8a","strs","l","push","apply","subarray","join","fromUint8Array","arguments","cb_utob","cc","re_utob","utob","u","_encode","encode","encodeURI","re_btou","cb_btou","cccc","offset","btou","b","atobPolyfill","test","u24","r1","r2","binArray","charAt","_atob","atob","_toUint8Array","split","map","toUint8Array","_unURI","_decode","decode","isValid","_noEnum","v","value","enumerable","writable","configurable","extendString","_add","name","body","Object","defineProperty","this","urlsafe","extendUint8Array","extendBuiltins","gBase64","fromBase64","toBase64","encodeURL"],"mappings":"oEAWMA,MAAAA,EAAU,QAIVC,EAAUD,EACVE,EAA+B,mBAAXC,OACpBC,EAA6B,mBAAhBC,YAA6B,IAAIA,iBAAgBC,EAC9DC,EAA6B,mBAAhBC,YAA6B,IAAIA,iBAAgBF,EAE9DG,EAASC,MAAMC,UAAUC,MAAMC,KADvB,qEAERC,EAAS,CAAEC,IACb,IAAIC,EAAM,CAAA,EAEV,OACDP,EAFGQ,SAAQ,CAACC,EAAGC,IAAMH,EAAIE,GAAKC,IACtBH,CACV,EAJc,GAKTI,EAAQ,0EACRC,EAAUC,OAAOC,aAAaC,KAAKF,QACnCG,EAAsC,mBAApBC,WAAWC,KAC7BD,WAAWC,KAAKH,KAAKE,YACpBE,GAAO,IAAIF,WAAWhB,MAAMC,UAAUC,MAAMC,KAAKe,EAAI,IACtDC,EAAcC,GAAQA,EACvBC,QAAQ,KAAM,IAAIA,QAAQ,UAAWC,GAAa,KAANA,EAAY,IAAM,MAC7DC,EAAYC,GAAMA,EAAEH,QAAQ,oBAAqB,IAIjDI,EAAgBC,IAElB,IAAIC,EAAKC,EAAIC,EAAIC,EAAIC,EAAM,GAC3B,MAAMC,EAAMN,EAAIO,OAAS,EACzB,IAAK,IAAIxB,EAAI,EAAGA,EAAIiB,EAAIO,QAAS,CAC7B,IAAKL,EAAKF,EAAIQ,WAAWzB,MAAQ,MAC5BoB,EAAKH,EAAIQ,WAAWzB,MAAQ,MAC5BqB,EAAKJ,EAAIQ,WAAWzB,MAAQ,IAC7B,MA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AAOD,EAAGE,YAAY,EAAOC,UAAU,EAAMC,cAAc,IAM7DC,EAAe,WACjB,MAAMC,EAAOA,CAACC,EAAMC,IAASC,OAAOC,eAAehF,OAAOX,UAAWwF,EAAMR,EAAQS,IACnFF,EAAK,cAAc,WAAc,OAAOT,EAAOc,KAAO,IACtDL,EAAK,YAAY,SAAUM,GAAW,OAAOtC,EAAOqC,KAAMC,EAAU,IACpEN,EAAK,eAAe,WAAc,OAAOhC,EAAOqC,MAAM,EAAO,IAC7DL,EAAK,eAAe,WAAc,OAAOhC,EAAOqC,MAAM,EAAO,IAC7DL,EAAK,gBAAgB,WAAc,OAAOZ,EAAaiB,KAAO,GAClE,EAIME,EAAmB,WACrB,MAAMP,EAAOA,CAACC,EAAMC,IAASC,OAAOC,eAAe5E,WAAWf,UAAWwF,EAAMR,EAAQS,IACvFF,EAAK,YAAY,SAAUM,GAAW,OAAO9C,EAAe6C,KAAMC,EAAU,IAC5EN,EAAK,eAAe,WAAc,OAAOxC,EAAe6C,MAAM,EAAO,IACrEL,EAAK,eAAe,WAAc,OAAOxC,EAAe6C,MAAM,EAAO,GACzE,EAIMG,EAAiBA,KACnBT,IACAQ,GAAkB,EAEhBE,EAAU,CACZ3G,QAASA,EACTC,QAASA,EACTiF,KAAMD,EACNP,aAAcA,EACd1B,KAAMD,EACNZ,aAAcA,EACdyE,WAAYnB,EACZoB,SAAU3C,EACVA,OAAQA,EACRC,UAAWA,EACX2C,UAAW3C,EACXJ,KAAMA,EACNS,KAAMA,EACNiB,OAAQA,EACRC,QAASA,EACThC,eAAgBA,EAChB4B,aAAcA,EACdW,aAAcA,EACdQ,iBAAkBA,EAClBC,eAAgBA"}
1
+ {"version":3,"file":"base64.mjs.js","sources":["../../../node_modules/js-base64/base64.mjs"],"sourcesContent":["/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.8.0';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder('utf-8', { ignoreBOM: true }) : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, r1, r2;\n let binArray = []; // use array to avoid minor gc in loop\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n if (r1 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255));\n }\n else if (r2 === 64) {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));\n }\n else {\n binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));\n }\n }\n return binArray.join('');\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n"],"names":["version","VERSION","_hasBuffer","Buffer","_TD","TextDecoder","ignoreBOM","undefined","_TE","TextEncoder","b64chs","Array","prototype","slice","call","b64tab","a","tab","forEach","c","i","b64re","_fromCC","String","fromCharCode","bind","_U8Afrom","Uint8Array","from","it","_mkUriSafe","src","replace","m0","_tidyB64","s","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","length","charCodeAt","TypeError","substring","_btoa","btoa","toString","_fromUint8Array","u8a","strs","l","push","apply","subarray","join","fromUint8Array","arguments","cb_utob","cc","re_utob","utob","u","_encode","encode","encodeURI","re_btou","cb_btou","cccc","offset","btou","b","atobPolyfill","test","u24","r1","r2","binArray","charAt","_atob","atob","_toUint8Array","split","map","toUint8Array","_unURI","_decode","decode","isValid","_noEnum","v","value","enumerable","writable","configurable","extendString","_add","name","body","Object","defineProperty","this","urlsafe","extendUint8Array","extendBuiltins","gBase64","fromBase64","toBase64","encodeURL"],"mappings":"oEAWMA,MAAAA,EAAU,QAIVC,EAAUD,EACVE,EAA+B,mBAAXC,OACpBC,EAA6B,mBAAhBC,YAA6B,IAAIA,YAAY,QAAS,CAAEC,WAAW,SAAUC,EAC1FC,EAA6B,mBAAhBC,YAA6B,IAAIA,iBAAgBF,EAE9DG,EAASC,MAAMC,UAAUC,MAAMC,KADvB,qEAERC,EAAS,CAAEC,IACb,IAAIC,EAAM,CAAA,EAEV,OACDP,EAFGQ,SAAQ,CAACC,EAAGC,IAAMH,EAAIE,GAAKC,IACtBH,CACV,EAJc,GAKTI,EAAQ,0EACRC,EAAUC,OAAOC,aAAaC,KAAKF,QACnCG,EAAsC,mBAApBC,WAAWC,KAC7BD,WAAWC,KAAKH,KAAKE,YACpBE,GAAO,IAAIF,WAAWhB,MAAMC,UAAUC,MAAMC,KAAKe,EAAI,IACtDC,EAAcC,GAAQA,EACvBC,QAAQ,KAAM,IAAIA,QAAQ,UAAWC,GAAa,K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,EACRC,UAAWA,EACX2C,UAAW3C,EACXJ,KAAMA,EACNS,KAAMA,EACNiB,OAAQA,EACRC,QAASA,EACThC,eAAgBA,EAChB4B,aAAcA,EACdW,aAAcA,EACdQ,iBAAkBA,EAClBC,eAAgBA"}
@@ -1 +1 @@
1
- {"version":3,"file":"JSAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/JSAnimation.mjs"],"sourcesContent":["import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n"],"names":["percentToProgress","percent","JSAnimation","WithPromise","constructor","options","super","this","state","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","done","value","undefined","stop","motionValue","updatedAt","time","now","tick","teardown","onStop","initAnimation","play","autoplay","pause","replaceTransitionType","type","keyframes","repeat","repeatDelay","repeatType","velocity","keyframes$1","generatorFactory","process","env","NODE_ENV","keyframesGenerator","invariant","length","mixKeyframes","pipe","mix","generator","mirroredGenerator","reverse","calculatedDuration","calcGeneratorDuration","resolvedDuration","totalDuration","updateTime","timestamp","animationTime","Math","round","sample","arguments","next","delay","onUpdate","finalKeyframe","speed","min","timeWithoutDelay","isInDelayPhase","max","elapsed","frameGenerator","progress","currentIteration","floor","iterationProgress","Boolean","clamp","isAnimationFinished","inertia","getFinalKeyframe","finish","then","resolve","reject","finished","duration","millisecondsToSeconds","iterationDuration","newTime","secondsToMilliseconds","driver","start","getGeneratorVelocity","t","current","s","newSpeed","hasChanged","frameloopDriver","onPlay","updateFinished","complete","notifyFinished","onComplete","cancel","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","ease","observe"],"mappings":"mvBA6BA,MAAMA,EAAqBC,GAAoBA,EAAU,IAEnD,MAAOC,UACDC,EAAAA,YA2DRC,WAAAA,CAAYC,GACRC,QAzDJC,KAAAC,MAA4B,OAE5BD,KAAAE,UAA2B,KAQnBF,KAAAG,WAAY,EAeZH,KAAAI,YAAsB,EAKtBJ,KAAAK,SAA0B,KAK1BL,KAAAM,cAAgB,EAgBhBN,KAAAO,WAAgC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,UAAYa,EAAMf,KAAKK,SACpBL,KAAKE,YACbF,KAAKE,UAAYA,GAAaa,GAGf,aAAff,KAAKC,OAAwBD,KAAK2D,MAAQ,IAC1C3D,KAAKE,WAAaF,KAAK4C,oBAG3B5C,KAAKK,SAAW,KAMhBL,KAAKC,MAAQ,UAEbD,KAAKqF,OAAOC,OAChB,CAEAhE,KAAAA,GACItB,KAAKC,MAAQ,SACbD,KAAKgD,WAAWlC,OAAKC,OACrBf,KAAKK,SAAWL,KAAKI,WACzB,CAkBA4F,QAAAA,GACuB,YAAfhG,KAAKC,OACLD,KAAKoB,OAGTpB,KAAKC,MAAQ,WACbD,KAAKK,SAAW,IACpB,CAEAsE,MAAAA,GACI3E,KAAKiG,iBACLjG,KAAKiB,WACLjB,KAAKC,MAAQ,WAEbD,KAAKF,QAAQoG,cACjB,CAEAC,MAAAA,GACInG,KAAKK,SAAW,KAChBL,KAAKE,UAAY,EACjBF,KAAKgB,KAAK,GACVhB,KAAKiB,WACLjB,KAAKF,QAAQsG,YACjB,CAEQnF,QAAAA,GACJjB,KAAKC,MAAQ,OACbD,KAAKqG,aACLrG,KAAKE,UAAYF,KAAKK,SAAW,IAErC,CAEQgG,UAAAA,GACCrG,KAAKqF,SACVrF,KAAKqF,OAAO1E,OACZX,KAAKqF,YAAS3E,EAClB,CAEA2C,MAAAA,CAAOiD,GAEH,OADAtG,KAAKE,UAAY,EACVF,KAAKgB,KAAKsF,GAAY,EACjC,CAEAC,cAAAA,CAAeC,GAQX,OAPIxG,KAAKF,QAAQ2G,eACbzG,KAAKF,QAAQ0B,KAAO,YACpBxB,KAAKF,QAAQ4G,KAAO,SACpB1G,KAAKmB,iBAGTnB,KAAKqF,QAAQ1E,OACN6F,EAASG,QAAQ3G,KAC5B"}
1
+ {"version":3,"file":"JSAnimation.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/animation/JSAnimation.mjs"],"sourcesContent":["import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\n };\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n const t = this.currentTime;\n if (t <= 0)\n return this.options.velocity || 0;\n if (this.generator.velocity) {\n return this.generator.velocity(t);\n }\n // Fallback: finite difference\n const current = this.generator.next(t).value;\n return getGeneratorVelocity((s) => this.generator.next(s).value, t, current);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n//# sourceMappingURL=JSAnimation.mjs.map\n"],"names":["percentToProgress","percent","JSAnimation","WithPromise","constructor","options","super","this","state","startTime","isStopped","currentTime","holdTime","playbackSpeed","delayState","done","value","undefined","stop","motionValue","updatedAt","time","now","tick","teardown","onStop","initAnimation","play","autoplay","pause","replaceTransitionType","type","keyframes","repeat","repeatDelay","repeatType","velocity","keyframes$1","generatorFactory","process","env","NODE_ENV","keyframesGenerator","invariant","length","mixKeyframes","pipe","mix","generator","mirroredGenerator","reverse","calculatedDuration","calcGeneratorDuration","resolvedDuration","totalDuration","updateTime","timestamp","animationTime","Math","round","sample","arguments","next","delay","onUpdate","finalKeyframe","speed","min","timeWithoutDelay","isInDelayPhase","max","elapsed","frameGenerator","progress","currentIteration","floor","iterationProgress","Boolean","clamp","isAnimationFinished","inertia","getFinalKeyframe","finish","then","resolve","reject","finished","duration","millisecondsToSeconds","iterationDuration","newTime","secondsToMilliseconds","driver","start","getGeneratorVelocity","t","current","s","newSpeed","hasChanged","frameloopDriver","onPlay","updateFinished","complete","notifyFinished","onComplete","cancel","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","ease","observe"],"mappings":"mvBA4BA,MAAMA,EAAqBC,GAAoBA,EAAU,IAEnD,MAAOC,UACDC,EAAAA,YA2DRC,WAAAA,CAAYC,GACRC,QAzDJC,KAAAC,MAA4B,OAE5BD,KAAAE,UAA2B,KAQnBF,KAAAG,WAAY,EAeZH,KAAAI,YAAsB,EAKtBJ,KAAAK,SAA0B,KAK1BL,KAAAM,cAAgB,EAgBhBN,KAAAO,WAAgC,CACpCC,MAAM,EACNC,WAAOC,GA8YXV,KAAAW,KAAO,KACH,MAAMC,YAAEA,GAAgBZ,KAAKF,QACzBc,GAAeA,EAAYC,YAAcC,EAAIA,KAACC,OAC9Cf,KAAKgB,KAAKF,OAAKC,OAGnBf,KAAKG,WAAY,EACE,SAAfH,KAAKC,QACTD,KAAKiB,WACLjB,KAAKF,QAAQoB,WAAU,EAjZvBlB,KAAKF,QAAUA,EACfE,KAAKmB,gBACLnB,KAAKoB,QAEoB,IAArBtB,EAAQuB,UAAoBrB,KAAKsB,OACzC,CAEAH,aAAAA,GACI,MAAMrB,QAAEA,G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,MAAQ,WACbD,KAAKK,SAAW,IACpB,CAEAsE,MAAAA,GACI3E,KAAKiG,iBACLjG,KAAKiB,WACLjB,KAAKC,MAAQ,WAEbD,KAAKF,QAAQoG,cACjB,CAEAC,MAAAA,GACInG,KAAKK,SAAW,KAChBL,KAAKE,UAAY,EACjBF,KAAKgB,KAAK,GACVhB,KAAKiB,WACLjB,KAAKF,QAAQsG,YACjB,CAEQnF,QAAAA,GACJjB,KAAKC,MAAQ,OACbD,KAAKqG,aACLrG,KAAKE,UAAYF,KAAKK,SAAW,IACrC,CAEQgG,UAAAA,GACCrG,KAAKqF,SACVrF,KAAKqF,OAAO1E,OACZX,KAAKqF,YAAS3E,EAClB,CAEA2C,MAAAA,CAAOiD,GAEH,OADAtG,KAAKE,UAAY,EACVF,KAAKgB,KAAKsF,GAAY,EACjC,CAEAC,cAAAA,CAAeC,GAQX,OAPIxG,KAAKF,QAAQ2G,eACbzG,KAAKF,QAAQ0B,KAAO,YACpBxB,KAAKF,QAAQ4G,KAAO,SACpB1G,KAAKmB,iBAGTnB,KAAKqF,QAAQ1E,OACN6F,EAASG,QAAQ3G,KAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"start-waapi-animation.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs"],"sourcesContent":["import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n"],"names":["element","valueName","keyframes","delay","duration","repeat","repeatType","ease","times","arguments","length","undefined","pseudoElement","keyframeOptions","offset","easing","mapEasingToNativeEasing","Array","isArray","options","fill","iterations","direction","animate"],"mappings":"4IAKM,SACFA,EACAC,EACAC,GAS6C,IAR7CC,MACIA,EAAQ,EAACC,SACTA,EAAW,IAAGC,OACdA,EAAS,EAACC,WACVA,EAAa,OAAMC,KACnBA,EAAO,UAASC,MAChBA,GAAKC,UAAAC,OAAAD,QAAAE,IAAAF,aAAAA,UAAA,GACY,GACrBG,EAAAH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,QAAoCE,EAEpC,MAAME,EAA4C,CAC9CZ,CAACA,GAAYC,GAEbM,IAAOK,EAAgBC,OAASN,GAEpC,MAAMO,EAASC,EAAAA,wBAAwBT,EAAMH,GAKzCa,MAAMC,QAAQH,KAASF,EAAgBE,OAASA,GAMpD,MAAMI,EAAoC,CACtChB,QACAC,WACAW,OAASE,MAAMC,QAAQH,GAAmB,SAATA,EACjCK,KAAM,OACNC,WAAYhB,EAAS,EACrBiB,UAA0B,YAAfhB,EAA2B,YAAc,UAaxD,OAVIM,IAAeO,EAAQP,cAAgBA,GAEzBZ,EAAQuB,QAAQV,EAAiBM,EASvD"}
1
+ {"version":3,"file":"start-waapi-animation.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs"],"sourcesContent":["import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n"],"names":["element","valueName","keyframes","delay","duration","repeat","repeatType","ease","times","arguments","length","undefined","pseudoElement","keyframeOptions","offset","easing","mapEasingToNativeEasing","Array","isArray","options","fill","iterations","direction","animate"],"mappings":"4IAGM,SACFA,EACAC,EACAC,GAS6C,IAR7CC,MACIA,EAAQ,EAACC,SACTA,EAAW,IAAGC,OACdA,EAAS,EAACC,WACVA,EAAa,OAAMC,KACnBA,EAAO,UAASC,MAChBA,GAAKC,UAAAC,OAAAD,QAAAE,IAAAF,aAAAA,UAAA,GACY,GACrBG,EAAAH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,QAAoCE,EAEpC,MAAME,EAA4C,CAC9CZ,CAACA,GAAYC,GAEbM,IAAOK,EAAgBC,OAASN,GAEpC,MAAMO,EAASC,EAAAA,wBAAwBT,EAAMH,GAKzCa,MAAMC,QAAQH,KAASF,EAAgBE,OAASA,GAEpD,MAAMI,EAAoC,CACtChB,QACAC,WACAW,OAASE,MAAMC,QAAQH,GAAmB,SAATA,EACjCK,KAAM,OACNC,WAAYhB,EAAS,EACrBiB,UAA0B,YAAfhB,EAA2B,YAAc,UAKxD,OAFIM,IAAeO,EAAQP,cAAgBA,GAEpCZ,EAAQuB,QAAQV,EAAiBM,EAC5C"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addDomEvent=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addDomEvent=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)};
2
2
  //# sourceMappingURL=add-dom-event.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-dom-event.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/events/add-dom-event.mjs"],"sourcesContent":["function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler);\n}\n\nexport { addDomEvent };\n//# sourceMappingURL=add-dom-event.mjs.map\n"],"names":["target","eventName","handler","options","arguments","length","undefined","passive","addEventListener","removeEventListener"],"mappings":"wFAAM,SACFA,EACAC,EACAC,GACoD,IAApDC,EAAAC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAmC,GAAA,CAAEG,SAAS,GAI9C,OAFAP,EAAOQ,iBAAiBP,EAAWC,EAASC,GAErC,IAAMH,EAAOS,oBAAoBR,EAAWC,EACvD"}
1
+ {"version":3,"file":"add-dom-event.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/events/add-dom-event.mjs"],"sourcesContent":["function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler, options);\n}\n\nexport { addDomEvent };\n//# sourceMappingURL=add-dom-event.mjs.map\n"],"names":["target","eventName","handler","options","arguments","length","undefined","passive","addEventListener","removeEventListener"],"mappings":"wFAAM,SACFA,EACAC,EACAC,GACoD,IAApDC,EAAAC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAmC,GAAA,CAAEG,SAAS,GAI9C,OAFAP,EAAOQ,iBAAiBP,EAAWC,EAASC,GAErC,IAAMH,EAAOS,oBAAoBR,EAAWC,EAASC,EAChE"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./order.mjs.js"),s=require("./render-step.mjs.js"),r=require("../../../../motion-utils/dist/es/global-config.mjs.js");exports.createRenderBatcher=function(t,o){let n=!1,c=!0;const i={delta:0,timestamp:0,isProcessing:!1},p=()=>n=!0,a=e.stepsOrder.reduce(((e,r)=>(e[r]=s.createRenderStep(p,o?r:void 0),e)),{}),{setup:d,read:l,resolveKeyframes:u,preUpdate:m,update:g,preRender:f,render:h,postRender:j}=a,v=()=>{const e=r.MotionGlobalConfig.useManualTiming,s=e?i.timestamp:performance.now();n=!1,e||(i.delta=c?1e3/60:Math.max(Math.min(s-i.timestamp,40),1)),i.timestamp=s,i.isProcessing=!0,d.process(i),l.process(i),u.process(i),m.process(i),g.process(i),f.process(i),h.process(i),j.process(i),i.isProcessing=!1,n&&o&&(c=!1,t(v))};return{schedule:e.stepsOrder.reduce(((e,s)=>{const r=a[s];return e[s]=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n||(n=!0,c=!0,i.isProcessing||t(v)),r.schedule(e,s,o)},e}),{}),cancel:s=>{for(let r=0;r<e.stepsOrder.length;r++)a[e.stepsOrder[r]].cancel(s)},state:i,steps:a}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./order.mjs.js"),s=require("./render-step.mjs.js"),r=require("../../../../motion-utils/dist/es/global-config.mjs.js");exports.createRenderBatcher=function(t,o){let n=!1,c=!0;const i={delta:0,timestamp:0,isProcessing:!1},p=()=>n=!0,a=e.stepsOrder.reduce(((e,r)=>(e[r]=s.createRenderStep(p),e)),{}),{setup:d,read:l,resolveKeyframes:u,preUpdate:m,update:g,preRender:f,render:h,postRender:j}=a,v=()=>{const e=r.MotionGlobalConfig.useManualTiming,s=e?i.timestamp:performance.now();n=!1,e||(i.delta=c?1e3/60:Math.max(Math.min(s-i.timestamp,40),1)),i.timestamp=s,i.isProcessing=!0,d.process(i),l.process(i),u.process(i),m.process(i),g.process(i),f.process(i),h.process(i),j.process(i),i.isProcessing=!1,n&&o&&(c=!1,t(v))};return{schedule:e.stepsOrder.reduce(((e,s)=>{const r=a[s];return e[s]=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n||(n=!0,c=!0,i.isProcessing||t(v)),r.schedule(e,s,o)},e}),{}),cancel:s=>{for(let r=0;r<e.stepsOrder.length;r++)a[e.stepsOrder[r]].cancel(s)},state:i,steps:a}};
2
2
  //# sourceMappingURL=batcher.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"batcher.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/frameloop/batcher.mjs"],"sourcesContent":["import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n"],"names":["scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","stepsOrder","reduce","acc","key","createRenderStep","undefined","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","MotionGlobalConfig","performance","now","Math","max","min","process","schedule","step","keepAlive","arguments","length","immediate","cancel","i"],"mappings":"qOAOM,SACFA,EACAC,GAEA,IAAIC,GAAe,EACfC,GAAoB,EAExB,MAAMC,EAAmB,CACrBC,MAAO,EACPC,UAAW,EACXC,cAAc,GAGZC,EAAmBA,IAAON,GAAe,EAEzCO,EAAQC,EAAUA,WAACC,QAAO,CAACC,EAAKC,KAClCD,EAAIC,GAAOC,EAAgBA,iBACvBN,EACAP,EAAiBY,OAAME,GAEpBH,IACR,CAAW,IAERI,MACFA,EAAKC,KACLA,EAAIC,iBACJA,EAAgBC,UAChBA,EAASC,OACTA,EAAMC,UACNA,EAASC,OACTA,EAAMC,WACNA,GACAd,EAEEe,EAAeA,KACjB,MAAMC,EAAkBC,EAAkBA,mBAACD,gBACrCnB,EAAYmB,EACZrB,EAAME,UACNqB,YAAYC,MAClB1B,GAAe,EAEVuB,IACDrB,EAAMC,MAAQF,EACR,IAAO,GACP0B,KAAKC,IAAID,KAAKE,IAAIzB,EAAYF,EAAME,UA9CnC,IA8C2D,IAGtEF,EAAME,UAAYA,EAClBF,EAAMG,cAAe,EAGrBS,EAAMgB,QAAQ5B,GACda,EAAKe,QAAQ5B,GACbc,EAAiBc,QAAQ5B,GACzBe,EAAUa,QAAQ5B,GAClBgB,EAAOY,QAAQ5B,GACfiB,EAAUW,QAAQ5B,GAClBkB,EAAOU,QAAQ5B,GACfmB,EAAWS,QAAQ5B,GAEnBA,EAAMG,cAAe,EAEjBL,GAAgBD,IAChBE,GAAoB,EACpBH,EAAkBwB,GACtB,EA4BJ,MAAO,CAAES,SAhBQvB,EAAUA,WAACC,QAAO,CAACC,EAAKC,KACrC,MAAMqB,EAAOzB,EAAMI,GAMnB,OALAD,EAAIC,GAAO,SAACmB,GAA0D,IAAxCG,EAASC,UAAAC,OAAA,QAAAtB,IAAAqB,UAAA,IAAAA,UAAA,GAAUE,EAASF,UAAAC,OAAA,QAAAtB,IAAAqB,UAAA,IAAAA,UAAA,GAGtD,OAFKlC,IAXTA,GAAe,EACfC,GAAoB,EAEfC,EAAMG,cACPP,EAAkBwB,IASXU,EAAKD,SAASD,EAASG,EAAWG,IAEtC1B,CAAG,GACX,CAAa,GAQG2B,OANHP,IACZ,IAAK,IAAIQ,EAAI,EAAGA,EAAI9B,EAAAA,WAAW2B,OAAQG,IACnC/B,EAAMC,EAAUA,WAAC8B,IAAID,OAAOP,EAChC,EAGuB5B,QAAOK,QACtC"}
1
+ {"version":3,"file":"batcher.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/frameloop/batcher.mjs"],"sourcesContent":["import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n"],"names":["scheduleNextBatch","allowKeepAlive","runNextFrame","useDefaultElapsed","state","delta","timestamp","isProcessing","flagRunNextFrame","steps","stepsOrder","reduce","acc","key","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","useManualTiming","MotionGlobalConfig","performance","now","Math","max","min","process","schedule","step","keepAlive","arguments","length","undefined","immediate","cancel","i"],"mappings":"qOAOM,SACFA,EACAC,GAEA,IAAIC,GAAe,EACfC,GAAoB,EAExB,MAAMC,EAAmB,CACrBC,MAAO,EACPC,UAAW,EACXC,cAAc,GAGZC,EAAmBA,IAAON,GAAe,EAEzCO,EAAQC,EAAUA,WAACC,QAAO,CAACC,EAAKC,KAClCD,EAAIC,GAAOC,EAAgBA,iBAACN,GACrBI,IACR,CAAW,IAERG,MACFA,EAAKC,KACLA,EAAIC,iBACJA,EAAgBC,UAChBA,EAASC,OACTA,EAAMC,UACNA,EAASC,OACTA,EAAMC,WACNA,GACAb,EAEEc,EAAeA,KACjB,MAAMC,EAAkBC,EAAkBA,mBAACD,gBACrClB,EAAYkB,EACZpB,EAAME,UACNoB,YAAYC,MAClBzB,GAAe,EAEVsB,IACDpB,EAAMC,MAAQF,EACR,IAAO,GACPyB,KAAKC,IAAID,KAAKE,IAAIxB,EAAYF,EAAME,UA3CnC,IA2C2D,IAGtEF,EAAME,UAAYA,EAClBF,EAAMG,cAAe,EAGrBQ,EAAMgB,QAAQ3B,GACdY,EAAKe,QAAQ3B,GACba,EAAiBc,QAAQ3B,GACzBc,EAAUa,QAAQ3B,GAClBe,EAAOY,QAAQ3B,GACfgB,EAAUW,QAAQ3B,GAClBiB,EAAOU,QAAQ3B,GACfkB,EAAWS,QAAQ3B,GAEnBA,EAAMG,cAAe,EAEjBL,GAAgBD,IAChBE,GAAoB,EACpBH,EAAkBuB,GACtB,EA4BJ,MAAO,CAAES,SAhBQtB,EAAUA,WAACC,QAAO,CAACC,EAAKC,KACrC,MAAMoB,EAAOxB,EAAMI,GAMnB,OALAD,EAAIC,GAAO,SAACkB,GAA0D,IAAxCG,EAASC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAAUG,EAASH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GAGtD,OAFKjC,IAXTA,GAAe,EACfC,GAAoB,EAEfC,EAAMG,cACPP,EAAkBuB,IASXU,EAAKD,SAASD,EAASG,EAAWI,IAEtC1B,CAAG,GACX,CAAa,GAQG2B,OANHR,IACZ,IAAK,IAAIS,EAAI,EAAGA,EAAI9B,EAAAA,WAAW0B,OAAQI,IACnC/B,EAAMC,EAAUA,WAAC8B,IAAID,OAAOR,EAChC,EAGuB3B,QAAOK,QACtC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../stats/buffer.mjs.js");exports.createRenderStep=function(t,s){let r=new Set,n=new Set,o=!1,c=!1;const a=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1},l=0;function d(e){a.has(e)&&(f.schedule(e),t()),l++,e(u)}const f={schedule:function(e){const t=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&o?r:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),t.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:t=>{if(u=t,o)return void(c=!0);o=!0;const a=r;r=n,n=a,r.forEach(d),s&&e.statsBuffer.value&&e.statsBuffer.value.frameloop[s].push(l),l=0,r.clear(),o=!1,c&&(c=!1,f.process(t))}};return f};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createRenderStep=function(e){let t=new Set,n=new Set,s=!1,c=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function d(t){o.has(t)&&(l.schedule(t),e()),t(r)}const l={schedule:function(e){const c=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&s?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&o.add(e),c.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(r=e,s)return void(c=!0);s=!0;const o=t;t=n,n=o,t.forEach(d),t.clear(),s=!1,c&&(c=!1,l.process(e))}};return l};
2
2
  //# sourceMappingURL=render-step.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-step.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/frameloop/render-step.mjs"],"sourcesContent":["import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n"],"names":["runNextFrame","stepName","thisFrame","Set","nextFrame","isProcessing","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","delta","timestamp","numCalls","triggerCallback","callback","has","step","schedule","queue","arguments","length","undefined","add","cancel","delete","process","frameData","prevFrame","forEach","statsBuffer","value","frameloop","push","clear"],"mappings":"qIAIM,SACFA,EACAC,GAMA,IAAIC,EAAY,IAAIC,IAChBC,EAAY,IAAID,IAMhBE,GAAe,EAEfC,GAAiB,EAKrB,MAAMC,EAAc,IAAIC,QAExB,IAAIC,EAA6B,CAC7BC,MAAO,EACPC,UAAW,EACXN,cAAc,GAGdO,EAAW,EAEf,SAASC,EAAgBC,GACjBP,EAAYQ,IAAID,KAChBE,EAAKC,SAASH,GACdd,KAGJY,IACAE,EAASL,EACb,CAEA,MAAMO,EAAa,CAIfC,SAAU,SAACH,GACP,MACMI,EAFuCC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,IACNd,EACLH,EAAYE,EAM9C,OAR0Be,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,IAIXZ,EAAYe,IAAIR,GAE/BI,EAAMI,IAAIR,GAEHA,CACV,EAKDS,OAAST,IACLV,EAAUoB,OAAOV,GACjBP,EAAYiB,OAAOV,EAAS,EAMhCW,QAAUC,IAQN,GAPAjB,EAAkBiB,EAOdrB,EAEA,YADAC,GAAiB,GAIrBD,GAAe,EAGf,MAAMsB,EAAYzB,EAClBA,EAAYE,EACZA,EAAYuB,EAGZzB,EAAU0B,QAAQf,GAKdZ,GAAY4B,EAAWA,YAACC,OACxBD,EAAWA,YAACC,MAAMC,UAAU9B,GAAU+B,KAAKpB,GAE/CA,EAAW,EAIXV,EAAU+B,QAEV5B,GAAe,EAEXC,IACAA,GAAiB,EACjBU,EAAKS,QAAQC,GACjB,GAIR,OAAOV,CACX"}
1
+ {"version":3,"file":"render-step.mjs.js","sources":["../../../../../../node_modules/motion-dom/dist/es/frameloop/render-step.mjs"],"sourcesContent":["function createRenderStep(runNextFrame) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n"],"names":["runNextFrame","thisFrame","Set","nextFrame","isProcessing","flushNextFrame","toKeepAlive","WeakSet","latestFrameData","delta","timestamp","triggerCallback","callback","has","step","schedule","queue","arguments","length","undefined","add","cancel","delete","process","frameData","prevFrame","forEach","clear"],"mappings":"6FAEM,SAA2BA,GAK7B,IAAIC,EAAY,IAAIC,IAChBC,EAAY,IAAID,IAMhBE,GAAe,EAEfC,GAAiB,EAKrB,MAAMC,EAAc,IAAIC,QAExB,IAAIC,EAA6B,CAC7BC,MAAO,EACPC,UAAW,EACXN,cAAc,GAGlB,SAASO,EAAgBC,GACjBN,EAAYO,IAAID,KAChBE,EAAKC,SAASH,GACdZ,KAGJY,EAASJ,EACb,CAEA,MAAMM,EAAa,CAIfC,SAAU,SAACH,GACP,MACMI,EAFuCC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,IACNb,EACLH,EAAYE,EAM9C,OAR0Bc,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,IAIXX,EAAYc,IAAIR,GAE/BI,EAAMI,IAAIR,GAEHA,CACV,EAKDS,OAAST,IACLT,EAAUmB,OAAOV,GACjBN,EAAYgB,OAAOV,EAAS,EAMhCW,QAAUC,IAQN,GAPAhB,EAAkBgB,EAOdpB,EAEA,YADAC,GAAiB,GAIrBD,GAAe,EAGf,MAAMqB,EAAYxB,EAClBA,EAAYE,EACZA,EAAYsB,EAGZxB,EAAUyB,QAAQf,GAIlBV,EAAU0B,QAEVvB,GAAe,EAEXC,IACAA,GAAiB,EACjBS,EAAKS,QAAQC,GACjB,GAIR,OAAOV,CACX"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/is-html-element.mjs.js"),s=require("../drag/state/is-active.mjs.js"),t=require("../utils/is-node-or-child.mjs.js"),r=require("../utils/is-primary-pointer.mjs.js"),i=require("../utils/setup.mjs.js"),n=require("./utils/is-keyboard-accessible.mjs.js"),o=require("./utils/keyboard.mjs.js"),a=require("./utils/state.mjs.js");function u(e){return r.isPrimaryPointer(e)&&!s.isDragActive()}const d=new WeakSet;exports.press=function(s,r){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const[c,p,j]=i.setupGesture(s,l),m=e=>{const s=e.currentTarget;if(!u(e))return;if(d.has(e))return;a.isPressing.add(s),l.stopPropagation&&d.add(e);const i=r(s,e),n=(e,t)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",c),a.isPressing.has(s)&&a.isPressing.delete(s),u(e)&&"function"==typeof i&&i(e,{success:t})},o=e=>{n(e,s===window||s===document||l.useGlobalTarget||t.isNodeOrChild(s,e.target))},c=e=>{n(e,!1)};window.addEventListener("pointerup",o,p),window.addEventListener("pointercancel",c,p)};return c.forEach((s=>{(l.useGlobalTarget?window:s).addEventListener("pointerdown",m,p),e.isHTMLElement(s)&&(s.addEventListener("focus",(e=>o.enableKeyboardPress(e,p))),n.isElementKeyboardAccessible(s)||s.hasAttribute("tabindex")||(s.tabIndex=0))})),j};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/is-html-element.mjs.js"),s=require("../drag/state/is-active.mjs.js"),t=require("../utils/is-node-or-child.mjs.js"),r=require("../utils/is-primary-pointer.mjs.js"),i=require("../utils/setup.mjs.js"),n=require("./utils/is-keyboard-accessible.mjs.js"),o=require("./utils/keyboard.mjs.js"),a=require("./utils/state.mjs.js");function u(e){return r.isPrimaryPointer(e)&&!s.isDragActive()}const d=new WeakSet;exports.press=function(s,r){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const[l,p,j]=i.setupGesture(s,c),m=e=>{const s=e.currentTarget;if(!u(e))return;if(d.has(e))return;a.isPressing.add(s),c.stopPropagation&&d.add(e);const i=r(s,e),n={...p,capture:!0},o=(e,t)=>{window.removeEventListener("pointerup",l,n),window.removeEventListener("pointercancel",j,n),a.isPressing.has(s)&&a.isPressing.delete(s),u(e)&&"function"==typeof i&&i(e,{success:t})},l=e=>{o(e,s===window||s===document||c.useGlobalTarget||t.isNodeOrChild(s,e.target))},j=e=>{o(e,!1)};window.addEventListener("pointerup",l,n),window.addEventListener("pointercancel",j,n)};return l.forEach((s=>{(c.useGlobalTarget?window:s).addEventListener("pointerdown",m,p),e.isHTMLElement(s)&&(s.addEventListener("focus",(e=>o.enableKeyboardPress(e,p))),n.isElementKeyboardAccessible(s)||s.hasAttribute("tabindex")||(s.tabIndex=0))})),j};
2
2
  //# sourceMappingURL=index.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/gestures/press/index.mjs"],"sourcesContent":["import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\nconst claimedPointerDownEvents = new WeakSet();\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n if (claimedPointerDownEvents.has(startEvent))\n return;\n isPressing.add(target);\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent);\n }\n const onPressEnd = onPressStart(target, startEvent);\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerCancel);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n//# sourceMappingURL=index.mjs.map\n"],"names":["isValidPressEvent","event","isPrimaryPointer","isDragActive","claimedPointerDownEvents","WeakSet","targetOrSelector","onPressStart","options","arguments","length","undefined","targets","eventOptions","cancelEvents","setupGesture","startPress","startEvent","target","currentTarget","has","isPressing","add","stopPropagation","onPressEnd","onPointerEnd","endEvent","success","window","removeEventListener","onPointerUp","onPointerCancel","delete","upEvent","document","useGlobalTarget","isNodeOrChild","cancelEvent","addEventListener","forEach","isHTMLElement","enableKeyboardPress","isElementKeyboardAccessible","hasAttribute","tabIndex"],"mappings":"+ZAgBA,SAASA,EAAkBC,GACvB,OAAOC,mBAAiBD,KAAWE,EAAYA,cACnD,CAEA,MAAMC,EAA2B,IAAIC,sBA0B/B,SACFC,EACAC,GACiC,IAAjCC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAA+B,CAAA,EAE/B,MAAOG,EAASC,EAAcC,GAAgBC,eAC1CT,EACAE,GAGEQ,EAAcC,IAChB,MAAMC,EAASD,EAAWE,cAE1B,IAAKnB,EAAkBiB,GAAa,OACpC,GAAIb,EAAyBgB,IAAIH,GAAa,OAE9CI,aAAWC,IAAIJ,GAEXV,EAAQe,iBACRnB,EAAyBkB,IAAIL,GAGjC,MAAMO,EAAajB,EAAaW,EAAQD,GAElCQ,EAAeA,CAACC,EAAwBC,KAC1CC,OAAOC,oBAAoB,YAAaC,GACxCF,OAAOC,oBAAoB,gBAAiBE,GAExCV,EAAUA,WAACD,IAAIF,IACfG,aAAWW,OAAOd,GAGjBlB,EAAkB0B,IAIG,mBAAfF,GACPA,EAAWE,EAAU,CAAEC,WAC3B,EAGEG,EAAeG,IACjBR,EACIQ,EACCf,IAAmBU,QACfV,IAAmBgB,UACpB1B,EAAQ2B,iBACRC,EAAAA,cAAclB,EAAQe,EAAQf,QACrC,EAGCa,EAAmBM,IACrBZ,EAAaY,GAAa,EAAM,EAGpCT,OAAOU,iBAAiB,YAAaR,EAAajB,GAClDe,OAAOU,iBAAiB,gBAAiBP,EAAiBlB,EAAa,EAyB3E,OAtBAD,EAAQ2B,SAASrB,KACaV,EAAQ2B,gBAAkBP,OAASV,GAC3CoB,iBACd,cACAtB,EACAH,GAGA2B,EAAAA,cAActB,KACdA,EAAOoB,iBAAiB,SAAUrC,GAC9BwC,EAAAA,oBAAoBxC,EAAqBY,KAIxC6B,EAA2BA,4BAACxB,IAC5BA,EAAOyB,aAAa,cAErBzB,EAAO0B,SAAW,GAE1B,IAGG9B,CACX"}
1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/gestures/press/index.mjs"],"sourcesContent":["import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\nconst claimedPointerDownEvents = new WeakSet();\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n if (claimedPointerDownEvents.has(startEvent))\n return;\n isPressing.add(target);\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent);\n }\n const onPressEnd = onPressStart(target, startEvent);\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true };\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.removeEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n//# sourceMappingURL=index.mjs.map\n"],"names":["isValidPressEvent","event","isPrimaryPointer","isDragActive","claimedPointerDownEvents","WeakSet","targetOrSelector","onPressStart","options","arguments","length","undefined","targets","eventOptions","cancelEvents","setupGesture","startPress","startEvent","target","currentTarget","has","isPressing","add","stopPropagation","onPressEnd","endEventOptions","capture","onPointerEnd","endEvent","success","window","removeEventListener","onPointerUp","onPointerCancel","delete","upEvent","document","useGlobalTarget","isNodeOrChild","cancelEvent","addEventListener","forEach","isHTMLElement","enableKeyboardPress","isElementKeyboardAccessible","hasAttribute","tabIndex"],"mapp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hC,CACX"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../utils/mix/number.mjs.js"),e=require("../../value/types/numbers/units.mjs.js"),r=require("../../../../../motion-utils/dist/es/easing/circ.mjs.js"),o=require("../../../../../motion-utils/dist/es/progress.mjs.js"),i=require("../../../../../motion-utils/dist/es/noop.mjs.js");const s=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],u=s.length,n=t=>"string"==typeof t?parseFloat(t):t,a=t=>"number"==typeof t||e.px.test(t);function m(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const p=d(0,.5,r.circOut),c=d(.5,.95,i.noop);function d(t,e,r){return i=>i<t?0:i>e?1:r(o.progress(t,e,i))}exports.mixValues=function(r,o,i,d,b,l){b?(r.opacity=t.mixNumber(0,i.opacity??1,p(d)),r.opacityExit=t.mixNumber(o.opacity??1,0,c(d))):l&&(r.opacity=t.mixNumber(o.opacity??1,i.opacity??1,d));for(let p=0;p<u;p++){const u=s[p];let c=m(o,u),b=m(i,u);if(void 0===c&&void 0===b)continue;c||(c=0),b||(b=0);0===c||0===b||a(c)===a(b)?(r[u]=Math.max(t.mixNumber(n(c),n(b),d),0),(e.percent.test(b)||e.percent.test(c))&&(r[u]+="%")):r[u]=b}(o.rotate||i.rotate)&&(r.rotate=t.mixNumber(o.rotate||0,i.rotate||0,d))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/mix/number.mjs.js"),t=require("../../value/types/numbers/units.mjs.js"),r=require("../../utils/border-radius.mjs.js"),i=require("../../../../../motion-utils/dist/es/easing/circ.mjs.js"),s=require("../../../../../motion-utils/dist/es/progress.mjs.js"),o=require("../../../../../motion-utils/dist/es/noop.mjs.js");const u=r.cornerRadiusProps.length,n=e=>"string"==typeof e?parseFloat(e):e,a=e=>"number"==typeof e||t.px.test(e);function m(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const c=d(0,.5,i.circOut),p=d(.5,.95,o.noop);function d(e,t,r){return i=>i<e?0:i>t?1:r(s.progress(e,t,i))}exports.mixValues=function(i,s,o,d,j,l){j?(i.opacity=e.mixNumber(0,o.opacity??1,c(d)),i.opacityExit=e.mixNumber(s.opacity??1,0,p(d))):l&&(i.opacity=e.mixNumber(s.opacity??1,o.opacity??1,d));for(let c=0;c<u;c++){const u=r.cornerRadiusProps[c];let p=m(s,u),j=m(o,u);if(void 0===p&&void 0===j)continue;p||(p=0),j||(j=0);0===p||0===j||a(p)===a(j)?(i[u]=Math.max(e.mixNumber(n(p),n(j),d),0),(t.percent.test(j)||t.percent.test(p))&&(i[u]+="%")):i[u]=j}(s.rotate||o.rotate)&&(i.rotate=e.mixNumber(s.rotate||0,o.rotate||0,d))};
2
2
  //# sourceMappingURL=mix-values.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mix-values.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs"],"sourcesContent":["import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\nimport { progress, circOut, noop } from 'motion-utils';\n\nconst borderLabels = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n];\nconst numBorders = borderLabels.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = borderLabels[i];\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n//# sourceMappingURL=mix-values.mjs.map\n"],"names":["borderLabels","numBorders","length","asNumber","value","parseFloat","isPx","px","test","getRadius","values","radiusName","undefined","borderRadius","easeCrossfadeIn","compress","circOut","easeCrossfadeOut","noop","min","max","easing","p","calcProgress","target","follow","lead","progress","shouldCrossfadeOpacity","isOnlyMember","opacity","mixNumber","opacityExit","i","borderLabel","followRadius","leadRadius","Math","percent","rotate"],"mappings":"yWAWA,MAAMA,EAAe,CACjB,sBACA,uBACA,yBACA,2BAEEC,EAAaD,EAAaE,OAE1BC,EAAYC,GACG,iBAAVA,EAAqBC,WAAWD,GAASA,EAE9CE,EAAQF,GACO,iBAAVA,GAAsBG,KAAGC,KAAKJ,GA6EzC,SAASK,EAAUC,EAAwBC,GACvC,YAA8BC,IAAvBF,EAAOC,GACRD,EAAOC,GACPD,EAAOG,YACjB,CAEA,MAAMC,EAAgCC,EAAS,EAAG,GAAKC,EAAOA,SACxDC,EAAiCF,EAAS,GAAK,IAAMG,EAAIA,MAE/D,SAASH,EACLI,EACAC,EACAC,GAEA,OAAQC,GAEAA,EAAIH,EAAY,EAChBG,EAAIF,EAAY,EACbC,EAAOE,EAAAA,SAAaJ,EAAKC,EAAKE,GAE7C,mBA/FM,SACFE,EACAC,EACAC,EACAC,EACAC,EACAC,GAEID,GACAJ,EAAOM,QAAUC,EAASA,UACtB,EACCL,EAAKI,SAAsB,EAC5BhB,EAAgBa,IAEpBH,EAAOQ,YAAcD,EAASA,UACzBN,EAAOK,SAAsB,EAC9B,EACAb,EAAiBU,KAEdE,IACPL,EAAOM,QAAUC,YACZN,EAAOK,SAAsB,EAC7BJ,EAAKI,SAAsB,EAC5BH,IAOR,IAAK,IAAIM,EAAI,EAAGA,EAAIhC,EAAYgC,IAAK,CACjC,MAAMC,EAAclC,EAAaiC,GACjC,IAAIE,EAAe1B,EAAUgB,EAAQS,GACjCE,EAAa3B,EAAUiB,EAAMQ,GAEjC,QAAqBtB,IAAjBuB,QAA6CvB,IAAfwB,EAA0B,SAE5DD,IAAAA,EAAiB,GACjBC,IAAAA,EAAe,GAGM,IAAjBD,GACe,IAAfC,GACA9B,EAAK6B,KAAkB7B,EAAK8B,IAG5BZ,EAAOU,GAAeG,KAAKjB,IACvBW,EAASA,UACL5B,EAASgC,GACThC,EAASiC,GACTT,GAEJ,IAGAW,EAAAA,QAAQ9B,KAAK4B,IAAeE,EAAAA,QAAQ9B,KAAK2B,MACzCX,EAAOU,IAAgB,MAG3BV,EAAOU,GAAeE,CAE9B,EAKIX,EAAOc,QAAUb,EAAKa,UACtBf,EAAOe,OAASR,YACXN,EAAOc,QAAqB,EAC5Bb,EAAKa,QAAqB,EAC3BZ,GAGZ"}
1
+ {"version":3,"file":"mix-values.mjs.js","sources":["../../../../../../../node_modules/motion-dom/dist/es/projection/animation/mix-values.mjs"],"sourcesContent":["import { mixNumber } from '../../utils/mix/number.mjs';\nimport { percent, px } from '../../value/types/numbers/units.mjs';\nimport { progress, circOut, noop } from 'motion-utils';\nimport { cornerRadiusProps } from '../../utils/border-radius.mjs';\n\nconst numBorders = cornerRadiusProps.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i];\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n//# sourceMappingURL=mix-values.mjs.map\n"],"names":["numBorders","cornerRadiusProps","length","asNumber","value","parseFloat","isPx","px","test","getRadius","values","radiusName","undefined","borderRadius","easeCrossfadeIn","compress","circOut","easeCrossfadeOut","noop","min","max","easing","p","calcProgress","target","follow","lead","progress","shouldCrossfadeOpacity","isOnlyMember","opacity","mixNumber","opacityExit","i","borderLabel","followRadius","leadRadius","Math","percent","rotate"],"mappings":"uZAYA,MAAMA,EAAaC,EAAiBA,kBAACC,OAE/BC,EAAYC,GACG,iBAAVA,EAAqBC,WAAWD,GAASA,EAE9CE,EAAQF,GACO,iBAAVA,GAAsBG,KAAGC,KAAKJ,GA6EzC,SAASK,EAAUC,EAAwBC,GACvC,YAA8BC,IAAvBF,EAAOC,GACRD,EAAOC,GACPD,EAAOG,YACjB,CAEA,MAAMC,EAAgCC,EAAS,EAAG,GAAKC,EAAOA,SACxDC,EAAiCF,EAAS,GAAK,IAAMG,EAAIA,MAE/D,SAASH,EACLI,EACAC,EACAC,GAEA,OAAQC,GAEAA,EAAIH,EAAY,EAChBG,EAAIF,EAAY,EACbC,EAAOE,EAAAA,SAAaJ,EAAKC,EAAKE,GAE7C,mBA/FM,SACFE,EACAC,EACAC,EACAC,EACAC,EACAC,GAEID,GACAJ,EAAOM,QAAUC,EAASA,UACtB,EACCL,EAAKI,SAAsB,EAC5BhB,EAAgBa,IAEpBH,EAAOQ,YAAcD,EAASA,UACzBN,EAAOK,SAAsB,EAC9B,EACAb,EAAiBU,KAEdE,IACPL,EAAOM,QAAUC,YACZN,EAAOK,SAAsB,EAC7BJ,EAAKI,SAAsB,EAC5BH,IAOR,IAAK,IAAIM,EAAI,EAAGA,EAAIjC,EAAYiC,IAAK,CACjC,MAAMC,EAAcjC,oBAAkBgC,GACtC,IAAIE,EAAe1B,EAAUgB,EAAQS,GACjCE,EAAa3B,EAAUiB,EAAMQ,GA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