@nethesis/phone-island 1.0.3 → 1.0.5-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/App.js.map +1 -1
  3. package/dist/_virtual/index6.js +1 -1
  4. package/dist/_virtual/index8.js +1 -1
  5. package/dist/components/AudioPlayerView/Progress.js +1 -1
  6. package/dist/components/AudioPlayerView/Progress.js.map +1 -1
  7. package/dist/components/CallView/BackCall.js +1 -1
  8. package/dist/components/CallView/BackCall.js.map +1 -1
  9. package/dist/components/CallView/DisplayNameUtils.js.map +1 -1
  10. package/dist/components/CallView/Number.js +1 -1
  11. package/dist/components/CallView/Number.js.map +1 -1
  12. package/dist/components/CallView/index.js +1 -1
  13. package/dist/components/CallView/index.js.map +1 -1
  14. package/dist/components/SideView/hooks/useSideViewLogic.js.map +1 -1
  15. package/dist/components/Socket.js +1 -1
  16. package/dist/components/Socket.js.map +1 -1
  17. package/dist/components/TextScroll.js.map +1 -1
  18. package/dist/events/SocketEvents.js +1 -1
  19. package/dist/events/SocketEvents.js.map +1 -1
  20. package/dist/index.css +1 -1
  21. package/dist/lib/devices/devices.js +1 -1
  22. package/dist/lib/phone/queue.js +2 -0
  23. package/dist/lib/phone/queue.js.map +1 -0
  24. package/dist/models/currentCall.js +1 -1
  25. package/dist/models/currentCall.js.map +1 -1
  26. package/dist/models/index.js +1 -1
  27. package/dist/models/index.js.map +1 -1
  28. package/dist/models/queue.js +2 -0
  29. package/dist/models/queue.js.map +1 -0
  30. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js +1 -1
  31. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.mjs.js.map +1 -1
  32. package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js +1 -1
  33. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +1 -1
  34. package/dist/node_modules/@headlessui/react/dist/components/label/label.js.map +1 -1
  35. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +1 -1
  36. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js.map +1 -1
  37. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +1 -1
  38. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js.map +1 -1
  39. package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js +1 -1
  40. package/dist/node_modules/@headlessui/react/dist/components/transition/transition.js.map +1 -1
  41. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js +1 -1
  42. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js.map +1 -1
  43. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js +1 -1
  44. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js.map +1 -1
  45. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js +1 -1
  46. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js.map +1 -1
  47. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js +1 -1
  48. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js.map +1 -1
  49. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js +1 -1
  50. package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js.map +1 -1
  51. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +1 -1
  52. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js.map +1 -1
  53. package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js +1 -1
  54. package/dist/node_modules/@headlessui/react/dist/hooks/use-element-size.js.map +1 -1
  55. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +1 -1
  56. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js.map +1 -1
  57. package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js +1 -1
  58. package/dist/node_modules/@headlessui/react/dist/hooks/use-flags.js.map +1 -1
  59. package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js +1 -1
  60. package/dist/node_modules/@headlessui/react/dist/hooks/use-inert-others.js.map +1 -1
  61. package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js +1 -1
  62. package/dist/node_modules/@headlessui/react/dist/hooks/use-owner.js.map +1 -1
  63. package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js +1 -1
  64. package/dist/node_modules/@headlessui/react/dist/hooks/use-quick-release.js.map +1 -1
  65. package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js +1 -1
  66. package/dist/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js.map +1 -1
  67. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +1 -1
  68. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js.map +1 -1
  69. package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js +1 -1
  70. package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js.map +1 -1
  71. package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js +1 -1
  72. package/dist/node_modules/@headlessui/react/dist/hooks/use-tree-walker.js.map +1 -1
  73. package/dist/node_modules/@headlessui/react/dist/internal/floating.js +1 -1
  74. package/dist/node_modules/@headlessui/react/dist/internal/floating.js.map +1 -1
  75. package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js +1 -1
  76. package/dist/node_modules/@headlessui/react/dist/internal/open-closed.js.map +1 -1
  77. package/dist/node_modules/@headlessui/react/dist/machine.js +1 -1
  78. package/dist/node_modules/@headlessui/react/dist/machine.js.map +1 -1
  79. package/dist/node_modules/@headlessui/react/dist/react-glue.js +1 -1
  80. package/dist/node_modules/@headlessui/react/dist/react-glue.js.map +1 -1
  81. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +1 -1
  82. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js.map +1 -1
  83. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +1 -1
  84. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js.map +1 -1
  85. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +1 -1
  86. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js.map +1 -1
  87. package/dist/node_modules/@headlessui/react/dist/utils/match.js +1 -1
  88. package/dist/node_modules/@headlessui/react/dist/utils/match.js.map +1 -1
  89. package/dist/node_modules/@headlessui/react/dist/utils/render.js +1 -1
  90. package/dist/node_modules/@headlessui/react/dist/utils/render.js.map +1 -1
  91. package/dist/node_modules/@headlessui/react/dist/utils/store.js +1 -1
  92. package/dist/node_modules/@headlessui/react/dist/utils/store.js.map +1 -1
  93. package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js +1 -1
  94. package/dist/node_modules/@react-aria/focus/dist/FocusScope.mjs.js.map +1 -1
  95. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js +1 -1
  96. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.mjs.js.map +1 -1
  97. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js +1 -1
  98. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.mjs.js.map +1 -1
  99. package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js +1 -1
  100. package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.mjs.js.map +1 -1
  101. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js +1 -1
  102. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.mjs.js.map +1 -1
  103. package/dist/node_modules/engine.io-client/build/esm/socket.js +1 -1
  104. package/dist/node_modules/engine.io-client/build/esm/socket.js.map +1 -1
  105. package/dist/node_modules/engine.io-client/build/esm/transport.js +1 -1
  106. package/dist/node_modules/engine.io-client/build/esm/transport.js.map +1 -1
  107. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js +1 -1
  108. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js.map +1 -1
  109. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js +1 -1
  110. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js.map +1 -1
  111. package/dist/node_modules/engine.io-client/build/esm/util.js +1 -1
  112. package/dist/node_modules/engine.io-client/build/esm/util.js.map +1 -1
  113. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +1 -1
  114. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +1 -1
  115. package/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs.js +1 -1
  116. package/dist/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs.js.map +1 -1
  117. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs.js +1 -1
  118. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs.js.map +1 -1
  119. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs.js +1 -1
  120. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs.js.map +1 -1
  121. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs.js +1 -1
  122. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs.js.map +1 -1
  123. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs.js +1 -1
  124. package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs.js.map +1 -1
  125. package/dist/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs.js +1 -1
  126. package/dist/node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs.js.map +1 -1
  127. package/dist/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs.js +1 -1
  128. package/dist/node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs.js.map +1 -1
  129. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js +1 -1
  130. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs.js.map +1 -1
  131. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js +1 -1
  132. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs.js.map +1 -1
  133. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js +1 -1
  134. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs.js.map +1 -1
  135. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js +1 -1
  136. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs.js.map +1 -1
  137. package/dist/node_modules/framer-motion/dist/es/events/add-dom-event.mjs.js +1 -1
  138. package/dist/node_modules/framer-motion/dist/es/events/add-dom-event.mjs.js.map +1 -1
  139. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js +1 -1
  140. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs.js.map +1 -1
  141. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js +1 -1
  142. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs.js.map +1 -1
  143. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js +1 -1
  144. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs.js.map +1 -1
  145. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js +1 -1
  146. package/dist/node_modules/framer-motion/dist/es/gestures/press.mjs.js.map +1 -1
  147. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js +1 -1
  148. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs.js.map +1 -1
  149. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js +1 -1
  150. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs.js.map +1 -1
  151. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js +1 -1
  152. package/dist/node_modules/framer-motion/dist/es/motion/index.mjs.js.map +1 -1
  153. package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs.js +1 -1
  154. package/dist/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs.js.map +1 -1
  155. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js +1 -1
  156. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs.js.map +1 -1
  157. package/dist/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs.js +1 -1
  158. package/dist/node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs.js.map +1 -1
  159. package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs.js +1 -1
  160. package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs.js.map +1 -1
  161. package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs.js +1 -1
  162. package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs.js.map +1 -1
  163. package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs.js +1 -1
  164. package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs.js.map +1 -1
  165. package/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs.js +1 -1
  166. package/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs.js.map +1 -1
  167. package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs.js +1 -1
  168. package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs.js.map +1 -1
  169. package/dist/node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs.js +1 -1
  170. package/dist/node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs.js.map +1 -1
  171. package/dist/node_modules/framer-motion/dist/es/render/VisualElement.mjs.js +1 -1
  172. package/dist/node_modules/framer-motion/dist/es/render/VisualElement.mjs.js.map +1 -1
  173. package/dist/node_modules/framer-motion/dist/es/render/components/create-factory.mjs.js +1 -1
  174. package/dist/node_modules/framer-motion/dist/es/render/components/create-factory.mjs.js.map +1 -1
  175. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.js +1 -1
  176. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.mjs.js.map +1 -1
  177. package/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs.js +1 -1
  178. package/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs.js.map +1 -1
  179. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js +1 -1
  180. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.mjs.js.map +1 -1
  181. package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs.js +1 -1
  182. package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs.js.map +1 -1
  183. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js +1 -1
  184. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.mjs.js.map +1 -1
  185. package/dist/node_modules/framer-motion/dist/es/render/html/utils/render.mjs.js +1 -1
  186. package/dist/node_modules/framer-motion/dist/es/render/html/utils/render.mjs.js.map +1 -1
  187. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs.js +1 -1
  188. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs.js.map +1 -1
  189. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs.js +1 -1
  190. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/path.mjs.js.map +1 -1
  191. package/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.mjs.js +1 -1
  192. package/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.mjs.js.map +1 -1
  193. package/dist/node_modules/framer-motion/dist/es/utils/delay.mjs.js +1 -1
  194. package/dist/node_modules/framer-motion/dist/es/utils/delay.mjs.js.map +1 -1
  195. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js +1 -1
  196. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.mjs.js.map +1 -1
  197. package/dist/node_modules/js-base64/base64.mjs.js +1 -1
  198. package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
  199. package/dist/node_modules/mic-check/lib/index.js +1 -1
  200. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js +1 -1
  201. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs.js.map +1 -1
  202. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js +1 -1
  203. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.mjs.js.map +1 -1
  204. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js +1 -1
  205. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs.js.map +1 -1
  206. package/dist/node_modules/motion-dom/dist/es/animation/drivers/driver-frameloop.mjs.js +1 -1
  207. package/dist/node_modules/motion-dom/dist/es/animation/drivers/driver-frameloop.mjs.js.map +1 -1
  208. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js +1 -1
  209. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.mjs.js.map +1 -1
  210. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js +1 -1
  211. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs.js.map +1 -1
  212. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs.js +1 -1
  213. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs.js.map +1 -1
  214. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs.js +1 -1
  215. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs.js.map +1 -1
  216. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js +1 -1
  217. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs.js.map +1 -1
  218. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js +1 -1
  219. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs.js.map +1 -1
  220. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js +1 -1
  221. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs.js.map +1 -1
  222. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js +1 -1
  223. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs.js.map +1 -1
  224. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js +1 -1
  225. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs.js.map +1 -1
  226. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js +1 -1
  227. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs.js.map +1 -1
  228. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js +1 -1
  229. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs.js.map +1 -1
  230. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js +1 -1
  231. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs.js.map +1 -1
  232. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js +1 -1
  233. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs.js.map +1 -1
  234. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js +1 -1
  235. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs.js.map +1 -1
  236. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js +1 -1
  237. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.mjs.js.map +1 -1
  238. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js +1 -1
  239. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.mjs.js.map +1 -1
  240. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js +1 -1
  241. package/dist/node_modules/motion-dom/dist/es/gestures/hover.mjs.js.map +1 -1
  242. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js +1 -1
  243. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.mjs.js.map +1 -1
  244. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js +1 -1
  245. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.mjs.js.map +1 -1
  246. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js +1 -1
  247. package/dist/node_modules/motion-dom/dist/es/value/index.mjs.js.map +1 -1
  248. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js +1 -1
  249. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs.js.map +1 -1
  250. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js +1 -1
  251. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.mjs.js.map +1 -1
  252. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js +1 -1
  253. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.mjs.js.map +1 -1
  254. package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js +1 -1
  255. package/dist/node_modules/motion-utils/dist/es/pipe.mjs.js.map +1 -1
  256. package/dist/node_modules/prop-types/index.js +1 -1
  257. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  258. package/dist/node_modules/react-redux/es/components/Provider.js +1 -1
  259. package/dist/node_modules/react-redux/es/components/Provider.js.map +1 -1
  260. package/dist/node_modules/react-redux/es/hooks/useDispatch.js +1 -1
  261. package/dist/node_modules/react-redux/es/hooks/useDispatch.js.map +1 -1
  262. package/dist/node_modules/react-redux/es/hooks/useSelector.js +1 -1
  263. package/dist/node_modules/react-redux/es/hooks/useSelector.js.map +1 -1
  264. package/dist/node_modules/react-redux/es/hooks/useStore.js +1 -1
  265. package/dist/node_modules/react-redux/es/hooks/useStore.js.map +1 -1
  266. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js +1 -1
  267. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.mjs.js.map +1 -1
  268. package/dist/node_modules/socket.io-client/build/esm/socket.js +1 -1
  269. package/dist/node_modules/socket.io-client/build/esm/socket.js.map +1 -1
  270. package/dist/node_modules/socket.io-client/build/esm/url.js +1 -1
  271. package/dist/node_modules/socket.io-client/build/esm/url.js.map +1 -1
  272. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js +1 -1
  273. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js.map +1 -1
  274. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js +1 -1
  275. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js.map +1 -1
  276. package/dist/package.json.js +1 -1
  277. package/dist/public/locales/en/translation.json.js +1 -1
  278. package/dist/public/locales/it/translation.json.js +1 -1
  279. package/dist/styles/CustomRange.styles.js.map +1 -1
  280. package/dist/styles/Island.styles.js.map +1 -1
  281. package/package.json +1 -1
  282. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.css.js +0 -2
  283. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.css.js.map +0 -1
  284. package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -2
  285. package/dist/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"visual-element-variant.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n const generateStaggerDuration = staggerDirection === 1\n ? (i = 0) => i * staggerChildren\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach((child, i) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delayChildren + generateStaggerDuration(i),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\n\nexport { animateVariant, sortByTreeOrder };\n"],"names":["animateVariant","visualElement","variant","options","resolved","resolveVariant","type","presenceContext","custom","undefined","transition","getDefaultTransition","transitionOverride","getAnimation","Promise","all","animateTarget","resolve","getChildAnimations","variantChildren","size","forwardDelay","delayChildren","staggerChildren","staggerDirection","animations","maxStaggerDuration","generateStaggerDuration","i","Array","from","sort","sortByTreeOrder","forEach","child","notify","push","delay","then","animateChildren","when","first","last","a","b","sortNodePosition"],"mappings":"oLAGA,SAASA,EAAeC,EAAeC,EAASC,EAAU,CAAA,GACtD,MAAMC,EAAWC,EAAAA,eAAeJ,EAAeC,EAA0B,SAAjBC,EAAQG,KAC1DL,EAAcM,iBAAiBC,YAC/BC,GACN,IAAIC,WAAEA,EAAaT,EAAcU,wBAA0B,CAAC,GAAMP,GAAY,CAAA,EAC1ED,EAAQS,qBACRF,EAAaP,EAAQS,oBAMzB,MAAMC,EAAeT,EACf,IAAMU,QAAQC,IAAIC,EAAaA,cAACf,EAAeG,EAAUD,IACzD,IAAMW,QAAQG,UAKdC,EAAqBjB,EAAckB,iBAAmBlB,EAAckB,gBAAgBC,KACpF,CAACC,EAAe,KACd,MAAMC,cAAEA,EAAgB,EAACC,gBAAEA,EAAeC,iBAAEA,GAAsBd,EAClE,OAkBZ,SAAyBT,EAAeC,EAASoB,EAAgB,EAAGC,EAAkB,EAAGC,EAAmB,EAAGrB,GAC3G,MAAMsB,EAAa,GACbC,GAAsBzB,EAAckB,gBAAgBC,KAAO,GAAKG,EAChEI,EAA+C,IAArBH,EAC1B,CAACI,EAAI,IAAMA,EAAIL,EACf,CAACK,EAAI,IAAMF,EAAqBE,EAAIL,EAU1C,OATAM,MAAMC,KAAK7B,EAAckB,iBACpBY,KAAKC,GACLC,SAAQ,CAACC,EAAON,KACjBM,EAAMC,OAAO,iBAAkBjC,GAC/BuB,EAAWW,KAAKpC,EAAekC,EAAOhC,EAAS,IACxCC,EACHkC,MAAOf,EAAgBK,EAAwBC,KAChDU,MAAK,IAAMJ,EAAMC,OAAO,oBAAqBjC,KAAU,IAEvDY,QAAQC,IAAIU,EACvB,CAlCmBc,CAAgBtC,EAAeC,EAASoB,EAAgBD,EAAcE,EAAiBC,EAAkBrB,EAAQ,EAE1H,IAAMW,QAAQG,WAKduB,KAAEA,GAAS9B,EACjB,GAAI8B,EAAM,CACN,MAAOC,EAAOC,GAAiB,mBAATF,EAChB,CAAC3B,EAAcK,GACf,CAACA,EAAoBL,GAC3B,OAAO4B,IAAQH,MAAK,IAAMI,KAC9B,CAEI,OAAO5B,QAAQC,IAAI,CAACF,IAAgBK,EAAmBf,EAAQkC,QAEvE,CAkBA,SAASL,EAAgBW,EAAGC,GACxB,OAAOD,EAAEE,iBAAiBD,EAC9B"}
1
+ {"version":3,"file":"visual-element-variant.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n const generateStaggerDuration = staggerDirection === 1\n ? (i = 0) => i * staggerChildren\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach((child, i) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delayChildren + generateStaggerDuration(i),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\n\nexport { animateVariant, sortByTreeOrder };\n"],"names":["animateVariant","visualElement","variant","options","arguments","length","undefined","resolved","resolveVariant","type","presenceContext","custom","transition","getDefaultTransition","transitionOverride","getAnimation","Promise","all","animateTarget","resolve","getChildAnimations","variantChildren","size","forwardDelay","delayChildren","staggerChildren","staggerDirection","animations","maxStaggerDuration","generateStaggerDuration","Array","from","sort","sortByTreeOrder","forEach","child","i","notify","push","delay","then","animateChildren","when","first","last","a","b","sortNodePosition"],"mappings":"oLAGA,SAASA,EAAeC,EAAeC,GAAuB,IAAdC,EAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EACtD,MAAMG,EAAWC,EAAAA,eAAeP,EAAeC,EAA0B,SAAjBC,EAAQM,KAC1DR,EAAcS,iBAAiBC,YAC/BL,GACN,IAAIM,WAAEA,EAAaX,EAAcY,wBAA0B,CAAC,GAAMN,GAAY,CAAA,EAC1EJ,EAAQW,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AAMa,QAAQG,WAKduB,KAAEA,GAAS9B,EACjB,GAAI8B,EAAM,CACN,MAAOC,EAAOC,GAAiB,mBAATF,EAChB,CAAC3B,EAAcK,GACf,CAACA,EAAoBL,GAC3B,OAAO4B,IAAQH,MAAK,IAAMI,KAC9B,CAEI,OAAO5B,QAAQC,IAAI,CAACF,IAAgBK,EAAmBjB,EAAQoC,QAEvE,CAkBA,SAASN,EAAgBY,EAAGC,GACxB,OAAOD,EAAEE,iBAAiBD,EAC9B"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/resolve-dynamic-variants.mjs.js"),t=require("./visual-element-target.mjs.js"),a=require("./visual-element-variant.mjs.js");exports.animateVisualElement=function(i,r,n={}){let s;if(i.notify("AnimationStart",r),Array.isArray(r)){const e=r.map((e=>a.animateVariant(i,e,n)));s=Promise.all(e)}else if("string"==typeof r)s=a.animateVariant(i,r,n);else{const a="function"==typeof r?e.resolveVariant(i,r,n.custom):r;s=Promise.all(t.animateTarget(i,a,n))}return s.then((()=>{i.notify("AnimationComplete",r)}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../render/utils/resolve-dynamic-variants.mjs.js"),t=require("./visual-element-target.mjs.js"),a=require("./visual-element-variant.mjs.js");exports.animateVisualElement=function(i,r){let n,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i.notify("AnimationStart",r),Array.isArray(r)){const e=r.map((e=>a.animateVariant(i,e,s)));n=Promise.all(e)}else if("string"==typeof r)n=a.animateVariant(i,r,s);else{const a="function"==typeof r?e.resolveVariant(i,r,s.custom):r;n=Promise.all(t.animateTarget(i,a,s))}return n.then((()=>{i.notify("AnimationComplete",r)}))};
2
2
  //# sourceMappingURL=visual-element.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual-element.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n"],"names":["visualElement","definition","options","animation","notify","Array","isArray","animations","map","variant","animateVariant","Promise","all","resolvedDefinition","resolveVariant","custom","animateTarget","then"],"mappings":"8PAIA,SAA8BA,EAAeC,EAAYC,EAAU,CAAA,GAE/D,IAAIC,EACJ,GAFAH,EAAcI,OAAO,iBAAkBH,GAEnCI,MAAMC,QAAQL,GAAa,CAC3B,MAAMM,EAAaN,EAAWO,KAAKC,GAAYC,EAAcA,eAACV,EAAeS,EAASP,KACtFC,EAAYQ,QAAQC,IAAIL,EAC5B,MACK,GAA0B,iBAAfN,EACZE,EAAYO,EAAAA,eAAeV,EAAeC,EAAYC,OAErD,CACD,MAAMW,EAA2C,mBAAfZ,EAC5Ba,EAAcA,eAACd,EAAeC,EAAYC,EAAQa,QAClDd,EACNE,EAAYQ,QAAQC,IAAII,EAAAA,cAAchB,EAAea,EAAoBX,GAC7E,CACA,OAAOC,EAAUc,MAAK,KAClBjB,EAAcI,OAAO,oBAAqBH,EAAW,GAE7D"}
1
+ {"version":3,"file":"visual-element.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n"],"names":["visualElement","definition","animation","options","arguments","length","undefined","notify","Array","isArray","animations","map","variant","animateVariant","Promise","all","resolvedDefinition","resolveVariant","custom","animateTarget","then"],"mappings":"8PAIA,SAA8BA,EAAeC,GAA0B,IAE/DC,EAFiDC,EAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EAG/D,GAFAJ,EAAcO,OAAO,iBAAkBN,GAEnCO,MAAMC,QAAQR,GAAa,CAC3B,MAAMS,EAAaT,EAAWU,KAAKC,GAAYC,EAAcA,eAACb,EAAeY,EAAST,KACtFD,EAAYY,QAAQC,IAAIL,EAC5B,MACK,GAA0B,iBAAfT,EACZC,EAAYW,EAAAA,eAAeb,EAAeC,EAAYE,OAErD,CACD,MAAMa,EAA2C,mBAAff,EAC5BgB,EAAcA,eAACjB,EAAeC,EAAYE,EAAQe,QAClDjB,EACNC,EAAYY,QAAQC,IAAII,EAAAA,cAAcnB,EAAegB,EAAoBb,GAC7E,CACA,OAAOD,EAAUkB,MAAK,KAClBpB,EAAcO,OAAO,oBAAqBN,EAAW,GAE7D"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../motion-dom/dist/es/render/utils/keys-transform.mjs.js");const s={type:"spring",stiffness:500,damping:25,restSpeed:10},t={type:"keyframes",duration:.8},r={type:"keyframes",ease:[.25,.1,.35,1],duration:.3};exports.getDefaultTransition=(a,{keyframes:i})=>i.length>2?t:e.transformProps.has(a)?a.startsWith("scale")?{type:"spring",stiffness:550,damping:0===i[1]?2*Math.sqrt(550):30,restSpeed:10}:s:r;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../motion-dom/dist/es/render/utils/keys-transform.mjs.js");const s={type:"spring",stiffness:500,damping:25,restSpeed:10},t={type:"keyframes",duration:.8},r={type:"keyframes",ease:[.25,.1,.35,1],duration:.3};exports.getDefaultTransition=(a,n)=>{let{keyframes:i}=n;return i.length>2?t:e.transformProps.has(a)?a.startsWith("scale")?{type:"spring",stiffness:550,damping:0===i[1]?2*Math.sqrt(550):30,restSpeed:10}:s:r};
2
2
  //# sourceMappingURL=default-transitions.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-transitions.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs"],"sourcesContent":["import { transformProps } from 'motion-dom';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n"],"names":["underDampedSpring","type","stiffness","damping","restSpeed","keyframesTransition","duration","ease","getDefaultTransition","valueKey","keyframes","length","transformProps","has","startsWith","Math","sqrt"],"mappings":"0JAEA,MAAMA,EAAoB,CACtBC,KAAM,SACNC,UAAW,IACXC,QAAS,GACTC,UAAW,IAQTC,EAAsB,CACxBJ,KAAM,YACNK,SAAU,IAMRC,EAAO,CACTN,KAAM,YACNM,KAAM,CAAC,IAAM,GAAK,IAAM,GACxBD,SAAU,iCAEeE,CAACC,GAAYC,eAClCA,EAAUC,OAAS,EACZN,EAEFO,EAAcA,eAACC,IAAIJ,GACjBA,EAASK,WAAW,SAxBS,CACxCb,KAAM,SACNC,UAAW,IACXC,QAAoB,IAsBaO,EAAU,GAtBnB,EAAIK,KAAKC,KAAK,KAAO,GAC7CZ,UAAW,IAsBDJ,EAEHO"}
1
+ {"version":3,"file":"default-transitions.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs"],"sourcesContent":["import { transformProps } from 'motion-dom';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n"],"names":["underDampedSpring","type","stiffness","damping","restSpeed","keyframesTransition","duration","ease","getDefaultTransition","valueKey","_ref","keyframes","length","transformProps","has","startsWith","Math","sqrt"],"mappings":"0JAEA,MAAMA,EAAoB,CACtBC,KAAM,SACNC,UAAW,IACXC,QAAS,GACTC,UAAW,IAQTC,EAAsB,CACxBJ,KAAM,YACNK,SAAU,IAMRC,EAAO,CACTN,KAAM,YACNM,KAAM,CAAC,IAAM,GAAK,IAAM,GACxBD,SAAU,iCAEeE,CAACC,EAAQC,KAAoB,IAAlBC,UAAEA,GAAWD,EACjD,OAAIC,EAAUC,OAAS,EACZP,EAEFQ,EAAcA,eAACC,IAAIL,GACjBA,EAASM,WAAW,SAxBS,CACxCd,KAAM,SACNC,UAAW,IACXC,QAAoB,IAsBaQ,EAAU,GAtBnB,EAAIK,KAAKC,KAAK,KAAO,GAC7Cb,UAAW,IAsBDJ,EAEHO,CAAI"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isTransitionDefined=function({when:e,delay:r,delayChildren:t,staggerChildren:n,staggerDirection:a,repeat:i,repeatType:s,repeatDelay:l,from:d,elapsed:o,...p}){return!!Object.keys(p).length};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isTransitionDefined=function(e){let{when:t,delay:r,delayChildren:n,staggerChildren:a,staggerDirection:i,repeat:s,repeatType:l,repeatDelay:d,from:o,elapsed:p,...y}=e;return!!Object.keys(y).length};
2
2
  //# sourceMappingURL=is-transition-defined.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-transition-defined.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs"],"sourcesContent":["/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n\nexport { isTransitionDefined };\n"],"names":["when","delay","_delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","transition","Object","keys","length"],"mappings":"gGAKA,UAA6BA,KAAEA,EAAMC,MAAOC,EAAMC,cAAEA,EAAaC,gBAAEA,EAAeC,iBAAEA,EAAgBC,OAAEA,EAAMC,WAAEA,EAAUC,YAAEA,EAAWC,KAAEA,EAAIC,QAAEA,KAAYC,IACrJ,QAASC,OAAOC,KAAKF,GAAYG,MACrC"}
1
+ {"version":3,"file":"is-transition-defined.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs"],"sourcesContent":["/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nfunction isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {\n return !!Object.keys(transition).length;\n}\n\nexport { isTransitionDefined };\n"],"names":["_ref","when","delay","_delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","transition","Object","keys","length"],"mappings":"gGAKA,SAA4BA,GAA2I,IAA1IC,KAAEA,EAAMC,MAAOC,EAAMC,cAAEA,EAAaC,gBAAEA,EAAeC,iBAAEA,EAAgBC,OAAEA,EAAMC,WAAEA,EAAUC,YAAEA,EAAWC,KAAEA,EAAIC,QAAEA,KAAYC,GAAYZ,EACjK,QAASa,OAAOC,KAAKF,GAAYG,MACrC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../react/jsx-runtime.js");var e=require("react"),t=require("../../context/MotionConfigContext.mjs.js"),n=require("../../../../../../_virtual/jsx-runtime.js");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=r(e);class i extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=e instanceof HTMLElement&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}exports.PopChild=function({children:r,isPresent:s,anchorX:f}){const c=e.useId(),u=e.useRef(null),p=e.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:h}=e.useContext(t.MotionConfigContext);return e.useInsertionEffect((()=>{const{width:e,height:t,top:n,left:r,right:o}=p.current;if(s||!u.current||!e||!t)return;const i="left"===f?`left: ${r}`:`right: ${o}`;u.current.dataset.motionPopId=c;const d=document.createElement("style");return h&&(d.nonce=h),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`\n [data-motion-pop-id="${c}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n ${i}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.removeChild(d)}}),[s]),n.exports.jsx(i,{isPresent:s,childRef:u,sizeRef:p,children:o.cloneElement(r,{ref:u})})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../react/jsx-runtime.js");var e=require("react"),t=require("../../context/MotionConfigContext.mjs.js"),n=require("../../../../../../_virtual/jsx-runtime.js");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=r(e);class i extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=e instanceof HTMLElement&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}exports.PopChild=function(r){let{children:s,isPresent:f,anchorX:c}=r;const u=e.useId(),p=e.useRef(null),h=e.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:d}=e.useContext(t.MotionConfigContext);return e.useInsertionEffect((()=>{const{width:e,height:t,top:n,left:r,right:o}=h.current;if(f||!p.current||!e||!t)return;const i="left"===c?`left: ${r}`:`right: ${o}`;p.current.dataset.motionPopId=u;const s=document.createElement("style");return d&&(s.nonce=d),document.head.appendChild(s),s.sheet&&s.sheet.insertRule(`\n [data-motion-pop-id="${u}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n ${i}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.removeChild(s)}}),[f]),n.exports.jsx(i,{isPresent:f,childRef:p,sizeRef:h,children:o.cloneElement(s,{ref:p})})};
2
2
  //# sourceMappingURL=PopChild.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopChild.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const parent = element.offsetParent;\n const parentWidth = parent instanceof HTMLElement ? parent.offsetWidth || 0 : 0;\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n size.right = parentWidth - size.width - size.left;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent, anchorX }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n top: ${top}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n"],"names":["PopChildMeasure","React","Component","getSnapshotBeforeUpdate","prevProps","element","this","props","childRef","current","isPresent","parent","offsetParent","parentWidth","HTMLElement","offsetWidth","size","sizeRef","height","offsetHeight","width","top","offsetTop","left","offsetLeft","right","componentDidUpdate","render","children","anchorX","id","useId","ref","useRef","nonce","useContext","MotionConfigContext","useInsertionEffect","x","dataset","motionPopId","style","document","createElement","head","appendChild","sheet","insertRule","removeChild","jsx","cloneElement"],"mappings":"iiBAUA,MAAMA,UAAwBC,EAAMC,UAChCC,uBAAAA,CAAwBC,GACpB,MAAMC,EAAUC,KAAKC,MAAMC,SAASC,QACpC,GAAIJ,GAAWD,EAAUM,YAAcJ,KAAKC,MAAMG,UAAW,CACzD,MAAMC,EAASN,EA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AEI,SAChI"}
1
+ {"version":3,"file":"PopChild.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const parent = element.offsetParent;\n const parentWidth = parent instanceof HTMLElement ? parent.offsetWidth || 0 : 0;\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n size.right = parentWidth - size.width - size.left;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent, anchorX }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n top: ${top}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n"],"names":["PopChildMeasure","React","Component","getSnapshotBeforeUpdate","prevProps","element","this","props","childRef","current","isPresent","parent","offsetParent","parentWidth","HTMLElement","offsetWidth","size","sizeRef","height","offsetHeight","width","top","offsetTop","left","offsetLeft","right","componentDidUpdate","render","children","_ref","anchorX","id","useId","ref","useRef","nonce","useContext","MotionConfigContext","useInsertionEffect","x","dataset","motionPopId","style","document","createElement","head","appendChild","sheet","insertRule","removeChild","jsx","cloneElement"],"mappings":"iiBAUA,MAAMA,UAAwBC,EAAMC,UAChCC,uBAAAA,CAAwBC,GACpB,MAAMC,EAAUC,KAAKC,MAAMC,SAASC,QACpC,GAAIJ,GAAWD,EAAUM,YAAcJ,KAAKC,MAAMG,UAAW,CACzD,MAAMC,EAASN,EAAQO,aACjBC,EAAcF,aAAkBG,aAAcH,EAAOI,aAAmB,EACxEC,EAAOV,KAAKC,MAAMU,QAAQR,QAChCO,EAAKE,OAASb,EAAQc,cAAgB,EACtCH,EAAKI,MAAQf,EAAQU,aAAe,EACpCC,EAAKK,IAAMhB,EAAQiB,UACnBN,EAAKO,KAAOlB,EAAQmB,WACpBR,EAAKS,MAAQZ,EAAcG,EAAKI,MAAQJ,EAAKO,IACjD,CACA,OAAO,IACX,CAIAG,kBAAAA,GAAuB,CACvBC,MAAAA,GACI,OAAOrB,KAAKC,MAAMqB,QACtB,mBAEJ,SAAiBC,GAAmC,IAAlCD,SAAEA,EAAQlB,UAAEA,EAASoB,QAAEA,GAASD,EAC9C,MAAME,EAAKC,EAAAA,QACLC,EAAMC,SAAO,MACblB,EAAOkB,EAAAA,OAAO,CAChBd,MAAO,EACPF,OAAQ,EACRG,IAAK,EACLE,KAAM,EACNE,MAAO,KAELU,MAAEA,GAAUC,EAAAA,WAAWC,EAAAA,qBAmC7B,OAzBAC,EAAAA,oBAAmB,KACf,MAAMlB,MAAEA,EAAKF,OAAEA,EAAMG,IAAEA,EAAGE,KAAEA,EAAIE,MAAEA,GAAUT,EAAKP,QACjD,GAAIC,IAAcuB,EAAIxB,UAAYW,IAAUF,EACxC,OACJ,MAAMqB,EAAgB,SAAZT,EAAqB,SAASP,IAAS,UAAUE,IAC3DQ,EAAIxB,QAAQ+B,QAAQC,YAAcV,EAClC,MAAMW,EAAQC,SAASC,cAAc,SAerC,OAdIT,IACAO,EAAMP,MAAQA,GAClBQ,SAASE,KAAKC,YAAYJ,GACtBA,EAAMK,OACNL,EAAMK,MAAMC,WAAW,oCACFjB,yEAEZX,wCACCF,gCACRqB,qCACKlB,0CAIJ,KACHsB,SAASE,KAAKI,YAAYP,EAAM,CACnC,GACF,CAAChC,IACIwC,EAAAA,QAAAA,IAAIlD,EAAiB,CAAEU,UAAWA,EAAWF,SAAUyB,EAAKhB,QAASD,EAAMY,SAAU3B,EAAMkD,aAAavB,EAAU,CAAEK,SAChI"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../react/jsx-runtime.js");var e=require("react"),t=require("../../context/PresenceContext.mjs.js"),r=require("../../utils/use-constant.mjs.js"),s=require("./PopChild.mjs.js"),n=require("../../../../../../_virtual/jsx-runtime.js");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var o=i(e);function u(){return new Map}exports.PresenceChild=({children:i,initial:c,isPresent:a,onExitComplete:l,custom:f,presenceAffectsLayout:j,mode:d,anchorX:p})=>{const m=r.useConstant(u),x=e.useId();let P=!0,h=e.useMemo((()=>(P=!1,{id:x,initial:c,isPresent:a,custom:f,onExitComplete:e=>{m.set(e,!0);for(const e of m.values())if(!e)return;l&&l()},register:e=>(m.set(e,!1),()=>m.delete(e))})),[a,m,l]);return j&&P&&(h={...h}),e.useMemo((()=>{m.forEach(((e,t)=>m.set(t,!1)))}),[a]),o.useEffect((()=>{!a&&!m.size&&l&&l()}),[a]),"popLayout"===d&&(i=n.exports.jsx(s.PopChild,{isPresent:a,anchorX:p,children:i})),n.exports.jsx(t.PresenceContext.Provider,{value:h,children:i})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../react/jsx-runtime.js");var e=require("react"),t=require("../../context/PresenceContext.mjs.js"),r=require("../../utils/use-constant.mjs.js"),s=require("./PopChild.mjs.js"),n=require("../../../../../../_virtual/jsx-runtime.js");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var o=i(e);function u(){return new Map}exports.PresenceChild=i=>{let{children:c,initial:a,isPresent:l,onExitComplete:f,custom:j,presenceAffectsLayout:d,mode:p,anchorX:m}=i;const x=r.useConstant(u),P=e.useId();let h=!0,v=e.useMemo((()=>(h=!1,{id:P,initial:a,isPresent:l,custom:j,onExitComplete:e=>{x.set(e,!0);for(const e of x.values())if(!e)return;f&&f()},register:e=>(x.set(e,!1),()=>x.delete(e))})),[l,x,f]);return d&&h&&(v={...v}),e.useMemo((()=>{x.forEach(((e,t)=>x.set(t,!1)))}),[l]),o.useEffect((()=>{!l&&!x.size&&f&&f()}),[l]),"popLayout"===p&&(c=n.exports.jsx(s.PopChild,{isPresent:l,anchorX:m,children:c})),n.exports.jsx(t.PresenceContext.Provider,{value:v,children:c})};
2
2
  //# sourceMappingURL=PresenceChild.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PresenceChild.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n let isReusedContext = true;\n let context = useMemo(() => {\n isReusedContext = false;\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n },\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n };\n }, [isPresent, presenceChildren, onExitComplete]);\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context };\n }\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = (jsx(PopChild, { isPresent: isPresent, anchorX: anchorX, children: children }));\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n"],"names":["newChildrenMap","Map","PresenceChild","children","initial","isPresent","onExitComplete","custom","presenceAffectsLayout","mode","anchorX","presenceChildren","useConstant","id","useId","isReusedContext","context","useMemo","childId","set","isComplete","values","register","delete","forEach","_","key","React","useEffect","size","jsx","exports","PopChild","PresenceContext","Provider","value"],"mappings":"ymBA2DA,SAASA,IACL,OAAO,IAAIC,GACf,uBArDsBC,EAAGC,WAAUC,UAASC,YAAWC,iBAAgBC,SAAQC,wBAAuBC,OAAMC,cACxG,MAAMC,EAAmBC,cAAYZ,GAC/Ba,EAAKC,EAAAA,QACX,IAAIC,GAAkB,EAClBC,EAAUC,EAAAA,SAAQ,KAClBF,GAAkB,EACX,CACHF,KACAT,UACAC,YACAE,SACAD,eAAiBY,IACbP,EAAiBQ,IAAID,GAAS,GAC9B,IAAK,MAAME,KAAcT,EAAiBU,SACtC,IAAKD,EACD,OAERd,GAAkBA,GAAgB,EAEtCgB,SAAWJ,IACPP,EAAiBQ,IAAID,GAAS,GACvB,IAAMP,EAAiBY,OAAOL,OAG9C,CAACb,EAAWM,EAAkBL,IAyBjC,OAnBIE,GAAyBO,IACzBC,EAAU,IAAKA,IAEnBC,EAAAA,SAAQ,KACJN,EAAiBa,SAAQ,CAACC,EAAGC,IAAQf,EAAiBQ,IAAIO,GAAK,IAAO,GACvE,CAACrB,IAKJsB,EAAMC,WAAU,MACXvB,IACIM,EAAiBkB,MAClBvB,GACAA,GAAgB,GACrB,CAACD,IACS,cAATI,IACAN,EAAY2B,EAAGC,QAAAD,IAACE,WAAU,CAAE3B,UAAWA,EAAWK,QAASA,EAASP,SAAUA,KAE1E2B,EAAGC,QAAAD,IAACG,EAAeA,gBAACC,SAAU,CAAEC,MAAOnB,EAASb,SAAUA,GAAW"}
1
+ {"version":3,"file":"PresenceChild.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, anchorX, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n let isReusedContext = true;\n let context = useMemo(() => {\n isReusedContext = false;\n return {\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: (childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n },\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n };\n }, [isPresent, presenceChildren, onExitComplete]);\n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n if (presenceAffectsLayout && isReusedContext) {\n context = { ...context };\n }\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = (jsx(PopChild, { isPresent: isPresent, anchorX: anchorX, children: children }));\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n"],"names":["newChildrenMap","Map","_ref","children","initial","isPresent","onExitComplete","custom","presenceAffectsLayout","mode","anchorX","presenceChildren","useConstant","id","useId","isReusedContext","context","useMemo","childId","set","isComplete","values","register","delete","forEach","_","key","React","useEffect","size","jsx","exports","PopChild","PresenceContext","Provider","value"],"mappings":"ymBA2DA,SAASA,IACL,OAAO,IAAIC,GACf,uBArDsBC,IAAqG,IAApGC,SAAEA,EAAQC,QAAEA,EAAOC,UAAEA,EAASC,eAAEA,EAAcC,OAAEA,EAAMC,sBAAEA,EAAqBC,KAAEA,EAAIC,QAAEA,GAAUR,EAClH,MAAMS,EAAmBC,cAAYZ,GAC/Ba,EAAKC,EAAAA,QACX,IAAIC,GAAkB,EAClBC,EAAUC,EAAAA,SAAQ,KAClBF,GAAkB,EACX,CACHF,KACAT,UACAC,YACAE,SACAD,eAAiBY,IACbP,EAAiBQ,IAAID,GAAS,GAC9B,IAAK,MAAME,KAAcT,EAAiBU,SACtC,IAAKD,EACD,OAERd,GAAkBA,GAAgB,EAEtCgB,SAAWJ,IACPP,EAAiBQ,IAAID,GAAS,GACvB,IAAMP,EAAiBY,OAAOL,OAG9C,CAACb,EAAWM,EAAkBL,IAyBjC,OAnBIE,GAAyBO,IACzBC,EAAU,IAAKA,IAEnBC,EAAAA,SAAQ,KACJN,EAAiBa,SAAQ,CAACC,EAAGC,IAAQf,EAAiBQ,IAAIO,GAAK,IAAO,GACvE,CAACrB,IAKJsB,EAAMC,WAAU,MACXvB,IACIM,EAAiBkB,MAClBvB,GACAA,GAAgB,GACrB,CAACD,IACS,cAATI,IACAN,EAAY2B,EAAGC,QAAAD,IAACE,WAAU,CAAE3B,UAAWA,EAAWK,QAASA,EAASP,SAAUA,KAE1E2B,EAAGC,QAAAD,IAACG,EAAeA,gBAACC,SAAU,CAAEC,MAAOnB,EAASb,SAAUA,GAAW"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../react/jsx-runtime.js");var e=require("react"),t=require("../../context/LayoutGroupContext.mjs.js"),s=require("../../utils/use-constant.mjs.js"),r=require("../../utils/use-isomorphic-effect.mjs.js"),n=require("./PresenceChild.mjs.js"),i=require("./use-presence.mjs.js"),o=require("./utils.mjs.js"),u=require("../../../../../../_virtual/jsx-runtime.js");exports.AnimatePresence=({children:c,custom:l,initial:a=!0,onExitComplete:m,presenceAffectsLayout:d=!0,mode:p="sync",propagate:h=!1,anchorX:j="left"})=>{const[f,x]=i.usePresence(h),g=e.useMemo((()=>o.onlyElements(c)),[c]),y=h&&!f?[]:g.map(o.getChildKey),C=e.useRef(!0),q=e.useRef(g),v=s.useConstant((()=>new Map)),[E,w]=e.useState(g),[P,L]=e.useState(g);r.useIsomorphicLayoutEffect((()=>{C.current=!1,q.current=g;for(let e=0;e<P.length;e++){const t=o.getChildKey(P[e]);y.includes(t)?v.delete(t):!0!==v.get(t)&&v.set(t,!1)}}),[P,y.length,y.join("-")]);const A=[];if(g!==E){let e=[...g];for(let t=0;t<P.length;t++){const s=P[t],r=o.getChildKey(s);y.includes(r)||(e.splice(t,0,s),A.push(s))}return"wait"===p&&A.length&&(e=A),L(o.onlyElements(e)),w(g),null}"production"!==process.env.NODE_ENV&&"wait"===p&&P.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:K}=e.useContext(t.LayoutGroupContext);return u.exports.jsx(u.exports.Fragment,{children:P.map((e=>{const t=o.getChildKey(e),s=!(h&&!f)&&(g===P||y.includes(t));return u.exports.jsx(n.PresenceChild,{isPresent:s,initial:!(C.current&&!a)&&void 0,custom:l,presenceAffectsLayout:d,mode:p,onExitComplete:s?void 0:()=>{if(!v.has(t))return;v.set(t,!0);let e=!0;v.forEach((t=>{t||(e=!1)})),e&&(K?.(),L(q.current),h&&x?.(),m&&m())},anchorX:j,children:e},t)}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../../../react/jsx-runtime.js");var e=require("react"),t=require("../../context/LayoutGroupContext.mjs.js"),s=require("../../utils/use-constant.mjs.js"),r=require("../../utils/use-isomorphic-effect.mjs.js"),n=require("./PresenceChild.mjs.js"),i=require("./use-presence.mjs.js"),o=require("./utils.mjs.js"),u=require("../../../../../../_virtual/jsx-runtime.js");exports.AnimatePresence=l=>{let{children:c,custom:a,initial:m=!0,onExitComplete:d,presenceAffectsLayout:p=!0,mode:h="sync",propagate:j=!1,anchorX:f="left"}=l;const[x,g]=i.usePresence(j),y=e.useMemo((()=>o.onlyElements(c)),[c]),C=j&&!x?[]:y.map(o.getChildKey),q=e.useRef(!0),v=e.useRef(y),E=s.useConstant((()=>new Map)),[w,P]=e.useState(y),[L,A]=e.useState(y);r.useIsomorphicLayoutEffect((()=>{q.current=!1,v.current=y;for(let e=0;e<L.length;e++){const t=o.getChildKey(L[e]);C.includes(t)?E.delete(t):!0!==E.get(t)&&E.set(t,!1)}}),[L,C.length,C.join("-")]);const K=[];if(y!==w){let e=[...y];for(let t=0;t<L.length;t++){const s=L[t],r=o.getChildKey(s);C.includes(r)||(e.splice(t,0,s),K.push(s))}return"wait"===h&&K.length&&(e=K),A(o.onlyElements(e)),P(y),null}"production"!==process.env.NODE_ENV&&"wait"===h&&L.length>1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.');const{forceRender:_}=e.useContext(t.LayoutGroupContext);return u.exports.jsx(u.exports.Fragment,{children:L.map((e=>{const t=o.getChildKey(e),s=!(j&&!x)&&(y===L||C.includes(t));return u.exports.jsx(n.PresenceChild,{isPresent:s,initial:!(q.current&&!m)&&void 0,custom:a,presenceAffectsLayout:p,mode:h,onExitComplete:s?void 0:()=>{if(!E.has(t))return;E.set(t,!0);let e=!0;E.forEach((t=>{t||(e=!1)})),e&&(_?.(),A(v.current),j&&g?.(),d&&d())},anchorX:f,children:e},t)}))})};
2
2
  //# sourceMappingURL=index.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, anchorX = \"left\", }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender?.();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && safeToRemove?.();\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n"],"names":["AnimatePresence","children","custom","initial","onExitComplete","presenceAffectsLayout","mode","propagate","anchorX","isParentPresent","safeToRemove","usePresence","presentChildren","useMemo","onlyElements","presentKeys","map","getChildKey","isInitialRender","useRef","pendingPresentChildren","exitComplete","useConstant","Map","diffedChildren","setDiffedChildren","useState","renderedChildren","setRenderedChildren","useIsomorphicLayoutEffect","current","i","length","key","includes","delete","get","set","join","exitingChildren","nextChildren","child","splice","push","process","env","NODE_ENV","console","warn","forceRender","useContext","LayoutGroupContext","jsx","Fragment","isPresent","PresenceChild","undefined","onExit","has","isEveryExitComplete","forEach","isExitComplete"],"mappings":"odA2CwBA,EAAGC,WAAUC,SAAQC,WAAU,EAAMC,iBAAgBC,yBAAwB,EAAMC,OAAO,OAAQC,aAAY,EAAOC,UAAU,WACnJ,MAAOC,EAAiBC,GAAgBC,EAAWA,YAACJ,GAK9CK,EAAkBC,EAAAA,SAAQ,IAAMC,EAAAA,aAAab,IAAW,CAACA,IAKzDc,EAAcR,IAAcE,EAAkB,GAAKG,EAAgBI,IAAIC,EAAAA,aAIvEC,EAAkBC,UAAO,GAMzBC,EAAyBD,SAAOP,GAIhCS,EAAeC,EAAWA,aAAC,IAAM,IAAIC,OAKpCC,EAAgBC,GAAqBC,EAAQA,SAACd,IAC9Ce,EAAkBC,GAAuBF,EAAQA,SAACd,GACzDiB,EAAAA,2BAA0B,KACtBX,EAAgBY,SAAU,EAC1BV,EAAuBU,QAAUlB,EAIjC,IAAK,IAAImB,EAAI,EAAGA,EAAIJ,EAAiBK,OAAQD,IAAK,CAC9C,MAAME,EAAMhB,EAAWA,YAACU,EAAiBI,IACpChB,EAAYmB,SAASD,GAMtBZ,EAAac,OAAOF,IALU,IAA1BZ,EAAae,IAAIH,IACjBZ,EAAagB,IAAIJ,G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1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, anchorX = \"left\", }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender?.();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && safeToRemove?.();\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n"],"names":["_ref","children","custom","initial","onExitComplete","presenceAffectsLayout","mode","propagate","anchorX","isParentPresent","safeToRemove","usePresence","presentChildren","useMemo","onlyElements","presentKeys","map","getChildKey","isInitialRender","useRef","pendingPresentChildren","exitComplete","useConstant","Map","diffedChildren","setDiffedChildren","useState","renderedChildren","setRenderedChildren","useIsomorphicLayoutEffect","current","i","length","key","includes","delete","get","set","join","exitingChildren","nextChildren","child","splice","push","process","env","NODE_ENV","console","warn","forceRender","useContext","LayoutGroupContext","jsx","Fragment","isPresent","PresenceChild","undefined","onExit","has","isEveryExitComplete","forEach","isExitComplete"],"mappings":"odA2CwBA,IAA6I,IAA5IC,SAAEA,EAAQC,OAAEA,EAAMC,QAAEA,GAAU,EAAIC,eAAEA,EAAcC,sBAAEA,GAAwB,EAAIC,KAAEA,EAAO,OAAMC,UAAEA,GAAY,EAAKC,QAAEA,EAAU,QAASR,EAC5J,MAAOS,EAAiBC,GAAgBC,EAAWA,YAACJ,GAK9CK,EAAkBC,EAAAA,SAAQ,IAAMC,EAAAA,aAAab,IAAW,CAACA,IAKzDc,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IAAcE,KAE1BG,IAAoBe,GAClBZ,EAAYmB,SAASD,IAoB7B,OAAQmB,EAAAA,QAAAA,IAAIG,EAAAA,cAAe,CAAED,UAAWA,EAAWnD,UAAUe,EAAgBY,UAAW3B,SAC9EqD,EACOtD,OAAQA,EAAQG,sBAAuBA,EAAuBC,KAAMA,EAAMF,eAAgBkD,OAAYE,EArBxGC,KACX,IAAIpC,EAAaqC,IAAIzB,GAIjB,OAHAZ,EAAagB,IAAIJ,GAAK,GAK1B,IAAI0B,GAAsB,EAC1BtC,EAAauC,SAASC,IACbA,IACDF,GAAsB,EAAK,IAE/BA,IACAV,MACArB,EAAoBR,EAAuBU,SAC3CvB,GAAaG,MACbN,GAAkBA,IACtB,EAIuII,QAASA,EAASP,SAAUwC,GAASR,EAAI,KACnL"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../context/PresenceContext.mjs.js");exports.usePresence=function(r=!0){const s=e.useContext(t.PresenceContext);if(null===s)return[!0,null];const{isPresent:n,onExitComplete:u,register:o}=s,c=e.useId();e.useEffect((()=>{if(r)return o(c)}),[r]);const i=e.useCallback((()=>r&&u&&u(c)),[c,u,r]);return!n&&u?[!1,i]:[!0]};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../context/PresenceContext.mjs.js");exports.usePresence=function(){let r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.useContext(t.PresenceContext);if(null===n)return[!0,null];const{isPresent:s,onExitComplete:u,register:o}=n,c=e.useId();e.useEffect((()=>{if(r)return o(c)}),[r]);const i=e.useCallback((()=>r&&u&&u(c)),[c,u,r]);return!s&&u?[!1,i]:[!0]};
2
2
  //# sourceMappingURL=use-presence.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-presence.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs"],"sourcesContent":["import { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n"],"names":["subscribe","context","useContext","PresenceContext","isPresent","onExitComplete","register","id","useId","useEffect","safeToRemove","useCallback"],"mappings":"iKA0BA,SAAqBA,GAAY,GAC7B,MAAMC,EAAUC,aAAWC,EAAAA,iBAC3B,GAAgB,OAAZF,EACA,MAAO,EAAC,EAAM,MAClB,MAAMG,UAAEA,EAASC,eAAEA,EAAcC,SAAEA,GAAaL,EAG1CM,EAAKC,EAAAA,QACXC,EAAAA,WAAU,KACN,GAAIT,EACA,OAAOM,EAASC,EACpB,GACD,CAACP,IACJ,MAAMU,EAAeC,EAAAA,aAAY,IAAMX,GAAaK,GAAkBA,EAAeE,IAAK,CAACA,EAAIF,EAAgBL,IAC/G,OAAQI,GAAaC,EAAiB,EAAC,EAAOK,GAAgB,EAAC,EACnE"}
1
+ {"version":3,"file":"use-presence.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs"],"sourcesContent":["import { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe) {\n return register(id);\n }\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n"],"names":["subscribe","arguments","length","undefined","context","useContext","PresenceContext","isPresent","onExitComplete","register","id","useId","useEffect","safeToRemove","useCallback"],"mappings":"iKA0BA,WAAuC,IAAlBA,IAASC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,KAAAA,UAAA,GAC1B,MAAMG,EAAUC,aAAWC,EAAAA,iBAC3B,GAAgB,OAAZF,EACA,MAAO,EAAC,EAAM,MAClB,MAAMG,UAAEA,EAASC,eAAEA,EAAcC,SAAEA,GAAaL,EAG1CM,EAAKC,EAAAA,QACXC,EAAAA,WAAU,KACN,GAAIZ,EACA,OAAOS,EAASC,EACpB,GACD,CAACV,IACJ,MAAMa,EAAeC,EAAAA,aAAY,IAAMd,GAAaQ,GAAkBA,EAAeE,IAAK,CAACA,EAAIF,EAAgBR,IAC/G,OAAQO,GAAaC,EAAiB,EAAC,EAAOK,GAAgB,EAAC,EACnE"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addDomEvent=function(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)};
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)};
2
2
  //# sourceMappingURL=add-dom-event.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-dom-event.mjs.js","sources":["../../../../../../node_modules/framer-motion/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"],"names":["target","eventName","handler","options","passive","addEventListener","removeEventListener"],"mappings":"wFAAA,SAAqBA,EAAQC,EAAWC,EAASC,EAAU,CAAEC,SAAS,IAElE,OADAJ,EAAOK,iBAAiBJ,EAAWC,EAASC,GACrC,IAAMH,EAAOM,oBAAoBL,EAAWC,EACvD"}
1
+ {"version":3,"file":"add-dom-event.mjs.js","sources":["../../../../../../node_modules/framer-motion/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"],"names":["target","eventName","handler","options","arguments","length","undefined","passive","addEventListener","removeEventListener"],"mappings":"wFAAA,SAAqBA,EAAQC,EAAWC,GAAsC,IAA7BC,EAAOC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAG,GAAA,CAAEG,SAAS,GAElE,OADAP,EAAOQ,iBAAiBP,EAAWC,EAASC,GACrC,IAAMH,EAAOS,oBAAoBR,EAAWC,EACvD"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../animation/interfaces/motion-value.mjs.js"),s=require("../../events/add-dom-event.mjs.js"),i=require("../../events/add-pointer-event.mjs.js"),e=require("../../events/event-info.mjs.js"),n=require("../../projection/geometry/conversion.mjs.js"),o=require("../../projection/geometry/delta-calc.mjs.js"),r=require("../../projection/geometry/models.mjs.js"),a=require("../../projection/utils/each-axis.mjs.js"),l=require("../../projection/utils/measure.mjs.js"),c=require("../../utils/get-context-window.mjs.js"),u=require("../../utils/is-ref-object.mjs.js"),h=require("../../value/use-will-change/add-will-change.mjs.js"),g=require("../pan/PanSession.mjs.js"),m=require("./utils/constraints.mjs.js"),d=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),p=require("../../../../../motion-utils/dist/es/errors.mjs.js"),v=require("../../../../../motion-dom/dist/es/gestures/drag/state/set-active.mjs.js"),j=require("../../../../../motion-dom/dist/es/value/types/numbers/units.mjs.js"),x=require("../../../../../motion-dom/dist/es/utils/mix/number.mjs.js");const f=new WeakMap;function E(t,s,i){return!(!0!==s&&s!==t||null!==i&&i!==t)}exports.VisualElementDragControls=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=r.createBox(),this.visualElement=t}start(t,{snapToCursor:s=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new g.PanSession(t,{onSessionStart:t=>{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(e.extractEventInfo(t).point)},onStart:(t,s)=>{const{drag:i,dragPropagation:e,onDragStart:n}=this.getProps();if(i&&!e&&(this.openDragLock&&this.openDragLock(),this.openDragLock=v.setDragLock(i),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),a.eachAxis((t=>{let s=this.getAxisMotionValue(t).get()||0;if(j.percent.test(s)){const{projection:i}=this.visualElement;if(i&&i.layout){const e=i.layout.layoutBox[t];if(e){s=o.calcLength(e)*(parseFloat(s)/100)}}}this.originPoint[t]=s})),n&&d.frame.postRender((()=>n(t,s))),h.addValueToWillChange(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,s)=>{const{dragPropagation:i,dragDirectionLock:e,onDirectionLock:n,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=s;if(e&&null===this.currentDirection)return this.currentDirection=function(t,s=10){let i=null;Math.abs(t.y)>s?i="y":Math.abs(t.x)>s&&(i="x");return i}(r),void(null!==this.currentDirection&&n&&n(this.currentDirection));this.updateAxis("x",s.point,r),this.updateAxis("y",s.point,r),this.visualElement.render(),o&&o(t,s)},onSessionEnd:(t,s)=>this.stop(t,s),resumeAnimation:()=>a.eachAxis((t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play()))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:c.getContextWindow(this.visualElement)})}stop(t,s){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:e}=s;this.startAnimation(e);const{onDragEnd:n}=this.getProps();n&&d.frame.postRender((()=>n(t,s)))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(t,s,i){const{drag:e}=this.getProps();if(!i||!E(t,e,this.currentDirection))return;const n=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=m.applyConstraints(o,this.constraints[t],this.elastic[t])),n.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,e=this.constraints;t&&u.isRefObject(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&m.calcRelativeConstraints(i.layoutBox,t),this.elastic=m.resolveDragElastic(s),e!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&a.eachAxis((t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=m.rebaseAxisConstraints(i.layoutBox[t],this.constraints[t]))}))}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!u.isRefObject(t))return!1;const i=t.current;p.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:e}=this.visualElement;if(!e||!e.layout)return!1;const o=l.measurePageBox(i,e.root,this.visualElement.getTransformPagePoint());let r=m.calcViewportConstraints(e.layout.layoutBox,o);if(s){const t=s(n.convertBoxToBoundingBox(r));this.hasMutatedConstraints=!!t,t&&(r=n.convertBoundingBoxToBox(t))}return r}startAnimation(t){const{drag:s,dragMomentum:i,dragElastic:e,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),l=this.constraints||{},c=a.eachAxis((r=>{if(!E(r,s,this.currentDirection))return;let a=l&&l[r]||{};o&&(a={min:0,max:0});const c=e?200:1e6,u=e?40:1e7,h={type:"inertia",velocity:i?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...n,...a};return this.startAxisValueAnimation(r,h)}));return Promise.all(c).then(r)}startAxisValueAnimation(s,i){const e=this.getAxisMotionValue(s);return h.addValueToWillChange(this.visualElement,s),e.start(t.animateMotionValue(s,e,0,i,this.visualElement,!1))}stopAnimation(){a.eachAxis((t=>this.getAxisMotionValue(t).stop()))}pauseAnimation(){a.eachAxis((t=>this.getAxisMotionValue(t).animation?.pause()))}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),e=i[s];return e||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){a.eachAxis((s=>{const{drag:i}=this.getProps();if(!E(s,i,this.currentDirection))return;const{projection:e}=this.visualElement,n=this.getAxisMotionValue(s);if(e&&e.layout){const{min:i,max:o}=e.layout.layoutBox[s];n.set(t[s]-x.mixNumber(i,o,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:i}=this.visualElement;if(!u.isRefObject(s)||!i||!this.constraints)return;this.stopAnimation();const e={x:0,y:0};a.eachAxis((t=>{const s=this.getAxisMotionValue(t);if(s&&!1!==this.constraints){const i=s.get();e[t]=m.calcOrigin({min:i,max:i},this.constraints[t])}}));const{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),a.eachAxis((s=>{if(!E(s,t,null))return;const i=this.getAxisMotionValue(s),{min:n,max:o}=this.constraints[s];i.set(x.mixNumber(n,o,e[s]))}))}addListeners(){if(!this.visualElement.current)return;f.set(this.visualElement,this);const t=this.visualElement.current,e=i.addPointerEvent(t,"pointerdown",(t=>{const{drag:s,dragListener:i=!0}=this.getProps();s&&i&&this.start(t)})),n=()=>{const{dragConstraints:t}=this.getProps();u.isRefObject(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",n);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),d.frame.read(n);const l=s.addDomEvent(window,"resize",(()=>this.scalePositionWithinConstraints())),c=o.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:s})=>{this.isDragging&&s&&(a.eachAxis((s=>{const i=this.getAxisMotionValue(s);i&&(this.originPoint[s]+=t[s].translate,i.set(i.get()+t[s].translate))})),this.visualElement.render())}));return()=>{l(),e(),r(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:i=!1,dragPropagation:e=!1,dragConstraints:n=!1,dragElastic:o=m.defaultElastic,dragMomentum:r=!0}=t;return{...t,drag:s,dragDirectionLock:i,dragPropagation:e,dragConstraints:n,dragElastic:o,dragMomentum:r}}},exports.elementDragControls=f;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../animation/interfaces/motion-value.mjs.js"),s=require("../../events/add-dom-event.mjs.js"),i=require("../../events/add-pointer-event.mjs.js"),e=require("../../events/event-info.mjs.js"),n=require("../../projection/geometry/conversion.mjs.js"),o=require("../../projection/geometry/delta-calc.mjs.js"),r=require("../../projection/geometry/models.mjs.js"),a=require("../../projection/utils/each-axis.mjs.js"),l=require("../../projection/utils/measure.mjs.js"),c=require("../../utils/get-context-window.mjs.js"),u=require("../../utils/is-ref-object.mjs.js"),h=require("../../value/use-will-change/add-will-change.mjs.js"),g=require("../pan/PanSession.mjs.js"),m=require("./utils/constraints.mjs.js"),d=require("../../../../../motion-dom/dist/es/frameloop/frame.mjs.js"),p=require("../../../../../motion-utils/dist/es/errors.mjs.js"),v=require("../../../../../motion-dom/dist/es/gestures/drag/state/set-active.mjs.js"),j=require("../../../../../motion-dom/dist/es/value/types/numbers/units.mjs.js"),x=require("../../../../../motion-dom/dist/es/utils/mix/number.mjs.js");const f=new WeakMap;function E(t,s,i){return!(!0!==s&&s!==t||null!==i&&i!==t)}exports.VisualElementDragControls=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=r.createBox(),this.visualElement=t}start(t){let{snapToCursor:s=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new g.PanSession(t,{onSessionStart:t=>{const{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(e.extractEventInfo(t).point)},onStart:(t,s)=>{const{drag:i,dragPropagation:e,onDragStart:n}=this.getProps();if(i&&!e&&(this.openDragLock&&this.openDragLock(),this.openDragLock=v.setDragLock(i),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),a.eachAxis((t=>{let s=this.getAxisMotionValue(t).get()||0;if(j.percent.test(s)){const{projection:i}=this.visualElement;if(i&&i.layout){const e=i.layout.layoutBox[t];if(e){s=o.calcLength(e)*(parseFloat(s)/100)}}}this.originPoint[t]=s})),n&&d.frame.postRender((()=>n(t,s))),h.addValueToWillChange(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,s)=>{const{dragPropagation:i,dragDirectionLock:e,onDirectionLock:n,onDrag:o}=this.getProps();if(!i&&!this.openDragLock)return;const{offset:r}=s;if(e&&null===this.currentDirection)return this.currentDirection=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=null;Math.abs(t.y)>s?i="y":Math.abs(t.x)>s&&(i="x");return i}(r),void(null!==this.currentDirection&&n&&n(this.currentDirection));this.updateAxis("x",s.point,r),this.updateAxis("y",s.point,r),this.visualElement.render(),o&&o(t,s)},onSessionEnd:(t,s)=>this.stop(t,s),resumeAnimation:()=>a.eachAxis((t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play()))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:c.getContextWindow(this.visualElement)})}stop(t,s){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:e}=s;this.startAnimation(e);const{onDragEnd:n}=this.getProps();n&&d.frame.postRender((()=>n(t,s)))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(t,s,i){const{drag:e}=this.getProps();if(!i||!E(t,e,this.currentDirection))return;const n=this.getAxisMotionValue(t);let o=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(o=m.applyConstraints(o,this.constraints[t],this.elastic[t])),n.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,e=this.constraints;t&&u.isRefObject(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i)&&m.calcRelativeConstraints(i.layoutBox,t),this.elastic=m.resolveDragElastic(s),e!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&a.eachAxis((t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=m.rebaseAxisConstraints(i.layoutBox[t],this.constraints[t]))}))}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!u.isRefObject(t))return!1;const i=t.current;p.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:e}=this.visualElement;if(!e||!e.layout)return!1;const o=l.measurePageBox(i,e.root,this.visualElement.getTransformPagePoint());let r=m.calcViewportConstraints(e.layout.layoutBox,o);if(s){const t=s(n.convertBoxToBoundingBox(r));this.hasMutatedConstraints=!!t,t&&(r=n.convertBoundingBoxToBox(t))}return r}startAnimation(t){const{drag:s,dragMomentum:i,dragElastic:e,dragTransition:n,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),l=this.constraints||{},c=a.eachAxis((r=>{if(!E(r,s,this.currentDirection))return;let a=l&&l[r]||{};o&&(a={min:0,max:0});const c=e?200:1e6,u=e?40:1e7,h={type:"inertia",velocity:i?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...n,...a};return this.startAxisValueAnimation(r,h)}));return Promise.all(c).then(r)}startAxisValueAnimation(s,i){const e=this.getAxisMotionValue(s);return h.addValueToWillChange(this.visualElement,s),e.start(t.animateMotionValue(s,e,0,i,this.visualElement,!1))}stopAnimation(){a.eachAxis((t=>this.getAxisMotionValue(t).stop()))}pauseAnimation(){a.eachAxis((t=>this.getAxisMotionValue(t).animation?.pause()))}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),e=i[s];return e||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){a.eachAxis((s=>{const{drag:i}=this.getProps();if(!E(s,i,this.currentDirection))return;const{projection:e}=this.visualElement,n=this.getAxisMotionValue(s);if(e&&e.layout){const{min:i,max:o}=e.layout.layoutBox[s];n.set(t[s]-x.mixNumber(i,o,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:i}=this.visualElement;if(!u.isRefObject(s)||!i||!this.constraints)return;this.stopAnimation();const e={x:0,y:0};a.eachAxis((t=>{const s=this.getAxisMotionValue(t);if(s&&!1!==this.constraints){const i=s.get();e[t]=m.calcOrigin({min:i,max:i},this.constraints[t])}}));const{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),a.eachAxis((s=>{if(!E(s,t,null))return;const i=this.getAxisMotionValue(s),{min:n,max:o}=this.constraints[s];i.set(x.mixNumber(n,o,e[s]))}))}addListeners(){if(!this.visualElement.current)return;f.set(this.visualElement,this);const t=this.visualElement.current,e=i.addPointerEvent(t,"pointerdown",(t=>{const{drag:s,dragListener:i=!0}=this.getProps();s&&i&&this.start(t)})),n=()=>{const{dragConstraints:t}=this.getProps();u.isRefObject(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,r=o.addEventListener("measure",n);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),d.frame.read(n);const l=s.addDomEvent(window,"resize",(()=>this.scalePositionWithinConstraints())),c=o.addEventListener("didUpdate",(t=>{let{delta:s,hasLayoutChanged:i}=t;this.isDragging&&i&&(a.eachAxis((t=>{const i=this.getAxisMotionValue(t);i&&(this.originPoint[t]+=s[t].translate,i.set(i.get()+s[t].translate))})),this.visualElement.render())}));return()=>{l(),e(),r(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:i=!1,dragPropagation:e=!1,dragConstraints:n=!1,dragElastic:o=m.defaultElastic,dragMomentum:r=!0}=t;return{...t,drag:s,dragDirectionLock:i,dragPropagation:e,dragConstraints:n,dragElastic:o,dragMomentum:r}}},exports.elementDragControls=f;
2
2
  //# sourceMappingURL=VisualElementDragControls.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VisualElementDragControls.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs"],"sourcesContent":["import { frame, mixNumber, setDragLock, percent } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';\nimport { calcLength } from '../../projection/geometry/delta-calc.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { eachAxis } from '../../projection/utils/each-axis.mjs';\nimport { measurePageBox } from '../../projection/utils/measure.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\n\nconst elementDragControls = new WeakMap();\n/**\n *\n */\n// let latestPointerEvent: PointerEvent\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n const { dragSnapToOrigin } = this.getProps();\n // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch\n // the component.\n dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.postRender(() => onDragStart(event, info));\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n // latestPointerEvent = event\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info);\n };\n const onSessionEnd = (event, info) => this.stop(event, info);\n const resumeAnimation = () => eachAxis((axis) => this.getAnimationState(axis) === \"paused\" &&\n this.getAxisMotionValue(axis).animation?.play());\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n contextWindow: getContextWindow(this.visualElement),\n });\n }\n stop(event, info) {\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging)\n return;\n const { velocity } = info;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(event, info));\n }\n }\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative.\n */\n if (prevConstraints !== this.constraints &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n pauseAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).animation?.pause());\n }\n getAnimationState(axis) {\n return this.getAxisMotionValue(axis).animation?.state;\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial\n ? props.initial[axis]\n : undefined) || 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n axisValue.set(point[axis] - mixNumber(min, max, 0.5));\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n drag && dragListener && this.start(event);\n });\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n"],"names":["elementDragControls","WeakMap","shouldDrag","direction","drag","currentDirection","constructor","visualElement","this","openDragLock","isDragging","originPoint","x","y","constraints","hasMutatedConstraints","elastic","createBox","start","originEvent","snapToCursor","presenceContext","isPresent","dragSnapToOrigin","getProps","panSession","PanSession","onSessionStart","event","pauseAnimation","stopAnimation","extractEventInfo","point","onStart","info","dragPropagation","onDragStart","setDragLock","resolveConstraints","projection","isAnimationBlocked","target","undefined","eachAxis","axis","current","getAxisMotionValue","get","percent","test","layout","measuredAxis","layoutBox","calcLength","parseFloat","frame","postRender","addValueToWillChange","animationState","setActive","onMove","dragDirectionLock","onDirectionLock","onDrag","offset","lockThreshold","Math","abs","getCurrentDirection","updateAxis","render","onSessionEnd","stop","resumeAnimation","getAnimationState","animation","play","transformPagePoint","getTransformPagePoint","contextWindow","getContextWindow","cancel","velocity","startAnimation","onDragEnd","end","_point","axisValue","next","applyConstraints","set","dragConstraints","dragElastic","measure","prevConstraints","isRefObject","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","invariant","constraintsBox","measurePageBox","root","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","convertBoundingBoxToBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","transition","min","max","bounceStiffness","bounceDamping","inertia","type","timeConstant","restDelta","restSpeed","startAxisValueAnimation","Promise","all","then","animateMotionValue","pause","state","dragKey","toUpperCase","props","externalMotionValue","getValue","initial","mixNumber","scalePositionWithinConstraints","boxProgress","latest","calcOrigin","transformTemplate","style","transform","updateScroll","updateLayout","addListeners","element","stopPointerListener","addPointerEvent","dragListener","measureDragConstraints","stopMeasureLayoutListener","addEventListener","read","stopResizeListener","addDomEvent","window","stopLayoutUp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AAKwD,gBAAEA,GAAkB,EAAKC,YAAEA,EAAcyE,EAAcA,eAAAtD,aAAEA,GAAe,GAAUuB,EAC1J,MAAO,IACAA,EACHlI,OACAyD,oBACA1B,kBACAwD,kBACAC,cACAmB,eAER"}
1
+ {"version":3,"file":"VisualElementDragControls.mjs.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs"],"sourcesContent":["import { frame, mixNumber, setDragLock, percent } from 'motion-dom';\nimport { invariant } from 'motion-utils';\nimport { animateMotionValue } from '../../animation/interfaces/motion-value.mjs';\nimport { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.mjs';\nimport { calcLength } from '../../projection/geometry/delta-calc.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { eachAxis } from '../../projection/utils/each-axis.mjs';\nimport { measurePageBox } from '../../projection/utils/measure.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { PanSession } from '../pan/PanSession.mjs';\nimport { applyConstraints, calcRelativeConstraints, resolveDragElastic, rebaseAxisConstraints, calcViewportConstraints, calcOrigin, defaultElastic } from './utils/constraints.mjs';\n\nconst elementDragControls = new WeakMap();\n/**\n *\n */\n// let latestPointerEvent: PointerEvent\nclass VisualElementDragControls {\n constructor(visualElement) {\n this.openDragLock = null;\n this.isDragging = false;\n this.currentDirection = null;\n this.originPoint = { x: 0, y: 0 };\n /**\n * The permitted boundaries of travel, in pixels.\n */\n this.constraints = false;\n this.hasMutatedConstraints = false;\n /**\n * The per-axis resolved elastic values.\n */\n this.elastic = createBox();\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n const { dragSnapToOrigin } = this.getProps();\n // Stop or pause any animations on both axis values immediately. This allows the user to throw and catch\n // the component.\n dragSnapToOrigin ? this.pauseAnimation() : this.stopAnimation();\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point);\n }\n };\n const onStart = (event, info) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps();\n if (drag && !dragPropagation) {\n if (this.openDragLock)\n this.openDragLock();\n this.openDragLock = setDragLock(drag);\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock)\n return;\n }\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0;\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement;\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis];\n if (measuredAxis) {\n const length = calcLength(measuredAxis);\n current = length * (parseFloat(current) / 100);\n }\n }\n }\n this.originPoint[axis] = current;\n });\n // Fire onDragStart event\n if (onDragStart) {\n frame.postRender(() => onDragStart(event, info));\n }\n addValueToWillChange(this.visualElement, \"transform\");\n const { animationState } = this.visualElement;\n animationState && animationState.setActive(\"whileDrag\", true);\n };\n const onMove = (event, info) => {\n // latestPointerEvent = event\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info);\n };\n const onSessionEnd = (event, info) => this.stop(event, info);\n const resumeAnimation = () => eachAxis((axis) => this.getAnimationState(axis) === \"paused\" &&\n this.getAxisMotionValue(axis).animation?.play());\n const { dragSnapToOrigin } = this.getProps();\n this.panSession = new PanSession(originEvent, {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n }, {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n contextWindow: getContextWindow(this.visualElement),\n });\n }\n stop(event, info) {\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging)\n return;\n const { velocity } = info;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(event, info));\n }\n }\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.panSession && this.panSession.end();\n this.panSession = undefined;\n const { dragPropagation } = this.getProps();\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock();\n this.openDragLock = null;\n }\n animationState && animationState.setActive(\"whileDrag\", false);\n }\n updateAxis(axis, _point, offset) {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection))\n return;\n const axisValue = this.getAxisMotionValue(axis);\n let next = this.originPoint[axis] + offset[axis];\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);\n }\n axisValue.set(next);\n }\n resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps();\n const layout = this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout;\n const prevConstraints = this.constraints;\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints();\n }\n }\n else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);\n }\n else {\n this.constraints = false;\n }\n }\n this.elastic = resolveDragElastic(dragElastic);\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative.\n */\n if (prevConstraints !== this.constraints &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints) {\n eachAxis((axis) => {\n if (this.constraints !== false &&\n this.getAxisMotionValue(axis)) {\n this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);\n }\n });\n }\n }\n resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();\n if (!constraints || !isRefObject(constraints))\n return false;\n const constraintsElement = constraints.current;\n invariant(constraintsElement !== null, \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n pauseAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).animation?.pause());\n }\n getAnimationState(axis) {\n return this.getAxisMotionValue(axis).animation?.state;\n }\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n getAxisMotionValue(axis) {\n const dragKey = `_drag${axis.toUpperCase()}`;\n const props = this.visualElement.getProps();\n const externalMotionValue = props[dragKey];\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(axis, (props.initial\n ? props.initial[axis]\n : undefined) || 0);\n }\n snapToCursor(point) {\n eachAxis((axis) => {\n const { drag } = this.getProps();\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection))\n return;\n const { projection } = this.visualElement;\n const axisValue = this.getAxisMotionValue(axis);\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis];\n axisValue.set(point[axis] - mixNumber(min, max, 0.5));\n }\n });\n }\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current)\n return;\n const { drag, dragConstraints } = this.getProps();\n const { projection } = this.visualElement;\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return;\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation();\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 };\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis);\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get();\n boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);\n }\n });\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps();\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n this.resolveConstraints();\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null))\n return;\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis);\n const { min, max } = this.constraints[axis];\n axisValue.set(mixNumber(min, max, boxProgress[axis]));\n });\n }\n addListeners() {\n if (!this.visualElement.current)\n return;\n elementDragControls.set(this.visualElement, this);\n const element = this.visualElement.current;\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(element, \"pointerdown\", (event) => {\n const { drag, dragListener = true } = this.getProps();\n drag && dragListener && this.start(event);\n });\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps();\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints();\n }\n };\n const { projection } = this.visualElement;\n const stopMeasureLayoutListener = projection.addEventListener(\"measure\", measureDragConstraints);\n if (projection && !projection.layout) {\n projection.root && projection.root.updateScroll();\n projection.updateLayout();\n }\n frame.read(measureDragConstraints);\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () => this.scalePositionWithinConstraints());\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection.addEventListener(\"didUpdate\", (({ delta, hasLayoutChanged }) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis);\n if (!motionValue)\n return;\n this.originPoint[axis] += delta[axis].translate;\n motionValue.set(motionValue.get() + delta[axis].translate);\n });\n this.visualElement.render();\n }\n }));\n return () => {\n stopResizeListener();\n stopPointerListener();\n stopMeasureLayoutListener();\n stopLayoutUpdateListener && stopLayoutUpdateListener();\n };\n }\n getProps() {\n const props = this.visualElement.getProps();\n const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n };\n }\n}\nfunction shouldDrag(direction, drag, currentDirection) {\n return ((drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction));\n}\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(offset, lockThreshold = 10) {\n let direction = null;\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\";\n }\n else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\";\n }\n return direction;\n}\n\nexport { VisualElementDragControls, elementDragControls };\n"],"names":["elementDragControls","WeakMap","shouldDrag","direction","drag","currentDirection","constructor","visualElement","this","openDragLock","isDragging","originPoint","x","y","constraints","hasMutatedConstraints","elastic","createBox","start","originEvent","snapToCursor","arguments","length","undefined","presenceContext","isPresent","dragSnapToOrigin","getProps","panSession","PanSession","onSessionStart","event","pauseAnimation","stopAnimation","extractEventInfo","point","onStart","info","dragPropagation","onDragStart","setDragLock","resolveConstraints","projection","isAnimationBlocked","target","eachAxis","axis","current","getAxisMotionValue","get","percent","test","layout","measuredAxis","layoutBox","calcLength","parseFloat","frame","postRender","addValueToWillChange","animationState","setActive","onMove","dragDirectionLock","onDirectionLock","onDrag","offset","lockThreshold","Math","abs","getCurrentDirection","updateAxis","render","onSessionEnd","stop","resumeAnimation","getAnimationState","animation","play","transformPagePoint","getTransformPagePoint","contextWindow","getContextWindow","cancel","velocity","startAnimation","onDragEnd","end","_point","axisValue","next","applyConstraints","set","dragConstraints","dragElastic","measure","prevConstraints","isRefObject","resolveRefConstraints","calcRelativeConstraints","resolveDragElastic","rebaseAxisConstraints","onMeasureDragConstraints","constraintsElement","invariant","constraintsBox","measurePageBox","root","measuredConstraints","calcViewportConstraints","userConstraints","convertBoxToBoundingBox","convertBoundingBoxToBox","dragMomentum","dragTransition","onDragTransitionEnd","momentumAnimations","transition","min","max","bounceStiffness","bounceDamping","inertia","type","timeConstant","restDelta","restSpeed","startAxisValueAnimation","Promise","all","then","animateMotionValue","pause","state","dragKey","toUpperCase","props","externalMotionValue","getValue","initial","mixNumber","scalePositionWithinConstraints","boxProgress","latest","calcOrigin","transformTemplate","style","transform","updateScroll","updateLayout","addListeners","element","stopPointerListener","addPointerEvent","dragListener","measureDragConstraints","stopMeasureLayoutListener","addEventListener","read","stopResizeListener","addDomEvent","window","stopLayoutUpdateListener","_ref","delta","hasLayoutChanged","motionValue","translate","defaultElastic"],"mappings":"ioCAiBA,MAAMA,EAAsB,IAAIC,QAobhC,SAASC,EAAWC,EAAWC,EAAMC,GACjC,SAAkB,IAATD,GAAiBA,IAASD,GACT,OAArBE,GAA6BA,IAAqBF,EAC3D,mCAlbA,MACIG,WAAAA,CAAYC,GACRC,KAAKC,aAAe,KACpBD,KAAKE,YAAa,EAClBF,KAAKH,iBAAmB,KACxBG,KAAKG,YAAc,CAAEC,EAAG,EAAGC,EAAG,GAI9BL,KAAKM,aAAc,EACnBN,KAAKO,uBAAwB,EAI7BP,KAAKQ,QAAUC,EAAAA,YACfT,KAAKD,cAAgBA,CACzB,CACAW,KAAAA,CAAMC,GAA4C,IAA/BC,aAAEA,GAAe,GAAOC,UAAAC,OAAAD,QAAAE,IAAAF,UAAAE,GAAAF,UAAG,GAAA,GAI1C,MAAMG,gBAAEA,GAAoBhB,KAAKD,cACjC,GAAIiB,IAAiD,IAA9BA,EAAgBC,UACnC,OACJ,MA0FMC,iBAAEA,GAAqBlB,KAAKmB,WAClCnB,KAAKoB,WAAa,IAAIC,EAAUA,WAACV,EAAa,CAC1CW,eA5FoBC,IACpB,MAAML,iBAAEA,GAAqBlB,KAAKmB,WAGlCD,EAAmBlB,KAAKwB,iBAAmBxB,KAAKyB,gBAC5Cb,GACAZ,KAAKY,aAAac,EAAAA,iBAAiBH,GAAOI,MAC9C,EAsFAC,QApFYA,CAACL,EAAOM,KAEpB,MAAMjC,KAAEA,EAAIkC,gBAAEA,EAAeC,YAAEA,GAAgB/B,KAAKmB,WACpD,GAAIvB,IAASkC,IACL9B,KAAKC,cACLD,KAAKC,eACTD,KAAKC,aAAe+B,cAAYpC,IAE3BI,KAAKC,cACN,OAERD,KAAKE,YAAa,EAClBF,KAAKH,iBAAmB,KACxBG,KAAKiC,qBACDjC,KAAKD,cAAcmC,aAC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WAAU,IAE9D/J,KAAKD,cAAciE,SACvB,IAEJ,MAAO,KACHuF,IACAP,IACAI,IACAM,GAA4BA,GAA0B,CAE9D,CACAvI,QAAAA,GACI,MAAM6G,EAAQhI,KAAKD,cAAcoB,YAC3BvB,KAAEA,GAAO,EAAK2D,kBAAEA,GAAoB,EAAKzB,gBAAEA,GAAkB,EAAKuD,gBAAEA,GAAkB,EAAKC,YAAEA,EAAc0E,EAAcA,eAAAvD,aAAEA,GAAe,GAAUuB,EAC1J,MAAO,IACAA,EACHpI,OACA2D,oBACAzB,kBACAuD,kBACAC,cACAmB,eAER"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../projection/geometry/delta-calc.mjs.js"),i=require("../../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),n=require("../../../../../../motion-utils/dist/es/progress.mjs.js"),e=require("../../../../../../motion-utils/dist/es/clamp.mjs.js");function r(t,i,n){return{min:void 0!==i?t.min+i:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function o(t,i){let n=i.min-t.min,e=i.max-t.max;return i.max-i.min<t.max-t.min&&([n,e]=[e,n]),{min:n,max:e}}const s=.35;function m(t,i,n){return{min:a(t,i),max:a(t,n)}}function a(t,i){return"number"==typeof t?t:t[i]||0}exports.applyConstraints=function(t,{min:n,max:e},r){return void 0!==n&&t<n?t=r?i.mixNumber(n,t,r.min):Math.max(t,n):void 0!==e&&t>e&&(t=r?i.mixNumber(e,t,r.max):Math.min(t,e)),t},exports.calcOrigin=function(i,r){let o=.5;const s=t.calcLength(i),m=t.calcLength(r);return m>s?o=n.progress(r.min,r.max-s,i.min):s>m&&(o=n.progress(i.min,i.max-m,r.min)),e.clamp(0,1,o)},exports.calcRelativeAxisConstraints=r,exports.calcRelativeConstraints=function(t,{top:i,left:n,bottom:e,right:o}){return{x:r(t.x,n,o),y:r(t.y,i,e)}},exports.calcViewportAxisConstraints=o,exports.calcViewportConstraints=function(t,i){return{x:o(t.x,i.x),y:o(t.y,i.y)}},exports.defaultElastic=s,exports.rebaseAxisConstraints=function(t,i){const n={};return void 0!==i.min&&(n.min=i.min-t.min),void 0!==i.max&&(n.max=i.max-t.min),n},exports.resolveAxisElastic=m,exports.resolveDragElastic=function(t=.35){return!1===t?t=0:!0===t&&(t=s),{x:m(t,"left","right"),y:m(t,"top","bottom")}},exports.resolvePointElastic=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../../projection/geometry/delta-calc.mjs.js"),i=require("../../../../../../motion-dom/dist/es/utils/mix/number.mjs.js"),e=require("../../../../../../motion-utils/dist/es/progress.mjs.js"),n=require("../../../../../../motion-utils/dist/es/clamp.mjs.js");function r(t,i,e){return{min:void 0!==i?t.min+i:void 0,max:void 0!==e?t.max+e-(t.max-t.min):void 0}}function o(t,i){let e=i.min-t.min,n=i.max-t.max;return i.max-i.min<t.max-t.min&&([e,n]=[n,e]),{min:e,max:n}}const s=.35;function m(t,i,e){return{min:a(t,i),max:a(t,e)}}function a(t,i){return"number"==typeof t?t:t[i]||0}exports.applyConstraints=function(t,e,n){let{min:r,max:o}=e;return void 0!==r&&t<r?t=n?i.mixNumber(r,t,n.min):Math.max(t,r):void 0!==o&&t>o&&(t=n?i.mixNumber(o,t,n.max):Math.min(t,o)),t},exports.calcOrigin=function(i,r){let o=.5;const s=t.calcLength(i),m=t.calcLength(r);return m>s?o=e.progress(r.min,r.max-s,i.min):s>m&&(o=e.progress(i.min,i.max-m,r.min)),n.clamp(0,1,o)},exports.calcRelativeAxisConstraints=r,exports.calcRelativeConstraints=function(t,i){let{top:e,left:n,bottom:o,right:s}=i;return{x:r(t.x,n,s),y:r(t.y,e,o)}},exports.calcViewportAxisConstraints=o,exports.calcViewportConstraints=function(t,i){return{x:o(t.x,i.x),y:o(t.y,i.y)}},exports.defaultElastic=s,exports.rebaseAxisConstraints=function(t,i){const e={};return void 0!==i.min&&(e.min=i.min-t.min),void 0!==i.max&&(e.max=i.max-t.min),e},exports.resolveAxisElastic=m,exports.resolveDragElastic=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return!1===t?t=0:!0===t&&(t=s),{x:m(t,"left","right"),y:m(t,"top","bottom")}},exports.resolvePointElastic=a;
2
2
  //# sourceMappingURL=constraints.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constraints.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs"],"sourcesContent":["import { mixNumber } from 'motion-dom';\nimport { progress, clamp } from 'motion-utils';\nimport { calcLength } from '../../../projection/geometry/delta-calc.mjs';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n"],"names":["calcRelativeAxisConstraints","axis","min","max","undefined","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","point","elastic","mixNumber","Math","source","target","origin","sourceLength","calcLength","targetLength","progress","clamp","layoutBox","top","left","bottom","right","x","y","constraintsBox","layout","constraints","relativeConstraints"],"mappings":"mVA6BA,SAASA,EAA4BC,EAAMC,EAAKC,GAC5C,MAAO,CACHD,SAAaE,IAARF,EAAoBD,EAAKC,IAAMA,OAAME,EAC1CD,SAAaC,IAARD,EACCF,EAAKE,IAAMA,GAAOF,EAAKE,IAAMF,EAAKC,UAClCE,EAEd,CAcA,SAASC,EAA4BC,EAAYC,GAC7C,IAAIL,EAAMK,EAAgBL,IAAMI,EAAWJ,IACvCC,EAAMI,EAAgBJ,IAAMG,EAAWH,IAO3C,OAJII,EAAgBJ,IAAMI,EAAgBL,IACtCI,EAAWH,IAAMG,EAAWJ,OAC3BA,EAAKC,GAAO,CAACA,EAAKD,IAEhB,CAAEA,MAAKC,MAClB,CAuCMK,MAAAA,EAAiB,IAgBvB,SAASC,EAAmBC,EAAaC,EAAUC,GAC/C,MAAO,CACHV,IAAKW,EAAoBH,EAAaC,GACtCR,IAAKU,EAAoBH,EAAaE,GAE9C,CACA,SAASC,EAAoBH,EAAaI,GACtC,MAA8B,iBAAhBJ,EACRA,EACAA,EAAYI,IAAU,CAChC,0BApHA,SAA0BC,GAAOb,IAAEA,EAAGC,IAAEA,GAAOa,GAa3C,YAZYZ,IAARF,GAAqBa,EAAQb,EAE7Ba,EAAQC,EACFC,YAAUf,EAAKa,EAAOC,EAAQd,KAC9BgB,KAAKf,IAAIY,EAAOb,QAETE,IAARD,GAAqBY,EAAQZ,IAElCY,EAAQC,EACFC,YAAUd,EAAKY,EAAOC,EAAQb,KAC9Be,KAAKhB,IAAIa,EAAOZ,IAEnBY,CACX,qBAmDA,SAAoBI,EAAQC,GACxB,IAAIC,EAAS,GACb,MAAMC,EAAeC,aAAWJ,GAC1BK,EAAeD,aAAWH,GAOhC,OANII,EAAeF,EACfD,EAASI,EAAAA,SAASL,EAAOlB,IAAKkB,EAAOjB,IAAMmB,EAAcH,EAAOjB,KAE3DoB,EAAeE,IACpBH,EAASI,EAAAA,SAASN,EAAOjB,IAAKiB,EAAOhB,IAAMqB,EAAcJ,EAAOlB,MAE7DwB,QAAM,EAAG,EAAGL,EACvB,wEA5CA,SAAiCM,GAAWC,IAAEA,EAAGC,KAAEA,EAAIC,OAAEA,EAAMC,MAAEA,IAC7D,MAAO,CACHC,EAAGhC,EAA4B2B,EAAUK,EAAGH,EAAME,GAClDE,EAAGjC,EAA4B2B,EAAUM,EAAGL,EAAKE,GAEzD,wEAkBA,SAAiCH,EAAWO,GACxC,MAAO,CACHF,EAAG3B,EAA4BsB,EAAUK,EAAGE,EAAeF,GAC3DC,EAAG5B,EAA4BsB,EAAUM,EAAGC,EAAeD,GAEnE,yDAoBA,SAA+BE,EAAQC,GACnC,MAAMC,EAAsB,CAAA,EAO5B,YANwBjC,IAApBgC,EAAYlC,MACZmC,EAAoBnC,IAAMkC,EAAYlC,IAAMiC,EAAOjC,UAE/BE,IAApBgC,EAAYjC,MACZkC,EAAoBlC,IAAMiC,EAAYjC,IAAMgC,EAAOjC,KAEhDmC,CACX,0DAKA,SAA4B3B,EAAcF,KAOtC,OANoB,IAAhBE,EACAA,EAAc,GAEO,IAAhBA,IACLA,EAAcF,GAEX,CACHwB,EAAGvB,EAAmBC,EAAa,OAAQ,SAC3CuB,EAAGxB,EAAmBC,EAAa,MAAO,UAElD"}
1
+ {"version":3,"file":"constraints.mjs.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs"],"sourcesContent":["import { mixNumber } from 'motion-dom';\nimport { progress, clamp } from 'motion-utils';\nimport { calcLength } from '../../../projection/geometry/delta-calc.mjs';\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nfunction applyConstraints(point, { min, max }, elastic) {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min);\n }\n else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max);\n }\n return point;\n}\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nfunction calcRelativeAxisConstraints(axis, min, max) {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max: max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n };\n}\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nfunction calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nfunction calcViewportAxisConstraints(layoutAxis, constraintsAxis) {\n let min = constraintsAxis.min - layoutAxis.min;\n let max = constraintsAxis.max - layoutAxis.max;\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min) {\n [min, max] = [max, min];\n }\n return { min, max };\n}\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nfunction calcViewportConstraints(layoutBox, constraintsBox) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n };\n}\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nfunction calcOrigin(source, target) {\n let origin = 0.5;\n const sourceLength = calcLength(source);\n const targetLength = calcLength(target);\n if (targetLength > sourceLength) {\n origin = progress(target.min, target.max - sourceLength, source.min);\n }\n else if (sourceLength > targetLength) {\n origin = progress(source.min, source.max - targetLength, target.min);\n }\n return clamp(0, 1, origin);\n}\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nfunction rebaseAxisConstraints(layout, constraints) {\n const relativeConstraints = {};\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min;\n }\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min;\n }\n return relativeConstraints;\n}\nconst defaultElastic = 0.35;\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nfunction resolveDragElastic(dragElastic = defaultElastic) {\n if (dragElastic === false) {\n dragElastic = 0;\n }\n else if (dragElastic === true) {\n dragElastic = defaultElastic;\n }\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n };\n}\nfunction resolveAxisElastic(dragElastic, minLabel, maxLabel) {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n };\n}\nfunction resolvePointElastic(dragElastic, label) {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label] || 0;\n}\n\nexport { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };\n"],"names":["calcRelativeAxisConstraints","axis","min","max","undefined","calcViewportAxisConstraints","layoutAxis","constraintsAxis","defaultElastic","resolveAxisElastic","dragElastic","minLabel","maxLabel","resolvePointElastic","label","point","_ref","elastic","mixNumber","Math","source","target","origin","sourceLength","calcLength","targetLength","progress","clamp","layoutBox","_ref2","top","left","bottom","right","x","y","constraintsBox","layout","constraints","relativeConstraints","arguments","length"],"mappings":"mVA6BA,SAASA,EAA4BC,EAAMC,EAAKC,GAC5C,MAAO,CACHD,SAAaE,IAARF,EAAoBD,EAAKC,IAAMA,OAAME,EAC1CD,SAAaC,IAARD,EACCF,EAAKE,IAAMA,GAAOF,EAAKE,IAAMF,EAAKC,UAClCE,EAEd,CAcA,SAASC,EAA4BC,EAAYC,GAC7C,IAAIL,EAAMK,EAAgBL,IAAMI,EAAWJ,IACvCC,EAAMI,EAAgBJ,IAAMG,EAAWH,IAO3C,OAJII,EAAgBJ,IAAMI,EAAgBL,IACtCI,EAAWH,IAAMG,EAAWJ,OAC3BA,EAAKC,GAAO,CAACA,EAAKD,IAEhB,CAAEA,MAAKC,MAClB,CAuCMK,MAAAA,EAAiB,IAgBvB,SAASC,EAAmBC,EAAaC,EAAUC,GAC/C,MAAO,CACHV,IAAKW,EAAoBH,EAAaC,GACtCR,IAAKU,EAAoBH,EAAaE,GAE9C,CACA,SAASC,EAAoBH,EAAaI,GACtC,MAA8B,iBAAhBJ,EACRA,EACAA,EAAYI,IAAU,CAChC,0BApHA,SAA0BC,EAAKC,EAAgBC,GAAS,IAAvBf,IAAEA,EAAGC,IAAEA,GAAKa,EAazC,YAZYZ,IAARF,GAAqBa,EAAQb,EAE7Ba,EAAQE,EACFC,YAAUhB,EAAKa,EAAOE,EAAQf,KAC9BiB,KAAKhB,IAAIY,EAAOb,QAETE,IAARD,GAAqBY,EAAQZ,IAElCY,EAAQE,EACFC,YAAUf,EAAKY,EAAOE,EAAQd,KAC9BgB,KAAKjB,IAAIa,EAAOZ,IAEnBY,CACX,qBAmDA,SAAoBK,EAAQC,GACxB,IAAIC,EAAS,GACb,MAAMC,EAAeC,aAAWJ,GAC1BK,EAAeD,aAAWH,GAOhC,OANII,EAAeF,EACfD,EAASI,EAAAA,SAAS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