@mks2508/sidebar-headless 0.2.0 → 0.3.0

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 (130) hide show
  1. package/CHANGELOG.md +53 -53
  2. package/LICENSE +21 -21
  3. package/README.md +165 -165
  4. package/dist/components/BottomNavBar/MobileBottomNav.d.ts +65 -0
  5. package/dist/components/BottomNavBar/MobileBottomNav.d.ts.map +1 -0
  6. package/dist/components/BottomNavBar/MobileBottomNav.styles.d.ts +94 -0
  7. package/dist/components/BottomNavBar/MobileBottomNav.styles.d.ts.map +1 -0
  8. package/dist/components/BottomNavBar/index.d.ts +10 -0
  9. package/dist/components/BottomNavBar/index.d.ts.map +1 -0
  10. package/dist/components/BottomNavBar/types.d.ts +363 -0
  11. package/dist/components/BottomNavBar/types.d.ts.map +1 -0
  12. package/dist/components/BottomNavBar/useIOSSafariFix.d.ts +74 -0
  13. package/dist/components/BottomNavBar/useIOSSafariFix.d.ts.map +1 -0
  14. package/dist/components/Sidebar/Sidebar.constants.d.ts +285 -0
  15. package/dist/components/Sidebar/Sidebar.constants.d.ts.map +1 -0
  16. package/dist/components/Sidebar/Sidebar.d.ts +80 -0
  17. package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
  18. package/dist/components/Sidebar/Sidebar.styles.d.ts +77 -0
  19. package/dist/components/Sidebar/Sidebar.styles.d.ts.map +1 -0
  20. package/dist/components/Sidebar/Sidebar.types.d.ts +638 -0
  21. package/dist/components/Sidebar/Sidebar.types.d.ts.map +1 -0
  22. package/dist/components/Sidebar/SidebarContent.d.ts +46 -0
  23. package/dist/components/Sidebar/SidebarContent.d.ts.map +1 -0
  24. package/dist/components/Sidebar/SidebarContext.d.ts +87 -0
  25. package/dist/components/Sidebar/SidebarContext.d.ts.map +1 -0
  26. package/dist/components/Sidebar/SidebarFluidIndicator.d.ts +37 -0
  27. package/dist/components/Sidebar/SidebarFluidIndicator.d.ts.map +1 -0
  28. package/dist/components/Sidebar/SidebarIndicator.d.ts +59 -0
  29. package/dist/components/Sidebar/SidebarIndicator.d.ts.map +1 -0
  30. package/dist/components/Sidebar/SidebarItem.d.ts +82 -0
  31. package/dist/components/Sidebar/SidebarItem.d.ts.map +1 -0
  32. package/dist/components/Sidebar/SidebarNav.d.ts +48 -0
  33. package/dist/components/Sidebar/SidebarNav.d.ts.map +1 -0
  34. package/dist/components/Sidebar/SidebarSafeArea.d.ts +56 -0
  35. package/dist/components/Sidebar/SidebarSafeArea.d.ts.map +1 -0
  36. package/dist/components/Sidebar/SidebarSubContent.d.ts +10 -0
  37. package/dist/components/Sidebar/SidebarSubContent.d.ts.map +1 -0
  38. package/dist/components/Sidebar/SidebarSubLink.d.ts +18 -0
  39. package/dist/components/Sidebar/SidebarSubLink.d.ts.map +1 -0
  40. package/dist/components/Sidebar/SidebarToggle.d.ts +52 -0
  41. package/dist/components/Sidebar/SidebarToggle.d.ts.map +1 -0
  42. package/dist/components/Sidebar/SidebarTooltip.d.ts +26 -0
  43. package/dist/components/Sidebar/SidebarTooltip.d.ts.map +1 -0
  44. package/dist/components/Sidebar/TooltipTitle3D.d.ts +42 -0
  45. package/dist/components/Sidebar/TooltipTitle3D.d.ts.map +1 -0
  46. package/dist/components/Sidebar/TooltipTitle3DCrossfade.d.ts +46 -0
  47. package/dist/components/Sidebar/TooltipTitle3DCrossfade.d.ts.map +1 -0
  48. package/dist/components/Sidebar/TooltipTitleCylinder.d.ts +9 -0
  49. package/dist/components/Sidebar/TooltipTitleCylinder.d.ts.map +1 -0
  50. package/dist/components/Sidebar/hooks/useSidebarContext.d.ts +48 -0
  51. package/dist/components/Sidebar/hooks/useSidebarContext.d.ts.map +1 -0
  52. package/dist/components/Sidebar/hooks/useSidebarIndicator.d.ts +72 -0
  53. package/dist/components/Sidebar/hooks/useSidebarIndicator.d.ts.map +1 -0
  54. package/dist/components/Sidebar/hooks/useSidebarKeyboard.d.ts +51 -0
  55. package/dist/components/Sidebar/hooks/useSidebarKeyboard.d.ts.map +1 -0
  56. package/dist/components/Sidebar/hooks/useSubContent.d.ts +7 -0
  57. package/dist/components/Sidebar/hooks/useSubContent.d.ts.map +1 -0
  58. package/dist/components/Sidebar/hooks/useTitleHistory.d.ts +41 -0
  59. package/dist/components/Sidebar/hooks/useTitleHistory.d.ts.map +1 -0
  60. package/dist/components/Sidebar/hooks/useTooltipDirection.d.ts +29 -0
  61. package/dist/components/Sidebar/hooks/useTooltipDirection.d.ts.map +1 -0
  62. package/dist/components/Sidebar/hooks/useTooltipTransition.d.ts +60 -0
  63. package/dist/components/Sidebar/hooks/useTooltipTransition.d.ts.map +1 -0
  64. package/dist/components/Sidebar/index.d.ts +163 -0
  65. package/dist/components/Sidebar/index.d.ts.map +1 -0
  66. package/dist/components/Sidebar/sidebar-defaults.d.ts +54 -0
  67. package/dist/components/Sidebar/sidebar-defaults.d.ts.map +1 -0
  68. package/dist/components/animate-ui/components/base/switch.d.ts +11 -0
  69. package/dist/components/animate-ui/components/base/switch.d.ts.map +1 -0
  70. package/dist/components/animate-ui/primitives/base/switch.d.ts +23 -0
  71. package/dist/components/animate-ui/primitives/base/switch.d.ts.map +1 -0
  72. package/dist/components/fluid-hover-indicator-v2.d.ts +46 -0
  73. package/dist/components/fluid-hover-indicator-v2.d.ts.map +1 -0
  74. package/dist/components/fluid-hover-indicator.d.ts +28 -0
  75. package/dist/components/fluid-hover-indicator.d.ts.map +1 -0
  76. package/dist/components/ui/TextCylinder.d.ts +21 -0
  77. package/dist/components/ui/TextCylinder.d.ts.map +1 -0
  78. package/dist/components/ui/button.d.ts +11 -0
  79. package/dist/components/ui/button.d.ts.map +1 -0
  80. package/dist/components/ui/card.d.ts +10 -0
  81. package/dist/components/ui/card.d.ts.map +1 -0
  82. package/dist/components/ui/custom-icon.d.ts +45 -0
  83. package/dist/components/ui/custom-icon.d.ts.map +1 -0
  84. package/dist/components/ui/dotted-glow-background.d.ts +42 -0
  85. package/dist/components/ui/dotted-glow-background.d.ts.map +1 -0
  86. package/dist/components/ui/input.d.ts +4 -0
  87. package/dist/components/ui/input.d.ts.map +1 -0
  88. package/dist/components/ui/label.d.ts +5 -0
  89. package/dist/components/ui/label.d.ts.map +1 -0
  90. package/dist/components/ui/optimized-image.d.ts +12 -0
  91. package/dist/components/ui/optimized-image.d.ts.map +1 -0
  92. package/dist/components/ui/select.d.ts +16 -0
  93. package/dist/components/ui/select.d.ts.map +1 -0
  94. package/dist/components/ui/slider.d.ts +5 -0
  95. package/dist/components/ui/slider.d.ts.map +1 -0
  96. package/dist/components/ui/textarea.d.ts +4 -0
  97. package/dist/components/ui/textarea.d.ts.map +1 -0
  98. package/dist/{index.css → dist/index.css} +945 -908
  99. package/dist/dist/index.css.map +1 -0
  100. package/dist/hooks/use-controlled-state.d.ts +9 -0
  101. package/dist/hooks/use-controlled-state.d.ts.map +1 -0
  102. package/dist/hooks/use-fluid-animation.d.ts +18 -0
  103. package/dist/hooks/use-fluid-animation.d.ts.map +1 -0
  104. package/dist/hooks/use-liquid-glass.d.ts +40 -0
  105. package/dist/hooks/use-liquid-glass.d.ts.map +1 -0
  106. package/dist/hooks/use-sidebar-liquid-glass.d.ts +48 -0
  107. package/dist/hooks/use-sidebar-liquid-glass.d.ts.map +1 -0
  108. package/dist/hooks/use-text-cylinder.d.ts +67 -0
  109. package/dist/hooks/use-text-cylinder.d.ts.map +1 -0
  110. package/dist/index.cjs +14087 -0
  111. package/dist/index.cjs.map +1 -0
  112. package/dist/index.d.ts +10 -2231
  113. package/dist/index.d.ts.map +1 -0
  114. package/dist/index.js +13132 -52336
  115. package/dist/index.js.map +1 -1
  116. package/dist/lib/get-strict-context.d.ts +10 -0
  117. package/dist/lib/get-strict-context.d.ts.map +1 -0
  118. package/dist/lib/liquid-glass-presets.d.ts +43 -0
  119. package/dist/lib/liquid-glass-presets.d.ts.map +1 -0
  120. package/dist/lib/utils.d.ts +3 -0
  121. package/dist/lib/utils.d.ts.map +1 -0
  122. package/dist/types/sidebar-minimal.d.ts +21 -0
  123. package/dist/types/sidebar-minimal.d.ts.map +1 -0
  124. package/dist/utils/TooltipAnimationController.d.ts +122 -0
  125. package/dist/utils/TooltipAnimationController.d.ts.map +1 -0
  126. package/package.json +12 -6
  127. package/dist/MobileOptimizations.css +0 -570
  128. package/dist/index.css.map +0 -1
  129. package/dist/index.d.cts +0 -2235
  130. package/dist/tooltip-keyframes.css +0 -329
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["isValidElement","animations","animations","distance","now","keyframes","prev","styles","distance","getChildKey","Children","animations","animations","Component","Component","Component","Component","percent","Component","Component","Component","useLayoutEffect","useEffect","ease","frameData","alpha","getAnimatableNone","mixNumber","progress","color","mixNumber","mixNumber","scale","progress","undampedFreq","progress","keyframes","ease","mixNumber","ease","isNotNull","getFinalKeyframe","keyframes","percent","motionValue","delay","progress","keyframes","getFinalKeyframe","now","keyframes","motionValue","keyframes","ease","keyframes","getFinalKeyframe","delay","motionValue","keyframes","motionValue","keyframes","motionValue","delay","getFinalKeyframe","number","motionValue","React","React","id","id","id","Fragment","layout","hasTransform","isSVGTag","Component","Component","Component","Fragment","scrapeMotionValuesFromProps","scrapeMotionValuesFromProps","Component","createProjectionNode","drag","layout","Component","MeasureLayout","drag","layout","Component","transformPoint","scale","scaleX","scaleY","scale","distance","mixNumber","transformPoint","rootProjectionNode","now","getComputedStyle","scrapeMotionValuesFromProps","Component","Fragment","keyframes","keyframes","delay","animations","animations","delay","animations","context","animations","motionValue","id","mixNumber","layout","point","event","time","mixNumber","layout","drag","isDragging","layout","inertia","mixNumber","motionValue","mixNumber","Component","drag","keyframes","mixNumber","progress","scale","mixNumber","rotate","layout","now","progress","mixNumber","param","React"],"sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/Sidebar/Sidebar.types.ts","../src/components/Sidebar/Sidebar.constants.ts","../src/components/Sidebar/sidebar-defaults.ts","../src/components/Sidebar/SidebarContext.tsx","../src/components/Sidebar/Sidebar.tsx","../src/lib/utils.ts","../src/components/Sidebar/hooks/useSidebarContext.ts","../src/components/Sidebar/hooks/useSubContent.ts","../src/components/Sidebar/hooks/useSidebarIndicator.ts","../src/components/Sidebar/hooks/useSidebarKeyboard.ts","../src/hooks/use-liquid-glass.ts","../src/lib/liquid-glass-presets.ts","../src/hooks/use-sidebar-liquid-glass.ts","../src/hooks/use-fluid-animation.ts","../src/components/fluid-hover-indicator.tsx","../src/components/fluid-hover-indicator-v2.tsx","../src/components/Sidebar/SidebarFluidIndicator.tsx","../src/components/Sidebar/hooks/useTooltipDirection.ts","../src/hooks/use-text-cylinder.ts","../src/components/ui/text-cylinder.module.css","../src/components/ui/TextCylinder.tsx","../src/components/Sidebar/hooks/useTitleHistory.ts","../src/components/Sidebar/TooltipTitleCylinder.tsx","../src/components/Sidebar/SidebarTooltip.tsx","../src/components/Sidebar/Sidebar.styles.ts","../src/components/Sidebar/SidebarNav.tsx","../src/components/Sidebar/SidebarToggle.tsx","../src/components/Sidebar/SidebarContent.tsx","../src/components/Sidebar/SidebarIndicator.tsx","../src/components/Sidebar/SidebarSafeArea.tsx","../src/components/Sidebar/SidebarSubContent.tsx","../src/components/Sidebar/SidebarItem.tsx","../src/components/Sidebar/SidebarSubLink.tsx","../node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","../node_modules/framer-motion/dist/es/utils/use-constant.mjs","../node_modules/framer-motion/dist/es/utils/is-browser.mjs","../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../node_modules/framer-motion/dist/es/context/PresenceContext.mjs","../node_modules/motion-utils/dist/es/array.mjs","../node_modules/motion-utils/dist/es/clamp.mjs","../node_modules/motion-utils/dist/es/format-error-message.mjs","../node_modules/motion-utils/dist/es/errors.mjs","../node_modules/motion-utils/dist/es/global-config.mjs","../node_modules/motion-utils/dist/es/is-numerical-string.mjs","../node_modules/motion-utils/dist/es/is-object.mjs","../node_modules/motion-utils/dist/es/is-zero-value-string.mjs","../node_modules/motion-utils/dist/es/memo.mjs","../node_modules/motion-utils/dist/es/noop.mjs","../node_modules/motion-utils/dist/es/pipe.mjs","../node_modules/motion-utils/dist/es/progress.mjs","../node_modules/motion-utils/dist/es/subscription-manager.mjs","../node_modules/motion-utils/dist/es/time-conversion.mjs","../node_modules/motion-utils/dist/es/velocity-per-second.mjs","../node_modules/motion-utils/dist/es/warn-once.mjs","../node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs","../node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs","../node_modules/motion-utils/dist/es/easing/modifiers/reverse.mjs","../node_modules/motion-utils/dist/es/easing/back.mjs","../node_modules/motion-utils/dist/es/easing/anticipate.mjs","../node_modules/motion-utils/dist/es/easing/circ.mjs","../node_modules/motion-utils/dist/es/easing/ease.mjs","../node_modules/motion-utils/dist/es/easing/utils/is-easing-array.mjs","../node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../node_modules/motion-utils/dist/es/easing/utils/map.mjs","../node_modules/motion-dom/dist/es/frameloop/order.mjs","../node_modules/motion-dom/dist/es/stats/buffer.mjs","../node_modules/motion-dom/dist/es/frameloop/render-step.mjs","../node_modules/motion-dom/dist/es/frameloop/batcher.mjs","../node_modules/motion-dom/dist/es/frameloop/frame.mjs","../node_modules/motion-dom/dist/es/frameloop/sync-time.mjs","../node_modules/motion-dom/dist/es/stats/animation-count.mjs","../node_modules/motion-dom/dist/es/animation/utils/is-css-variable.mjs","../node_modules/motion-dom/dist/es/value/types/numbers/index.mjs","../node_modules/motion-dom/dist/es/value/types/utils/sanitize.mjs","../node_modules/motion-dom/dist/es/value/types/utils/float-regex.mjs","../node_modules/motion-dom/dist/es/value/types/utils/is-nullish.mjs","../node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../node_modules/motion-dom/dist/es/value/types/color/utils.mjs","../node_modules/motion-dom/dist/es/value/types/color/rgba.mjs","../node_modules/motion-dom/dist/es/value/types/color/hex.mjs","../node_modules/motion-dom/dist/es/value/types/numbers/units.mjs","../node_modules/motion-dom/dist/es/value/types/color/hsla.mjs","../node_modules/motion-dom/dist/es/value/types/color/index.mjs","../node_modules/motion-dom/dist/es/value/types/utils/color-regex.mjs","../node_modules/motion-dom/dist/es/value/types/complex/index.mjs","../node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../node_modules/motion-dom/dist/es/utils/mix/immediate.mjs","../node_modules/motion-dom/dist/es/utils/mix/number.mjs","../node_modules/motion-dom/dist/es/utils/mix/color.mjs","../node_modules/motion-dom/dist/es/utils/mix/visibility.mjs","../node_modules/motion-dom/dist/es/utils/mix/complex.mjs","../node_modules/motion-dom/dist/es/utils/mix/index.mjs","../node_modules/motion-dom/dist/es/animation/drivers/frame.mjs","../node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs","../node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs","../node_modules/motion-dom/dist/es/animation/generators/spring/defaults.mjs","../node_modules/motion-dom/dist/es/animation/generators/spring/find.mjs","../node_modules/motion-dom/dist/es/animation/generators/spring/index.mjs","../node_modules/motion-dom/dist/es/animation/generators/inertia.mjs","../node_modules/motion-dom/dist/es/utils/interpolate.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs","../node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs","../node_modules/motion-dom/dist/es/animation/JSAnimation.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../node_modules/motion-dom/dist/es/render/dom/parse-transform.mjs","../node_modules/motion-dom/dist/es/render/utils/keys-transform.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs","../node_modules/motion-dom/dist/es/render/dom/style-set.mjs","../node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../node_modules/motion-dom/dist/es/utils/supports/flags.mjs","../node_modules/motion-dom/dist/es/utils/supports/memo.mjs","../node_modules/motion-dom/dist/es/utils/supports/linear-easing.mjs","../node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../node_modules/motion-dom/dist/es/animation/waapi/easing/supported.mjs","../node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs","../node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../node_modules/motion-dom/dist/es/animation/utils/is-animatable.mjs","../node_modules/motion-dom/dist/es/animation/utils/can-animate.mjs","../node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs","../node_modules/motion-dom/dist/es/render/utils/keys-position.mjs","../node_modules/motion-dom/dist/es/value/types/auto.mjs","../node_modules/motion-dom/dist/es/value/types/test.mjs","../node_modules/motion-dom/dist/es/value/types/dimensions.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../node_modules/motion-dom/dist/es/value/types/complex/filter.mjs","../node_modules/motion-dom/dist/es/value/types/int.mjs","../node_modules/motion-dom/dist/es/value/types/maps/transform.mjs","../node_modules/motion-dom/dist/es/value/types/maps/number.mjs","../node_modules/motion-dom/dist/es/value/types/maps/defaults.mjs","../node_modules/motion-dom/dist/es/value/types/utils/animatable-none.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../node_modules/motion-dom/dist/es/utils/resolve-elements.mjs","../node_modules/motion-dom/dist/es/value/types/utils/get-as-type.mjs","../node_modules/motion-dom/dist/es/utils/is-html-element.mjs","../node_modules/motion-dom/dist/es/value/index.mjs","../node_modules/motion-dom/dist/es/frameloop/microtask.mjs","../node_modules/motion-dom/dist/es/gestures/drag/state/is-active.mjs","../node_modules/motion-dom/dist/es/gestures/drag/state/set-active.mjs","../node_modules/motion-dom/dist/es/gestures/utils/setup.mjs","../node_modules/motion-dom/dist/es/gestures/hover.mjs","../node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.mjs","../node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs","../node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs","../node_modules/motion-dom/dist/es/gestures/press/utils/state.mjs","../node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.mjs","../node_modules/motion-dom/dist/es/gestures/press/index.mjs","../node_modules/motion-dom/dist/es/utils/is-svg-element.mjs","../node_modules/motion-dom/dist/es/utils/is-svg-svg-element.mjs","../node_modules/motion-dom/dist/es/value/utils/is-motion-value.mjs","../node_modules/motion-dom/dist/es/value/types/utils/find.mjs","../node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","../node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/utils.mjs","../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","../node_modules/framer-motion/dist/es/context/LazyContext.mjs","../node_modules/framer-motion/dist/es/motion/features/definitions.mjs","../node_modules/framer-motion/dist/es/motion/features/load-features.mjs","../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs","../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs","../node_modules/framer-motion/dist/es/context/MotionContext/index.mjs","../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs","../node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs","../node_modules/framer-motion/dist/es/render/utils/variant-props.mjs","../node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs","../node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs","../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs","../node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs","../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs","../node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs","../node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs","../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs","../node_modules/framer-motion/dist/es/render/html/use-props.mjs","../node_modules/framer-motion/dist/es/render/svg/utils/path.mjs","../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs","../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs","../node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs","../node_modules/framer-motion/dist/es/render/svg/use-props.mjs","../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs","../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","../node_modules/framer-motion/dist/es/render/dom/use-render.mjs","../node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs","../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs","../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs","../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs","../node_modules/framer-motion/dist/es/render/html/use-html-visual-state.mjs","../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs","../node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.mjs","../node_modules/framer-motion/dist/es/motion/utils/symbol.mjs","../node_modules/framer-motion/dist/es/utils/is-ref-object.mjs","../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs","../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs","../node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs","../node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs","../node_modules/framer-motion/dist/es/motion/index.mjs","../node_modules/framer-motion/dist/es/render/components/create-proxy.mjs","../node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs","../node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs","../node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs","../node_modules/framer-motion/dist/es/projection/utils/measure.mjs","../node_modules/framer-motion/dist/es/projection/geometry/models.mjs","../node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs","../node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs","../node_modules/framer-motion/dist/es/render/store.mjs","../node_modules/framer-motion/dist/es/render/utils/motion-values.mjs","../node_modules/framer-motion/dist/es/render/VisualElement.mjs","../node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs","../node_modules/framer-motion/dist/es/render/html/utils/render.mjs","../node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs","../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs","../node_modules/framer-motion/dist/es/render/svg/utils/render.mjs","../node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs","../node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs","../node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs","../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs","../node_modules/framer-motion/dist/es/render/utils/setters.mjs","../node_modules/framer-motion/dist/es/value/use-will-change/is.mjs","../node_modules/framer-motion/dist/es/value/use-will-change/add-will-change.mjs","../node_modules/framer-motion/dist/es/animation/optimized-appear/get-appear-id.mjs","../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs","../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs","../node_modules/framer-motion/dist/es/animation/utils/is-transition-defined.mjs","../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs","../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs","../node_modules/framer-motion/dist/es/animation/utils/calc-child-stagger.mjs","../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs","../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs","../node_modules/framer-motion/dist/es/utils/shallow-compare.mjs","../node_modules/framer-motion/dist/es/render/utils/get-variant-context.mjs","../node_modules/framer-motion/dist/es/render/utils/animation-state.mjs","../node_modules/framer-motion/dist/es/motion/features/Feature.mjs","../node_modules/framer-motion/dist/es/motion/features/animation/index.mjs","../node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs","../node_modules/framer-motion/dist/es/motion/features/animations.mjs","../node_modules/framer-motion/dist/es/events/add-dom-event.mjs","../node_modules/framer-motion/dist/es/events/event-info.mjs","../node_modules/framer-motion/dist/es/events/add-pointer-event.mjs","../node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs","../node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs","../node_modules/framer-motion/dist/es/utils/get-context-window.mjs","../node_modules/framer-motion/dist/es/utils/distance.mjs","../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs","../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs","../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","../node_modules/framer-motion/dist/es/gestures/drag/index.mjs","../node_modules/framer-motion/dist/es/gestures/pan/index.mjs","../node_modules/framer-motion/dist/es/projection/node/state.mjs","../node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs","../node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs","../node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","../node_modules/framer-motion/dist/es/animation/animate/single-value.mjs","../node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs","../node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs","../node_modules/framer-motion/dist/es/utils/delay.mjs","../node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs","../node_modules/framer-motion/dist/es/projection/geometry/copy.mjs","../node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs","../node_modules/framer-motion/dist/es/projection/geometry/utils.mjs","../node_modules/framer-motion/dist/es/projection/shared/stack.mjs","../node_modules/framer-motion/dist/es/projection/styles/transform.mjs","../node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs","../node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs","../node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs","../node_modules/framer-motion/dist/es/motion/features/drag.mjs","../node_modules/framer-motion/dist/es/gestures/hover.mjs","../node_modules/framer-motion/dist/es/gestures/focus.mjs","../node_modules/framer-motion/dist/es/gestures/press.mjs","../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs","../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs","../node_modules/framer-motion/dist/es/motion/features/gestures.mjs","../node_modules/framer-motion/dist/es/motion/features/layout.mjs","../node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.mjs","../node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs","../src/components/BottomNavBar/types.ts","../node_modules/class-variance-authority/dist/index.mjs","../src/components/BottomNavBar/MobileBottomNav.styles.ts","../src/components/BottomNavBar/useIOSSafariFix.ts","../src/components/BottomNavBar/MobileBottomNav.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import type { ComponentType, ReactNode, CSSProperties, ElementType, RefObject } from \"react\"\nimport type { SidebarLiquidConfig } from \"@/lib/liquid-glass-presets\"\n\n// ============================================================================\n// ENUMS\n// ============================================================================\n\n/**\n * Modo de colapso del sidebar\n * @enum {string}\n */\nexport enum SidebarCollapseMode {\n /** Colapsa el sidebar a un ancho mínimo mostrando solo iconos */\n COLLAPSE = \"collapse\",\n /** Oculta completamente el sidebar */\n HIDE = \"hide\",\n}\n\n/**\n * Comportamiento del sidebar cuando está en modo hide\n * @enum {string}\n */\nexport enum SidebarHideBehaviour {\n /** Muestra un botón indicador para reabrir el sidebar */\n SHOW_INDICATOR = \"showIndicator\",\n /** El sidebar es completamente controlado externamente sin indicador */\n CONTROLLED = \"controlled\",\n}\n\n/**\n * Comportamiento al abrir desde el estado hide\n * @enum {string}\n */\nexport enum SidebarHideOpensBehavior {\n /** Abre al tamaño colapsado (solo iconos) */\n COLLAPSED = \"collapsed\",\n /** Abre al tamaño expandido completo */\n EXPANDED = \"expanded\",\n}\n\n/**\n * Comportamiento de layout del sidebar\n * @enum {string}\n */\nexport enum SidebarLayoutBehaviour {\n /** Sidebar flotante con z-index que NO desplaza el contenido (default) */\n FLOATING = \"floating\",\n /** Sidebar como parte del layout que SÍ desplaza el contenido */\n INLINE = \"inline\",\n}\n\n/**\n * Anchos predefinidos del sidebar\n * @enum {string}\n */\nexport enum SidebarWidth {\n /** Ancho en estado colapsado (solo iconos) */\n COLLAPSED = \"5rem\",\n /** Ancho expandido completo */\n EXPANDED = \"16rem\",\n /** Ancho mínimo absoluto */\n MIN = \"3rem\",\n /** Ancho máximo absoluto */\n MAX = \"20rem\",\n}\n\n/**\n * Duraciones de transición en milisegundos\n * @enum {number}\n */\nexport enum SidebarTransitionDuration {\n /** Transición rápida para cambios de opacidad */\n FAST = 200,\n /** Transición normal para width y transforms */\n NORMAL = 300,\n /** Transición lenta para animaciones complejas */\n SLOW = 500,\n}\n\n/**\n * Índices Z para capas del sidebar\n * @enum {number}\n */\nexport enum SidebarZIndex {\n /** Base del contenedor wrapper */\n BASE = 0,\n /** Indicador visual */\n INDICATOR = 5,\n /** Contenido interno del sidebar */\n CONTENT = 10,\n /** Botón de toggle */\n TOGGLE = 30,\n}\n\n/**\n * Radios de borde predefinidos\n * @enum {string}\n */\nexport enum SidebarBorderRadius {\n /** Sin radio de borde */\n NONE = \"0\",\n /** Radio pequeño */\n SM = \"0.25rem\",\n /** Radio medio */\n MD = \"0.5rem\",\n /** Radio grande */\n LG = \"1rem\",\n /** Radio completo (circular) */\n FULL = \"9999px\",\n}\n\n/**\n * Posiciones para SidebarSafeArea\n * @enum {string}\n */\nexport enum SidebarSafeAreaPosition {\n /** Área segura superior */\n TOP = \"top\",\n /** Área segura inferior */\n BOTTOM = \"bottom\",\n}\n\n/**\n * Timing functions para transiciones CSS\n * @enum {string}\n */\nexport enum SidebarTimingFunction {\n /** Ease estándar */\n EASE = \"ease\",\n /** Linear (velocidad constante) */\n LINEAR = \"linear\",\n /** Ease in (aceleración) */\n EASE_IN = \"ease-in\",\n /** Ease out (desaceleración) */\n EASE_OUT = \"ease-out\",\n /** Ease in out (aceleración y desaceleración) */\n EASE_IN_OUT = \"ease-in-out\",\n /** Cubic bezier personalizado */\n CUSTOM = \"cubic-bezier(0.4, 0, 0.2, 1)\",\n}\n\n// ============================================================================\n// INTERFACES DE CONFIGURACIÓN\n// ============================================================================\n\n/**\n * Configuración de estilo visual del sidebar\n * @interface\n */\nexport interface SidebarVisualStyle {\n /** Margen superior (separación del borde superior) */\n marginTop?: string\n /** Margen inferior (separación del borde inferior) */\n marginBottom?: string\n /** Margen izquierdo (separación del borde izquierdo) */\n marginLeft?: string\n /** Margen derecho (generalmente 0 en modo inline) */\n marginRight?: string\n /** Altura del sidebar (default: \"100vh\") */\n height?: string\n /** Radio de borde redondeado */\n borderRadius?: string\n /** Sombra del sidebar */\n boxShadow?: string\n}\n\n/**\n * Configuración de dimensiones del sidebar\n * @interface\n */\nexport interface SidebarDimensions {\n /** Ancho cuando está colapsado */\n collapsedWidth: string\n /** Ancho cuando está expandido */\n expandedWidth: string\n /** Altura del indicador visual */\n indicatorHeight: string\n /** Distancia del tooltip al borde del sidebar (CSS-first con Anchor API) */\n tooltipDistance?: string\n /** Configuración de estilo visual */\n visualStyle?: SidebarVisualStyle\n}\n\n/**\n * Configuración de áreas seguras (safe areas)\n * @interface\n */\nexport interface SidebarSafeAreas {\n /** Porcentaje de altura para área segura superior */\n topPercent: number\n /** Porcentaje de altura para área segura inferior */\n bottomPercent: number\n}\n\n/**\n * Configuración de animaciones\n * @interface\n */\nexport interface SidebarAnimations {\n /** Duración de transición de width en ms */\n widthTransitionDuration: number\n /** Duración de transición de opacidad en ms */\n opacityTransitionDuration: number\n /** Función de timing para animaciones */\n timingFunction: string\n}\n\n/**\n * Configuración experimental de Liquid Glass V2\n *\n * @description\n * Feature flags para habilitar efectos avanzados de liquid glass basados en:\n * - SVG Displacement Mapping (Snell's Law refraction)\n * - Chromatic Aberration (RGB channel separation)\n * - Edge Glass 3D (dual backdrop layers)\n * - Backdrop Extension (Josh Comeau technique)\n *\n * @interface\n * @experimental\n */\nexport interface SidebarLiquidGlassConfig {\n /**\n * Habilitar Liquid Glass V2 (master flag)\n *\n * @description\n * Activa el uso de FluidHoverIndicatorV2 y SidebarTooltipV2 con SVG displacement mapping\n * en lugar de las versiones básicas con backdrop-blur CSS.\n *\n * @default false\n */\n enableLiquidGlassV2?: boolean\n\n /**\n * Habilitar Chromatic Aberration (Phase 2)\n *\n * @description\n * Activa la separación real de canales RGB usando feColorMatrix + feOffset\n * en lugar del método legacy basado en diferentes escalas de displacement.\n * Proporciona +15% de realismo visual según benchmarks.\n *\n * **Requiere**: enableLiquidGlassV2 = true\n *\n * @default false\n */\n enableChromaticAberration?: boolean\n\n /**\n * Habilitar Edge Glass 3D (tooltips)\n *\n * @description\n * Activa dual backdrop layers con blur diferenciado para crear ilusión de profundidad:\n * - Depth layer: blur alto (16px) con brightness 1.15\n * - Surface layer: blur moderado (8px) con brightness 1.25\n *\n * **Solo aplica a**: SidebarTooltipV2\n * **Requiere**: enableLiquidGlassV2 = true\n *\n * @default true\n */\n enableEdgeGlass3D?: boolean\n\n /**\n * Habilitar Backdrop Extension (Josh Comeau)\n *\n * @description\n * Extiende el área de backdrop-filter al 200% de altura con mask\n * para capturar elementos cercanos y mejorar el realismo de la refracción.\n *\n * **Solo aplica a**: SidebarTooltipV2\n * **Requiere**: enableLiquidGlassV2 = true\n *\n * @default true\n */\n enableBackdropExtension?: boolean\n\n /**\n * Habilitar animaciones staggered de items en tooltips\n *\n * @description\n * Activa entrada/salida escalonada de items del tooltip usando CSS custom properties.\n * Incluye grid trick para height auto transitions y direction-aware animations.\n *\n * **Solo aplica a**: SidebarTooltipV2\n *\n * @default true\n * @experimental\n */\n enableTooltipItemAnimations?: boolean\n\n /**\n * Habilitar animación 3D de cilindro para títulos de tooltips\n *\n * @description\n * Activa efecto de cilindro rotatorio 3D para el título del tooltip usando Web Animations API.\n * Mantiene historial circular de últimos 10 títulos y rota según dirección de navegación.\n *\n * **Features**:\n * - Rotación 3D con rotateX\n * - Direction-aware (up/down navigation)\n * - Historial circular de títulos\n * - Duración: 400ms, easing cubic-bezier\n *\n * **Solo aplica a**: SidebarTooltip\n *\n * @default false\n * @experimental\n */\n enableCylinderTitle?: boolean\n\n /**\n * Overrides de preset para configuración avanzada de Liquid Glass\n *\n * @description\n * Permite sobrescribir valores del preset 'sidebar' para debugging y ajuste fino.\n * Incluye parámetros visuales como frost, blur, scale, chromatic aberration RGB, etc.\n *\n * **Ejemplo**:\n * ```tsx\n * presetOverrides: {\n * frost: 0.08,\n * blur: 12,\n * blurBackground: 10,\n * scale: -200,\n * r: 5,\n * g: 15,\n * b: 25\n * }\n * ```\n *\n * **Requiere**: enableLiquidGlassV2 = true\n *\n * @default undefined\n * @experimental\n */\n presetOverrides?: Partial<SidebarLiquidConfig>\n}\n\n/**\n * Librería de iconos a utilizar\n * @enum {string}\n */\nexport enum SidebarIconLibrary {\n /** Iconos de lucide-react */\n LUCIDE = \"lucide\",\n /** Iconos custom proporcionados por el usuario */\n CUSTOM = \"custom\",\n}\n\n// ============================================================================\n// ESTADOS Y RENDER PROPS\n// ============================================================================\n\n/**\n * Estado compartido del sidebar\n * @interface\n */\nexport interface SidebarState {\n /** Indica si el sidebar está abierto */\n open: boolean\n /** Indica si el sidebar está colapsado (solo en modo COLLAPSE) */\n collapsed: boolean\n /** Modo de colapso actual */\n collapseMode: SidebarCollapseMode\n /** Comportamiento de layout actual */\n layoutBehaviour: SidebarLayoutBehaviour\n}\n\n/**\n * Estado del botón toggle\n * @interface\n */\nexport interface SidebarToggleState {\n /** Indica si el toggle está activo/presionado */\n active: boolean\n /** Indica si el sidebar está abierto */\n open: boolean\n}\n\n/**\n * Estado de un item del sidebar\n * @interface\n */\nexport interface SidebarItemState {\n /** Indica si el item está enfocado por teclado */\n focused: boolean\n /** Indica si el mouse está sobre el item */\n hovered: boolean\n /** Indica si el item está deshabilitado */\n disabled: boolean\n}\n\n/**\n * Estado del indicador visual\n * @interface\n */\nexport interface SidebarIndicatorState {\n /** Indica si el indicador está visible */\n visible: boolean\n /** Posición Y del indicador en píxeles */\n position: number\n}\n\n// ============================================================================\n// RENDER PROP TYPES\n// ============================================================================\n\n/**\n * Tipo para render prop de Sidebar\n */\nexport type SidebarRenderProp = (state: SidebarState) => ReactNode\n\n/**\n * Tipo para render prop de SidebarToggle\n */\nexport type SidebarToggleRenderProp = (state: SidebarToggleState) => ReactNode\n\n/**\n * Tipo para render prop de SidebarItem\n */\nexport type SidebarItemRenderProp = (state: SidebarItemState) => ReactNode\n\n/**\n * Tipo para render prop de SidebarIndicator\n */\nexport type SidebarIndicatorRenderProp = (state: SidebarIndicatorState) => ReactNode\n\n// ============================================================================\n// CONTEXT\n// ============================================================================\n\n/**\n * Valor del contexto compartido del Sidebar\n * @interface\n */\nexport interface SidebarContextValue {\n /** Estado inicial del sidebar (solo lectura) */\n defaultOpen: boolean\n /** Estado actual open/closed del sidebar */\n open: boolean\n /** Función para actualizar el estado open */\n setOpen: (open: boolean) => void\n /** Modo de colapso actual */\n collapseMode: SidebarCollapseMode\n /** Comportamiento en modo hide */\n hideBehaviour: SidebarHideBehaviour\n /** Comportamiento al abrir desde hide */\n hideOpensBehavior: SidebarHideOpensBehavior\n /** Comportamiento de layout del sidebar */\n layoutBehaviour: SidebarLayoutBehaviour\n /** Configuración de dimensiones */\n dimensions: SidebarDimensions\n /** Configuración de safe areas */\n safeAreas: SidebarSafeAreas\n /** Configuración de animaciones */\n animations: SidebarAnimations\n /** ID del toggle input */\n toggleId: string\n /** Modo debug para visualizar safe areas */\n debug: boolean\n /** Ref al contenedor de navegación */\n navRef: RefObject<HTMLElement | null>\n /** Ref al contenedor de items */\n contentRef: RefObject<HTMLDivElement | null>\n /** Ref al indicador visual */\n indicatorRef: RefObject<HTMLDivElement | null>\n /** Registrar un item para navegación por teclado */\n registerItem: (element: HTMLElement) => void\n /** Des-registrar un item */\n unregisterItem: (element: HTMLElement) => void\n /** Items registrados actualmente */\n items: HTMLElement[]\n /** Indica si el indicador debe mostrarse por navegación de teclado */\n showIndicatorForKeyboard: boolean\n /** Función para activar/desactivar el indicador por teclado */\n setShowIndicatorForKeyboard: (show: boolean) => void\n /** Indica si el cursor/focus está sobre el área de items */\n isOverItems: boolean\n /** Función para actualizar el estado de isOverItems */\n setIsOverItems: (isOver: boolean) => void\n /** Habilitar FluidHoverIndicator (glassmorphism + spring physics) */\n enableFluidIndicator: boolean\n /** Habilitar tooltip en hover (muestra label o subcategorías) */\n enableTooltip: boolean\n /** Elemento del item actualmente hovered/focused (para FluidIndicator) */\n currentItemElement: HTMLElement | null\n /** Función para actualizar el currentItemElement */\n setCurrentItemElement: (element: HTMLElement | null) => void\n /** Configuración experimental de Liquid Glass V2 */\n liquidGlass: SidebarLiquidGlassConfig\n}\n\n// ============================================================================\n// PROPS DE COMPONENTES\n// ============================================================================\n\n/**\n * Props polimórficas base con soporte para prop 'as'\n */\nexport type PolymorphicProps<E extends ElementType = ElementType> = {\n /** Elemento o componente a renderizar */\n as?: E\n} & Omit<React.ComponentPropsWithRef<E>, \"as\">\n\n/**\n * Props del componente Sidebar (root container)\n * @interface\n */\nexport interface SidebarProps {\n /** Contenido del sidebar (puede ser ReactNode o render prop) */\n children: ReactNode | SidebarRenderProp\n /** Clase CSS adicional para el wrapper */\n className?: string\n /** Estilos inline para el wrapper */\n style?: CSSProperties\n /** Estado inicial abierto (modo uncontrolled) */\n defaultOpen?: boolean\n /** Estado abierto (modo controlled) */\n open?: boolean\n /** Callback cuando cambia el estado open */\n onOpenChange?: (open: boolean) => void\n /** Modo de colapso del sidebar */\n collapseMode?: SidebarCollapseMode\n /** Comportamiento en modo hide */\n hideBehaviour?: SidebarHideBehaviour\n /** Comportamiento al abrir desde hide */\n hideOpensBehavior?: SidebarHideOpensBehavior\n /** Comportamiento de layout del sidebar */\n layoutBehaviour?: SidebarLayoutBehaviour\n /** Configuración de dimensiones (partial override) */\n dimensions?: Partial<SidebarDimensions>\n /** Configuración de áreas seguras (partial override) */\n safeAreas?: Partial<SidebarSafeAreas>\n /** Configuración de animaciones (partial override) */\n animations?: Partial<SidebarAnimations>\n /** ID personalizado para el toggle input */\n toggleId?: string\n /** Modo debug (muestra bordes y labels) */\n debug?: boolean\n /** Habilitar FluidHoverIndicator (glassmorphism + spring physics) */\n enableFluidIndicator?: boolean\n /** Habilitar tooltip en hover (muestra label o subcategorías) */\n enableTooltip?: boolean\n /**\n * Configuración experimental de Liquid Glass V2 (partial override)\n *\n * @description\n * Permite activar/desactivar features experimentales de liquid glass mediante flags:\n *\n * @example\n * ```tsx\n * <Sidebar\n * liquidGlass={{\n * enableLiquidGlassV2: true,\n * enableChromaticAberration: true,\n * enableEdgeGlass3D: true,\n * enableBackdropExtension: true\n * }}\n * >\n * ...\n * </Sidebar>\n * ```\n *\n * @experimental\n */\n liquidGlass?: Partial<SidebarLiquidGlassConfig>\n /** Elemento o componente a renderizar */\n as?: ElementType\n}\n\n/**\n * Props del componente SidebarNav\n * @interface\n */\nexport interface SidebarNavProps {\n /** Contenido del nav */\n children: ReactNode\n /** Clase CSS adicional */\n className?: string\n /** Estilos inline */\n style?: CSSProperties\n /** Label ARIA para el nav */\n \"aria-label\"?: string\n /** Elemento o componente a renderizar */\n as?: ElementType\n}\n\n/**\n * Props del componente SidebarToggle\n * @interface\n */\nexport interface SidebarToggleProps {\n /** Contenido del botón (puede ser ReactNode o render prop) */\n children?: ReactNode | SidebarToggleRenderProp\n /** Librería de iconos a utilizar (Lucide o custom) */\n iconLibrary?: SidebarIconLibrary\n /** Clase CSS adicional */\n className?: string\n /** Estilos inline */\n style?: CSSProperties\n /** Label ARIA para el botón */\n \"aria-label\"?: string\n /** Elemento o componente a renderizar */\n as?: ElementType\n}\n\n/**\n * Props del componente SidebarContent\n * @interface\n */\nexport interface SidebarContentProps {\n /** Contenido (items del sidebar) */\n children: ReactNode\n /** Clase CSS adicional */\n className?: string\n /** Estilos inline */\n style?: CSSProperties\n /** Elemento o componente a renderizar */\n as?: ElementType\n}\n\n/**\n * Props del componente SidebarIndicator\n * @interface\n */\nexport interface SidebarIndicatorProps {\n /** Contenido personalizado del indicador (opcional) */\n children?: ReactNode | SidebarIndicatorRenderProp\n /** Clase CSS adicional */\n className?: string\n /** Estilos inline */\n style?: CSSProperties\n /** Elemento o componente a renderizar */\n as?: ElementType\n}\n\n/**\n * Props del componente SidebarSafeArea\n * @interface\n */\nexport interface SidebarSafeAreaProps {\n /** Contenido del área segura */\n children?: ReactNode\n /** Posición del área segura (top o bottom) */\n position: SidebarSafeAreaPosition\n /** Porcentaje de altura del sidebar (override del config) */\n percent?: number\n /** Clase CSS adicional */\n className?: string\n /** Estilos inline */\n style?: CSSProperties\n /** Elemento o componente a renderizar */\n as?: ElementType\n}\n\n/**\n * Props del componente SidebarItem\n * @interface\n */\nexport interface SidebarItemProps {\n /** URL de destino */\n href?: string\n /** Icono del item */\n icon?: ReactNode\n /** Label/texto del item */\n label?: string\n /** Contenido del item (puede ser ReactNode o render prop) */\n children?: ReactNode | SidebarItemRenderProp\n /** Componente Link personalizado (ej: React Router Link, Next Link) */\n LinkComponent?: ComponentType<any>\n /** Props adicionales para el LinkComponent */\n linkProps?: Record<string, any>\n /** Clase CSS adicional */\n className?: string\n /** Estilos inline */\n style?: CSSProperties\n /** Callback al hacer hover */\n onHover?: () => void\n /** Callback al hacer click */\n onClick?: () => void\n /** Item deshabilitado */\n disabled?: boolean\n /** Elemento o componente a renderizar */\n as?: ElementType\n}\n\n// ============================================================================\n// UTILITY TYPES\n// ============================================================================\n\n/**\n * Configuración completa del sidebar (sin partials)\n */\nexport interface SidebarConfig {\n defaultOpen: boolean\n collapseMode: SidebarCollapseMode\n hideBehaviour: SidebarHideBehaviour\n hideOpensBehavior: SidebarHideOpensBehavior\n layoutBehaviour: SidebarLayoutBehaviour\n dimensions: SidebarDimensions\n safeAreas: SidebarSafeAreas\n animations: SidebarAnimations\n toggleId: string\n debug: boolean\n liquidGlass: SidebarLiquidGlassConfig\n}\n","import {\n SidebarCollapseMode,\n SidebarHideBehaviour,\n SidebarHideOpensBehavior,\n SidebarLayoutBehaviour,\n SidebarWidth,\n SidebarTransitionDuration,\n SidebarTimingFunction,\n type SidebarDimensions,\n type SidebarSafeAreas,\n type SidebarAnimations,\n type SidebarConfig,\n} from \"./Sidebar.types\"\n\n// ============================================================================\n// VALORES POR DEFECTO\n// ============================================================================\n\n/**\n * Dimensiones por defecto del sidebar\n * @constant\n */\nexport const DEFAULT_DIMENSIONS: SidebarDimensions = {\n collapsedWidth: SidebarWidth.COLLAPSED,\n expandedWidth: SidebarWidth.EXPANDED,\n indicatorHeight: \"3rem\",\n tooltipDistance: \"1rem\",\n}\n\n/**\n * Áreas seguras por defecto\n * @constant\n */\nexport const DEFAULT_SAFE_AREAS: SidebarSafeAreas = {\n topPercent: 15,\n bottomPercent: 25,\n}\n\n/**\n * Animaciones por defecto\n * @constant\n */\nexport const DEFAULT_ANIMATIONS: SidebarAnimations = {\n widthTransitionDuration: SidebarTransitionDuration.NORMAL,\n opacityTransitionDuration: SidebarTransitionDuration.FAST,\n timingFunction: SidebarTimingFunction.CUSTOM,\n}\n\n/**\n * Configuración por defecto del sidebar\n * @constant\n *\n * @description\n * Los colores se obtienen automáticamente de los tokens CSS de shadcn:\n * - --sidebar: Color de fondo\n * - --sidebar-foreground: Color de texto\n * - --sidebar-primary: Color primario (indicador)\n * - --sidebar-accent: Color de hover\n * - --sidebar-border: Color de bordes\n */\nexport const DEFAULT_CONFIG: SidebarConfig = {\n defaultOpen: true,\n collapseMode: SidebarCollapseMode.HIDE,\n hideBehaviour: SidebarHideBehaviour.SHOW_INDICATOR,\n hideOpensBehavior: SidebarHideOpensBehavior.COLLAPSED,\n layoutBehaviour: SidebarLayoutBehaviour.FLOATING,\n dimensions: DEFAULT_DIMENSIONS,\n safeAreas: DEFAULT_SAFE_AREAS,\n animations: DEFAULT_ANIMATIONS,\n toggleId: \"sidebar-toggle\",\n debug: false,\n liquidGlass: {\n enableLiquidGlassV2: false,\n enableChromaticAberration: false,\n enableEdgeGlass3D: false,\n enableBackdropExtension: false,\n enableTooltipItemAnimations: false,\n enableCylinderTitle: false,\n },\n}\n\n// ============================================================================\n// CONSTANTES DE TECLADO\n// ============================================================================\n\n/**\n * Teclas de navegación del sidebar\n * @constant\n */\nexport const SIDEBAR_KEYBOARD_KEYS = {\n /** Flecha abajo - navegar al siguiente item */\n ARROW_DOWN: \"ArrowDown\",\n /** Flecha arriba - navegar al item anterior */\n ARROW_UP: \"ArrowUp\",\n /** Home - ir al primer item */\n HOME: \"Home\",\n /** End - ir al último item */\n END: \"End\",\n /** Tab - navegación estándar */\n TAB: \"Tab\",\n /** Escape - cerrar sidebar o quitar focus */\n ESCAPE: \"Escape\",\n} as const\n\n/**\n * Tipo derivado de las teclas del teclado\n */\nexport type SidebarKeyboardKey = (typeof SIDEBAR_KEYBOARD_KEYS)[keyof typeof SIDEBAR_KEYBOARD_KEYS]\n\n// ============================================================================\n// TIMING FUNCTIONS (CUBIC BEZIER)\n// ============================================================================\n\n/**\n * Timing functions perfectas para animaciones suaves\n * @constant\n */\nexport const SIDEBAR_TIMING_FUNCTIONS = {\n /** Ease-out perfecto para elevación de iconos */\n EASE_OUT_PERFECT: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n /** Ease-in-out suave */\n EASE_IN_OUT_SMOOTH: \"cubic-bezier(0.45, 0, 0.55, 1)\",\n /** Spring suave */\n SPRING_SOFT: \"cubic-bezier(0.34, 1.56, 0.64, 1)\",\n} as const\n\n// ============================================================================\n// DATA ATTRIBUTES\n// ============================================================================\n\n/**\n * Atributos data-* para styling CSS y selección de elementos\n * @constant\n */\nexport const SIDEBAR_DATA_ATTRIBUTES = {\n /** data-open - indica si el sidebar está abierto */\n OPEN: \"data-open\",\n /** data-collapsed - indica si el sidebar está colapsado */\n COLLAPSED: \"data-collapsed\",\n /** data-focused - indica si un elemento está enfocado */\n FOCUSED: \"data-focused\",\n /** data-hovered - indica si el mouse está sobre un elemento */\n HOVERED: \"data-hovered\",\n /** data-disabled - indica si un elemento está deshabilitado */\n DISABLED: \"data-disabled\",\n /** data-sidebar-item - marca un item del sidebar para navegación */\n ITEM: \"data-sidebar-item\",\n /** data-active - indica si un toggle/botón está activo */\n ACTIVE: \"data-active\",\n /** data-visible - indica si un elemento es visible */\n VISIBLE: \"data-visible\",\n} as const\n\n// ============================================================================\n// CLASES CSS BASE (TAILWIND)\n// ============================================================================\n\n/**\n * Clases Tailwind reutilizables para componentes del sidebar\n * @constant\n */\nexport const SIDEBAR_TAILWIND_CLASSES = {\n /** Clases base para el wrapper */\n wrapper: \"relative\",\n\n /** Clases base para el nav */\n nav: \"relative h-screen border-r\",\n\n /** Clases base para el indicador */\n indicator: \"absolute left-0 rounded-r-full pointer-events-none\",\n\n /** Clases base para el botón toggle */\n toggleButton: \"block w-6 h-6 rounded-full cursor-pointer flex items-center justify-center transition-colors\",\n\n /** Clases para el wrapper del botón toggle */\n toggleButtonWrapper: \"absolute top-6 z-30\",\n\n /** Clases base para el contenedor de items */\n content: \"flex flex-col items-center\",\n\n /** Clases base para áreas seguras */\n safeArea: \"flex items-center justify-center\",\n\n /** Clases de borde debug */\n debugBorder: \"border-dashed\",\n\n /** Clases de focus ring (accesibilidad) */\n focusRing: \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2\",\n\n /** Clases SR-only (screen reader only) */\n srOnly: \"sr-only\",\n} as const\n\n/**\n * Tipo derivado de las clases Tailwind\n */\nexport type SidebarTailwindClass = (typeof SIDEBAR_TAILWIND_CLASSES)[keyof typeof SIDEBAR_TAILWIND_CLASSES]\n\n// ============================================================================\n// PATRONES DE DEBUG\n// ============================================================================\n\n/**\n * Patrones visuales para modo debug\n * @constant\n */\nexport const SIDEBAR_DEBUG_PATTERNS = {\n /** Patrón de rayas para áreas seguras */\n safeArea:\n \"repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px)\",\n\n /** Fondo semi-transparente para área de contenido */\n contentArea: \"rgba(0, 0, 0, 0.5)\",\n\n /** Color de borde para debug */\n borderColor: \"rgb(34 197 94)\", // emerald-500\n\n /** Opacidad de borde debug */\n borderOpacity: \"0.3\",\n} as const\n\n// ============================================================================\n// ROLES ARIA\n// ============================================================================\n\n/**\n * Roles ARIA para accesibilidad\n * @constant\n */\nexport const SIDEBAR_ARIA_ROLES = {\n /** Rol para el nav principal */\n navigation: \"navigation\",\n\n /** Rol para lista de items */\n list: \"list\",\n\n /** Rol para item individual */\n listitem: \"listitem\",\n\n /** Rol para botón toggle */\n button: \"button\",\n} as const\n\n// ============================================================================\n// LABELS ARIA POR DEFECTO\n// ============================================================================\n\n/**\n * Labels ARIA por defecto para accesibilidad\n * @constant\n */\nexport const SIDEBAR_ARIA_LABELS = {\n /** Label para toggle */\n toggleSidebar: \"Alternar sidebar\",\n\n /** Label para navegación principal */\n mainNavigation: \"Navegación principal\",\n\n /** Label cuando sidebar está abierto */\n sidebarOpen: \"Sidebar abierto\",\n\n /** Label cuando sidebar está cerrado */\n sidebarClosed: \"Sidebar cerrado\",\n} as const\n\n// ============================================================================\n// ESTILOS VISUALES\n// ============================================================================\n\n/**\n * Configuración de estilo visual por defecto del sidebar\n * @constant\n */\nexport const DEFAULT_VISUAL_STYLE = {\n marginTop: \"0\",\n marginBottom: \"0\",\n marginLeft: \"0\",\n marginRight: \"0\",\n height: \"100vh\",\n borderRadius: \"0\",\n boxShadow: \"none\",\n} as const\n\n/**\n * Preconfiguraciones de estilo visual para el sidebar\n * @constant\n */\nexport const SIDEBAR_VISUAL_PRESETS = {\n /** Estilo por defecto: pegado a bordes */\n DEFAULT: {\n marginTop: \"0\",\n marginBottom: \"0\",\n marginLeft: \"0\",\n marginRight: \"0\",\n height: \"100vh\",\n borderRadius: \"0\",\n boxShadow: \"none\",\n },\n\n /** Estilo floating: separado y con sombra */\n FLOATING_CARD: {\n marginTop: \"1rem\",\n marginBottom: \"1rem\",\n marginLeft: \"1rem\",\n marginRight: \"0\",\n height: \"calc(100vh - 2rem)\",\n borderRadius: \"0.75rem\",\n boxShadow: \"0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)\",\n },\n\n /** Estilo moderno: esquinas redondeadas suaves */\n MODERN_ROUNDED: {\n marginTop: \"0.5rem\",\n marginBottom: \"0.5rem\",\n marginLeft: \"0.5rem\",\n marginRight: \"0\",\n height: \"calc(100vh - 1rem)\",\n borderRadius: \"1rem\",\n boxShadow: \"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)\",\n },\n\n /** Estilo minimal: ligera separación */\n MINIMAL_SPACED: {\n marginTop: \"0.25rem\",\n marginBottom: \"0.25rem\",\n marginLeft: \"0.25rem\",\n marginRight: \"0\",\n height: \"calc(100vh - 0.5rem)\",\n borderRadius: \"0.5rem\",\n boxShadow: \"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)\",\n },\n} as const\n\n/**\n * Tipo para los presets de estilo visual\n */\nexport type SidebarVisualPreset = keyof typeof SIDEBAR_VISUAL_PRESETS\n\n// ============================================================================\n// BREAKPOINTS\n// ============================================================================\n\n/**\n * Breakpoints para responsive behavior\n * @constant\n */\nexport const SIDEBAR_BREAKPOINTS = {\n /** Ancho mínimo para mostrar sidebar expandido */\n minExpandedWidth: 768, // md en Tailwind\n\n /** Ancho mínimo para sidebar colapsado */\n minCollapsedWidth: 640, // sm en Tailwind\n\n /** Ancho para forzar modo mobile */\n mobileWidth: 480,\n} as const\n\n// ============================================================================\n// LÍMITES Y VALORES SEGUROS\n// ============================================================================\n\n/**\n * Límites y valores seguros para validación\n * @constant\n */\nexport const SIDEBAR_LIMITS = {\n /** Porcentaje mínimo para safe area */\n minSafeAreaPercent: 0,\n\n /** Porcentaje máximo para safe area */\n maxSafeAreaPercent: 50,\n\n /** Número máximo de items recomendado */\n maxRecommendedItems: 20,\n\n /** Duración mínima de transición (ms) */\n minTransitionDuration: 0,\n\n /** Duración máxima de transición (ms) */\n maxTransitionDuration: 1000,\n} as const\n\n// ============================================================================\n// CSS VARIABLES\n// ============================================================================\n\n/**\n * Nombres de CSS variables utilizadas\n * @constant\n */\nexport const SIDEBAR_CSS_VARIABLES = {\n /** Ancho cuando cerrado */\n widthClosed: \"--sidebar-width-closed\",\n\n /** Ancho cuando abierto */\n widthOpen: \"--sidebar-width-open\",\n\n /** Ancho actual */\n width: \"--sidebar-width\",\n\n /** Color de fondo */\n background: \"--sidebar-bg\",\n\n /** Color de borde (variable interna para evitar colisión con --sidebar-border de shadcn) */\n borderColor: \"--sidebar-border-color\",\n\n /** Color de hover */\n hover: \"--sidebar-hover\",\n\n /** Color del indicador */\n indicator: \"--sidebar-indicator\",\n\n /** Altura del indicador */\n indicatorHeight: \"--sidebar-indicator-height\",\n\n /** Distancia del tooltip al sidebar */\n tooltipDistance: \"--sidebar-tooltip-distance\",\n\n /** Comportamiento de layout */\n layoutBehaviour: \"--sidebar-layout-behaviour\",\n\n /** Flag para modo inline */\n isInline: \"--sidebar-is-inline\",\n\n /** Variables de estilo visual */\n marginTop: \"--sidebar-margin-top\",\n marginBottom: \"--sidebar-margin-bottom\",\n marginLeft: \"--sidebar-margin-left\",\n marginRight: \"--sidebar-margin-right\",\n sidebarHeight: \"--sidebar-height\",\n sidebarBorderRadius: \"--sidebar-border-radius\",\n sidebarBoxShadow: \"--sidebar-box-shadow\",\n} as const\n","import type { SidebarLiquidGlassConfig } from './Sidebar.types'\n\n/**\n * Valores por defecto para Liquid Glass V2\n *\n * @description\n * Configuración conservadora que prioriza compatibilidad y performance:\n * - Liquid Glass V2 desactivado por defecto (opt-in)\n * - Chromatic Aberration desactivado (requiere opt-in explícito)\n * - Edge Glass 3D y Backdrop Extension activados cuando V2 está habilitado\n *\n * @example\n * ```tsx\n * // Activar todas las features V2\n * <Sidebar\n * liquidGlass={{\n * enableLiquidGlassV2: true,\n * enableChromaticAberration: true\n * }}\n * />\n * ```\n */\nexport const DEFAULT_LIQUID_GLASS_CONFIG: SidebarLiquidGlassConfig = {\n /**\n * V2 desactivado por defecto (backward compatibility)\n *\n * Cuando está desactivado, usa FluidHoverIndicator y SidebarTooltip originales\n * con backdrop-blur CSS básico.\n */\n enableLiquidGlassV2: false,\n\n /**\n * Chromatic aberration desactivado por defecto\n *\n * Requiere activación explícita debido a:\n * - Costo computacional adicional (filtros SVG complejos)\n * - Efecto visual intenso que puede no ser adecuado para todos los temas\n * - Requiere que enableLiquidGlassV2 = true\n */\n enableChromaticAberration: false,\n\n /**\n * Edge Glass 3D activado por defecto (cuando V2 está habilitado)\n *\n * Proporciona profundidad visual significativa con costo computacional aceptable.\n * Solo aplica a SidebarTooltipV2.\n */\n enableEdgeGlass3D: true,\n\n /**\n * Backdrop Extension activado por defecto (cuando V2 está habilitado)\n *\n * Técnica de Josh Comeau para mejorar realismo de refracción.\n * Captura elementos nearby con 200% height + mask.\n * Solo aplica a SidebarTooltipV2.\n */\n enableBackdropExtension: true,\n\n /**\n * Animaciones de items activadas por defecto\n *\n * Staggered animations para entrada/salida de items del tooltip.\n * Incluye grid trick para height auto transitions.\n */\n enableTooltipItemAnimations: true,\n\n /**\n * Animación 3D de cilindro para títulos desactivada por defecto\n *\n * Efecto experimental de rotación 3D para títulos del tooltip.\n * Requiere opt-in explícito.\n */\n enableCylinderTitle: false\n}\n\n/**\n * Helper para merge de configuración liquid glass con defaults\n *\n * @example\n * ```tsx\n * const config = mergeLiquidGlassConfig({ enableLiquidGlassV2: true })\n * // { enableLiquidGlassV2: true, enableChromaticAberration: false, ... }\n * ```\n */\nexport function mergeLiquidGlassConfig(\n override?: Partial<SidebarLiquidGlassConfig>\n): SidebarLiquidGlassConfig {\n return {\n ...DEFAULT_LIQUID_GLASS_CONFIG,\n ...override\n }\n}\n\n/**\n * Validar configuración de liquid glass\n *\n * @description\n * Verifica que las flags dependientes tengan sus requisitos satisfechos:\n * - Chromatic Aberration requiere Liquid Glass V2\n * - Edge Glass 3D requiere Liquid Glass V2\n * - Backdrop Extension requiere Liquid Glass V2\n *\n * @returns Configuración validada con warnings en consola si hay conflictos\n */\nexport function validateLiquidGlassConfig(\n config: SidebarLiquidGlassConfig\n): SidebarLiquidGlassConfig {\n const validated = { ...config }\n\n // Si V2 está desactivado, deshabilitar todas las features dependientes\n if (!config.enableLiquidGlassV2) {\n if (config.enableChromaticAberration) {\n console.warn(\n '[Sidebar] enableChromaticAberration requiere enableLiquidGlassV2 = true. ' +\n 'Deshabilitando chromatic aberration.'\n )\n validated.enableChromaticAberration = false\n }\n\n if (config.enableEdgeGlass3D) {\n console.warn(\n '[Sidebar] enableEdgeGlass3D requiere enableLiquidGlassV2 = true. ' +\n 'Deshabilitando edge glass 3D.'\n )\n validated.enableEdgeGlass3D = false\n }\n\n if (config.enableBackdropExtension) {\n console.warn(\n '[Sidebar] enableBackdropExtension requiere enableLiquidGlassV2 = true. ' +\n 'Deshabilitando backdrop extension.'\n )\n validated.enableBackdropExtension = false\n }\n }\n\n return validated\n}\n\n/**\n * Tipo guard para verificar si Liquid Glass V2 está habilitado\n */\nexport function isLiquidGlassV2Enabled(\n config: SidebarLiquidGlassConfig\n): boolean {\n return config.enableLiquidGlassV2 === true\n}\n\n/**\n * Tipo guard para verificar si Chromatic Aberration está habilitado\n * (y sus requisitos están satisfechos)\n */\nexport function isChromaticAberrationEnabled(\n config: SidebarLiquidGlassConfig\n): boolean {\n return config.enableLiquidGlassV2 === true &&\n config.enableChromaticAberration === true\n}\n","\"use client\"\n\nimport { createContext, useRef, useState, useCallback, useMemo } from \"react\"\nimport type { ReactNode, RefObject } from \"react\"\n\nexport interface SubContentData {\n itemId: string\n subContent: ReactNode\n title?: string\n}\n\nexport const SubContentContext = createContext<{\n subContentMap: Map<string, SubContentData>\n registerSubContent: (itemId: string, data: SubContentData) => void\n unregisterSubContent: (itemId: string) => void\n getSubContent: (itemId: string) => SubContentData | undefined\n} | null>(null)\nimport type {\n SidebarContextValue,\n SidebarCollapseMode,\n SidebarHideBehaviour,\n SidebarHideOpensBehavior,\n SidebarLayoutBehaviour,\n SidebarDimensions,\n SidebarSafeAreas,\n SidebarAnimations,\n SidebarLiquidGlassConfig,\n} from \"./Sidebar.types\"\nimport {\n DEFAULT_DIMENSIONS,\n DEFAULT_SAFE_AREAS,\n DEFAULT_ANIMATIONS,\n DEFAULT_VISUAL_STYLE,\n DEFAULT_CONFIG,\n} from \"./Sidebar.constants\"\nimport { DEFAULT_LIQUID_GLASS_CONFIG } from \"./sidebar-defaults\"\n\n/**\n * Contexto del Sidebar para compartir estado entre componentes primitivos\n * @constant\n */\nexport const SidebarContext = createContext<SidebarContextValue | null>(null)\n\n/**\n * Props del SidebarProvider\n * @interface\n */\ninterface SidebarProviderProps {\n /** Contenido hijo (componentes primitivos del sidebar) */\n children: ReactNode\n /** Estado inicial abierto (modo uncontrolled) */\n defaultOpen?: boolean\n /** Estado abierto (modo controlled) */\n open?: boolean\n /** Callback cuando cambia el estado open */\n onOpenChange?: (open: boolean) => void\n /** Modo de colapso del sidebar */\n collapseMode?: SidebarCollapseMode\n /** Comportamiento en modo hide */\n hideBehaviour?: SidebarHideBehaviour\n /** Comportamiento al abrir desde hide */\n hideOpensBehavior?: SidebarHideOpensBehavior\n /** Comportamiento de layout del sidebar */\n layoutBehaviour?: SidebarLayoutBehaviour\n /** Configuración de dimensiones */\n dimensions?: Partial<SidebarDimensions>\n /** Configuración de safe areas */\n safeAreas?: Partial<SidebarSafeAreas>\n /** Configuración de animaciones */\n animations?: Partial<SidebarAnimations>\n /** ID del toggle input */\n toggleId?: string\n /** Modo debug para visualizar safe areas */\n debug?: boolean\n /** Habilitar FluidHoverIndicator (glassmorphism + spring physics) */\n enableFluidIndicator?: boolean\n /** Habilitar tooltip en hover (muestra label o subcategorías) */\n enableTooltip?: boolean\n /** Configuración experimental de Liquid Glass V2 */\n liquidGlass?: Partial<SidebarLiquidGlassConfig>\n}\n\n/**\n * Provider del contexto del Sidebar\n *\n * @description\n * Componente que provee el contexto compartido a todos los componentes\n * primitivos del sidebar. Gestiona el estado global (open/closed) y\n * referencias a elementos DOM necesarios para funcionalidades como\n * el indicador visual y navegación por teclado.\n *\n * Soporta tanto modo controlled (pasando prop `open`) como uncontrolled\n * (usando `defaultOpen`).\n *\n * @example\n * ```tsx\n * // Modo uncontrolled\n * <SidebarProvider defaultOpen={true}>\n * <SidebarNav>...</SidebarNav>\n * </SidebarProvider>\n *\n * // Modo controlled\n * <SidebarProvider\n * open={isOpen}\n * onOpenChange={setIsOpen}\n * >\n * <SidebarNav>...</SidebarNav>\n * </SidebarProvider>\n * ```\n */\nexport function SidebarProvider({\n children,\n defaultOpen = DEFAULT_CONFIG.defaultOpen,\n open: controlledOpen,\n onOpenChange,\n collapseMode = DEFAULT_CONFIG.collapseMode,\n hideBehaviour = DEFAULT_CONFIG.hideBehaviour,\n hideOpensBehavior = DEFAULT_CONFIG.hideOpensBehavior,\n layoutBehaviour = DEFAULT_CONFIG.layoutBehaviour,\n dimensions: dimensionsProp,\n safeAreas: safeAreasProp,\n animations: animationsProp,\n toggleId = DEFAULT_CONFIG.toggleId,\n debug = DEFAULT_CONFIG.debug,\n enableFluidIndicator = false,\n enableTooltip = true,\n liquidGlass: liquidGlassProp,\n}: SidebarProviderProps) {\n // Estado para open/closed (controlled o uncontrolled)\n const [internalOpen, setInternalOpen] = useState(defaultOpen)\n const open = controlledOpen !== undefined ? controlledOpen : internalOpen\n\n const setOpen = useCallback((newOpen: boolean) => {\n if (controlledOpen === undefined) {\n setInternalOpen(newOpen)\n }\n onOpenChange?.(newOpen)\n }, [controlledOpen, onOpenChange])\n\n // Referencias a elementos DOM\n const navRef = useRef<HTMLElement>(null)\n const contentRef = useRef<HTMLDivElement>(null)\n const indicatorRef = useRef<HTMLDivElement>(null)\n\n // Estado de items registrados para navegación por teclado\n const [items, setItems] = useState<HTMLElement[]>([])\n\n // Estado para mostrar indicador cuando se navega por teclado\n const [showIndicatorForKeyboard, setShowIndicatorForKeyboard] = useState(false)\n\n // Estado compartido para indicar si el cursor/focus está sobre el área de items\n const [isOverItems, setIsOverItems] = useState(false)\n\n // Estado para el elemento actualmente hovered/focused (para FluidIndicator)\n const [currentItemElement, setCurrentItemElement] = useState<HTMLElement | null>(null)\n\n // Estado para SubContent (map de itemId → subContent)\n const [subContentMap] = useState(() => new Map<string, SubContentData>())\n\n /**\n * Registrar subContent de un item\n */\n const registerSubContent = useCallback((itemId: string, data: SubContentData) => {\n subContentMap.set(itemId, data)\n }, [subContentMap])\n\n /**\n * Des-registrar subContent de un item\n */\n const unregisterSubContent = useCallback((itemId: string) => {\n subContentMap.delete(itemId)\n }, [subContentMap])\n\n /**\n * Obtener subContent de un item\n */\n const getSubContent = useCallback((itemId: string) => {\n return subContentMap.get(itemId)\n }, [subContentMap])\n\n /**\n * Registrar un item para navegación por teclado\n */\n const registerItem = useCallback((element: HTMLElement) => {\n setItems((prev) => {\n // Evitar duplicados\n if (prev.includes(element)) return prev\n return [...prev, element]\n })\n }, [])\n\n /**\n * Des-registrar un item cuando se desmonta\n */\n const unregisterItem = useCallback((element: HTMLElement) => {\n setItems((prev) => prev.filter((item) => item !== element))\n }, [])\n\n // Merge de configuraciones con defaults (memoizado para evitar recreaciones innecesarias)\n const dimensions: SidebarDimensions = useMemo(\n () => ({\n ...DEFAULT_DIMENSIONS,\n ...dimensionsProp,\n }),\n [dimensionsProp],\n )\n\n const safeAreas: SidebarSafeAreas = useMemo(\n () => ({\n ...DEFAULT_SAFE_AREAS,\n ...safeAreasProp,\n }),\n [safeAreasProp],\n )\n\n const animations: SidebarAnimations = useMemo(\n () => ({\n ...DEFAULT_ANIMATIONS,\n ...animationsProp,\n }),\n [animationsProp],\n )\n\n const liquidGlass: SidebarLiquidGlassConfig = useMemo(\n () => ({\n ...DEFAULT_LIQUID_GLASS_CONFIG,\n ...liquidGlassProp,\n }),\n [liquidGlassProp],\n )\n\n // Valor del contexto (memoizado para evitar re-renders innecesarios)\n const contextValue: SidebarContextValue = useMemo(\n () => ({\n defaultOpen,\n open,\n setOpen,\n collapseMode,\n hideBehaviour,\n hideOpensBehavior,\n layoutBehaviour,\n dimensions,\n safeAreas,\n animations,\n toggleId,\n debug,\n navRef: navRef as RefObject<HTMLElement>,\n contentRef,\n indicatorRef,\n registerItem,\n unregisterItem,\n items,\n showIndicatorForKeyboard,\n setShowIndicatorForKeyboard,\n isOverItems,\n setIsOverItems,\n enableFluidIndicator,\n enableTooltip,\n currentItemElement,\n setCurrentItemElement,\n liquidGlass,\n }),\n [\n defaultOpen,\n open,\n setOpen,\n collapseMode,\n hideBehaviour,\n hideOpensBehavior,\n layoutBehaviour,\n dimensions,\n safeAreas,\n animations,\n liquidGlass,\n toggleId,\n debug,\n navRef,\n contentRef,\n indicatorRef,\n registerItem,\n unregisterItem,\n items,\n showIndicatorForKeyboard,\n setShowIndicatorForKeyboard,\n isOverItems,\n setIsOverItems,\n enableFluidIndicator,\n enableTooltip,\n currentItemElement,\n setCurrentItemElement,\n ],\n )\n\n // Valor del SubContentContext\n const subContentContextValue = useMemo(\n () => ({\n subContentMap,\n registerSubContent,\n unregisterSubContent,\n getSubContent,\n }),\n [subContentMap, registerSubContent, unregisterSubContent, getSubContent],\n )\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <SubContentContext.Provider value={subContentContextValue}>\n {children}\n </SubContentContext.Provider>\n </SidebarContext.Provider>\n )\n}\n","\"use client\"\n\nimport type { ElementType } from \"react\"\nimport { SidebarProvider } from \"./SidebarContext\"\nimport type { SidebarProps, SidebarRenderProp } from \"./Sidebar.types\"\nimport { DEFAULT_CONFIG } from \"./Sidebar.constants\"\n\n/**\n * Componente raíz del Sidebar con arquitectura headless\n *\n * @description\n * Componente principal que provee el contexto compartido a todos los\n * componentes primitivos del sidebar (SidebarNav, SidebarToggle, etc.).\n *\n * Este componente NO renderiza ningún elemento visual por sí mismo,\n * solo provee el Provider de contexto. Los estilos y estructura visual\n * se definen componiendo los primitivos hijos.\n *\n * Soporta dos modos:\n * - **Uncontrolled**: Usa `defaultOpen` para estado interno\n * - **Controlled**: Usa `open` + `onOpenChange` para control externo\n *\n * También soporta render props para acceder al estado del sidebar:\n *\n * @example\n * ```tsx\n * // Uso básico (children estáticos)\n * <Sidebar defaultOpen={true} collapseMode=\"collapse\">\n * <SidebarNav>\n * <SidebarToggle />\n * <SidebarContent>\n * <SidebarItem href=\"/\" icon={<HomeIcon />} />\n * </SidebarContent>\n * </SidebarNav>\n * </Sidebar>\n * ```\n *\n * @example\n * ```tsx\n * // Con render props (acceso al estado)\n * <Sidebar>\n * {({ open, collapsed }) => (\n * <>\n * <SidebarNav className={cn(!open && 'hidden')}>\n * <SidebarContent>\n * <SidebarItem label={open ? \"Home\" : undefined} />\n * </SidebarContent>\n * </SidebarNav>\n * <div>Sidebar is {open ? 'open' : 'closed'}</div>\n * </>\n * )}\n * </Sidebar>\n * ```\n *\n * @example\n * ```tsx\n * // Modo controlled\n * function App() {\n * const [open, setOpen] = useState(true)\n *\n * return (\n * <Sidebar open={open} onOpenChange={setOpen}>\n * <SidebarNav>...</SidebarNav>\n * </Sidebar>\n * )\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Con configuración custom\n * <Sidebar\n * collapseMode=\"hide\"\n * dimensions={{ expandedWidth: \"20rem\" }}\n * animations={{ widthTransitionDuration: 500 }}\n * >\n * <SidebarNav>...</SidebarNav>\n * </Sidebar>\n * ```\n *\n * @note\n * Los colores se obtienen automáticamente de los tokens CSS de shadcn definidos\n * en globals.css (--sidebar, --sidebar-accent, --sidebar-primary, etc.)\n */\nexport function Sidebar({\n children,\n className,\n style,\n defaultOpen = DEFAULT_CONFIG.defaultOpen,\n open,\n onOpenChange,\n collapseMode = DEFAULT_CONFIG.collapseMode,\n hideBehaviour = DEFAULT_CONFIG.hideBehaviour,\n hideOpensBehavior = DEFAULT_CONFIG.hideOpensBehavior,\n layoutBehaviour = DEFAULT_CONFIG.layoutBehaviour,\n dimensions,\n animations,\n toggleId = DEFAULT_CONFIG.toggleId,\n debug = DEFAULT_CONFIG.debug,\n enableFluidIndicator = false,\n enableTooltip = true,\n liquidGlass,\n as,\n}: SidebarProps) {\n // Determinar si children es render prop o ReactNode\n const isRenderProp = typeof children === \"function\"\n\n // Wrapper component (default: div, customizable con 'as')\n const Component = (as || \"div\") as ElementType\n\n return (\n <SidebarProvider\n defaultOpen={defaultOpen}\n open={open}\n onOpenChange={onOpenChange}\n collapseMode={collapseMode}\n hideBehaviour={hideBehaviour}\n hideOpensBehavior={hideOpensBehavior}\n layoutBehaviour={layoutBehaviour}\n dimensions={dimensions}\n animations={animations}\n toggleId={toggleId}\n debug={debug}\n enableFluidIndicator={enableFluidIndicator}\n enableTooltip={enableTooltip}\n liquidGlass={liquidGlass}\n >\n <Component className={className} style={style}>\n {isRenderProp\n ? (children as SidebarRenderProp)({\n open: open ?? defaultOpen,\n collapsed: !open && collapseMode === \"collapse\",\n collapseMode,\n layoutBehaviour,\n })\n : children}\n </Component>\n </SidebarProvider>\n )\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { SidebarContext } from \"../SidebarContext\"\nimport type { SidebarContextValue } from \"../Sidebar.types\"\n\n/**\n * Hook para acceder al contexto del Sidebar\n *\n * @description\n * Hook personalizado que provee acceso al contexto compartido del Sidebar.\n * Debe ser utilizado dentro de un componente que esté envuelto por\n * `<Sidebar>` o `<SidebarProvider>`.\n *\n * Lanza un error si se utiliza fuera del contexto apropiado, ayudando\n * a detectar problemas de composición durante el desarrollo.\n *\n * @throws {Error} Si se usa fuera de un SidebarProvider\n *\n * @returns {SidebarContextValue} El valor del contexto del sidebar\n *\n * @example\n * ```tsx\n * function CustomToggle() {\n * const { open, setOpen } = useSidebarContext()\n *\n * return (\n * <button onClick={() => setOpen(!open)}>\n * {open ? 'Cerrar' : 'Abrir'}\n * </button>\n * )\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Acceder a configuración\n * function CustomItem() {\n * const { colors, dimensions } = useSidebarContext()\n *\n * return (\n * <div style={{\n * background: colors.hover,\n * width: dimensions.expandedWidth\n * }}>\n * Item\n * </div>\n * )\n * }\n * ```\n */\nexport function useSidebarContext(): SidebarContextValue {\n const context = useContext(SidebarContext)\n\n if (!context) {\n throw new Error(\n \"useSidebarContext debe ser utilizado dentro de un componente <Sidebar> o <SidebarProvider>. \" +\n \"Asegúrate de que tu componente esté envuelto correctamente en la jerarquía del Sidebar.\",\n )\n }\n\n return context\n}\n","\"use client\"\n\nimport { useContext } from \"react\"\nimport { SubContentContext } from \"../SidebarContext\"\n\nexport function useSubContent() {\n const context = useContext(SubContentContext)\n\n if (!context) {\n throw new Error(\"useSubContent must be used within a <Sidebar> component\")\n }\n\n return context\n}\n","\"use client\"\n\nimport { useState, useRef, useCallback, useEffect } from \"react\"\nimport type { MouseEvent } from \"react\"\nimport { useSidebarContext } from \"./useSidebarContext\"\n\n/**\n * Valor de retorno del hook useSidebarIndicator\n * @interface\n */\ninterface UseSidebarIndicatorReturn {\n /** Indica si el indicador está visible */\n isVisible: boolean\n /** Indica si el mouse está sobre el área de items */\n isOverItems: boolean\n /** Elemento del item actualmente hovered o enfocado (para FluidHoverIndicator) */\n currentItemElement: HTMLElement | null\n /** ID del item bajo el indicador (para tooltip con subContent) */\n hoveredItemId: string | null\n /** Label del item hovered (para tooltip simple) */\n hoveredLabel: string | null\n /** Manejador de evento mousemove */\n handleMouseMove: (e: MouseEvent<HTMLDivElement>) => void\n /** Manejador de evento mouseenter */\n handleMouseEnter: () => void\n /** Manejador de evento mouseleave */\n handleMouseLeave: () => void\n /** Manejador de evento focus */\n handleFocus: () => void\n /** Manejador de evento blur */\n handleBlur: (e: React.FocusEvent) => void\n /** Función para limpiar el estado hovered desde fuera (tooltip mouseleave) */\n clearHoveredState: () => void\n}\n\n/**\n * Hook para gestionar el indicador visual del Sidebar\n *\n * @description\n * Hook que implementa la lógica del indicador visual que sigue al cursor\n * del mouse dentro del sidebar. El indicador se muestra cuando:\n * - El mouse está sobre el sidebar (isHovering = true)\n * - El cursor está en el área de items (isOverItems = true)\n *\n * Utiliza requestAnimationFrame para optimizar el rendimiento y evitar\n * cálculos excesivos durante el movimiento del mouse.\n *\n * El indicador también se actualiza cuando se navega por teclado,\n * integrándose con useSidebarKeyboard.\n *\n * @returns {UseSidebarIndicatorReturn} Estado y manejadores de eventos\n *\n * @example\n * ```tsx\n * function SidebarNav() {\n * const {\n * isVisible,\n * handleMouseMove,\n * handleMouseEnter,\n * handleMouseLeave\n * } = useSidebarIndicator()\n *\n * return (\n * <nav\n * onMouseMove={handleMouseMove}\n * onMouseEnter={handleMouseEnter}\n * onMouseLeave={handleMouseLeave}\n * >\n * <SidebarIndicator visible={isVisible} />\n * {children}\n * </nav>\n * )\n * }\n * ```\n */\nexport function useSidebarIndicator(): UseSidebarIndicatorReturn {\n const {\n indicatorRef,\n navRef,\n contentRef,\n showIndicatorForKeyboard,\n setShowIndicatorForKeyboard,\n isOverItems,\n setIsOverItems,\n currentItemElement,\n setCurrentItemElement,\n } = useSidebarContext()\n\n const [isHovering, setIsHovering] = useState(false)\n const [refsReady, setRefsReady] = useState(false)\n const [hoveredItemId, setHoveredItemId] = useState<string | null>(null)\n const [hoveredLabel, setHoveredLabel] = useState<string | null>(null)\n\n // Ref para almacenar el ID del requestAnimationFrame\n const rafRef = useRef<number | null>(null)\n\n // Verificar que todas las refs estén listas\n useEffect(() => {\n if (indicatorRef.current && navRef.current && contentRef.current) {\n setRefsReady(true)\n }\n }, [indicatorRef, navRef, contentRef, indicatorRef.current, navRef.current, contentRef.current])\n\n /**\n * Manejador de mousemove con optimización via requestAnimationFrame\n *\n * @param {MouseEvent<HTMLDivElement>} e - Evento de mouse\n */\n const handleMouseMove = useCallback(\n (e: MouseEvent<HTMLDivElement>) => {\n if (!indicatorRef.current || !navRef.current || !contentRef.current) {\n return\n }\n\n // Cancelar frame anterior si existe\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current)\n }\n\n // Programar actualización en el próximo frame\n rafRef.current = requestAnimationFrame(() => {\n if (!indicatorRef.current || !navRef.current || !contentRef.current) return\n\n const navRect = navRef.current.getBoundingClientRect()\n const contentRect = contentRef.current.getBoundingClientRect()\n\n // Calcular posición Y relativa al nav\n const y = e.clientY - navRect.top\n\n // Obtener límites del área de contenido\n const minY = contentRect.top - navRect.top\n const maxY = contentRect.bottom - navRect.top\n\n // Clamp Y dentro del área de contenido\n const clampedY = Math.max(minY, Math.min(maxY, y))\n\n // Actualizar posición del indicador\n indicatorRef.current.style.top = `${clampedY}px`\n\n // Determinar si el cursor está en el área de items\n const isInItemsArea = e.clientY >= contentRect.top && e.clientY <= contentRect.bottom\n\n setIsOverItems(isInItemsArea)\n\n // Detectar el item actualmente hovered (para FluidHoverIndicator y tooltip)\n const hoveredElement = document.elementFromPoint(e.clientX, e.clientY)\n\n // Buscar el item con data-sidebar-item (puede estar en un padre si el cursor está sobre un hijo)\n const itemElement = hoveredElement?.closest('[data-sidebar-item]') as HTMLElement | null\n\n if (itemElement) {\n setCurrentItemElement(itemElement)\n\n // Extraer label para tooltip simple (items sin subContent)\n const label = itemElement.getAttribute('aria-label') || itemElement.getAttribute('title')\n setHoveredLabel(label || null)\n\n // Extraer itemId para tooltip con subContent\n const itemId = itemElement.getAttribute(\"data-item-id\")\n setHoveredItemId(itemId || null)\n } else {\n // Si no hay item hovered, limpiar\n setCurrentItemElement(null)\n setHoveredItemId(null)\n setHoveredLabel(null)\n }\n })\n },\n [indicatorRef, navRef, contentRef],\n )\n\n /**\n * Manejador de mouseenter\n */\n const handleMouseEnter = useCallback(() => {\n setIsHovering(true)\n }, [])\n\n /**\n * Manejador de mouseleave\n */\n const handleMouseLeave = useCallback(() => {\n setIsHovering(false)\n setIsOverItems(false)\n setShowIndicatorForKeyboard(false)\n setCurrentItemElement(null)\n setHoveredLabel(null)\n\n // Cancelar animación pendiente\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current)\n }\n }, [setShowIndicatorForKeyboard, setIsOverItems])\n\n /**\n * Manejador de focus (cuando se enfoca un elemento dentro del sidebar)\n */\n const handleFocus = useCallback(() => {\n setIsHovering(true)\n setIsOverItems(true)\n }, [setIsOverItems])\n\n /**\n * Manejador de blur (cuando se pierde el focus)\n *\n * @param {React.FocusEvent} e - Evento de blur\n */\n const handleBlur = useCallback(\n (e: React.FocusEvent) => {\n // Solo ocultar si el focus sale completamente del sidebar\n if (!navRef.current?.contains(e.relatedTarget as Node)) {\n setIsHovering(false)\n setIsOverItems(false)\n setShowIndicatorForKeyboard(false)\n }\n },\n [navRef, setShowIndicatorForKeyboard, setIsOverItems],\n )\n\n /**\n * Limpia el estado hovered (para cuando el mouse sale del tooltip)\n */\n const clearHoveredState = useCallback(() => {\n setHoveredLabel(null)\n setHoveredItemId(null)\n setCurrentItemElement(null)\n }, [])\n\n // El indicador es visible cuando:\n // - Mouse hover: refsReady && isHovering && isOverItems\n // - Keyboard focus: refsReady && showIndicatorForKeyboard\n const isVisible = refsReady && ((isHovering && isOverItems) || showIndicatorForKeyboard)\n\n return {\n isVisible,\n isOverItems,\n currentItemElement,\n hoveredItemId,\n hoveredLabel,\n handleMouseMove,\n handleMouseEnter,\n handleMouseLeave,\n handleFocus,\n handleBlur,\n clearHoveredState,\n }\n}\n","\"use client\"\n\nimport { useState, useEffect, useCallback } from \"react\"\nimport { SIDEBAR_KEYBOARD_KEYS, SIDEBAR_DATA_ATTRIBUTES } from \"../Sidebar.constants\"\nimport { useSidebarContext } from \"./useSidebarContext\"\n\n/**\n * Valor de retorno del hook useSidebarKeyboard\n * @interface\n */\ninterface UseSidebarKeyboardReturn {\n /** Índice del item actualmente enfocado (-1 si ninguno) */\n focusedIndex: number\n /** Función para cambiar el índice enfocado manualmente */\n setFocusedIndex: (index: number) => void\n /** Callback para actualizar el indicador según el item enfocado */\n updateIndicatorForFocus: (index: number) => void\n}\n\n/**\n * Hook para gestionar la navegación por teclado en el Sidebar\n *\n * @description\n * Hook que implementa navegación accesible por teclado para los items\n * del sidebar, siguiendo las especificaciones WAI-ARIA:\n *\n * - ArrowDown: Navegar al siguiente item\n * - ArrowUp: Navegar al item anterior\n * - Home: Ir al primer item\n * - End: Ir al último item\n * - Tab: Navegación estándar que actualiza el indicador\n *\n * También sincroniza el indicador visual con el item enfocado.\n *\n * @returns {UseSidebarKeyboardReturn} Estado y funciones para navegación\n *\n * @example\n * ```tsx\n * function SidebarNav() {\n * const { focusedIndex, updateIndicatorForFocus } = useSidebarKeyboard()\n *\n * return (\n * <nav>\n * {items.map((item, index) => (\n * <SidebarItem\n * key={item.id}\n * focused={index === focusedIndex}\n * onFocus={() => updateIndicatorForFocus(index)}\n * />\n * ))}\n * </nav>\n * )\n * }\n * ```\n */\nexport function useSidebarKeyboard(): UseSidebarKeyboardReturn {\n const {\n contentRef,\n indicatorRef,\n navRef,\n items,\n setShowIndicatorForKeyboard,\n setIsOverItems,\n setCurrentItemElement,\n } = useSidebarContext()\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n\n /**\n * Actualiza la posición del indicador basándose en el item enfocado\n *\n * @param {number} index - Índice del item a enfocar\n * @param {HTMLElement[]} [itemsOverride] - Array de items frescos (opcional). Si se proporciona, se usa en lugar del array del context.\n */\n const updateIndicatorForFocus = useCallback(\n (index: number, itemsOverride?: HTMLElement[]) => {\n if (!indicatorRef.current || !navRef.current) return\n\n // Usar items pasadas como parámetro si existen, o del context como fallback\n const itemsToUse = itemsOverride || items\n\n if (index < 0 || index >= itemsToUse.length) return\n\n const item = itemsToUse[index]\n if (!item) return\n\n const navRect = navRef.current.getBoundingClientRect()\n const itemRect = item.getBoundingClientRect()\n\n // Calcular posición Y relativa al nav\n const y = itemRect.top - navRect.top + itemRect.height / 2\n\n // Actualizar posición del indicador\n indicatorRef.current.style.top = `${y}px`\n\n // Actualizar currentItemElement para sincronizar FluidIndicator\n setCurrentItemElement(item)\n\n // Mostrar indicador cuando se navega por teclado\n setShowIndicatorForKeyboard(true)\n // Activar isOverItems como en el monolito para que el indicador sea visible\n setIsOverItems(true)\n },\n [indicatorRef, navRef, items, setShowIndicatorForKeyboard, setIsOverItems, setCurrentItemElement],\n )\n\n /**\n * Manejador de eventos de teclado\n */\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n // Solo procesar si hay un contentRef\n if (!contentRef.current) return\n\n // Obtener todos los items del sidebar\n const sidebarItems = Array.from(\n contentRef.current.querySelectorAll(`[${SIDEBAR_DATA_ATTRIBUTES.ITEM}]`),\n ) as HTMLElement[]\n\n if (sidebarItems.length === 0) return\n\n switch (e.key) {\n case SIDEBAR_KEYBOARD_KEYS.ARROW_DOWN: {\n e.preventDefault()\n setFocusedIndex((prev) => {\n const next = prev < sidebarItems.length - 1 ? prev + 1 : prev\n sidebarItems[next]?.focus()\n updateIndicatorForFocus(next, sidebarItems)\n return next\n })\n break\n }\n\n case SIDEBAR_KEYBOARD_KEYS.ARROW_UP: {\n e.preventDefault()\n setFocusedIndex((prev) => {\n const next = prev > 0 ? prev - 1 : prev\n sidebarItems[next]?.focus()\n updateIndicatorForFocus(next, sidebarItems)\n return next\n })\n break\n }\n\n case SIDEBAR_KEYBOARD_KEYS.HOME: {\n e.preventDefault()\n sidebarItems[0]?.focus()\n setFocusedIndex(0)\n updateIndicatorForFocus(0, sidebarItems)\n break\n }\n\n case SIDEBAR_KEYBOARD_KEYS.END: {\n e.preventDefault()\n const lastIndex = sidebarItems.length - 1\n sidebarItems[lastIndex]?.focus()\n setFocusedIndex(lastIndex)\n updateIndicatorForFocus(lastIndex, sidebarItems)\n break\n }\n\n case SIDEBAR_KEYBOARD_KEYS.TAB: {\n // Actualizar indicador cuando se navega con Tab\n const activeElement = document.activeElement as HTMLElement\n const currentIndex = sidebarItems.indexOf(activeElement)\n\n if (currentIndex !== -1) {\n setFocusedIndex(currentIndex)\n updateIndicatorForFocus(currentIndex, sidebarItems)\n }\n break\n }\n\n case SIDEBAR_KEYBOARD_KEYS.ESCAPE: {\n // Quitar focus del sidebar\n ;(document.activeElement as HTMLElement)?.blur()\n setFocusedIndex(-1)\n setShowIndicatorForKeyboard(false)\n setIsOverItems(false)\n setCurrentItemElement(null)\n break\n }\n }\n }\n\n // Agregar listener global\n document.addEventListener(\"keydown\", handleKeyDown)\n\n // Cleanup\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown)\n }\n }, [contentRef, updateIndicatorForFocus, setIsOverItems])\n\n return {\n focusedIndex,\n setFocusedIndex,\n updateIndicatorForFocus,\n }\n}\n","import { useMemo } from 'react'\n\n// Try to import optional dependency\nlet generateDisplacementMap: any = null\n\n// Define local types when external dependency is not available\ninterface LocalGeometryConfig {\n width: number\n height: number\n radius?: number\n border?: number\n}\n\ninterface LocalVisualConfig {\n blur?: number\n frost?: number\n scale?: number\n alpha?: number\n [key: string]: any\n}\n\ntype GeometryConfig = LocalGeometryConfig\ntype VisualConfig = LocalVisualConfig\n\ntry {\n const liquidGlassCore = require('@liquid-svg-glass/core')\n generateDisplacementMap = liquidGlassCore.generateDisplacementMap\n} catch {\n // Optional dependency not available\n console.warn('@liquid-svg-glass/core is not installed. Liquid glass effects will be disabled.')\n}\n\n/**\n * Hook genérico para crear efectos liquid glass\n *\n * @description\n * Genera un displacement map SVG y atributos de filtro usando la librería @liquid-svg-glass/core.\n * Memoiza el resultado para evitar recalcular en cada render.\n *\n * @example\n * ```tsx\n * const glass = useLiquidGlass(\n * { width: 240, height: 48, radius: 12, border: 0.07 },\n * { frost: 0.05, blur: 8, scale: -200, ... }\n * )\n *\n * <feImage href={glass.dataUri} result=\"map\" />\n * ```\n */\nexport function useLiquidGlass(\n geometry: GeometryConfig,\n visual: VisualConfig,\n enableChromaticAberration = false\n) {\n return useMemo(() => {\n const result = generateDisplacementMap(geometry, visual, enableChromaticAberration)\n\n return {\n dataUri: result.dataUri,\n filterAttributes: result.filterAttributes,\n chromaticAberrationSVG: result.chromaticAberrationSVG,\n calculatedGeometry: result.calculatedGeometry\n }\n }, [\n // Geometry dependencies\n geometry.width,\n geometry.height,\n geometry.radius,\n geometry.border,\n // Visual dependencies\n visual.frost,\n visual.blur,\n visual.blurBackground,\n visual.displace,\n visual.scale,\n visual.alpha,\n visual.lightness,\n visual.x,\n visual.y,\n visual.blend,\n visual.r,\n visual.g,\n visual.b,\n enableChromaticAberration\n ])\n}\n","/**\n * Glass configuration interface (local definition to avoid external dependency issues)\n * Made flexible to handle all liquid glass configuration properties\n */\nexport interface SidebarLiquidConfig {\n /** Habilitar chromatic aberration (Phase 2) - solo para tooltips por defecto */\n enableChromaticAberration?: boolean\n /** Allow any property to avoid external dependency issues */\n [key: string]: any\n}\n\n/**\n * Presets optimizados de Liquid Glass para componentes del Sidebar\n *\n * @description\n * Configuraciones pre-optimizadas para diferentes componentes del sidebar:\n * - `indicator`: Para el FluidHoverIndicator (hover states de items)\n * - `tooltip`: Para tooltips expandidos con contenido rico\n * - `dropdown`: Para menús dropdown y submenús\n *\n * Cada preset está calibrado para:\n * - Performance óptimo en sidebar (blur reducido vs showcase)\n * - Tamaños típicos de componentes de sidebar\n * - Visual balance entre refracción y legibilidad\n */\n\n/**\n * Extended config interface for sidebar liquid glass\n */\nexport interface ExtendedSidebarLiquidConfig extends SidebarLiquidConfig {\n /** Habilitar chromatic aberration (Phase 2) - solo para tooltips por defecto */\n enableChromaticAberration?: boolean\n}\n\nexport type SidebarLiquidPreset = 'indicator' | 'tooltip' | 'dropdown' | 'sidebar'\n\nexport const sidebarLiquidPresets: Record<SidebarLiquidPreset, SidebarLiquidConfig> = {\n /**\n * Preset para FluidHoverIndicator\n *\n * Optimizado para:\n * - Items de sidebar (~48px altura)\n * - Animaciones suaves con spring physics\n * - Performance en hover rápido\n */\n indicator: {\n // Geometry\n width: 240,\n height: 48,\n radius: 12,\n border: 0.07,\n\n // Visual Effects\n frost: 0.05,\n blur: 8,\n blurBackground: 6,\n displace: 0.3,\n scale: -200,\n alpha: 0.93,\n lightness: 50,\n\n // Channels\n x: 'R',\n y: 'B',\n blend: 'difference',\n\n // Chromatic Aberration (subtle para no distraer)\n r: 0,\n g: 10,\n b: 20,\n\n // Feature flags\n enableChromaticAberration: false // Mantener simple para hover indicator\n },\n\n /**\n * Preset para SidebarTooltip\n *\n * Optimizado para:\n * - Tooltips expandidos con contenido (~280x320px)\n * - Máximo realismo visual (chromatic aberration habilitado)\n * - Edge glass 3D para profundidad\n */\n tooltip: {\n // Geometry\n width: 280,\n height: 320,\n radius: 16,\n border: 0.07,\n\n // Visual Effects (calibrado con showcase dock preset)\n frost: 0.05,\n blur: 11,\n blurBackground: 8,\n displace: 0.2,\n scale: -180,\n alpha: 0.93,\n lightness: 50,\n\n // Channels\n x: 'R',\n y: 'B',\n blend: 'difference',\n\n // Chromatic Aberration (moderado para realismo sin distracción)\n r: 0,\n g: 10,\n b: 20,\n\n // Feature flags\n enableChromaticAberration: true // Phase 2: chromatic aberration completo\n },\n\n /**\n * Preset para Dropdown/SubMenu\n *\n * Optimizado para:\n * - Menús dropdown (~200x180px)\n * - Legibilidad de texto en lista de opciones\n * - Transiciones rápidas de aparición\n */\n dropdown: {\n // Geometry\n width: 200,\n height: 180,\n radius: 14,\n border: 0.07,\n\n // Visual Effects\n frost: 0.06,\n blur: 9,\n blurBackground: 8,\n displace: 0.35,\n scale: -180,\n alpha: 0.94,\n lightness: 50,\n\n // Channels\n x: 'R',\n y: 'B',\n blend: 'difference',\n\n // Chromatic Aberration (moderado)\n r: 0,\n g: 12,\n b: 22,\n\n // Feature flags\n enableChromaticAberration: false // Priorizar legibilidad sobre efecto\n },\n\n /**\n * Preset para SidebarNav (contenedor principal)\n *\n * Optimizado para:\n * - Contenedor de sidebar completo (~256px ancho, altura completa viewport)\n * - Efecto sutil que no distrae del contenido\n * - Background transparency para mostrar refracción\n */\n sidebar: {\n // Geometry\n width: 256,\n height: 800,\n radius: 0,\n border: 0.05,\n\n // Visual Effects\n frost: 0.05,\n blur: 8,\n blurBackground: 8,\n displace: 0.25,\n scale: -180,\n alpha: 0.92,\n lightness: 50,\n\n // Channels\n x: 'R',\n y: 'B',\n blend: 'difference',\n\n // Chromatic Aberration (muy sutil)\n r: 0,\n g: 8,\n b: 16,\n\n // Feature flags\n enableChromaticAberration: false // Efecto muy sutil para el contenedor principal\n }\n}\n\n/**\n * Helper para obtener preset con overrides\n *\n * @example\n * ```tsx\n * const config = getLiquidPreset('indicator', { blur: 12 })\n * ```\n */\nexport function getLiquidPreset(\n preset: SidebarLiquidPreset,\n overrides?: Partial<SidebarLiquidConfig>\n): SidebarLiquidConfig {\n return {\n ...sidebarLiquidPresets[preset],\n ...overrides\n }\n}\n","import { useSidebarContext } from '@/components/Sidebar/hooks/useSidebarContext'\nimport { useLiquidGlass } from './use-liquid-glass'\nimport { type SidebarLiquidPreset, sidebarLiquidPresets, type SidebarLiquidConfig } from '@/lib/liquid-glass-presets'\n\n/**\n * Hook especializado para Liquid Glass en componentes del Sidebar\n *\n * @description\n * Wrapper sobre `useLiquidGlass` que:\n * - Usa presets optimizados para sidebar\n * - Accede al contexto del sidebar (navRef)\n * - Simplifica la API para componentes sidebar\n *\n * @example\n * ```tsx\n * function SidebarFluidIndicator() {\n * const glass = useSidebarLiquidGlass('indicator')\n *\n * return (\n * <svg>\n * <filter id=\"liquid-glass\">\n * <feImage href={glass.dataUri} />\n * <feDisplacementMap scale={glass.filterAttributes.red.scale} />\n * </filter>\n * </svg>\n * )\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Con overrides\n * const glass = useSidebarLiquidGlass('tooltip', {\n * blur: 12,\n * enableChromaticAberration: true\n * })\n * ```\n */\nexport function useSidebarLiquidGlass(\n preset: SidebarLiquidPreset,\n overrides?: Partial<SidebarLiquidConfig>\n) {\n const { navRef } = useSidebarContext()\n\n // Merge preset con overrides\n const config = {\n ...sidebarLiquidPresets[preset],\n ...overrides\n }\n\n // Extraer enableChromaticAberration antes de separar geometry/visual\n const enableChromaticAberration = config.enableChromaticAberration ?? false\n\n // Generar liquid glass con preset\n const glass = useLiquidGlass(\n // GeometryConfig\n {\n width: config.width,\n height: config.height,\n radius: config.radius,\n border: config.border\n },\n // VisualConfig\n {\n frost: config.frost,\n blur: config.blur,\n blurBackground: config.blurBackground,\n displace: config.displace,\n scale: config.scale,\n alpha: config.alpha,\n lightness: config.lightness,\n x: config.x,\n y: config.y,\n blend: config.blend,\n r: config.r,\n g: config.g,\n b: config.b\n },\n enableChromaticAberration\n )\n\n // Retornar glass data + sidebar context\n return {\n ...glass,\n containerRef: navRef,\n preset,\n config\n }\n}\n","import { useRef, useCallback } from 'react'\n\n/**\n * Position interface\n */\ninterface Position {\n x: number\n y: number\n width: number\n height: number\n}\n\n/**\n * Animation direction\n */\ntype Direction = 'horizontal' | 'vertical' | 'diagonal'\n\n/**\n * Spring easing function with damping\n * Simulates spring physics for smooth, bouncy motion\n */\nconst createSpringEasing = (damping = 0.7, stiffness = 0.3) => {\n return `cubic-bezier(0.34, ${1 + stiffness}, ${damping}, 1)`\n}\n\n/**\n * Calculate direction and distance between two positions\n */\nconst calculateMovement = (from: Position, to: Position) => {\n const dx = to.x - from.x\n const dy = to.y - from.y\n const distance = Math.sqrt(dx * dx + dy * dy)\n\n // Determine primary direction\n let direction: Direction = 'horizontal'\n if (Math.abs(dy) > Math.abs(dx) * 1.5) {\n direction = 'vertical'\n } else if (Math.abs(dx) > Math.abs(dy) * 1.5) {\n direction = 'horizontal'\n } else {\n direction = 'diagonal'\n }\n\n // Calculate angle for skew effect\n const angle = Math.atan2(dy, dx) * (180 / Math.PI)\n\n return { dx, dy, distance, direction, angle }\n}\n\n/**\n * Generate morphing keyframes based on direction\n */\nconst generateMorphingKeyframes = (\n from: Position,\n to: Position,\n direction: Direction,\n angle: number\n) => {\n // Base transforms\n const fromTransform = `translate(${from.x}px, ${from.y}px) scale(1) skew(0deg)`\n const toTransform = `translate(${to.x}px, ${to.y}px) scale(1) skew(0deg)`\n\n // Morphing parameters based on direction\n let stretchScale = '1.15, 0.95' // Default: stretch X, squash Y\n let overshootScale = '1.05, 1.03' // Slight overshoot\n let skewValue = '5deg'\n\n if (direction === 'vertical') {\n stretchScale = '0.95, 1.15' // Stretch Y, squash X\n skewValue = '-5deg'\n } else if (direction === 'diagonal') {\n stretchScale = '1.1, 1.1' // Equal stretch\n skewValue = `${angle * 0.1}deg` // Skew based on angle\n }\n\n // Keyframes with physics stages\n return [\n // Start: Idle state\n {\n transform: fromTransform,\n opacity: '0.95',\n offset: 0\n },\n // Anticipate: Slight squash before moving (15%)\n {\n transform: `translate(${from.x}px, ${from.y}px) scale(0.95) skew(0deg)`,\n opacity: '0.98',\n offset: 0.15\n },\n // Stretch: Mid-movement elongation (45%)\n {\n transform: `translate(${(from.x + to.x) / 2}px, ${(from.y + to.y) / 2}px) scale(${stretchScale}) skew(${skewValue})`,\n opacity: '1',\n offset: 0.45\n },\n // Overshoot: Go past target slightly (75%)\n {\n transform: `translate(${to.x + (to.x - from.x) * 0.1}px, ${to.y + (to.y - from.y) * 0.1}px) scale(${overshootScale}) skew(${direction === 'horizontal' ? '-2deg' : '2deg'})`,\n opacity: '1',\n offset: 0.75\n },\n // Settle: Return to normal (100%)\n {\n transform: toTransform,\n opacity: '0.95',\n offset: 1\n },\n ]\n}\n\n/**\n * Extract current position from element's computed transform\n */\nconst getCurrentPosition = (element: HTMLElement): { x: number; y: number } => {\n const transform = getComputedStyle(element).transform\n\n if (transform === 'none') {\n return { x: 0, y: 0 }\n }\n\n const matrix = new DOMMatrix(transform)\n return {\n x: matrix.m41,\n y: matrix.m42,\n }\n}\n\n/**\n * Generate fast mode keyframes (simple, direct movement)\n */\nconst generateFastKeyframes = (from: Position, to: Position) => {\n return [\n {\n transform: `translate(${from.x}px, ${from.y}px)`,\n width: `${from.width}px`,\n height: `${from.height}px`,\n offset: 0,\n },\n {\n transform: `translate(${to.x}px, ${to.y}px)`,\n width: `${to.width}px`,\n height: `${to.height}px`,\n offset: 1,\n },\n ]\n}\n\n/**\n * Custom hook for fluid animation with spring physics\n */\nexport function useFluidAnimation() {\n const previousPositionRef = useRef<Position | null>(null)\n const animationRef = useRef<Animation | null>(null)\n const lastChangeTimestampRef = useRef<number>(0)\n\n /**\n * Animate element to new position with fluid physics\n */\n const animate = useCallback((element: HTMLElement, targetPosition: Position) => {\n // Detect fast mode (rapid changes < 200ms)\n const now = Date.now()\n const timeSinceLastChange = now - lastChangeTimestampRef.current\n const isFastMode = timeSinceLastChange < 200 && lastChangeTimestampRef.current > 0\n lastChangeTimestampRef.current = now\n\n // Capture current visual position before canceling\n let from: Position\n if (animationRef.current) {\n // Get actual current position from computed transform\n const currentPos = getCurrentPosition(element)\n from = {\n x: currentPos.x,\n y: currentPos.y,\n width: previousPositionRef.current?.width || targetPosition.width,\n height: previousPositionRef.current?.height || targetPosition.height,\n }\n\n // Cancel previous animation\n animationRef.current.cancel()\n } else {\n from = previousPositionRef.current || targetPosition\n }\n\n const to = targetPosition\n\n // Calculate movement parameters\n const { direction, angle, distance } = calculateMovement(from, to)\n\n // Choose keyframes and duration based on mode\n let keyframes: Keyframe[]\n let duration: number\n let easing: string\n\n if (isFastMode) {\n // Fast mode: Simple, direct movement\n keyframes = generateFastKeyframes(from, to)\n duration = Math.min(150, Math.max(100, distance * 0.5))\n easing = 'cubic-bezier(0.25, 0.1, 0.25, 1)' // ease-out\n } else {\n // Slow mode: Full morphing with spring physics\n keyframes = generateMorphingKeyframes(from, to, direction, angle)\n duration = Math.min(450, Math.max(350, distance * 2))\n easing = createSpringEasing(0.65, 0.4)\n }\n\n // Create animation\n const animation = element.animate(keyframes, {\n duration,\n easing,\n fill: 'forwards',\n })\n\n // Store animation reference\n animationRef.current = animation\n\n // Update position after animation\n animation.onfinish = () => {\n previousPositionRef.current = to\n }\n\n return animation\n }, [])\n\n /**\n * Reset animation state (for initial appearance)\n */\n const reset = useCallback(() => {\n if (animationRef.current) {\n animationRef.current.cancel()\n animationRef.current = null\n }\n previousPositionRef.current = null\n lastChangeTimestampRef.current = 0\n }, [])\n\n return {\n animate,\n reset,\n }\n}\n","import { useEffect, useRef } from 'react'\nimport type { RefObject } from 'react'\nimport { cn } from '@/lib/utils'\nimport { useFluidAnimation } from '@/hooks/use-fluid-animation'\n\n/**\n * FluidHoverIndicator Props\n */\nexport interface FluidHoverIndicatorProps {\n /** Target element to track */\n targetElement: HTMLElement | null\n /** Whether the indicator should be visible */\n isVisible: boolean\n /** Optional className for customization */\n className?: string\n /** Container ref for relative positioning (default: targetElement.parentElement) */\n containerRef?: RefObject<HTMLElement>\n}\n\n/**\n * Fluid Hover Indicator Component\n *\n * A liquid drop-like hover indicator that uses spring physics\n * and morphing to create organic, fluid motion between sidebar items.\n *\n * Features:\n * - Spring physics with anticipation, stretch, overshoot, and settle\n * - Morphing (scale, skew) based on movement direction\n * - Pure CSS + Web Animations API (no Framer Motion)\n * - GPU-accelerated with will-change and transform\n */\nexport function FluidHoverIndicator({\n targetElement,\n isVisible,\n className = '',\n containerRef,\n}: FluidHoverIndicatorProps) {\n const indicatorRef = useRef<HTMLDivElement>(null)\n const { animate, reset } = useFluidAnimation()\n const isFirstRender = useRef(true)\n\n useEffect(() => {\n console.log('🎨 [FluidHoverIndicator] useEffect:', {\n hasTargetElement: !!targetElement,\n hasIndicatorRef: !!indicatorRef.current,\n isVisible,\n targetElementRect: targetElement?.getBoundingClientRect(),\n })\n\n if (!targetElement || !indicatorRef.current || !isVisible) {\n // Reset animation state when hiding\n if (!isVisible && indicatorRef.current) {\n reset()\n indicatorRef.current.style.opacity = '0'\n isFirstRender.current = true\n }\n return\n }\n\n // Get target position\n const targetRect = targetElement.getBoundingClientRect()\n\n // Use containerRef if provided, otherwise fallback to parentElement\n const parentRect = containerRef?.current?.getBoundingClientRect()\n || targetElement.parentElement?.getBoundingClientRect()\n\n if (!parentRect) return\n\n // Calculate position relative to sidebar\n // Reduce dimensions to leave space for SidebarIndicator\n const padding = 8 // Space for the sidebar indicator bar\n const position = {\n x: targetRect.left - parentRect.left + padding,\n y: targetRect.top - parentRect.top + 4,\n width: targetRect.width - padding - 4,\n height: targetRect.height - 8,\n }\n\n // First render: instant positioning without animation\n if (isFirstRender.current) {\n indicatorRef.current.style.transform = `translate(${position.x}px, ${position.y}px)`\n indicatorRef.current.style.width = `${position.width}px`\n indicatorRef.current.style.height = `${position.height}px`\n indicatorRef.current.style.opacity = '1'\n isFirstRender.current = false\n return\n }\n\n // Animate to new position with fluid physics\n animate(indicatorRef.current, position)\n }, [targetElement, isVisible, animate, reset, containerRef])\n\n return (\n <div\n ref={indicatorRef}\n className={cn(\n // Base styling\n 'pointer-events-none absolute z-20',\n 'rounded-xl',\n // Glassmorphism effect - AUMENTADO para mejor visibilidad\n 'bg-primary/30 backdrop-blur-md',\n // Border with glow - AUMENTADO para mejor visibilidad\n 'border-2 border-primary/80',\n 'shadow-lg shadow-primary/40',\n // GPU acceleration\n 'will-change-transform',\n // Visibility\n isVisible ? 'opacity-100' : 'opacity-0',\n // Transition for opacity only (position handled by animate())\n 'transition-opacity duration-200',\n // Custom classes\n className\n )}\n style={{\n // Performance optimization\n contain: 'layout style paint',\n // Initial state\n transform: 'translate(0, 0) scale(1) skew(0deg)',\n // Force hide when not visible\n opacity: isVisible ? undefined : 0,\n }}\n >\n {/* Optional: Inner glow effect - AUMENTADO para mejor visibilidad */}\n <div\n className=\"absolute inset-0 rounded-xl bg-gradient-to-br from-primary/40 to-transparent opacity-80\"\n style={{ pointerEvents: 'none' }}\n />\n </div>\n )\n}\n","import { useEffect, useRef } from 'react'\nimport type { RefObject } from 'react'\nimport { cn } from '@/lib/utils'\nimport { useFluidAnimation } from '@/hooks/use-fluid-animation'\nimport { useSidebarLiquidGlass } from '@/hooks/use-sidebar-liquid-glass'\n\n/**\n * FluidHoverIndicatorV2 Props\n */\nexport interface FluidHoverIndicatorV2Props {\n /** Target element to track */\n targetElement: HTMLElement | null\n /** Whether the indicator should be visible */\n isVisible: boolean\n /** Optional className for customization */\n className?: string\n /** Container ref for relative positioning (default: targetElement.parentElement) */\n containerRef?: RefObject<HTMLElement>\n /** Enable chromatic aberration (Phase 2) */\n enableChromaticAberration?: boolean\n}\n\n/**\n * Fluid Hover Indicator V2 - Con Liquid Glass Effect\n *\n * @description\n * Versión mejorada del FluidHoverIndicator que combina:\n * - **Spring physics** del original (anticipation, stretch, overshoot)\n * - **Liquid glass effect** con SVG displacement mapping\n * - **Refracción real** según Snell's Law\n * - **Chromatic aberration** RGB opcional (Phase 2)\n * - **Backdrop extension** para capturar elementos cercanos\n *\n * Features del research aplicadas:\n * - ✅ SVG Displacement (Kube.io) → Refracción física\n * - ✅ Chromatic Aberration (Atlas Pup Labs) → RGB channels\n * - ✅ Performance Optimizations → GPU acceleration\n * - ✅ Backdrop Extension (Josh Comeau) → Captura elementos nearby\n *\n * @example\n * ```tsx\n * <SidebarNav>\n * <FluidHoverIndicatorV2\n * targetElement={hoveredItem}\n * isVisible={isHovering}\n * enableChromaticAberration={true}\n * />\n * </SidebarNav>\n * ```\n */\nexport function FluidHoverIndicatorV2({\n targetElement,\n isVisible,\n className = '',\n containerRef,\n enableChromaticAberration = false\n}: FluidHoverIndicatorV2Props) {\n const indicatorRef = useRef<HTMLDivElement>(null)\n const { animate, reset } = useFluidAnimation()\n const isFirstRender = useRef(true)\n\n // Generar liquid glass effect con preset optimizado\n const { dataUri, filterAttributes, chromaticAberrationSVG } = useSidebarLiquidGlass(\n 'indicator',\n { enableChromaticAberration }\n )\n\n // Debug: Log liquid glass data\n useEffect(() => {\n console.log('🔬 Liquid Glass V2 Data:', {\n hasDataUri: !!dataUri,\n dataUriLength: dataUri?.length || 0,\n hasFilterAttributes: !!filterAttributes,\n hasChromaticSVG: !!chromaticAberrationSVG,\n enabledChromatic: enableChromaticAberration,\n filterIds: {\n red: filterAttributes?.red?.xChannelSelector,\n green: filterAttributes?.green?.xChannelSelector,\n blue: filterAttributes?.blue?.xChannelSelector\n }\n })\n }, [dataUri, filterAttributes, chromaticAberrationSVG, enableChromaticAberration])\n\n // Spring physics animation (mantener del original)\n useEffect(() => {\n if (!targetElement || !indicatorRef.current || !isVisible) {\n if (!isVisible && indicatorRef.current) {\n reset()\n indicatorRef.current.style.opacity = '0'\n isFirstRender.current = true\n }\n return\n }\n\n // Get target position\n const targetRect = targetElement.getBoundingClientRect()\n const parentRect = containerRef?.current?.getBoundingClientRect()\n || targetElement.parentElement?.getBoundingClientRect()\n\n if (!parentRect) return\n\n // Calculate position relative to sidebar\n const padding = 8 // Space for the sidebar indicator bar\n const position = {\n x: targetRect.left - parentRect.left + padding,\n y: targetRect.top - parentRect.top + 4,\n width: targetRect.width - padding - 4,\n height: targetRect.height - 8,\n }\n\n // First render: instant positioning\n if (isFirstRender.current) {\n indicatorRef.current.style.transform = `translate(${position.x}px, ${position.y}px)`\n indicatorRef.current.style.width = `${position.width}px`\n indicatorRef.current.style.height = `${position.height}px`\n indicatorRef.current.style.opacity = '1'\n isFirstRender.current = false\n return\n }\n\n // Animate to new position with fluid physics\n animate(indicatorRef.current, position)\n }, [targetElement, isVisible, animate, reset, containerRef])\n\n return (\n <div\n ref={indicatorRef}\n className={cn(\n // Base styling\n 'pointer-events-none absolute z-20',\n 'rounded-xl',\n // GPU acceleration (Phase 1 performance optimization)\n 'will-change-transform',\n // Visibility\n isVisible ? 'opacity-100' : 'opacity-0',\n // Transition for opacity only (position handled by animate())\n 'transition-opacity duration-200',\n // Custom classes\n className\n )}\n style={{\n // Performance optimization (Phase 1)\n contain: 'layout style paint',\n // Initial state\n transform: 'translate(0, 0) scale(1) skew(0deg)',\n // Force hide when not visible\n opacity: isVisible ? undefined : 0,\n }}\n >\n {/* SVG Filter Definition con Liquid Glass */}\n <svg className=\"absolute inset-0 pointer-events-none w-full h-full\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <filter id=\"liquid-glass-indicator\" colorInterpolationFilters=\"sRGB\">\n {/* Displacement Map generado con refracción física */}\n <feImage\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n result=\"map\"\n href={dataUri}\n />\n\n {/* Phase 1: Legacy chromatic aberration con scale offsets */}\n {!enableChromaticAberration && (\n <>\n {/* Red channel */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={filterAttributes.red.xChannelSelector}\n yChannelSelector={filterAttributes.red.yChannelSelector}\n scale={filterAttributes.red.scale}\n result=\"dispRed\"\n />\n <feColorMatrix\n in=\"dispRed\"\n type=\"matrix\"\n values=\"1 0 0 0 0\n 0 0 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0\"\n result=\"red\"\n />\n\n {/* Green channel */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={filterAttributes.green.xChannelSelector}\n yChannelSelector={filterAttributes.green.yChannelSelector}\n scale={filterAttributes.green.scale}\n result=\"dispGreen\"\n />\n <feColorMatrix\n in=\"dispGreen\"\n type=\"matrix\"\n values=\"0 0 0 0 0\n 0 1 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0\"\n result=\"green\"\n />\n\n {/* Blue channel */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={filterAttributes.blue.xChannelSelector}\n yChannelSelector={filterAttributes.blue.yChannelSelector}\n scale={filterAttributes.blue.scale}\n result=\"dispBlue\"\n />\n <feColorMatrix\n in=\"dispBlue\"\n type=\"matrix\"\n values=\"0 0 0 0 0\n 0 0 0 0 0\n 0 0 1 0 0\n 0 0 0 1 0\"\n result=\"blue\"\n />\n\n {/* Blend RGB channels */}\n <feBlend in=\"red\" in2=\"green\" mode=\"screen\" result=\"rg\" />\n <feBlend in=\"rg\" in2=\"blue\" mode=\"screen\" result=\"output\" />\n\n {/* Final blur */}\n <feGaussianBlur\n in=\"output\"\n stdDeviation={filterAttributes.gaussianBlur.stdDeviation}\n />\n </>\n )}\n\n {/* Phase 2: True chromatic aberration con feColorMatrix + feOffset */}\n {enableChromaticAberration && chromaticAberrationSVG && (\n <>\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={filterAttributes.red.xChannelSelector}\n yChannelSelector={filterAttributes.red.yChannelSelector}\n scale={filterAttributes.red.scale}\n result=\"displaced\"\n />\n <g dangerouslySetInnerHTML={{ __html: chromaticAberrationSVG }} />\n <feGaussianBlur\n in=\"chromaticAberration\"\n stdDeviation={filterAttributes.gaussianBlur.stdDeviation}\n />\n </>\n )}\n </filter>\n </defs>\n </svg>\n\n {/* Backdrop extension layer - 200% height para capturar más contenido */}\n <div\n className=\"absolute inset-0 rounded-xl pointer-events-none\"\n style={{\n height: '200%',\n backdropFilter: 'blur(6px) url(#liquid-glass-indicator) brightness(1.1) saturate(1.5)',\n WebkitBackdropFilter: 'blur(6px) url(#liquid-glass-indicator) brightness(1.1) saturate(1.5)',\n maskImage: 'linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)',\n WebkitMaskImage: 'linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)',\n zIndex: 0\n }}\n />\n\n {/* Main glass layer - usando frost variable */}\n <div\n className=\"absolute inset-0 rounded-xl border border-primary/60\"\n style={{\n // CRÍTICO: backdrop-filter con blur() ANTES de url(#filter)\n backdropFilter: 'blur(6px) url(#liquid-glass-indicator) brightness(1.1) saturate(1.5)',\n WebkitBackdropFilter: 'blur(6px) url(#liquid-glass-indicator) brightness(1.1) saturate(1.5)',\n // Background usando frost (5% opacity)\n background: 'hsl(0 0% 50% / 0.05)',\n // Box shadow inset para profundidad\n boxShadow: `\n 0 0 2px 1px rgba(99, 102, 241, 0.15) inset,\n 0 0 10px 4px rgba(99, 102, 241, 0.1) inset,\n 0px 4px 16px rgba(17, 17, 26, 0.05),\n 0px 8px 24px rgba(17, 17, 26, 0.05)\n `,\n pointerEvents: 'none'\n }}\n />\n </div>\n )\n}\n","\"use client\"\n\nimport { useSidebarContext } from \"./hooks/useSidebarContext\"\nimport { FluidHoverIndicator } from \"@/components/fluid-hover-indicator\"\nimport { FluidHoverIndicatorV2 } from \"@/components/fluid-hover-indicator-v2\"\n\n/**\n * Props del SidebarFluidIndicator\n * @interface\n */\ninterface SidebarFluidIndicatorProps {\n /** Elemento del item actualmente hovered/focused */\n targetElement: HTMLElement | null\n /** Indica si el indicador está visible */\n isVisible: boolean\n}\n\n/**\n * Componente wrapper de FluidHoverIndicator para Sidebar\n *\n * @description\n * Wrapper que conecta el FluidHoverIndicator (glassmorphism + spring physics)\n * con el sistema de estado del Sidebar. Este componente decide automáticamente\n * qué versión renderizar basándose en las feature flags:\n *\n * - **V1 (default)**: FluidHoverIndicator con backdrop-blur CSS básico\n * - **V2 (experimental)**: FluidHoverIndicatorV2 con SVG displacement mapping\n *\n * Feature flags del contexto:\n * - `liquidGlass.enableLiquidGlassV2`: Activa la versión V2\n * - `liquidGlass.enableChromaticAberration`: Activa chromatic aberration (Phase 2)\n *\n * @example\n * ```tsx\n * <SidebarNav>\n * <SidebarIndicator />\n * <SidebarFluidIndicator targetElement={currentItemElement} isVisible={isVisible} />\n * <SidebarContent>...</SidebarContent>\n * </SidebarNav>\n * ```\n */\nexport function SidebarFluidIndicator({ targetElement, isVisible }: SidebarFluidIndicatorProps) {\n const { navRef, liquidGlass } = useSidebarContext()\n\n // Decidir qué versión renderizar basándose en feature flags\n if (liquidGlass.enableLiquidGlassV2) {\n return (\n <FluidHoverIndicatorV2\n targetElement={targetElement}\n isVisible={isVisible}\n containerRef={navRef as React.RefObject<HTMLElement>}\n enableChromaticAberration={liquidGlass.enableChromaticAberration}\n className=\"z-[5]\"\n />\n )\n }\n\n // Fallback a versión V1 (CSS blur básico)\n return (\n <FluidHoverIndicator\n targetElement={targetElement}\n isVisible={isVisible}\n containerRef={navRef as React.RefObject<HTMLElement>}\n className=\"z-[5]\"\n />\n )\n}\n","/**\n * useTooltipDirection\n *\n * Hook para detectar la dirección de navegación en el sidebar basado en índices.\n *\n * Direction-aware animations:\n * - Si navegamos a un item con índice mayor → direction: 'down'\n * - Si navegamos a un item con índice menor → direction: 'up'\n * - Primera navegación → direction: 'down' (default)\n *\n * @example\n * ```typescript\n * const { getDirection, currentIndex } = useTooltipDirection();\n *\n * // Al cambiar de item\n * const direction = getDirection(newItemIndex);\n * // direction = 'up' | 'down'\n * ```\n */\n\nimport { useRef } from 'react';\n\nexport type TooltipDirection = 'up' | 'down';\n\nexport interface UseTooltipDirectionReturn {\n getDirection: (currentIndex: number) => TooltipDirection;\n currentIndex: number | null;\n previousIndex: number | null;\n reset: () => void;\n}\n\nexport function useTooltipDirection(): UseTooltipDirectionReturn {\n const prevIndexRef = useRef<number | null>(null);\n const currentIndexRef = useRef<number | null>(null);\n\n /**\n * Determina la dirección basada en el índice del item actual\n */\n const getDirection = (currentIndex: number): TooltipDirection => {\n const prev = prevIndexRef.current;\n\n prevIndexRef.current = currentIndexRef.current;\n currentIndexRef.current = currentIndex;\n\n if (prev === null) {\n return 'down';\n }\n\n return currentIndex > prev ? 'down' : 'up';\n };\n\n /**\n * Resetea el estado (útil para testing o unmount)\n */\n const reset = () => {\n prevIndexRef.current = null;\n currentIndexRef.current = null;\n };\n\n return {\n getDirection,\n currentIndex: currentIndexRef.current,\n previousIndex: prevIndexRef.current,\n reset,\n };\n}\n\nexport default useTooltipDirection;\n","/**\n * use-text-cylinder\n *\n * Hook para gestionar el estado y controles de un cilindro de texto rotatorio 3D.\n *\n * Features:\n * - State management: currentIndex, isAnimating\n * - Controls: next(), prev(), goTo(index), pause(), resume()\n * - Auto-rotate con interval configurable\n * - Direction-aware: calcula ruta más corta\n *\n * @example\n * ```typescript\n * const { state, controls } = useTextCylinder({\n * items: ['Fast', 'Reliable', 'Scalable'],\n * autoRotate: true,\n * duration: 600\n * });\n *\n * // Controlar manualmente\n * controls.next();\n * controls.goTo(2);\n * controls.pause();\n * ```\n */\n\nimport { useState, useRef, useCallback, useEffect } from 'react'\n\nexport interface TextCylinderOptions<T = React.ReactNode> {\n /** Array de items a mostrar en el cilindro */\n items: T[]\n /** Habilitar rotación automática */\n autoRotate?: boolean\n /** Intervalo de rotación automática en ms */\n autoRotateInterval?: number\n /** Duración de la animación en ms */\n duration?: number\n /** Función de easing CSS */\n easing?: string\n /** Dirección de auto-rotate: 'forward' o 'backward' */\n direction?: 'forward' | 'backward'\n}\n\nexport interface TextCylinderState {\n /** Índice actual del item visible */\n currentIndex: number\n /** Si hay una animación en curso */\n isAnimating: boolean\n}\n\nexport interface TextCylinderControls {\n /** Ir al siguiente item */\n next: () => void\n /** Ir al item anterior */\n prev: () => void\n /** Ir a un índice específico */\n goTo: (index: number) => void\n /** Pausar auto-rotate */\n pause: () => void\n /** Reanudar auto-rotate */\n resume: () => void\n /** Toggle pause/resume */\n toggle: () => void\n}\n\nexport interface UseTextCylinderReturn {\n state: TextCylinderState\n controls: TextCylinderControls\n setIsAnimating: (isAnimating: boolean) => void\n animationRef: React.MutableRefObject<Animation | null>\n}\n\nexport function useTextCylinder<T = React.ReactNode>({\n items,\n autoRotate = false,\n autoRotateInterval = 3000,\n duration = 600,\n easing = 'cubic-bezier(0.4, 0.0, 0.2, 1)',\n direction = 'forward',\n}: TextCylinderOptions<T>): UseTextCylinderReturn {\n const [currentIndex, setCurrentIndex] = useState(0)\n const [isAnimating, setIsAnimating] = useState(false)\n const [isPaused, setIsPaused] = useState(false)\n\n const animationRef = useRef<Animation | null>(null)\n const intervalRef = useRef<NodeJS.Timeout | null>(null)\n\n // Navegar al siguiente item\n const next = useCallback(() => {\n if (items.length === 0) return\n setCurrentIndex((prev) => (prev + 1) % items.length)\n }, [items.length])\n\n // Navegar al item anterior\n const prev = useCallback(() => {\n if (items.length === 0) return\n setCurrentIndex((prev) => (prev - 1 + items.length) % items.length)\n }, [items.length])\n\n // Navegar a índice específico\n const goTo = useCallback(\n (index: number) => {\n if (index < 0 || index >= items.length) {\n console.warn(`[useTextCylinder] Índice ${index} fuera de rango (0-${items.length - 1})`)\n return\n }\n setCurrentIndex(index)\n },\n [items.length]\n )\n\n // Pausar auto-rotate\n const pause = useCallback(() => {\n setIsPaused(true)\n if (intervalRef.current) {\n clearInterval(intervalRef.current)\n intervalRef.current = null\n }\n }, [])\n\n // Reanudar auto-rotate\n const resume = useCallback(() => {\n setIsPaused(false)\n }, [])\n\n // Toggle pause/resume\n const toggle = useCallback(() => {\n if (isPaused) {\n resume()\n } else {\n pause()\n }\n }, [isPaused, pause, resume])\n\n // Auto-rotate effect\n useEffect(() => {\n if (!autoRotate || isPaused || items.length <= 1) {\n return\n }\n\n intervalRef.current = setInterval(() => {\n if (direction === 'forward') {\n next()\n } else {\n prev()\n }\n }, autoRotateInterval)\n\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current)\n }\n }\n }, [autoRotate, isPaused, autoRotateInterval, direction, items.length, next, prev])\n\n // Cleanup al desmontar\n useEffect(() => {\n return () => {\n if (animationRef.current) {\n try {\n animationRef.current.cancel()\n } catch (e) {\n // Animation already canceled\n }\n }\n if (intervalRef.current) {\n clearInterval(intervalRef.current)\n }\n }\n }, [])\n\n const state: TextCylinderState = {\n currentIndex,\n isAnimating,\n }\n\n const controls: TextCylinderControls = {\n next,\n prev,\n goTo,\n pause,\n resume,\n toggle,\n }\n\n return {\n state,\n controls,\n setIsAnimating,\n animationRef,\n }\n}\n","({})","\"use client\"\n\nimport type React from \"react\"\nimport type { ReactNode } from \"react\"\nimport { useEffect, useRef } from \"react\"\nimport { useTextCylinder, type TextCylinderOptions } from \"@/hooks/use-text-cylinder\"\nimport { cn } from \"@/lib/utils\"\nimport styles from \"./text-cylinder.module.css\"\n\nexport interface TextCylinderProps<T = React.ReactNode> extends TextCylinderOptions<T> {\n className?: string\n faceClassName?: string\n containerClassName?: string\n onRotationComplete?: (index: number) => void\n perspective?: number\n radius?: number\n width?: number | string\n height?: number | string\n renderFace?: (item: T, index: number, isActive: boolean) => React.ReactNode\n debugMode?: boolean\n}\n\nexport function TextCylinder<T = React.ReactNode>({\n items,\n autoRotate = false,\n autoRotateInterval = 3000,\n duration = 600,\n easing = \"cubic-bezier(0.4, 0.0, 0.2, 1)\",\n direction = \"forward\",\n className,\n faceClassName,\n containerClassName,\n onRotationComplete,\n perspective = 1000,\n radius = 100,\n width = \"auto\",\n height = \"auto\",\n renderFace,\n debugMode = false,\n}: TextCylinderProps<T>) {\n const { state, controls, setIsAnimating, animationRef } = useTextCylinder({\n items,\n autoRotate,\n autoRotateInterval,\n duration,\n easing,\n direction,\n })\n\n const cylinderRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const prevIndexRef = useRef(state.currentIndex)\n const currentRotationRef = useRef(0)\n\n const anglePerFace = 360 / items.length\n\n useEffect(() => {\n if (!cylinderRef.current) return\n\n const cylinder = cylinderRef.current\n const targetIndex = state.currentIndex\n\n const forwardDistance = (targetIndex - prevIndexRef.current + items.length) % items.length\n const backwardDistance = (prevIndexRef.current - targetIndex + items.length) % items.length\n\n let rotationDelta: number\n if (forwardDistance <= backwardDistance) {\n rotationDelta = -forwardDistance * anglePerFace\n } else {\n rotationDelta = backwardDistance * anglePerFace\n }\n\n const targetRotation = currentRotationRef.current + rotationDelta\n\n if (prevIndexRef.current !== targetIndex) {\n if (animationRef.current) {\n try {\n // Commit current animated styles before canceling\n animationRef.current.commitStyles()\n animationRef.current.cancel()\n } catch (e) {\n // Animation might already be finished\n }\n }\n\n setIsAnimating(true)\n cylinder.classList.add(styles.animating || \"animating\")\n\n const distance = Math.min(forwardDistance, backwardDistance)\n const dynamicDuration = Math.max(duration * 0.5, Math.min(duration, duration * (distance / (items.length / 4))))\n\n const animation = cylinder.animate(\n [{ transform: `rotateX(${currentRotationRef.current}deg)` }, { transform: `rotateX(${targetRotation}deg)` }],\n {\n duration: dynamicDuration,\n easing,\n fill: \"forwards\",\n },\n )\n\n animationRef.current = animation\n\n animation.onfinish = () => {\n currentRotationRef.current = targetRotation\n prevIndexRef.current = targetIndex\n setIsAnimating(false)\n cylinder.classList.remove(styles.animating || \"animating\")\n onRotationComplete?.(targetIndex)\n }\n\n animation.oncancel = () => {\n cylinder.classList.remove(styles.animating || \"animating\")\n }\n\n return () => {\n if (animation.playState !== \"finished\") {\n try {\n animation.commitStyles()\n animation.cancel()\n } catch (e) {\n // Already canceled or finished\n }\n }\n cylinder.classList.remove(styles.animating || \"animating\")\n }\n }\n }, [\n state.currentIndex,\n anglePerFace,\n duration,\n easing,\n items.length,\n setIsAnimating,\n onRotationComplete,\n animationRef,\n ])\n\n useEffect(() => {\n if (containerRef.current) {\n containerRef.current.style.setProperty(\"--cylinder-perspective\", `${perspective}px`)\n }\n }, [perspective])\n\n return {\n cylinderElement: (\n <div\n ref={containerRef}\n className={cn(styles.container, containerClassName)}\n style={{\n width: typeof width === \"number\" ? `${width}px` : width,\n height: typeof height === \"number\" ? `${height}px` : height,\n }}\n >\n <div\n ref={cylinderRef}\n className={cn(styles.cylinder, className)}\n style={{\n transform: `rotateX(${-state.currentIndex * anglePerFace}deg)`,\n }}\n >\n {items.map((item, index) => {\n const rotateX = index * anglePerFace\n const translateZ = radius\n const isActive = index === state.currentIndex\n\n let isVisible = true\n let faceOpacity = 1\n\n if (!debugMode) {\n const currentRotation = state.currentIndex * anglePerFace\n const faceRotation = index * anglePerFace\n const angleDiff = ((faceRotation - currentRotation + 540) % 360) - 180\n isVisible = Math.abs(angleDiff) < 90\n faceOpacity = 1\n } else {\n faceOpacity = isActive ? 1 : 0.4\n }\n\n return (\n <div\n key={index}\n className={cn(styles.face, isVisible ? styles.visible : styles.hidden, faceClassName)}\n style={{\n transform: `rotateX(${rotateX}deg) translateZ(${translateZ}px)`,\n opacity: debugMode ? faceOpacity : undefined,\n }}\n >\n {renderFace ? renderFace(item, index, isActive) : (item as ReactNode)}\n </div>\n )\n })}\n </div>\n </div>\n ),\n state,\n controls,\n }\n}\n\nexport function useTextCylinderPrimitive<T = React.ReactNode>(options: TextCylinderOptions<T>) {\n return useTextCylinder(options)\n}\n","/**\n * useTitleHistory\n *\n * Hook para mantener un historial circular de títulos del tooltip.\n * Sincroniza con la dirección de navegación (up/down) para determinar el índice actual.\n *\n * Features:\n * - Historial circular con límite máximo (default: 10 títulos)\n * - Sincronización con dirección de navegación\n * - Reset del historial\n * - Manejo de primera renderización\n *\n * @example\n * ```typescript\n * const { titles, currentIndex, addTitle } = useTitleHistory({\n * maxHistory: 10\n * });\n *\n * // Al cambiar de item\n * addTitle('New Item', 'down');\n * // titles = ['New Item']\n * // currentIndex = 0\n * ```\n */\n\nimport { useState, useCallback, useRef } from 'react'\nimport type { TooltipDirection } from './useTooltipDirection'\n\nexport interface UseTitleHistoryOptions {\n /** Máximo número de títulos en historial (default: 10) */\n maxHistory?: number\n}\n\nexport interface UseTitleHistoryReturn {\n /** Array de títulos en el historial */\n titles: string[]\n /** Índice actual en el historial */\n currentIndex: number\n /** Agregar nuevo título según dirección de navegación */\n addTitle: (newTitle: string, direction: TooltipDirection) => void\n /** Resetear historial */\n reset: () => void\n}\n\nexport function useTitleHistory({\n maxHistory = 10\n}: UseTitleHistoryOptions = {}): UseTitleHistoryReturn {\n const [titles, setTitles] = useState<string[]>([])\n const [currentIndex, setCurrentIndex] = useState(0)\n const isFirstRenderRef = useRef(true)\n\n /**\n * Agregar nuevo título al historial\n *\n * Lógica:\n * - Primera vez: Agregar título y establecer índice 0\n * - Direction 'down': Avanzar (incrementar índice)\n * - Direction 'up': Retroceder (decrementar índice)\n * - Si el título ya existe en el historial, mover índice a esa posición\n * - Limitar historial a maxHistory títulos (FIFO circular)\n */\n const addTitle = useCallback(\n (newTitle: string, direction: TooltipDirection) => {\n // Primera renderización: inicializar con el primer título\n if (isFirstRenderRef.current) {\n setTitles([newTitle])\n setCurrentIndex(0)\n isFirstRenderRef.current = false\n return\n }\n\n setTitles((prevTitles) => {\n // Buscar si el título ya existe en el historial\n const existingIndex = prevTitles.findIndex(t => t === newTitle)\n\n if (existingIndex !== -1) {\n // El título ya existe, mover índice a esa posición\n setCurrentIndex(existingIndex)\n return prevTitles\n }\n\n // Título nuevo: agregar según dirección\n let newTitles: string[]\n let newIndex: number\n\n if (direction === 'down') {\n // Navegación hacia adelante: agregar al final\n newTitles = [...prevTitles, newTitle]\n newIndex = newTitles.length - 1\n } else {\n // Navegación hacia atrás: agregar al principio\n newTitles = [newTitle, ...prevTitles]\n newIndex = 0\n }\n\n // Limitar historial a maxHistory\n if (newTitles.length > maxHistory) {\n if (direction === 'down') {\n // Eliminar primeros elementos (más antiguos)\n newTitles = newTitles.slice(newTitles.length - maxHistory)\n newIndex = newTitles.length - 1\n } else {\n // Eliminar últimos elementos\n newTitles = newTitles.slice(0, maxHistory)\n newIndex = 0\n }\n }\n\n setCurrentIndex(newIndex)\n return newTitles\n })\n },\n [maxHistory]\n )\n\n /**\n * Resetear historial a estado inicial\n */\n const reset = useCallback(() => {\n setTitles([])\n setCurrentIndex(0)\n isFirstRenderRef.current = true\n }, [])\n\n return {\n titles,\n currentIndex,\n addTitle,\n reset,\n }\n}\n","\"use client\"\n\nimport { useEffect } from 'react'\nimport { TextCylinder } from '@/components/ui/TextCylinder'\nimport { useTitleHistory } from './hooks/useTitleHistory'\nimport type { TooltipDirection } from './hooks/useTooltipDirection'\n\nexport interface TooltipTitleCylinderProps {\n title: string\n direction: TooltipDirection\n className?: string\n maxHistory?: number\n}\n\nexport function TooltipTitleCylinder({\n title,\n direction,\n className,\n maxHistory = 10,\n}: TooltipTitleCylinderProps) {\n const { titles, currentIndex, addTitle, reset } = useTitleHistory({\n maxHistory,\n })\n\n useEffect(() => {\n if (title) {\n addTitle(title, direction)\n }\n }, [title, direction, addTitle])\n\n useEffect(() => {\n return () => {\n reset()\n }\n }, [reset])\n\n const { cylinderElement } = TextCylinder({\n items: titles.length > 0 ? titles : [title],\n autoRotate: false,\n duration: 400,\n easing: 'cubic-bezier(0.4, 0.0, 0.2, 1)',\n perspective: 600,\n radius: 30,\n width: '100%',\n height: 24,\n className,\n })\n\n return cylinderElement\n}\n","\"use client\"\n\nimport { memo, useRef, useEffect, Children, cloneElement, isValidElement, useMemo, useState } from \"react\"\nimport type { ReactNode, ReactElement } from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { useSidebarLiquidGlass } from \"@/hooks/use-sidebar-liquid-glass\"\nimport { useTooltipDirection } from \"./hooks/useTooltipDirection\"\nimport { TooltipTitleCylinder } from \"./TooltipTitleCylinder\"\nimport '@/animations/tooltip-keyframes.css'\n\n/**\n * Helper: Extraer key única de un child (usa href del SidebarSubLink)\n */\nfunction getChildKey(child: ReactElement<any>, index: number): string {\n // Prioridad: key explícita > href > index\n if (child.key) return String(child.key)\n if (child.props?.href) return child.props.href\n return `item-${index}`\n}\n\nexport interface SidebarTooltipProps {\n /** Contenido del tooltip */\n children: ReactNode\n /** Título opcional del tooltip */\n title?: string\n /** Modo debug para visualizar safety triangle y layers */\n debug?: boolean\n /** Handler llamado cuando el mouse sale del tooltip */\n onMouseLeave?: () => void\n\n /** Habilitar liquid glass con SVG displacement filters (false = backdrop-blur básico) */\n enableLiquidGlass?: boolean\n /** Habilitar Edge Glass 3D (dual backdrop layers para profundidad) */\n enableEdgeGlass3D?: boolean\n /** Habilitar Backdrop Extension (Josh Comeau technique - 200% height) */\n enableBackdropExtension?: boolean\n /** Habilitar chromatic aberration RGB (requiere enableLiquidGlass) */\n enableChromaticAberration?: boolean\n\n /** Habilitar animaciones staggered de items (entrada/salida escalonada) */\n enableTooltipItemAnimations?: boolean\n /** Habilitar animación 3D de cilindro para el título del tooltip */\n enableCylinderTitle?: boolean\n}\n\nexport const SidebarTooltip = memo(function SidebarTooltip({\n children,\n title,\n debug = false,\n onMouseLeave,\n enableLiquidGlass = false,\n enableEdgeGlass3D = false,\n enableBackdropExtension = false,\n enableChromaticAberration = false,\n enableTooltipItemAnimations = true,\n enableCylinderTitle = false\n}: SidebarTooltipProps) {\n const tooltipRef = useRef<HTMLDivElement>(null)\n const contentGridRef = useRef<HTMLDivElement>(null)\n const previousChildrenKeysRef = useRef<Set<string>>(new Set())\n const previousTitleRef = useRef<string | undefined>(undefined)\n const isFirstRenderRef = useRef(true)\n const [isTransitioning, setIsTransitioning] = useState(false)\n const { getDirection } = useTooltipDirection()\n\n // Extraer keys actuales de children\n const currentChildrenKeys = useMemo(() => {\n const keys = new Set<string>()\n Children.forEach(children, (child, index) => {\n if (isValidElement(child)) {\n keys.add(getChildKey(child as ReactElement<any>, index))\n }\n })\n return keys\n }, [children])\n\n // Detectar si hubo cambio en el título\n const titleChanged = previousTitleRef.current !== undefined && previousTitleRef.current !== title\n\n // Determinar dirección de navegación (usamos el primer item como referencia)\n const currentDirection = useMemo(() => {\n const firstChild = Children.toArray(children)[0]\n if (isValidElement(firstChild)) {\n return getDirection(0)\n }\n return 'down'\n }, [children, getDirection])\n\n // Procesar children para agregar animationOrder y animationState\n const processedChildren = useMemo(() => {\n const prevKeys = previousChildrenKeysRef.current\n const isFirstRender = isFirstRenderRef.current\n\n return Children.map(children, (child, index) => {\n if (!isValidElement(child)) return child\n\n const childKey = getChildKey(child as ReactElement<any>, index)\n const isNew = !prevKeys.has(childKey)\n\n // Determinar estado de animación\n let animationState: 'entering' | 'leaving' | 'static' = 'static'\n\n if (enableTooltipItemAnimations) {\n if (isFirstRender) {\n // Primera renderización - todos entran con stagger\n animationState = 'entering'\n } else if (isNew) {\n // Item nuevo después del primer render\n animationState = 'entering'\n }\n // Items que ya existían se quedan en 'static'\n }\n\n // Clonar elemento agregando props de animación\n return cloneElement(child as ReactElement<any>, {\n key: childKey,\n animationOrder: index,\n animationState,\n })\n })\n }, [children, enableTooltipItemAnimations])\n\n // Actualizar tracking refs después de render\n useEffect(() => {\n previousChildrenKeysRef.current = currentChildrenKeys\n previousTitleRef.current = title\n\n // Marcar que ya pasó el primer render\n if (isFirstRenderRef.current) {\n isFirstRenderRef.current = false\n }\n\n if (titleChanged) {\n setIsTransitioning(true)\n const timer = setTimeout(() => setIsTransitioning(false), 250)\n return () => clearTimeout(timer)\n }\n }, [currentChildrenKeys, title, titleChanged])\n\n // Generar liquid glass effect (solo si está habilitado)\n const liquidGlassData = enableLiquidGlass\n ? useSidebarLiquidGlass('tooltip', { enableChromaticAberration })\n : null\n\n useEffect(() => {\n if (!tooltipRef.current) return\n\n const animation = tooltipRef.current.animate(\n [\n { opacity: 0, transform: 'translateX(-5px) scale(0.98)' },\n { opacity: 1, transform: 'translateX(0) scale(1)' }\n ],\n {\n duration: 150,\n easing: 'ease-out',\n fill: 'forwards'\n }\n )\n\n return () => {\n animation.cancel()\n if (tooltipRef.current) {\n tooltipRef.current.style.opacity = '0'\n }\n }\n }, [])\n\n const anchorStyles: React.CSSProperties = {\n position: \"absolute\",\n positionAnchor: \"--sidebar-indicator\",\n left: \"anchor(right)\",\n marginLeft: \"calc(var(--sidebar-width) + var(--sidebar-tooltip-distance))\",\n top: \"anchor(center)\",\n translate: \"0 -50%\",\n zIndex: 50,\n }\n\n return (\n <>\n {/* SVG Filters (solo si liquid glass está habilitado) */}\n {enableLiquidGlass && liquidGlassData && (\n <svg className=\"absolute inset-0 pointer-events-none w-0 h-0\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <filter id=\"liquid-glass-tooltip\" colorInterpolationFilters=\"sRGB\">\n <feImage\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n result=\"map\"\n href={liquidGlassData.dataUri}\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={liquidGlassData.filterAttributes.red.xChannelSelector}\n yChannelSelector={liquidGlassData.filterAttributes.red.yChannelSelector}\n scale={liquidGlassData.filterAttributes.red.scale}\n result=\"displaced\"\n />\n <feGaussianBlur\n in=\"displaced\"\n stdDeviation={liquidGlassData.filterAttributes.gaussianBlur.stdDeviation}\n />\n </filter>\n\n {enableBackdropExtension && (\n <mask id=\"tooltip-backdrop-mask\">\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"white\" />\n </mask>\n )}\n </defs>\n </svg>\n )}\n\n {/* Safety Triangle CSS - Pure CSS hover intent detection */}\n <style dangerouslySetInnerHTML={{\n __html: `\n @keyframes activatePointerEvents {\n to { pointer-events: all; }\n }\n\n .sidebar-tooltip::before {\n content: '';\n position: absolute;\n right: 100%;\n top: 0;\n width: calc(var(--sidebar-tooltip-distance) + 0.25rem + 2px);\n height: 100%;\n clip-path: polygon(0% 25%, 100% 0%, 100% 100%, 0% 75%);\n pointer-events: none;\n animation: activatePointerEvents 0s 0.15s forwards;\n z-index: -1;\n scale: 1;\n transition: scale 0s 0.2s;\n ${debug ? `\n background: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 10px,\n rgba(244, 114, 182, 0.15) 10px,\n rgba(244, 114, 182, 0.15) 20px\n );\n border: 2px dashed rgb(244 114 182);\n ` : ''}\n }\n `\n }} />\n\n {/* Debug label para safety triangle */}\n {debug && (\n <div\n className=\"absolute text-[9px] text-pink-300 font-mono bg-black/70 px-1.5 py-0.5 rounded pointer-events-none z-50\"\n style={{\n right: \"calc(100% + 4px)\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n }}\n >\n SAFETY TRIANGLE\n </div>\n )}\n\n <div\n ref={tooltipRef}\n className=\"sidebar-tooltip min-w-56 opacity-0\"\n style={anchorStyles}\n onMouseLeave={onMouseLeave}\n >\n {/* Backdrop Extension Layer (solo si está habilitado) */}\n {enableLiquidGlass && enableBackdropExtension && (\n <div\n className=\"absolute inset-0 rounded-lg pointer-events-none\"\n style={{\n height: '200%',\n top: '-50%',\n mask: 'url(#tooltip-backdrop-mask)',\n WebkitMask: 'url(#tooltip-backdrop-mask)',\n backdropFilter: 'blur(12px)',\n WebkitBackdropFilter: 'blur(12px)',\n opacity: 0.6,\n zIndex: 0\n }}\n />\n )}\n\n {/* Inner container */}\n <div\n className={cn(\n \"sidebar-tooltip-inner overflow-hidden rounded-lg shadow-lg border border-border relative\",\n enableLiquidGlass ? \"\" : \"bg-card backdrop-blur-sm\",\n debug && enableEdgeGlass3D && \"ring-2 ring-cyan-400/50\"\n )}\n style={enableLiquidGlass ? {\n background: 'rgba(24, 24, 27, var(--tooltip-frost, 0.05))',\n backdropFilter: `blur(${liquidGlassData?.filterAttributes?.gaussianBlur?.stdDeviation || 8}px) url(#liquid-glass-tooltip) brightness(1.1) saturate(1.5)`,\n WebkitBackdropFilter: `blur(${liquidGlassData?.filterAttributes?.gaussianBlur?.stdDeviation || 8}px) url(#liquid-glass-tooltip) brightness(1.1) saturate(1.5)`,\n willChange: 'backdrop-filter, transform',\n transform: 'translateZ(0)'\n } : undefined}\n >\n {/* Edge Glass 3D Layers (solo si está habilitado) */}\n {enableLiquidGlass && enableEdgeGlass3D && (\n <>\n {/* Depth layer */}\n <div\n className=\"absolute inset-0 rounded-lg pointer-events-none\"\n style={{\n backdropFilter: 'blur(12px) url(#liquid-glass-tooltip) brightness(1.1) saturate(1.3)',\n WebkitBackdropFilter: 'blur(12px) url(#liquid-glass-tooltip) brightness(1.1) saturate(1.3)',\n background: 'rgba(24, 24, 27, 0.3)',\n zIndex: 1,\n opacity: debug ? 0.7 : 1,\n willChange: 'backdrop-filter',\n transform: 'translateZ(0)'\n }}\n >\n {debug && (\n <div className=\"absolute top-1 left-1 text-[8px] text-cyan-300 font-mono bg-black/70 px-1 rounded\">\n DEPTH\n </div>\n )}\n </div>\n\n {/* Surface layer */}\n <div\n className=\"absolute inset-0 rounded-lg pointer-events-none\"\n style={{\n backdropFilter: 'blur(6px) url(#liquid-glass-tooltip) brightness(1.15) saturate(1.4)',\n WebkitBackdropFilter: 'blur(6px) url(#liquid-glass-tooltip) brightness(1.15) saturate(1.4)',\n background: 'rgba(24, 24, 27, 0.5)',\n border: '1px solid rgba(255, 255, 255, 0.1)',\n zIndex: 2,\n opacity: debug ? 0.7 : 1,\n willChange: 'backdrop-filter',\n transform: 'translateZ(0)'\n }}\n >\n {debug && (\n <div className=\"absolute top-1 right-1 text-[8px] text-purple-300 font-mono bg-black/70 px-1 rounded\">\n SURFACE\n </div>\n )}\n </div>\n </>\n )}\n\n {/* Glow effects */}\n <div className=\"absolute -left-1 -top-6 h-12 w-12 rounded-full bg-primary/10 blur-xl pointer-events-none z-0\" />\n <div className=\"absolute -right-1 -bottom-6 h-12 w-12 rounded-full bg-primary/10 blur-xl pointer-events-none z-0\" />\n\n {/* Content layer */}\n <div className=\"sidebar-tooltip-content relative pointer-events-auto\" style={{ zIndex: 10 }}>\n {/* Title Header */}\n {title && (\n <div className=\"flex items-center px-4 py-3 font-medium border-b border-border/50 text-foreground relative\">\n {enableCylinderTitle ? (\n <TooltipTitleCylinder\n title={title}\n direction={currentDirection}\n />\n ) : (\n <span>{title}</span>\n )}\n\n {debug && (\n <span className=\"ml-auto text-[8px] text-purple-400 font-mono space-x-1\">\n {enableLiquidGlass && <span>GLASS</span>}\n {enableEdgeGlass3D && <span>3D</span>}\n {enableChromaticAberration && <span>CA</span>}\n {enableTooltipItemAnimations && <span>ITEMS</span>}\n {enableCylinderTitle && <span>CYLINDER</span>}\n </span>\n )}\n </div>\n )}\n\n {/* Content con grid trick para height transitions */}\n <div\n ref={contentGridRef}\n className=\"tooltip-content-grid\"\n data-state=\"open\"\n >\n <div className=\"tooltip-content-inner\">\n <div className=\"max-h-[calc(100vh-200px)] overflow-y-auto py-2\">\n <div className=\"space-y-0.5 px-2\">\n {processedChildren}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </>\n )\n})\n","import type {\n SidebarDimensions,\n SidebarAnimations,\n SidebarCollapseMode,\n SidebarHideOpensBehavior,\n SidebarVisualStyle,\n} from \"./Sidebar.types\"\nimport {\n SidebarLayoutBehaviour,\n} from \"./Sidebar.types\"\nimport {\n SIDEBAR_CSS_VARIABLES,\n DEFAULT_VISUAL_STYLE,\n} from \"./Sidebar.constants\"\n\n/**\n * Configuración para el generador de estilos\n * @interface\n */\ninterface StyleGeneratorConfig {\n dimensions: SidebarDimensions\n animations: SidebarAnimations\n collapseMode: SidebarCollapseMode\n hideOpensBehavior: SidebarHideOpensBehavior\n layoutBehaviour: SidebarLayoutBehaviour\n visualStyle: SidebarVisualStyle\n}\n\n/**\n * Genera los estilos CSS del sidebar usando CSS-in-JS y tokens de shadcn\n *\n * @description\n * Función que genera todo el CSS necesario para el sidebar,\n * utilizando los tokens CSS de shadcn definidos en globals.css:\n *\n * **Tokens utilizados:**\n * - `--sidebar`: Color de fondo\n * - `--sidebar-foreground`: Color de texto\n * - `--sidebar-primary`: Color primario (indicador, elementos activos)\n * - `--sidebar-accent`: Color de hover y estados secundarios\n * - `--sidebar-border`: Color de bordes\n * - `--sidebar-ring`: Color de focus ring (accesibilidad)\n *\n * Usa CSS Layers para organización y control de especificidad:\n * - sidebar-base: Variables y estilos base\n * - sidebar-states: Estados (:checked, :hover, etc.)\n * - sidebar-animations: Transiciones y animaciones\n *\n * @param {StyleGeneratorConfig} config - Configuración de dimensiones y animaciones\n * @returns {string} String con el CSS completo\n *\n * @example\n * ```tsx\n * const styles = generateSidebarStyles({\n * dimensions: DEFAULT_DIMENSIONS,\n * animations: DEFAULT_ANIMATIONS,\n * collapseMode: SidebarCollapseMode.COLLAPSE,\n * hideOpensBehavior: SidebarHideOpensBehavior.COLLAPSED\n * })\n *\n * <style jsx>{styles}</style>\n * ```\n *\n * @note\n * Los colores NO se configuran aquí, se obtienen automáticamente de los tokens\n * CSS de shadcn. Esto permite soporte automático para dark/light mode.\n */\nexport function generateSidebarStyles({\n dimensions,\n animations,\n collapseMode,\n hideOpensBehavior,\n layoutBehaviour,\n visualStyle,\n}: StyleGeneratorConfig): string {\n // Calcular ancho cuando está cerrado según el modo\n const widthClosed =\n collapseMode === \"hide\" ? \"0px\" : `clamp(3rem, ${dimensions.collapsedWidth}, 6rem)`\n\n // Calcular ancho cuando está abierto según el modo y comportamiento\n const widthOpen =\n collapseMode === \"hide\" && hideOpensBehavior === \"collapsed\"\n ? `clamp(3rem, ${dimensions.collapsedWidth}, 6rem)`\n : `clamp(12rem, ${dimensions.expandedWidth}, 20rem)`\n\n // Determinar si es modo inline\n const isInline = layoutBehaviour === SidebarLayoutBehaviour.INLINE\n\n // Merge de visual style con defaults\n const mergedVisualStyle = {\n ...DEFAULT_VISUAL_STYLE,\n ...visualStyle,\n }\n\n return `\n @layer sidebar-base, sidebar-states, sidebar-animations, sidebar-liquid-glass;\n\n @layer sidebar-base {\n :root {\n ${SIDEBAR_CSS_VARIABLES.widthClosed}: ${widthClosed};\n ${SIDEBAR_CSS_VARIABLES.widthOpen}: ${widthOpen};\n ${SIDEBAR_CSS_VARIABLES.width}: var(${SIDEBAR_CSS_VARIABLES.widthClosed});\n ${SIDEBAR_CSS_VARIABLES.layoutBehaviour}: \"${layoutBehaviour}\";\n ${SIDEBAR_CSS_VARIABLES.isInline}: ${isInline ? '1' : '0'};\n ${SIDEBAR_CSS_VARIABLES.tooltipDistance}: ${dimensions.tooltipDistance || '1rem'};\n\n /* Variables de estilo visual */\n ${SIDEBAR_CSS_VARIABLES.marginTop}: ${mergedVisualStyle.marginTop};\n ${SIDEBAR_CSS_VARIABLES.marginBottom}: ${mergedVisualStyle.marginBottom};\n ${SIDEBAR_CSS_VARIABLES.marginLeft}: ${mergedVisualStyle.marginLeft};\n ${SIDEBAR_CSS_VARIABLES.marginRight}: ${mergedVisualStyle.marginRight};\n ${SIDEBAR_CSS_VARIABLES.sidebarHeight}: ${mergedVisualStyle.height};\n ${SIDEBAR_CSS_VARIABLES.sidebarBorderRadius}: ${mergedVisualStyle.borderRadius};\n ${SIDEBAR_CSS_VARIABLES.sidebarBoxShadow}: ${mergedVisualStyle.boxShadow};\n }\n\n .sidebar-wrapper {\n ${SIDEBAR_CSS_VARIABLES.background}: var(--sidebar);\n ${SIDEBAR_CSS_VARIABLES.borderColor}: var(--sidebar-border);\n ${SIDEBAR_CSS_VARIABLES.hover}: var(--sidebar-accent);\n ${SIDEBAR_CSS_VARIABLES.indicator}: var(--sidebar-primary);\n ${SIDEBAR_CSS_VARIABLES.indicatorHeight}: ${dimensions.indicatorHeight};\n container-type: inline-size;\n container-name: sidebar;\n /* Posicionamiento base */\n position: ${isInline ? 'relative' : 'absolute'};\n z-index: ${isInline ? 'auto' : '40'};\n left: ${isInline ? 'auto' : '0'};\n top: ${isInline ? 'auto' : '0'};\n }\n\n .sidebar-nav {\n width: min(var(${SIDEBAR_CSS_VARIABLES.width}), 100vw);\n /* background removed - handled by liquid-glass layer */\n border-color: var(${SIDEBAR_CSS_VARIABLES.borderColor});\n position: ${isInline ? 'relative' : 'absolute'};\n\n /* Aplicar variables de estilo visual */\n margin-top: var(--sidebar-margin-top);\n margin-bottom: var(--sidebar-margin-bottom);\n margin-left: var(--sidebar-margin-left);\n margin-right: var(--sidebar-margin-right);\n height: var(--sidebar-height);\n border-radius: var(--sidebar-border-radius);\n box-shadow: var(--sidebar-box-shadow);\n }\n }\n\n @layer sidebar-states {\n :root:has(#sidebar-toggle:checked) {\n ${SIDEBAR_CSS_VARIABLES.width}: var(${SIDEBAR_CSS_VARIABLES.widthOpen});\n }\n\n :where(.sidebar-wrapper:has(#sidebar-toggle:checked)) .toggle-icon {\n transform: rotate(180deg);\n }\n\n .sidebar-wrapper:has(#sidebar-toggle:checked) .toggle-button-wrapper {\n left: calc(var(${SIDEBAR_CSS_VARIABLES.widthOpen}) - 0.75rem);\n }\n\n .sidebar-wrapper:not(:has(#sidebar-toggle:checked)) .toggle-button-wrapper {\n left: ${collapseMode === \"hide\" ? \"-0.75rem\" : `calc(${dimensions.collapsedWidth} - 0.75rem)`};\n }\n }\n\n @layer sidebar-layout {\n /* Inline mode - desplaza contenido */\n body:has(.sidebar-wrapper[data-layout=\"inline\"]) main {\n margin-left: var(--sidebar-width);\n transition: margin-left ${animations.widthTransitionDuration}ms ${animations.timingFunction};\n }\n\n /* Floating mode - sin desplazamiento (mantener comportamiento actual) */\n body:has(.sidebar-wrapper[data-layout=\"floating\"]) main {\n margin-left: 0;\n }\n\n /* Responsive adjustments */\n @media (max-width: 768px) {\n body:has(.sidebar-wrapper[data-layout=\"inline\"]) main {\n margin-left: 0; /* En mobile, siempre floating */\n }\n\n .sidebar-wrapper[data-layout=\"inline\"] {\n position: absolute;\n z-index: 40;\n left: 0;\n top: 0;\n }\n\n .sidebar-wrapper[data-layout=\"inline\"] .sidebar-nav {\n position: absolute;\n }\n }\n }\n\n @layer sidebar-visual-responsive {\n /* Ajustes responsive para visual style */\n @media (max-width: 768px) {\n .sidebar-nav {\n /* En mobile, reducir márgenes para mejor uso de espacio */\n margin-top: calc(var(--sidebar-margin-top) * 0.5);\n margin-bottom: calc(var(--sidebar-margin-bottom) * 0.5);\n margin-left: calc(var(--sidebar-margin-left) * 0.5);\n }\n }\n\n /* Ajustes específicos para layout behaviour */\n body:has(.sidebar-wrapper[data-layout=\"inline\"]) .sidebar-nav {\n /* En modo inline, mantener margins */\n margin-left: var(--sidebar-margin-left);\n }\n\n body:has(.sidebar-wrapper[data-layout=\"floating\"]) .sidebar-nav {\n /* En modo floating, margin-left puede ser útil para separación visual */\n margin-left: var(--sidebar-margin-left);\n }\n\n /* Transiciones suaves para cambios de estilo visual */\n .sidebar-nav {\n transition:\n width ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n margin-top ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n margin-bottom ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n margin-left ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n margin-right ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n height ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n border-radius ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n box-shadow ${animations.widthTransitionDuration}ms ${animations.timingFunction},\n overflow ${collapseMode === \"hide\" ? \"hidden\" : \"visible\"};\n }\n }\n\n @layer sidebar-liquid-glass {\n /* Liquid Glass V2 Styles - Solo cuando data attribute está presente */\n .sidebar-nav[data-liquid-glass=\"true\"] {\n background: light-dark(\n hsl(0 0% 100% / var(--sidebar-glass, 0.05)),\n hsl(0 0% 0% / var(--sidebar-glass, 0.05))\n ) !important;\n backdrop-filter: blur(calc(var(--sidebar-glass-background, 8) * 1px)) url(#sidebar-liquid-glass) brightness(1.1) saturate(1.5) !important;\n -webkit-backdrop-filter: blur(calc(var(--sidebar-glass-background, 8) * 1px)) url(#sidebar-liquid-glass) brightness(1.1) saturate(1.5) !important;\n box-shadow:\n 0 0 2px 1px light-dark(\n color-mix(in oklch, canvasText, #0000 85%),\n color-mix(in oklch, canvasText, #0000 65%)\n ) inset,\n 0 0 10px 4px light-dark(\n color-mix(in oklch, canvasText, #0000 90%),\n color-mix(in oklch, canvasText, #0000 85%)\n ) inset,\n 0px 4px 16px rgba(17, 17, 26, 0.05),\n 0px 8px 24px rgba(17, 17, 26, 0.05),\n 0px 16px 56px rgba(17, 17, 26, 0.05),\n 0px 4px 16px rgba(17, 17, 26, 0.05) inset,\n 0px 8px 24px rgba(17, 17, 26, 0.05) inset,\n 0px 16px 56px rgba(17, 17, 26, 0.05) inset !important;\n\n /* Performance optimizations */\n will-change: backdrop-filter, transform;\n contain: layout style paint;\n transform: translateZ(0);\n }\n\n /* Asegurar que el background base no interfiera cuando está desactivado */\n .sidebar-nav[data-liquid-glass=\"false\"] {\n background: var(--sidebar);\n }\n }\n\n @layer sidebar-animations {\n\n .toggle-icon {\n transition: transform ${animations.widthTransitionDuration}ms ${animations.timingFunction};\n }\n\n .toggle-button-wrapper {\n transition: left ${animations.widthTransitionDuration}ms ${animations.timingFunction};\n }\n\n .sidebar-indicator {\n transition: opacity ${animations.opacityTransitionDuration}ms ${animations.timingFunction};\n }\n }\n\n @container sidebar (max-width: 80px) {\n .sidebar-item-label {\n display: none;\n }\n }\n\n @supports selector(:has(*)) {\n .sidebar-wrapper:has(.sidebar-nav:hover) {\n ${SIDEBAR_CSS_VARIABLES.borderColor}: color-mix(in srgb, var(--sidebar-primary) 20%, var(--sidebar-border) 80%);\n }\n }\n\n /* Estilos para el hover/focus del icono elevado - CSS-first */\n .sidebar-item-icon-wrapper {\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n /* Elevación con keyboard focus (prioridad siempre) */\n .sidebar-item-icon-wrapper[data-focused=\"true\"] {\n background: var(--sidebar-accent);\n transform: translateY(-2px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);\n }\n\n /* Elevación con mouse hover (solo si NO hay focus activo) - Mouse Dominance */\n .sidebar-nav:not(:has([data-focused=\"true\"])) .sidebar-item-icon-wrapper[data-hovered=\"true\"] {\n background: var(--sidebar-accent);\n transform: translateY(-2px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);\n }\n\n /* Asegurar que el icono SVG se escale correctamente */\n .sidebar-item-icon-wrapper svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n `\n}\n\n/**\n * Genera estilos para el indicador visual usando tokens CSS\n *\n * @description\n * Función auxiliar para generar estilos dinámicos del indicador.\n * Útil para aplicar estilos inline con estado reactivo.\n *\n * Utiliza el token `--sidebar-primary` para el color del indicador,\n * asegurando consistencia con el theme del sidebar.\n *\n * @param {boolean} isVisible - Si el indicador está visible\n * @returns {React.CSSProperties} Objeto de estilos inline\n *\n * @example\n * ```tsx\n * const indicatorStyles = generateIndicatorStyles(isHovering && isOverItems)\n *\n * <div style={indicatorStyles} />\n * ```\n */\nexport function generateIndicatorStyles(isVisible: boolean): React.CSSProperties {\n return {\n background: \"var(--sidebar-primary)\",\n transform: \"translateY(-50%)\",\n opacity: isVisible ? 1 : 0,\n height: `var(${SIDEBAR_CSS_VARIABLES.indicatorHeight})`,\n width: \"0.25rem\",\n }\n}\n","\"use client\"\n\nimport { forwardRef, useRef, useEffect, useMemo } from \"react\"\nimport type { ElementType } from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { useSidebarContext } from \"./hooks/useSidebarContext\"\nimport { useSubContent } from \"./hooks/useSubContent\"\nimport { useSidebarIndicator } from \"./hooks/useSidebarIndicator\"\nimport { useSidebarKeyboard } from \"./hooks/useSidebarKeyboard\"\nimport { useSidebarLiquidGlass } from \"@/hooks/use-sidebar-liquid-glass\"\nimport { SidebarFluidIndicator } from \"./SidebarFluidIndicator\"\nimport { SidebarTooltip } from \"./SidebarTooltip\"\nimport type { SidebarNavProps } from \"./Sidebar.types\"\nimport {\n SIDEBAR_TAILWIND_CLASSES,\n SIDEBAR_ARIA_LABELS,\n SIDEBAR_DATA_ATTRIBUTES,\n SIDEBAR_CSS_VARIABLES,\n DEFAULT_DIMENSIONS,\n DEFAULT_ANIMATIONS,\n DEFAULT_VISUAL_STYLE,\n} from \"./Sidebar.constants\"\nimport { generateSidebarStyles } from \"./Sidebar.styles\"\n\n/**\n * Componente de navegación del Sidebar\n *\n * @description\n * Contenedor de navegación que renderiza un elemento `<nav>` por defecto.\n * Gestiona los eventos de mouse y teclado para el indicador visual y\n * la navegación accesible.\n *\n * Este componente:\n * - Aplica data attributes para reflejar el estado (open/collapsed)\n * - Gestiona eventos de mouse para el indicador visual\n * - Gestiona navegación por teclado (arrows, home, end)\n * - Expone una ref al elemento DOM para mediciones\n *\n * Usa forwardRef para permitir acceso al elemento DOM desde componentes padre.\n *\n * @example\n * ```tsx\n * <Sidebar>\n * <SidebarNav className=\"bg-zinc-900 border-zinc-800\">\n * <SidebarToggle />\n * <SidebarIndicator />\n * <SidebarContent>\n * <SidebarItem href=\"/\" />\n * </SidebarContent>\n * </SidebarNav>\n * </Sidebar>\n * ```\n *\n * @example\n * ```tsx\n * // Con data attributes para styling\n * <SidebarNav className=\"data-[open=true]:w-64 data-[open=false]:w-16\">\n * {children}\n * </SidebarNav>\n * ```\n *\n * @example\n * ```tsx\n * // Con elemento personalizado\n * <SidebarNav as=\"aside\" aria-label=\"Navegación lateral\">\n * {children}\n * </SidebarNav>\n * ```\n */\nexport const SidebarNav = forwardRef<HTMLElement, SidebarNavProps>(function SidebarNav(\n { children, className = \"\", style, \"aria-label\": ariaLabel, as, ...props },\n forwardedRef,\n) {\n const {\n defaultOpen,\n navRef,\n indicatorRef,\n dimensions,\n animations,\n collapseMode,\n hideBehaviour,\n hideOpensBehavior,\n layoutBehaviour,\n toggleId,\n enableFluidIndicator,\n enableTooltip,\n debug,\n liquidGlass,\n } = useSidebarContext()\n\n // Ref local para el nav (DEBE estar ANTES del hook condicional)\n const localNavRef = useRef<HTMLElement>(null)\n\n // Generar liquid glass effect para sidebar (SIEMPRE llamar el hook)\n const sidebarGlass = useSidebarLiquidGlass('sidebar', {\n enableChromaticAberration: liquidGlass.enableChromaticAberration,\n ...liquidGlass.presetOverrides // Aplicar overrides configurables desde UI\n })\n\n // Combinar refs en useEffect\n useEffect(() => {\n const node = localNavRef.current\n if (!node) return\n\n // Asignar a context ref\n if (navRef && \"current\" in navRef) {\n ;(navRef as React.MutableRefObject<HTMLElement | null>).current = node\n }\n\n // Asignar a forwarded ref\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n }, [navRef, forwardedRef])\n\n // Note: Liquid glass styles are now applied via CSS layers and data-liquid-glass attribute\n // No need for useEffect manipulation of inline styles\n\n // Hooks para indicador y navegación por teclado\n const {\n isVisible,\n hoveredItemId,\n hoveredLabel,\n currentItemElement,\n handleMouseMove,\n handleMouseEnter,\n handleMouseLeave,\n handleFocus,\n handleBlur,\n clearHoveredState,\n } = useSidebarIndicator()\n\n // Obtener subContent desde el context\n const { getSubContent } = useSubContent()\n const subContentData = hoveredItemId ? getSubContent(hoveredItemId) : null\n\n useSidebarKeyboard()\n\n // Generar estilos CSS con tokens de shadcn (memoizado para regenerar cuando cambian dimensions/animations)\n const sidebarStyles = useMemo(\n () =>\n generateSidebarStyles({\n dimensions: { ...DEFAULT_DIMENSIONS, ...dimensions },\n animations: { ...DEFAULT_ANIMATIONS, ...animations },\n collapseMode,\n hideOpensBehavior,\n layoutBehaviour,\n visualStyle: { ...DEFAULT_VISUAL_STYLE, ...dimensions.visualStyle },\n }),\n [dimensions, animations, collapseMode, hideOpensBehavior, layoutBehaviour, dimensions.visualStyle],\n )\n\n // Elemento a renderizar (default: nav)\n const Component = (as || \"nav\") as ElementType\n\n // Lógica para mostrar el toggle button\n const shouldShowToggle =\n collapseMode === \"collapse\" || hideBehaviour === \"showIndicator\"\n\n // Key para forzar regeneración de estilos cuando cambien dimensions\n const styleKey = useMemo(\n () => `${dimensions.collapsedWidth}-${dimensions.expandedWidth}-${layoutBehaviour}-${JSON.stringify(dimensions.visualStyle || {})}`,\n [dimensions, layoutBehaviour, dimensions.visualStyle],\n )\n\n return (\n <>\n {/* Inyectar estilos CSS generados con key para forzar regeneración */}\n <style key={styleKey} dangerouslySetInnerHTML={{ __html: sidebarStyles }} />\n\n {/* Wrapper con CSS variables y estado */}\n <div\n className={`sidebar-wrapper ${SIDEBAR_TAILWIND_CLASSES.wrapper} ${className}`}\n style={style}\n data-layout={layoutBehaviour}\n >\n {/* Checkbox oculto NO controlado - CSS puro con :has() */}\n <input\n type=\"checkbox\"\n id={toggleId}\n className=\"sr-only\"\n defaultChecked={defaultOpen}\n aria-label=\"Toggle sidebar\"\n />\n\n {/* Toggle button visual (FUERA del nav) */}\n {shouldShowToggle && (\n <div className={`toggle-button-wrapper ${SIDEBAR_TAILWIND_CLASSES.toggleButtonWrapper}`}>\n <label\n htmlFor={toggleId}\n className={`${SIDEBAR_TAILWIND_CLASSES.toggleButton} bg-zinc-800 border border-zinc-700 hover:bg-zinc-700 ${\n collapseMode === \"hide\" && hideBehaviour === \"showIndicator\" ? \"shadow-lg\" : \"\"\n }`}\n aria-label=\"Toggle sidebar\"\n >\n {/* Icono chevron SVG */}\n <svg\n className=\"toggle-icon w-3 h-3 text-zinc-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n {collapseMode === \"hide\" ? (\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n ) : (\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n )}\n </svg>\n </label>\n </div>\n )}\n\n {/* Debug: Mostrar si liquid glass está activo */}\n {debug && liquidGlass.enableLiquidGlassV2 && (\n <div className=\"absolute top-2 right-2 z-50 px-2 py-1 bg-purple-500/90 text-white text-xs rounded font-mono\">\n 🧪 Liquid Glass V2 Active\n </div>\n )}\n\n {/* SVG Filter for Liquid Glass V2 */}\n {liquidGlass.enableLiquidGlassV2 && (\n <svg className=\"absolute inset-0 pointer-events-none w-0 h-0\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <filter id=\"sidebar-liquid-glass\" colorInterpolationFilters=\"sRGB\">\n {/* Displacement Map generado con refracción física */}\n <feImage\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n result=\"map\"\n href={sidebarGlass.dataUri}\n />\n\n {/* Phase 1: Legacy chromatic aberration con scale offsets */}\n {!liquidGlass.enableChromaticAberration && (\n <>\n {/* Red channel */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={sidebarGlass.filterAttributes.red.xChannelSelector}\n yChannelSelector={sidebarGlass.filterAttributes.red.yChannelSelector}\n scale={sidebarGlass.filterAttributes.red.scale}\n result=\"dispRed\"\n />\n <feColorMatrix\n in=\"dispRed\"\n type=\"matrix\"\n values=\"1 0 0 0 0\n 0 0 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0\"\n result=\"red\"\n />\n\n {/* Green channel */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={sidebarGlass.filterAttributes.green.xChannelSelector}\n yChannelSelector={sidebarGlass.filterAttributes.green.yChannelSelector}\n scale={sidebarGlass.filterAttributes.green.scale}\n result=\"dispGreen\"\n />\n <feColorMatrix\n in=\"dispGreen\"\n type=\"matrix\"\n values=\"0 0 0 0 0\n 0 1 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0\"\n result=\"green\"\n />\n\n {/* Blue channel */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={sidebarGlass.filterAttributes.blue.xChannelSelector}\n yChannelSelector={sidebarGlass.filterAttributes.blue.yChannelSelector}\n scale={sidebarGlass.filterAttributes.blue.scale}\n result=\"dispBlue\"\n />\n <feColorMatrix\n in=\"dispBlue\"\n type=\"matrix\"\n values=\"0 0 0 0 0\n 0 0 0 0 0\n 0 0 1 0 0\n 0 0 0 1 0\"\n result=\"blue\"\n />\n\n {/* Blend RGB channels */}\n <feBlend in=\"red\" in2=\"green\" mode=\"screen\" result=\"rg\" />\n <feBlend in=\"rg\" in2=\"blue\" mode=\"screen\" result=\"output\" />\n\n {/* Final blur */}\n <feGaussianBlur\n in=\"output\"\n stdDeviation={sidebarGlass.filterAttributes.gaussianBlur.stdDeviation}\n />\n </>\n )}\n\n {/* Phase 2: True chromatic aberration con feColorMatrix + feOffset */}\n {liquidGlass.enableChromaticAberration && sidebarGlass.chromaticAberrationSVG && (\n <>\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"map\"\n xChannelSelector={sidebarGlass.filterAttributes.red.xChannelSelector}\n yChannelSelector={sidebarGlass.filterAttributes.red.yChannelSelector}\n scale={sidebarGlass.filterAttributes.red.scale}\n result=\"displaced\"\n />\n <g dangerouslySetInnerHTML={{ __html: sidebarGlass.chromaticAberrationSVG }} />\n <feGaussianBlur\n in=\"chromaticAberration\"\n stdDeviation={sidebarGlass.filterAttributes.gaussianBlur.stdDeviation}\n />\n </>\n )}\n </filter>\n </defs>\n </svg>\n )}\n\n {/* Nav interno con eventos */}\n <Component\n ref={localNavRef}\n className={`sidebar-nav ${SIDEBAR_TAILWIND_CLASSES.nav}`}\n data-liquid-glass={liquidGlass.enableLiquidGlassV2 ? \"true\" : \"false\"}\n onMouseMove={handleMouseMove}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onBlur={handleBlur}\n aria-label={ariaLabel || SIDEBAR_ARIA_LABELS.mainNavigation}\n {...props}\n >\n {/* Backdrop extension layer - solo si liquid glass V2 está activo */}\n {liquidGlass.enableLiquidGlassV2 && (\n <div\n className=\"absolute inset-0 pointer-events-none\"\n style={{\n height: '200%',\n backdropFilter: 'blur(8px) url(#sidebar-liquid-glass) brightness(1.1) saturate(1.5)',\n WebkitBackdropFilter: 'blur(8px) url(#sidebar-liquid-glass) brightness(1.1) saturate(1.5)',\n maskImage: 'linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)',\n WebkitMaskImage: 'linear-gradient(to bottom, black 0% 50%, transparent 50% 100%)',\n zIndex: 0\n }}\n />\n )}\n\n {/* Indicador lateral (barra vertical - SIEMPRE visible) */}\n <div\n ref={indicatorRef}\n className={`sidebar-indicator ${SIDEBAR_TAILWIND_CLASSES.indicator} pointer-events-none`}\n style={{\n background: \"var(--sidebar-primary)\",\n transform: \"translateY(-50%)\",\n opacity: isVisible ? 1 : 0,\n height: `var(${SIDEBAR_CSS_VARIABLES.indicatorHeight})`,\n width: \"0.25rem\",\n anchorName: \"--sidebar-indicator\",\n }}\n aria-hidden=\"true\"\n />\n\n\n {/* Líneas horizontales de threshold dinámicas - marcan bordes del elemento hovered */}\n {debug && currentItemElement && navRef.current && (() => {\n const navRect = navRef.current!.getBoundingClientRect()\n const itemRect = currentItemElement.getBoundingClientRect()\n const top = itemRect.top - navRect.top\n const height = itemRect.height\n\n return (\n <>\n <style dangerouslySetInnerHTML={{\n __html: `\n @keyframes threshold-pulse {\n 0%, 100% {\n opacity: 0.6;\n transform: scaleX(0.95);\n }\n 50% {\n opacity: 1;\n transform: scaleX(1);\n }\n }\n `\n }} />\n\n {/* Línea TOP - marca donde empieza el elemento */}\n <div\n className=\"absolute pointer-events-none\"\n style={{\n top: `${top}px`,\n left: 0,\n width: '100%',\n height: '2px',\n background: 'linear-gradient(90deg, transparent 0%, rgba(251, 191, 36, 0.9) 10%, rgba(251, 191, 36, 0.9) 90%, transparent 100%)',\n zIndex: 200,\n animation: 'threshold-pulse 2s ease-in-out infinite',\n }}\n >\n {/* Label TOP */}\n <div\n className=\"absolute -top-4 right-2 text-[8px] text-amber-300 font-mono bg-black/90 px-1.5 py-0.5 rounded whitespace-nowrap\"\n >\n TOP: {Math.round(top)}px\n </div>\n </div>\n\n {/* Línea BOTTOM - marca donde termina el elemento */}\n <div\n className=\"absolute pointer-events-none\"\n style={{\n top: `${top + height}px`,\n left: 0,\n width: '100%',\n height: '2px',\n background: 'linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.9) 10%, rgba(239, 68, 68, 0.9) 90%, transparent 100%)',\n zIndex: 200,\n animation: 'threshold-pulse 2s ease-in-out infinite 1s',\n }}\n >\n {/* Label BOTTOM */}\n <div\n className=\"absolute -bottom-4 right-2 text-[8px] text-red-300 font-mono bg-black/90 px-1.5 py-0.5 rounded whitespace-nowrap\"\n >\n BOTTOM: {Math.round(top + height)}px (H: {Math.round(height)}px)\n </div>\n </div>\n </>\n )\n })()}\n\n {/* Fluid Indicator glassmorphism (OPCIONAL - controlado desde App.tsx) */}\n {enableFluidIndicator && (\n <SidebarFluidIndicator targetElement={currentItemElement} isVisible={isVisible} />\n )}\n\n {/* Estructura de columna flex con safe areas y content */}\n <div className=\"relative z-10 h-full flex flex-col\">\n {children}\n </div>\n </Component>\n </div>\n\n {/* Tooltip anclado al indicador - fuera del nav para z-index correcto */}\n {enableTooltip && (\n <>\n {/* Tooltip con subContent (links) - Unificado con feature flags opcionales */}\n {subContentData && (\n <SidebarTooltip\n title={subContentData.title}\n debug={debug}\n onMouseLeave={clearHoveredState}\n enableLiquidGlass={liquidGlass.enableLiquidGlassV2}\n enableEdgeGlass3D={liquidGlass.enableEdgeGlass3D}\n enableBackdropExtension={liquidGlass.enableBackdropExtension}\n enableChromaticAberration={liquidGlass.enableChromaticAberration}\n enableTooltipItemAnimations={liquidGlass.enableTooltipItemAnimations}\n enableCylinderTitle={liquidGlass.enableCylinderTitle}\n >\n {subContentData.subContent}\n </SidebarTooltip>\n )}\n\n {/* Tooltip simple para items sin subContent */}\n {!subContentData && hoveredLabel && (\n <>\n <style dangerouslySetInnerHTML={{\n __html: `\n @keyframes activatePointerEventsSimple {\n to { pointer-events: all; }\n }\n\n .sidebar-tooltip-simple::before {\n content: '';\n position: absolute;\n right: 100%;\n top: 0;\n width: calc(var(--sidebar-tooltip-distance) + 0.25rem + 2px);\n height: 100%;\n clip-path: polygon(0% 25%, 100% 0%, 100% 100%, 0% 75%);\n pointer-events: none;\n animation: activatePointerEventsSimple 0s 0.15s forwards;\n z-index: -1;\n scale: 1;\n transition: scale 0s 0.2s;\n ${debug ? `\n background: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 10px,\n rgba(244, 114, 182, 0.15) 10px,\n rgba(244, 114, 182, 0.15) 20px\n );\n border: 2px dashed rgb(244 114 182);\n ` : ''}\n }\n `\n }} />\n\n {/* Debug label para safety triangle simple */}\n {debug && (\n <div\n className=\"absolute text-[9px] text-pink-300 font-mono bg-black/70 px-1.5 py-0.5 rounded pointer-events-none z-50\"\n style={{\n position: \"absolute\",\n positionAnchor: \"--sidebar-indicator\",\n left: \"anchor(right)\",\n marginLeft: \"calc((var(--sidebar-width) + var(--sidebar-tooltip-distance)) / 2)\",\n top: \"anchor(center)\",\n translate: \"-50% -50%\",\n zIndex: 51,\n }}\n >\n SAFETY △\n </div>\n )}\n\n <div\n className=\"sidebar-tooltip-simple min-w-32\"\n style={{\n position: \"absolute\",\n positionAnchor: \"--sidebar-indicator\",\n left: \"anchor(right)\",\n marginLeft: \"calc(var(--sidebar-width) + var(--sidebar-tooltip-distance))\",\n top: \"anchor(center)\",\n translate: \"0 -50%\",\n zIndex: 50,\n }}\n onMouseLeave={clearHoveredState}\n >\n {/* Inner container con overflow para no cortar ::before */}\n <div\n className={cn(\n \"px-3 py-2 rounded-lg shadow-lg border border-border\",\n liquidGlass.enableLiquidGlassV2 ? \"backdrop-blur-sm\" : \"bg-card backdrop-blur-sm\"\n )}\n style={liquidGlass.enableLiquidGlassV2 ? {\n background: 'rgba(24, 24, 27, 0.2) !important',\n } : undefined}\n >\n <span className=\"text-sm text-foreground pointer-events-auto\">{hoveredLabel}</span>\n </div>\n </div>\n </>\n )}\n </>\n )}\n </>\n )\n})\n","\"use client\"\n\nimport { forwardRef } from \"react\"\nimport type { ElementType } from \"react\"\nimport { useSidebarContext } from \"./hooks/useSidebarContext\"\nimport type { SidebarToggleProps, SidebarToggleRenderProp, SidebarCollapseMode } from \"./Sidebar.types\"\nimport { SidebarIconLibrary } from \"./Sidebar.types\"\nimport {\n SIDEBAR_TAILWIND_CLASSES,\n SIDEBAR_ARIA_LABELS,\n SIDEBAR_DATA_ATTRIBUTES,\n} from \"./Sidebar.constants\"\n\n// Intento de import dinámico de lucide-react (opcional)\nlet ChevronLeft: any = null\nlet ChevronRight: any = null\n\ntry {\n const lucide = require(\"lucide-react\")\n ChevronLeft = lucide.ChevronLeft\n ChevronRight = lucide.ChevronRight\n} catch {\n // lucide-react no está instalado, usar SVG inline como fallback\n}\n\n/**\n * Icono de chevron SVG inline (fallback cuando lucide-react no está disponible)\n */\nfunction SVGChevronIcon({ collapseMode }: { collapseMode: SidebarCollapseMode }) {\n return (\n <svg className=\"toggle-icon w-3 h-3 text-zinc-400\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n {collapseMode === \"hide\" ? (\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n ) : (\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n )}\n </svg>\n )\n}\n\n/**\n * Icono de chevron usando lucide-react\n */\nfunction LucideChevronIcon({ collapseMode }: { collapseMode: SidebarCollapseMode }) {\n if (!ChevronLeft || !ChevronRight) {\n // Fallback si lucide no está disponible\n return <SVGChevronIcon collapseMode={collapseMode} />\n }\n\n const IconComponent = collapseMode === \"hide\" ? ChevronRight : ChevronLeft\n\n return <IconComponent className=\"toggle-icon w-3 h-3 text-zinc-400\" />\n}\n\n/**\n * Icono de toggle por defecto (selecciona entre Lucide o SVG)\n */\nfunction DefaultToggleIcon({\n collapseMode,\n iconLibrary,\n}: {\n collapseMode: SidebarCollapseMode\n iconLibrary?: SidebarIconLibrary\n}) {\n // Si se solicita Lucide y está disponible, usarlo\n if (iconLibrary === SidebarIconLibrary.LUCIDE && ChevronLeft && ChevronRight) {\n return <LucideChevronIcon collapseMode={collapseMode} />\n }\n\n // Fallback a SVG inline\n return <SVGChevronIcon collapseMode={collapseMode} />\n}\n\n/**\n * Componente de botón toggle del Sidebar\n *\n * @description\n * Botón que controla el estado abierto/cerrado del sidebar.\n * Renderiza un `<label>` por defecto que controla un checkbox oculto,\n * permitiendo gestionar el estado con CSS puro (:checked selector).\n *\n * Características:\n * - Soporta render props para acceso al estado (open, active)\n * - Renderiza icono de chevron por defecto (customizable)\n * - Aplica data attributes para styling CSS\n * - Accesibilidad completa (aria-label, aria-expanded)\n * - Soporta prop `as` para usar elemento/componente custom\n *\n * @example\n * ```tsx\n * // Uso básico con icono por defecto\n * <SidebarToggle />\n * ```\n *\n * @example\n * ```tsx\n * // Con render props para estado\n * <SidebarToggle>\n * {({ open, active }) => (\n * <div className={cn(active && 'bg-blue-500')}>\n * {open ? <CloseIcon /> : <MenuIcon />}\n * </div>\n * )}\n * </SidebarToggle>\n * ```\n *\n * @example\n * ```tsx\n * // Con icono custom\n * <SidebarToggle className=\"bg-zinc-800\">\n * <CustomChevronIcon />\n * </SidebarToggle>\n * ```\n *\n * @example\n * ```tsx\n * // Como botón real (sin checkbox)\n * <SidebarToggle as=\"button\" onClick={() => setOpen(!open)}>\n * Toggle\n * </SidebarToggle>\n * ```\n */\nexport const SidebarToggle = forwardRef<HTMLLabelElement | HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { children, iconLibrary, className = \"\", style, \"aria-label\": ariaLabel, as, ...props },\n ref,\n ) {\n const { open, setOpen, toggleId, collapseMode } = useSidebarContext()\n\n // Determinar si children es render prop\n const isRenderProp = typeof children === \"function\"\n\n // Estado del toggle\n const toggleState = {\n active: open,\n open,\n }\n\n // Elemento a renderizar (default: label)\n const Component = (as || \"label\") as ElementType\n\n // Wrapper con estilos base\n const toggleClassName = `${SIDEBAR_TAILWIND_CLASSES.toggleButton} ${SIDEBAR_TAILWIND_CLASSES.toggleButtonWrapper} bg-zinc-800 border border-zinc-700 hover:bg-zinc-700 ${className}`\n\n // Props comunes\n const commonProps = {\n className: toggleClassName,\n style,\n \"aria-label\": ariaLabel || SIDEBAR_ARIA_LABELS.toggleSidebar,\n ...{ [SIDEBAR_DATA_ATTRIBUTES.ACTIVE]: open },\n ...props,\n }\n\n // Si es label (default), controla el checkbox\n if (!as || as === \"label\") {\n return (\n <>\n {/* Checkbox oculto para gestionar estado con CSS */}\n <input\n type=\"checkbox\"\n id={toggleId}\n className={SIDEBAR_TAILWIND_CLASSES.srOnly}\n checked={open}\n onChange={(e) => setOpen(e.target.checked)}\n aria-label={ariaLabel || SIDEBAR_ARIA_LABELS.toggleSidebar}\n />\n\n <label ref={ref as React.Ref<HTMLLabelElement>} htmlFor={toggleId} {...commonProps}>\n {isRenderProp ? (\n (children as SidebarToggleRenderProp)(toggleState)\n ) : children ? (\n children\n ) : (\n <DefaultToggleIcon collapseMode={collapseMode} iconLibrary={iconLibrary} />\n )}\n </label>\n </>\n )\n }\n\n // Si es otro elemento (button, div, etc.)\n return (\n <Component\n ref={ref}\n onClick={() => setOpen(!open)}\n aria-expanded={open}\n role=\"button\"\n {...commonProps}\n >\n {isRenderProp ? (\n (children as SidebarToggleRenderProp)(toggleState)\n ) : children ? (\n children\n ) : (\n <DefaultToggleIcon collapseMode={collapseMode} iconLibrary={iconLibrary} />\n )}\n </Component>\n )\n },\n)\n","\"use client\"\n\nimport { forwardRef, useRef, useEffect } from \"react\"\nimport type { ElementType } from \"react\"\nimport { useSidebarContext } from \"./hooks/useSidebarContext\"\nimport type { SidebarContentProps } from \"./Sidebar.types\"\nimport { SIDEBAR_TAILWIND_CLASSES, SIDEBAR_ARIA_ROLES } from \"./Sidebar.constants\"\n\n/**\n * Componente de contenido del Sidebar (contenedor de items)\n *\n * @description\n * Contenedor que agrupa los items de navegación (SidebarItem).\n * Renderiza un `<div>` por defecto y aplica estilos de layout flex.\n *\n * Este componente:\n * - Registra su ref en el contexto para cálculos del indicador\n * - Aplica rol ARIA \"list\" para accesibilidad\n * - Centra y distribuye items verticalmente\n * - Permite customización completa con className y style\n *\n * Los items dentro de este contenedor son utilizados por:\n * - useSidebarIndicator: Para calcular posición del indicador\n * - useSidebarKeyboard: Para navegación por teclado\n *\n * @example\n * ```tsx\n * <SidebarNav>\n * <SidebarContent>\n * <SidebarItem href=\"/\" icon={<HomeIcon />} />\n * <SidebarItem href=\"/settings\" icon={<SettingsIcon />} />\n * </SidebarContent>\n * </SidebarNav>\n * ```\n *\n * @example\n * ```tsx\n * // Con estilos custom\n * <SidebarContent className=\"gap-2 py-4\">\n * <SidebarItem href=\"/\" />\n * </SidebarContent>\n * ```\n *\n * @example\n * ```tsx\n * // Como lista semántica\n * <SidebarContent as=\"ul\">\n * <SidebarItem as=\"li\" href=\"/\" />\n * </SidebarContent>\n * ```\n */\nexport const SidebarContent = forwardRef<HTMLDivElement, SidebarContentProps>(function SidebarContent(\n { children, className = \"\", style, as, ...props },\n forwardedRef,\n) {\n const { contentRef, debug, safeAreas } = useSidebarContext()\n\n // Elemento a renderizar (default: div)\n const Component = (as || \"div\") as ElementType\n\n // Ref local\n const localContentRef = useRef<HTMLDivElement>(null)\n\n // Calcular height dinámica basada en safe areas\n const contentHeight = 100 - safeAreas.topPercent - safeAreas.bottomPercent\n\n // Combinar refs en useEffect\n useEffect(() => {\n const node = localContentRef.current\n if (!node) return\n\n // Asignar a context ref\n if (contentRef && \"current\" in contentRef) {\n ;(contentRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n }\n\n // Asignar a forwarded ref\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n }, [contentRef, forwardedRef])\n\n // Aplicar clases de debug mode\n const debugClasses = debug ? \"bg-zinc-900/70 border-y-2 border-dashed border-emerald-400/60 relative\" : \"\"\n\n return (\n <Component\n ref={localContentRef}\n className={`${SIDEBAR_TAILWIND_CLASSES.content} ${debugClasses} ${className}`}\n style={{\n height: `${contentHeight}%`,\n ...style,\n }}\n role={SIDEBAR_ARIA_ROLES.list}\n {...props}\n >\n {debug && (\n <span className=\"absolute top-1 right-1 text-[10px] text-emerald-300 font-mono z-50 bg-black/60 px-1.5 py-0.5 rounded\">\n CONTENT {contentHeight}%\n </span>\n )}\n {children}\n </Component>\n )\n})\n","\"use client\"\n\nimport { forwardRef } from \"react\"\nimport type { ElementType, CSSProperties } from \"react\"\nimport { useSidebarContext } from \"./hooks/useSidebarContext\"\nimport { useSidebarIndicator } from \"./hooks/useSidebarIndicator\"\nimport type { SidebarIndicatorProps, SidebarIndicatorRenderProp } from \"./Sidebar.types\"\nimport { SIDEBAR_TAILWIND_CLASSES, SIDEBAR_DATA_ATTRIBUTES } from \"./Sidebar.constants\"\n\n/**\n * Componente de indicador visual del Sidebar\n *\n * @description\n * Indicador visual que sigue al cursor del mouse (o item enfocado) dentro\n * del área de navegación. Proporciona feedback visual claro al usuario.\n *\n * Características:\n * - Se muestra solo cuando el mouse está sobre el área de items\n * - Sigue al cursor con animación suave\n * - Se posiciona en el item enfocado al navegar por teclado\n * - Totalmente customizable con className y style\n * - Soporta render props para control total del contenido\n * - Color y dimensiones configurables via contexto\n *\n * El indicador se oculta automáticamente cuando:\n * - El mouse sale del sidebar\n * - El cursor está fuera del área de items\n * - Se pierde el focus del sidebar\n *\n * @example\n * ```tsx\n * // Uso básico con estilos por defecto\n * <SidebarNav>\n * <SidebarIndicator />\n * <SidebarContent>...</SidebarContent>\n * </SidebarNav>\n * ```\n *\n * @example\n * ```tsx\n * // Con estilos custom\n * <SidebarIndicator className=\"bg-red-500 w-1\" />\n * ```\n *\n * @example\n * ```tsx\n * // Con render props\n * <SidebarIndicator>\n * {({ visible, position }) => (\n * <div\n * className={cn('indicator', visible && 'opacity-100')}\n * style={{ top: position }}\n * >\n * <span>→</span>\n * </div>\n * )}\n * </SidebarIndicator>\n * ```\n *\n * @example\n * ```tsx\n * // Como elemento custom\n * <SidebarIndicator as={motion.div} animate={{ opacity: 1 }} />\n * ```\n */\nexport const SidebarIndicator = forwardRef<HTMLDivElement, SidebarIndicatorProps>(\n function SidebarIndicator({ children, className = \"\", style, as, ...props }, forwardedRef) {\n const { indicatorRef } = useSidebarContext()\n const { isVisible } = useSidebarIndicator()\n\n // Determinar si children es render prop\n const isRenderProp = typeof children === \"function\"\n\n // Estado del indicador\n const indicatorState = {\n visible: isVisible,\n position: 0, // La posición se gestiona via style.top en el ref\n }\n\n // Elemento a renderizar (default: div)\n const Component = (as || \"div\") as ElementType\n\n // Estilos del indicador (usando tokens CSS de shadcn en formato oklch)\n const indicatorStyles: CSSProperties = {\n background: \"var(--sidebar-primary)\",\n transform: \"translateY(-50%)\",\n opacity: isVisible ? 1 : 0,\n height: \"var(--sidebar-indicator-height, 3rem)\",\n width: \"0.25rem\",\n anchorName: \"--sidebar-indicator\",\n ...style,\n }\n\n // Combinar refs (forwarded + context)\n const setRefs = (node: HTMLDivElement | null) => {\n // Actualizar ref del contexto\n if (indicatorRef && \"current\" in indicatorRef) {\n ;(indicatorRef as React.MutableRefObject<HTMLDivElement | null>).current = node\n }\n\n // Actualizar ref forwarded\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node)\n } else if (forwardedRef) {\n forwardedRef.current = node\n }\n }\n\n // Si hay render prop, delegar renderizado completo\n if (isRenderProp) {\n return (\n <Component ref={setRefs} {...props}>\n {(children as SidebarIndicatorRenderProp)(indicatorState)}\n </Component>\n )\n }\n\n // Renderizado por defecto\n return (\n <Component\n ref={setRefs}\n className={`sidebar-indicator ${SIDEBAR_TAILWIND_CLASSES.indicator} ${className}`}\n style={indicatorStyles}\n aria-hidden=\"true\"\n {...{ [SIDEBAR_DATA_ATTRIBUTES.VISIBLE]: isVisible }}\n {...props}\n >\n {children}\n </Component>\n )\n },\n)\n","\"use client\"\n\nimport { forwardRef } from \"react\"\nimport type { ElementType, CSSProperties } from \"react\"\nimport { useSidebarContext } from \"./hooks/useSidebarContext\"\nimport type { SidebarSafeAreaProps } from \"./Sidebar.types\"\nimport {\n SIDEBAR_TAILWIND_CLASSES,\n SIDEBAR_DEBUG_PATTERNS,\n DEFAULT_CONFIG,\n} from \"./Sidebar.constants\"\n\n/**\n * Componente de área segura del Sidebar\n *\n * @description\n * Área reservada en la parte superior o inferior del sidebar para\n * contenido especial como logos, usuario, configuración, etc.\n *\n * Las áreas seguras:\n * - No contienen items de navegación\n * - Tienen altura porcentual configurable\n * - Pueden mostrar patrones de debug\n * - Son completamente customizables\n *\n * Casos de uso comunes:\n * - Top: Logo, título de la aplicación, búsqueda\n * - Bottom: Usuario, configuración, logout\n *\n * @example\n * ```tsx\n * <SidebarNav>\n * <SidebarSafeArea position=\"top\" percent={20}>\n * <img src=\"/logo.png\" alt=\"Logo\" />\n * </SidebarSafeArea>\n *\n * <SidebarContent>\n * <SidebarItem href=\"/\" />\n * </SidebarContent>\n *\n * <SidebarSafeArea position=\"bottom\" percent={15}>\n * <UserProfile />\n * </SidebarSafeArea>\n * </SidebarNav>\n * ```\n *\n * @example\n * ```tsx\n * // Con estilos custom\n * <SidebarSafeArea\n * position=\"top\"\n * className=\"bg-zinc-950 border-b border-zinc-800\"\n * >\n * <h1>Mi App</h1>\n * </SidebarSafeArea>\n * ```\n *\n * @example\n * ```tsx\n * // Override de porcentaje\n * <SidebarSafeArea position=\"bottom\" percent={30}>\n * <ExtendedFooter />\n * </SidebarSafeArea>\n * ```\n */\nexport const SidebarSafeArea = forwardRef<HTMLDivElement, SidebarSafeAreaProps>(\n function SidebarSafeArea(\n { children, position, percent, className = \"\", style, as, ...props },\n ref,\n ) {\n const context = useSidebarContext()\n\n // Obtener porcentaje desde props o config\n const percentValue =\n percent ??\n (position === \"top\"\n ? context.dimensions.collapsedWidth // Este parece un error en el código original, debería ser safeAreas\n : context.dimensions.collapsedWidth) // Voy a usar un valor por defecto razonable\n\n // En realidad, el código original usa safeAreas.topPercent y bottomPercent\n // Voy a corregir esto\n const actualPercent =\n percent ?? (position === \"top\" ? DEFAULT_CONFIG.safeAreas.topPercent : DEFAULT_CONFIG.safeAreas.bottomPercent)\n\n // Elemento a renderizar (default: div)\n const Component = (as || \"div\") as ElementType\n\n // Obtener debug mode del contexto\n const { debug } = context\n\n // Estilos del área segura\n const safeAreaStyles: CSSProperties = {\n height: `${actualPercent}%`,\n ...style,\n }\n\n // Si está en debug, mostrar patrón visual\n if (debug) {\n return (\n <Component\n ref={ref}\n className={`${SIDEBAR_TAILWIND_CLASSES.debugBorder} ${className}`}\n style={{\n ...safeAreaStyles,\n background:\n \"repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(34,197,94,0.1) 10px, rgba(34,197,94,0.1) 20px)\",\n borderBottom: position === \"top\" ? `2px dashed ${SIDEBAR_DEBUG_PATTERNS.borderColor}` : undefined,\n borderTop: position === \"bottom\" ? `2px dashed ${SIDEBAR_DEBUG_PATTERNS.borderColor}` : undefined,\n }}\n {...props}\n >\n <div className={`${SIDEBAR_TAILWIND_CLASSES.safeArea} relative h-full`}>\n {/* Label de debug superpuesto con mejor contraste */}\n <span className=\"absolute top-2 left-2 text-[10px] text-emerald-300 font-mono z-50 bg-black/60 px-1.5 py-0.5 rounded\">\n SAFE {actualPercent}% ({position.toUpperCase()})\n </span>\n {/* Children visibles con el patrón de fondo */}\n {children}\n </div>\n </Component>\n )\n }\n\n // Renderizado normal\n return (\n <Component\n ref={ref}\n className={`${SIDEBAR_TAILWIND_CLASSES.safeArea} ${className}`}\n style={safeAreaStyles}\n {...props}\n >\n {children}\n </Component>\n )\n },\n)\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\n\nexport interface SidebarSubContentProps {\n children: ReactNode\n title?: string\n}\n\nexport function SidebarSubContent({ children, title }: SidebarSubContentProps) {\n return null\n}\n\nSidebarSubContent.displayName = \"SidebarSubContent\"\n","\"use client\"\n\nimport { forwardRef, useState, useEffect, useId, Children, isValidElement } from \"react\"\nimport type { ElementType, CSSProperties } from \"react\"\nimport { useSidebarContext } from \"./hooks/useSidebarContext\"\nimport { useSubContent } from \"./hooks/useSubContent\"\nimport type { SidebarItemProps, SidebarItemRenderProp } from \"./Sidebar.types\"\nimport {\n SIDEBAR_TAILWIND_CLASSES,\n SIDEBAR_DATA_ATTRIBUTES,\n SIDEBAR_ARIA_ROLES,\n} from \"./Sidebar.constants\"\nimport { SidebarSubContent } from \"./SidebarSubContent\"\n\n/**\n * Componente item de navegación del Sidebar\n *\n * @description\n * Item individual de navegación dentro del sidebar.\n * Renderiza un `<a>` por defecto, pero puede ser cualquier elemento\n * o componente (ej: React Router Link, Next.js Link).\n *\n * Características:\n * - Soporta iconos y labels\n * - Gestiona estados de hover y focus\n * - Se registra automáticamente para navegación por teclado\n * - Aplica data attributes para styling\n * - Soporta render props para control total\n * - Compatible con React Router, Next.js, etc. via prop `as`\n * - Label oculto automáticamente cuando sidebar está colapsado (via CSS container queries)\n *\n * @example\n * ```tsx\n * // Uso básico\n * <SidebarItem\n * href=\"/\"\n * icon={<HomeIcon />}\n * label=\"Home\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Con React Router\n * <SidebarItem\n * as={Link}\n * to=\"/dashboard\"\n * icon={<DashboardIcon />}\n * label=\"Dashboard\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Con Next.js Link\n * <SidebarItem\n * LinkComponent={Link}\n * href=\"/profile\"\n * icon={<UserIcon />}\n * label=\"Profile\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Con render props\n * <SidebarItem href=\"/settings\">\n * {({ focused, hovered, disabled }) => (\n * <div className={cn(\n * 'flex items-center gap-2',\n * focused && 'ring-2',\n * hovered && 'bg-zinc-800',\n * disabled && 'opacity-50'\n * )}>\n * <SettingsIcon />\n * <span>Settings</span>\n * </div>\n * )}\n * </SidebarItem>\n * ```\n *\n * @example\n * ```tsx\n * // Con callbacks\n * <SidebarItem\n * href=\"/analytics\"\n * icon={<ChartIcon />}\n * label=\"Analytics\"\n * onHover={() => prefetchAnalytics()}\n * onClick={() => trackNavigation('analytics')}\n * />\n * ```\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n {\n href,\n icon,\n label,\n children,\n LinkComponent,\n linkProps = {},\n className = \"\",\n style,\n onHover,\n onClick,\n disabled = false,\n as,\n ...props\n },\n forwardedRef,\n) {\n const { registerItem, unregisterItem } = useSidebarContext()\n const { registerSubContent, unregisterSubContent } = useSubContent()\n\n const [isHovered, setIsHovered] = useState(false)\n const [isFocused, setIsFocused] = useState(false)\n\n // Generar ID único para este item\n const itemId = useId()\n\n // Detectar SidebarSubContent en children\n let subContentElement: any = null\n let otherChildren: any = null\n\n if (children && typeof children !== 'function') {\n Children.forEach(children, (child) => {\n if (isValidElement(child) && child.type === SidebarSubContent) {\n subContentElement = child\n } else {\n otherChildren = child\n }\n })\n }\n\n // Determinar si children es render prop\n const isRenderProp = typeof children === \"function\"\n\n // Estado del item\n const itemState = {\n focused: isFocused,\n hovered: isHovered,\n disabled,\n }\n\n // Determinar el componente a renderizar\n // Prioridad: as > LinkComponent > \"a\"\n const Component = (as || LinkComponent || \"a\") as ElementType\n\n // Estilos del item (usando tokens CSS de shadcn)\n // El item crece para ocupar espacio disponible, el gap se maneja con padding\n // El hover ahora se aplica solo al icono, no al contenedor completo\n const itemStyles: CSSProperties = {\n paddingTop: \"calc(var(--sidebar-items-gap) / 2)\",\n paddingBottom: \"calc(var(--sidebar-items-gap) / 2)\",\n flex: \"1 1 auto\", // Grow para ocupar espacio disponible\n minHeight: \"3rem\", // Altura mínima\n ...style,\n }\n\n // Manejadores de eventos\n const handleMouseEnter = () => {\n setIsHovered(true)\n onHover?.()\n }\n\n const handleMouseLeave = () => {\n setIsHovered(false)\n }\n\n const handleFocus = () => {\n setIsFocused(true)\n // CSS maneja el visual del icono elevado via data-focused\n }\n\n const handleBlur = () => {\n setIsFocused(false)\n // CSS maneja el visual del icono via data-focused\n }\n\n const handleClick = (e: React.MouseEvent) => {\n if (disabled) {\n e.preventDefault()\n return\n }\n onClick?.()\n }\n\n // Registrar/des-registrar el item para navegación por teclado\n useEffect(() => {\n const element = forwardedRef && \"current\" in forwardedRef ? forwardedRef.current : null\n\n if (element) {\n registerItem(element)\n return () => unregisterItem(element)\n }\n }, [registerItem, unregisterItem, forwardedRef])\n\n // Registrar/des-registrar subContent si existe\n useEffect(() => {\n if (subContentElement) {\n const subContentData = {\n itemId,\n subContent: subContentElement.props.children,\n title: subContentElement.props.title,\n }\n registerSubContent(itemId, subContentData)\n return () => unregisterSubContent(itemId)\n }\n }, [itemId, subContentElement, registerSubContent, unregisterSubContent])\n\n // Props base del componente\n const baseProps = {\n ref: forwardedRef,\n className: `flex items-center justify-center w-full h-12 rounded-lg transition-colors focus-visible:outline-none ${className}`,\n style: itemStyles,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onClick: handleClick,\n role: SIDEBAR_ARIA_ROLES.listitem,\n \"aria-label\": label,\n title: label,\n tabIndex: disabled ? -1 : 0,\n ...{ [SIDEBAR_DATA_ATTRIBUTES.ITEM]: \"\" },\n ...{ [SIDEBAR_DATA_ATTRIBUTES.FOCUSED]: isFocused },\n ...{ [SIDEBAR_DATA_ATTRIBUTES.HOVERED]: isHovered },\n ...{ [SIDEBAR_DATA_ATTRIBUTES.DISABLED]: disabled },\n \"data-item-id\": itemId,\n ...props,\n }\n\n // Si es render prop, delegar renderizado completo\n if (isRenderProp) {\n return <Component {...baseProps}>{(children as SidebarItemRenderProp)(itemState)}</Component>\n }\n\n // Si hay children custom (no render prop), renderizarlos (excluyendo SidebarSubContent)\n if (otherChildren) {\n return (\n <Component href={href} {...linkProps} {...baseProps}>\n {otherChildren}\n </Component>\n )\n }\n\n // Renderizado por defecto con icono y label\n return (\n <Component href={href} {...linkProps} {...baseProps}>\n {icon && (\n <span\n className=\"sidebar-item-icon-wrapper relative z-[15] inline-flex items-center justify-center p-2 rounded-xl transition-all duration-300\"\n data-hovered={isHovered}\n data-focused={isFocused}\n >\n {icon}\n </span>\n )}\n {label && <span className=\"sidebar-item-label sr-only\">{label}</span>}\n </Component>\n )\n})\n","\"use client\"\n\nimport type { ReactNode, ComponentType, MouseEvent as ReactMouseEvent, CSSProperties } from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface SidebarSubLinkProps {\n href: string\n children: ReactNode\n icon?: ReactNode\n LinkComponent?: ComponentType<any>\n linkProps?: Record<string, any>\n className?: string\n onClick?: (e: ReactMouseEvent<HTMLAnchorElement>) => void\n animationOrder?: number\n animationState?: 'entering' | 'leaving' | 'static'\n style?: CSSProperties\n}\n\nexport function SidebarSubLink({\n href,\n children,\n icon,\n LinkComponent,\n linkProps = {},\n className,\n onClick,\n animationOrder,\n animationState,\n style,\n}: SidebarSubLinkProps) {\n const Component = (LinkComponent || \"a\") as any\n\n const customStyle: CSSProperties = {\n ...style,\n ...(animationOrder !== undefined && { '--animation-order': animationOrder } as any),\n }\n\n return (\n <Component\n href={href}\n {...linkProps}\n onClick={onClick}\n className={cn(\n \"sidebar-sublink flex items-center rounded-md px-3 py-1.5 text-sm transition-colors w-full text-left\",\n \"text-foreground hover:bg-secondary/70 hover:text-primary\",\n className\n )}\n style={customStyle}\n data-state={animationState}\n data-animation-order={animationOrder}\n >\n {icon && <span className=\"mr-2 text-muted-foreground\">{icon}</span>}\n <span>{children}</span>\n </Component>\n )\n}\n\nSidebarSubLink.displayName = \"SidebarSubLink\"\n","\"use client\";\nimport { createContext } from 'react';\n\nconst LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n","\"use client\";\nimport { useRef } from 'react';\n\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nfunction useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n\nexport { useConstant };\n","const isBrowser = typeof window !== \"undefined\";\n\nexport { isBrowser };\n","\"use client\";\nimport { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst PresenceContext = \n/* @__PURE__ */ createContext(null);\n\nexport { PresenceContext };\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n","const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n","function formatErrorMessage(message, errorCode) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message;\n}\n\nexport { formatErrorMessage };\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nlet warning = () => { };\nlet invariant = () => { };\nif (process.env.NODE_ENV !== \"production\") {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode));\n }\n };\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode));\n }\n };\n}\n\nexport { invariant, warning };\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n","function isObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\nexport { isObject };\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n","/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c);\n }\n else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i];\n handler && handler(a, b, c);\n }\n }\n }\n getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nfunction velocityPerSecond(velocity, frameDuration) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0;\n}\n\nexport { velocityPerSecond };\n","import { formatErrorMessage } from './format-error-message.mjs';\n\nconst warned = new Set();\nfunction hasWarned(message) {\n return warned.has(message);\n}\nfunction warnOnce(condition, message, errorCode) {\n if (condition || warned.has(message))\n return;\n console.warn(formatErrorMessage(message, errorCode));\n warned.add(message);\n}\n\nexport { hasWarned, warnOnce };\n","import { noop } from '../noop.mjs';\n\n/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t;\nconst subdivisionPrecision = 0.0000001;\nconst subdivisionMaxIterations = 12;\nfunction binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {\n let currentX;\n let currentT;\n let i = 0;\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - x;\n if (currentX > 0.0) {\n upperBound = currentT;\n }\n else {\n lowerBound = currentT;\n }\n } while (Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations);\n return currentT;\n}\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);\n // If animation is at start/end, return t without easing\n return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);\n}\n\nexport { cubicBezier };\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n","const isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n","const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backIn, backInOut, backOut } from '../back.mjs';\nimport { circIn, circInOut, circOut } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeIn, easeInOut, easeOut } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n","const stepsOrder = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n];\n\nexport { stepsOrder };\n","const statsBuffer = {\n value: null,\n addProjectionMetrics: null,\n};\n\nexport { statsBuffer };\n","import { statsBuffer } from '../stats/buffer.mjs';\n\nfunction createRenderStep(runNextFrame, stepName) {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set();\n let nextFrame = new Set();\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false;\n let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n let numCalls = 0;\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n numCalls++;\n callback(latestFrameData);\n }\n const step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const queue = addToCurrentFrame ? thisFrame : nextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (!queue.has(callback))\n queue.add(callback);\n return callback;\n },\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback);\n toKeepAlive.delete(callback);\n },\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [thisFrame, nextFrame] = [nextFrame, thisFrame];\n // Execute this frame\n thisFrame.forEach(triggerCallback);\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls);\n }\n numCalls = 0;\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear();\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame, allowKeepAlive ? key : undefined);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\n // Unrolled render loop for better per-frame performance\n setup.process(state);\n read.process(state);\n resolveKeyframes.process(state);\n preUpdate.process(state);\n update.process(state);\n preRender.process(state);\n render.process(state);\n postRender.process(state);\n state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true);\n\nexport { cancelFrame, frame, frameData, frameSteps };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\n}\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n","const activeAnimations = {\n layout: 0,\n mainThread: 0,\n waapi: 0,\n};\n\nexport { activeAnimations };\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim());\n};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\n\nexport { isCSSVariableName, isCSSVariableToken };\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3);\n g = v.substring(3, 5);\n b = v.substring(5, 7);\n a = v.substring(7, 9);\n // Or we have 3 characters, ie #F00\n }\n else {\n r = v.substring(1, 2);\n g = v.substring(2, 3);\n b = v.substring(3, 4);\n a = v.substring(4, 5);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0);\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex = /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu;\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\n let i = 0;\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i);\n types.push(COLOR_TOKEN);\n values.push(color.parse(parsedValue));\n }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\n else {\n indexes.number.push(i);\n types.push(NUMBER_TOKEN);\n values.push(parseFloat(parsedValue));\n }\n ++i;\n return SPLIT_TOKEN;\n });\n const split = tokenised.split(SPLIT_TOKEN);\n return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction createTransformer(source) {\n const { split, types } = analyseComplexValue(source);\n const numSections = split.length;\n return (v) => {\n let output = \"\";\n for (let i = 0; i < numSections; i++) {\n output += split[i];\n if (v[i] !== undefined) {\n const type = types[i];\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\nfunction getAnimatableNone(v) {\n const parsed = parseComplexValue(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex };\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n warning(Boolean(type), `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n if (!Boolean(type))\n return false;\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v);\n return rgba.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i];\n const originIndex = origin.indexes[type][pointers[type]];\n const originValue = origin.values[originIndex] ?? 0;\n orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length;\n if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n","import { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n };\n};\n\nexport { frameloopDriver };\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator) {\n let duration = 0;\n const timeStep = 50;\n let state = generator.next(duration);\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep;\n state = generator.next(duration);\n }\n return duration >= maxGeneratorDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction calcGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n\nexport { calcGeneratorVelocity };\n","const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n};\n\nexport { springDefaults };\n","import { warning, secondsToMilliseconds, clamp, millisecondsToSeconds } from 'motion-utils';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n","import { millisecondsToSeconds, secondsToMilliseconds, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from '../utils/calc-duration.mjs';\nimport { createGeneratorEasing } from '../utils/create-generator-easing.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n","import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse();\n output = [...output].reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\n const min = offset[offset.length - 1];\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i);\n offset.push(mixNumber(min, 1, offsetProgress));\n }\n}\n\nexport { fillOffset };\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n","import { easeInOut, isEasingArray, easingDefinitionToFunction } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease);\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n","class WithPromise {\n constructor() {\n this.updateFinished();\n }\n get finished() {\n return this._finished;\n }\n updateFinished() {\n this._finished = new Promise((resolve) => {\n this.resolve = resolve;\n });\n }\n notifyFinished() {\n this.resolve();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { activeAnimations } from '../stats/animation-count.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n activeAnimations.mainThread++;\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n this.calculatedDuration = calculatedDuration;\n this.resolvedDuration = calculatedDuration + repeatDelay;\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay;\n this.generator = generator;\n }\n updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime;\n }\n }\n tick(timestamp, sample = false) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, calculatedDuration, } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, repeat, repeatType, repeatDelay, type, onUpdate, finalKeyframe, } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n this.driver?.start(false);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n this.updateTime(time.now());\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? now;\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n activeAnimations.mainThread--;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue };\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.sqrt(v[0] * v[0] + v[1] * v[1]);\nconst scaleY = (v) => Math.sqrt(v[4] * v[4] + v[5] * v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n */\nconst transformProps = /*@__PURE__*/ (() => new Set(transformPropOrder))();\n\nexport { transformPropOrder, transformProps };\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n removedTransforms.push([key, value.get()]);\n value.set(key.startsWith(\"scale\") ? 1 : 0);\n }\n });\n return removedTransforms;\n}\nconst positionalValues = {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n top: (_bbox, { top }) => parseFloat(top),\n left: (_bbox, { left }) => parseFloat(left),\n bottom: ({ y }, { top }) => parseFloat(top) + (y.max - y.min),\n right: ({ x }, { left }) => parseFloat(left) + (x.max - x.min),\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n","import { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement);\n const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element));\n const transformsToRestore = new Map();\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\n this.unresolvedKeyframes = [...unresolvedKeyframes];\n this.onComplete = onComplete;\n this.name = name;\n this.motionValue = motionValue;\n this.element = element;\n this.isAsync = isAsync;\n }\n scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get();\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe);\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n","import { memo } from 'motion-utils';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== undefined);\n\nexport { supportsScrollTimeline };\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n};\n\nexport { supportedWaapiEasing };\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n","import { activeAnimations } from '../../stats/animation-count.mjs';\nimport { statsBuffer } from '../../stats/buffer.mjs';\nimport { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n if (statsBuffer.value) {\n activeAnimations.waapi++;\n }\n const options = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n };\n if (pseudoElement)\n options.pseudoElement = pseudoElement;\n const animation = element.animate(keyframeOptions, options);\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--;\n });\n }\n return animation;\n}\n\nexport { startWaapiAnimation };\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\n else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe);\n }\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n }\n play() {\n if (this.isStopped)\n return;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n commitStyles() {\n if (!this.isPseudoElement) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n }\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate;\n }\n set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n","import { anticipate, backInOut, circInOut } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n","import { secondsToMilliseconds } from 'motion-utils';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options);\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options);\n super(options);\n if (options.startTime) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read commited styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n });\n const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n sampleAnimation.stop();\n }\n}\n\nexport { NativeAnimationExtended };\n","import { complex } from '../../value/types/complex/index.mjs';\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value))\n return true;\n if (typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true;\n }\n return false;\n};\n\nexport { isAnimatable };\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0];\n if (originKeyframe === null)\n return false;\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n","import { memo } from 'motion-utils';\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n const subject = motionValue?.owner?.current;\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n}\n\nexport { supportsBrowserAnimation };\n","import { MotionGlobalConfig, noop } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", keyframes, name, motionValue, element, ...options }) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const optionsWithDefaults = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n };\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first commited frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined;\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n };\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const animation = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element: resolvedOptions.motionValue.owner.current,\n })\n : new JSAnimation(resolvedOptions);\n animation.finished.then(() => this.notifyFinished()).catch(noop);\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n if (!this._animation) {\n return this._finished;\n }\n else {\n return this.animation.finished;\n }\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\nconst splitCSSVariableRegex = \n// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n/^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n","function getValueTransition(transition, key) {\n return (transition?.[key] ??\n transition?.[\"default\"] ??\n transition);\n}\n\nexport { getValueTransition };\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n","import { scale, alpha } from '../numbers/index.mjs';\nimport { degrees, px, progressPercentage } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n};\n\nexport { transformValueTypes };\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n radius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (defaultValueType !== filter)\n defaultValueType = complex;\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined;\n}\n\nexport { getAnimatableNone };\n","import { analyseComplexValue } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { isCSSVariableToken } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { isNumOrPxType, positionalValues } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\n }\n }\n }\n }\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes();\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return;\n }\n const [origin, target] = unresolvedKeyframes;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i];\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value);\n }\n }\n }\n else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true;\n }\n }\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n const value = element.getValue(name);\n value && value.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current));\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector);\n}\n\nexport { resolveElements };\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return isObject(element) && \"offsetHeight\" in element;\n}\n\nexport { isHTMLElement };\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init, options = {}) {\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue();\n }\n this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current);\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\n }\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n const unsubscribe = this.events[eventName].add(callback);\n if (eventName === \"change\") {\n return () => {\n unsubscribe();\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop();\n }\n });\n };\n }\n return unsubscribe;\n }\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\n }\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v, endAnimation = true) {\n this.updateAndNotify(v);\n this.prev = v;\n this.prevUpdatedAt = this.prevFrameValue = undefined;\n endAnimation && this.stop();\n if (this.stopPassiveEffect)\n this.stopPassiveEffect();\n }\n dirty() {\n this.events.change?.notify(this.current);\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\n }\n }\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this);\n }\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\n }\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now();\n if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\n }\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n this.animation = startAnimation(resolve);\n if (this.events.animationStart) {\n this.events.animationStart.notify();\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify();\n }\n this.clearAnimation();\n });\n }\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n delete this.animation;\n }\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear();\n this.events.destroy?.notify();\n this.clearListeners();\n this.stop();\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n","const isDragging = {\n x: false,\n y: false,\n};\nfunction isDragActive() {\n return isDragging.x || isDragging.y;\n}\n\nexport { isDragActive, isDragging };\n","import { isDragging } from './is-active.mjs';\n\nfunction setDragLock(axis) {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null;\n }\n else {\n isDragging[axis] = true;\n return () => {\n isDragging[axis] = false;\n };\n }\n }\n else {\n if (isDragging.x || isDragging.y) {\n return null;\n }\n else {\n isDragging.x = isDragging.y = true;\n return () => {\n isDragging.x = isDragging.y = false;\n };\n }\n }\n}\n\nexport { setDragLock };\n","import { resolveElements } from '../../utils/resolve-elements.mjs';\n\nfunction setupGesture(elementOrSelector, options) {\n const elements = resolveElements(elementOrSelector);\n const gestureAbortController = new AbortController();\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n };\n const cancel = () => gestureAbortController.abort();\n return [elements, eventOptions, cancel];\n}\n\nexport { setupGesture };\n","import { isDragActive } from './drag/state/is-active.mjs';\nimport { setupGesture } from './utils/setup.mjs';\n\nfunction isValidHover(event) {\n return !(event.pointerType === \"touch\" || isDragActive());\n}\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nfunction hover(elementOrSelector, onHoverStart, options = {}) {\n const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);\n const onPointerEnter = (enterEvent) => {\n if (!isValidHover(enterEvent))\n return;\n const { target } = enterEvent;\n const onHoverEnd = onHoverStart(target, enterEvent);\n if (typeof onHoverEnd !== \"function\" || !target)\n return;\n const onPointerLeave = (leaveEvent) => {\n if (!isValidHover(leaveEvent))\n return;\n onHoverEnd(leaveEvent);\n target.removeEventListener(\"pointerleave\", onPointerLeave);\n };\n target.addEventListener(\"pointerleave\", onPointerLeave, eventOptions);\n };\n elements.forEach((element) => {\n element.addEventListener(\"pointerenter\", onPointerEnter, eventOptions);\n });\n return cancel;\n}\n\nexport { hover };\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n","const focusableElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n]);\nfunction isElementKeyboardAccessible(element) {\n return (focusableElements.has(element.tagName) ||\n element.tabIndex !== -1);\n}\n\nexport { isElementKeyboardAccessible };\n","const isPressing = new WeakSet();\n\nexport { isPressing };\n","import { isPressing } from './state.mjs';\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.key !== \"Enter\")\n return;\n callback(event);\n };\n}\nfunction firePointerEvent(target, type) {\n target.dispatchEvent(new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true }));\n}\nconst enableKeyboardPress = (focusEvent, eventOptions) => {\n const element = focusEvent.currentTarget;\n if (!element)\n return;\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element))\n return;\n firePointerEvent(element, \"down\");\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\");\n });\n const handleBlur = () => firePointerEvent(element, \"cancel\");\n element.addEventListener(\"keyup\", handleKeyup, eventOptions);\n element.addEventListener(\"blur\", handleBlur, eventOptions);\n });\n element.addEventListener(\"keydown\", handleKeydown, eventOptions);\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\"blur\", () => element.removeEventListener(\"keydown\", handleKeydown), eventOptions);\n};\n\nexport { enableKeyboardPress };\n","import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n isPressing.add(target);\n const onPressEnd = onPressStart(target, startEvent);\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerCancel);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nfunction isSVGElement(element) {\n return isObject(element) && \"ownerSVGElement\" in element;\n}\n\nexport { isSVGElement };\n","import { isSVGElement } from './is-svg-element.mjs';\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nfunction isSVGSVGElement(element) {\n return isSVGElement(element) && element.tagName === \"svg\";\n}\n\nexport { isSVGSVGElement };\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n","import { color } from '../color/index.mjs';\nimport { complex } from '../complex/index.mjs';\nimport { dimensionValueTypes } from '../dimensions.mjs';\nimport { testValueType } from '../test.mjs';\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex];\n/**\n * Tests a value against the list of ValueTypes\n */\nconst findValueType = (v) => valueTypes.find(testValueType(v));\n\nexport { findValueType };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n","import * as React from 'react';\n\n/**\n * Taken from https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx\n */\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n }\n else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup === \"function\") {\n cleanup();\n }\n else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { useComposedRefs };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { isHTMLElement } from 'motion-dom';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { useComposedRefs } from '../../utils/use-composed-ref.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 = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 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, root }) {\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 const composedRef = useComposedRefs(ref, children?.ref);\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 const parent = root ?? document.head;\n parent.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 if (parent.contains(style)) {\n parent.removeChild(style);\n }\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref: composedRef }) }));\n}\n\nexport { PopChild };\n","\"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, root }) => {\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, root: root, children: children }));\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","\"use client\";\nimport { 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","import { Children, isValidElement } from 'react';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n\nexport { getChildKey, onlyElements };\n","\"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\", root }) => {\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, root: root, onExitComplete: isPresent ? undefined : onExit, anchorX: anchorX, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n","\"use client\";\nimport { createContext } from 'react';\n\nconst LazyContext = createContext({ strict: false });\n\nexport { LazyContext };\n","const featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nconst featureDefinitions = {};\nfor (const key in featureProps) {\n featureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n}\n\nexport { featureDefinitions };\n","import { featureDefinitions } from './definitions.mjs';\n\nfunction loadFeatures(features) {\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n}\n\nexport { loadFeatures };\n","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nfunction isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n\nexport { isValidMotionProp };\n","import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';\n\nlet shouldForward = (key) => !isValidMotionProp(key);\nfunction loadExternalIsValidProp(isValidProp) {\n if (typeof isValidProp !== \"function\")\n return;\n // Explicitly filter our events\n shouldForward = (key) => key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key);\n}\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default);\n}\ncatch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\nfunction filterProps(props, isDom, forwardMotionProps) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n\nexport { filterProps, loadExternalIsValidProp };\n","\"use client\";\nimport { createContext } from 'react';\n\nconst MotionContext = /* @__PURE__ */ createContext({});\n\nexport { MotionContext };\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n","import { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n return (isAnimationControls(props.animate) ||\n variantProps.some((name) => isVariantLabel(props[name])));\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n","import { isControllingVariants } from '../../render/utils/is-controlling-variants.mjs';\nimport { isVariantLabel } from '../../render/utils/is-variant-label.mjs';\n\nfunction getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n\nexport { getCurrentTreeVariants };\n","\"use client\";\nimport { useContext, useMemo } from 'react';\nimport { MotionContext } from './index.mjs';\nimport { getCurrentTreeVariants } from './utils.mjs';\n\nfunction useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n\nexport { useCreateMotionContext };\n","import { isCSSVariableName } from 'motion-dom';\n\nconst scaleCorrectors = {};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n","import { transformProps } from 'motion-dom';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue };\n","import { transformPropOrder, getValueAsType, numberValueTypes } from 'motion-dom';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n valueIsDefault = parseFloat(value) === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n transformString = transformString.trim();\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform };\n","import { transformProps, isCSSVariableName, getValueAsType, numberValueTypes } from 'motion-dom';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key];\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true;\n transformOrigin[key] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, transformTemplate);\n }\n else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\";\n }\n }\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n","const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n\nexport { createHtmlRenderState };\n","\"use client\";\nimport { isMotionValue } from 'motion-dom';\nimport { useMemo } from 'react';\nimport { isForcedMotionValue } from '../../motion/utils/is-forced-motion-value.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\n\nfunction copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nfunction useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n\nexport { copyRawValuesOnly, useHTMLProps };\n","import { px } from 'motion-dom';\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n};\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys;\n // Build the dash offset\n attrs[keys.offset] = px.transform(-offset);\n // Build the dash array\n const pathLength = px.transform(length);\n const pathSpacing = px.transform(spacing);\n attrs[keys.array] = `${pathLength} ${pathSpacing}`;\n}\n\nexport { buildSVGPath };\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox;\n }\n return;\n }\n state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform;\n delete attrs.transform;\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\n }\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = styleProp?.transformBox ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs };\n","import { createHtmlRenderState } from '../../html/utils/create-render-state.mjs';\n\nconst createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n\nexport { createSvgRenderState };\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n","\"use client\";\nimport { useMemo } from 'react';\nimport { copyRawValuesOnly } from '../html/use-props.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\n\nfunction useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n\nexport { useSVGProps };\n","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nconst lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n\nexport { lowercaseSVGElements };\n","import { lowercaseSVGElements } from '../../svg/lowercase-elements.mjs';\n\nfunction isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n\nexport { isSVGComponent };\n","\"use client\";\nimport { isMotionValue } from 'motion-dom';\nimport { Fragment, useMemo, createElement } from 'react';\nimport { useHTMLProps } from '../html/use-props.mjs';\nimport { useSVGProps } from '../svg/use-props.mjs';\nimport { filterProps } from './utils/filter-props.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nfunction useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false) {\n const useVisualProps = isSVGComponent(Component)\n ? useSVGProps\n : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n\nexport { useRender };\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement);\n definition = definition(custom !== undefined ? custom : props.custom, current, velocity);\n }\n return definition;\n}\n\nexport { resolveVariantFromProps };\n","import { isMotionValue } from 'motion-dom';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n *\n * TODO: Remove and move to library\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n","\"use client\";\nimport { useContext } from 'react';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { isControllingVariants, isVariantNode } from '../../render/utils/is-controlling-variants.mjs';\nimport { resolveVariantFromProps } from '../../render/utils/resolve-variants.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\n\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants$1 = isControllingVariants(props);\n const isVariantNode$1 = isVariantNode(props);\n if (context &&\n isVariantNode$1 &&\n !isControllingVariants$1 &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nconst makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n\nexport { makeUseVisualState };\n","import { isMotionValue } from 'motion-dom';\nimport { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const { style } = props;\n const newValues = {};\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevProps.style &&\n isMotionValue(prevProps.style[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","\"use client\";\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { createHtmlRenderState } from './utils/create-render-state.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nconst useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n\nexport { useHTMLVisualState };\n","import { isMotionValue, transformPropOrder } from 'motion-dom';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n if (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key])) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n","\"use client\";\nimport { makeUseVisualState } from '../../motion/utils/use-visual-state.mjs';\nimport { createSvgRenderState } from './utils/create-render-state.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nconst useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n\nexport { useSVGVisualState };\n","const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n\nexport { motionComponentSymbol };\n","function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n\nexport { isRefObject };\n","\"use client\";\nimport { useCallback } from 'react';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\n\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nfunction useMotionRef(visualState, visualElement, externalRef) {\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount && visualState.onMount(instance);\n }\n if (visualElement) {\n if (instance) {\n visualElement.mount(instance);\n }\n else {\n visualElement.unmount();\n }\n }\n if (externalRef) {\n if (typeof externalRef === \"function\") {\n externalRef(instance);\n }\n else if (isRefObject(externalRef)) {\n externalRef.current = instance;\n }\n }\n }, \n /**\n * Include externalRef in dependencies to ensure the callback updates\n * when the ref changes, allowing proper ref forwarding.\n */\n [visualElement]);\n}\n\nexport { useMotionRef };\n","/**\n * Convert camelCase to dash-case properties.\n */\nconst camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, \"$1-$2\").toLowerCase();\n\nexport { camelToDash };\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * Internal, exported only for usage in Framer\n */\nconst SwitchLayoutGroupContext = createContext({});\n\nexport { SwitchLayoutGroupContext };\n","\"use client\";\nimport { useContext, useRef, useInsertionEffect, useEffect } from 'react';\nimport { optimizedAppearDataAttribute } from '../../animation/optimized-appear/data-id.mjs';\nimport { LazyContext } from '../../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../../context/MotionContext/index.mjs';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../context/SwitchLayoutGroupContext.mjs';\nimport { isRefObject } from '../../utils/is-ref-object.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\nfunction useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const reducedMotionConfig = useContext(MotionConfigContext).reducedMotion;\n const visualElementRef = useRef(null);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n });\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n useIsomorphicLayoutEffect(() => {\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situtation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n\nexport { useVisualElement };\n","\"use client\";\nimport { jsxs, jsx } from 'react/jsx-runtime';\nimport { warning, invariant } from 'motion-utils';\nimport { forwardRef, useContext } from 'react';\nimport { LayoutGroupContext } from '../context/LayoutGroupContext.mjs';\nimport { LazyContext } from '../context/LazyContext.mjs';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { MotionContext } from '../context/MotionContext/index.mjs';\nimport { useCreateMotionContext } from '../context/MotionContext/create.mjs';\nimport { useRender } from '../render/dom/use-render.mjs';\nimport { isSVGComponent } from '../render/dom/utils/is-svg-component.mjs';\nimport { useHTMLVisualState } from '../render/html/use-html-visual-state.mjs';\nimport { useSVGVisualState } from '../render/svg/use-svg-visual-state.mjs';\nimport { isBrowser } from '../utils/is-browser.mjs';\nimport { featureDefinitions } from './features/definitions.mjs';\nimport { loadFeatures } from './features/load-features.mjs';\nimport { motionComponentSymbol } from './utils/symbol.mjs';\nimport { useMotionRef } from './utils/use-motion-ref.mjs';\nimport { useVisualElement } from './utils/use-visual-element.mjs';\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nfunction createMotionComponent(Component, { forwardMotionProps = false } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n const useVisualState = isSVGComponent(Component)\n ? useSVGVisualState\n : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n\nexport { createMotionComponent };\n","import { warnOnce } from 'motion-utils';\nimport { createMotionComponent } from '../../motion/index.mjs';\n\nfunction createMotionProxy(preloadedFeatures, createVisualElement) {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent;\n }\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map();\n const factory = (Component, options) => {\n return createMotionComponent(Component, options, preloadedFeatures, createVisualElement);\n };\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (Component, options) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, \"motion() is deprecated. Use motion.create() instead.\");\n }\n return factory(Component, options);\n };\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key) => {\n if (key === \"create\")\n return factory;\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(key, createMotionComponent(key, undefined, preloadedFeatures, createVisualElement));\n }\n return componentCache.get(key);\n },\n });\n}\n\nexport { createMotionProxy };\n","/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\n}\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n","function isIdentityScale(scale) {\n return scale === undefined || scale === 1;\n}\nfunction hasScale({ scale, scaleX, scaleY }) {\n return (!isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY));\n}\nfunction hasTransform(values) {\n return (hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY);\n}\nfunction has2DTranslate(values) {\n return is2DTranslate(values.x) || is2DTranslate(values.y);\n}\nfunction is2DTranslate(value) {\n return value && value !== \"0%\";\n}\n\nexport { has2DTranslate, hasScale, hasTransform };\n","import { mixNumber } from 'motion-dom';\nimport { hasTransform } from '../utils/has-transform.mjs';\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nfunction scalePoint(point, scale, originPoint) {\n const distanceFromOrigin = point - originPoint;\n const scaled = scale * distanceFromOrigin;\n return originPoint + scaled;\n}\n/**\n * Applies a translate/scale delta to a point\n */\nfunction applyPointDelta(point, translate, scale, originPoint, boxScale) {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint);\n }\n return scalePoint(point, scale, originPoint) + translate;\n}\n/**\n * Applies a translate/scale delta to an axis\n */\nfunction applyAxisDelta(axis, translate = 0, scale = 1, originPoint, boxScale) {\n axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Applies a translate/scale delta to a box\n */\nfunction applyBoxDelta(box, { x, y }) {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);\n}\nconst TREE_SCALE_SNAP_MIN = 0.999999999999;\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001;\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nfunction applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {\n const treeLength = treePath.length;\n if (!treeLength)\n return;\n // Reset the treeScale\n treeScale.x = treeScale.y = 1;\n let node;\n let delta;\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i];\n delta = node.projectionDelta;\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options;\n if (visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\") {\n continue;\n }\n if (isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (delta) {\n // Incoporate each ancestor's scale into a culmulative treeScale for this component\n treeScale.x *= delta.x.scale;\n treeScale.y *= delta.y.scale;\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta);\n }\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues);\n }\n }\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN) {\n treeScale.x = 1.0;\n }\n if (treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN) {\n treeScale.y = 1.0;\n }\n}\nfunction translateAxis(axis, distance) {\n axis.min = axis.min + distance;\n axis.max = axis.max + distance;\n}\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nfunction transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin);\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale);\n}\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nfunction transformBox(box, transform) {\n transformAxis(box.x, transform.x, transform.scaleX, transform.scale, transform.originX);\n transformAxis(box.y, transform.y, transform.scaleY, transform.scale, transform.originY);\n}\n\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis };\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n","import { isBrowser } from '../is-browser.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { initPrefersReducedMotion };\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n","import { isMotionValue, motionValue } from 'motion-dom';\n\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue);\n }\n else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }));\n }\n else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key);\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n","import { KeyframeResolver, time, frame, isMotionValue, cancelFrame, transformProps, motionValue, findValueType, complex, getAnimatableNone, microtask } from 'motion-dom';\nimport { warnOnce, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { featureDefinitions } from '../motion/features/definitions.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { initPrefersReducedMotion } from '../utils/reduced-motion/index.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from '../utils/reduced-motion/state.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { resolveVariantFromProps } from './utils/resolve-variants.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n this.shouldReduceMotion = null;\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n this.prevMotionValues = {};\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.scheduleRender = () => {\n const now = time.now();\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now;\n frame.render(this.render, false, true);\n }\n };\n const { latestValues, renderState } = visualState;\n this.latestValues = latestValues;\n this.baseTarget = { ...latestValues };\n this.initialValues = props.initial ? { ...latestValues } : {};\n this.renderState = renderState;\n this.parent = parent;\n this.props = props;\n this.presenceContext = presenceContext;\n this.depth = parent ? parent.depth + 1 : 0;\n this.reducedMotionConfig = reducedMotionConfig;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this);\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion =\n this.reducedMotionConfig === \"never\"\n ? false\n : this.reducedMotionConfig === \"always\"\n ? true\n : prefersReducedMotion.current;\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n }\n unmount() {\n this.projection && this.projection.unmount();\n cancelFrame(this.notifyUpdate);\n cancelFrame(this.render);\n this.valueSubscriptions.forEach((remove) => remove());\n this.valueSubscriptions.clear();\n this.removeFromVariantTree && this.removeFromVariantTree();\n this.parent?.removeChild(this);\n for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true;\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n if (value.owner)\n value.stop();\n });\n }\n sortNodePosition(other) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (!this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\n }\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key];\n if (feature.isMounted) {\n feature.update();\n }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\n }\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox();\n }\n getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\n }\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props, presenceContext) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i];\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]();\n delete this.propEventSubscriptions[key];\n }\n const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n getClosestVariantNode() {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined;\n }\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child) {\n const closestVariantNode = this.getClosestVariantNode();\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child);\n return () => closestVariantNode.variantChildren.delete(child);\n }\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n this.latestValues[key] = value.get();\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\n this.values.delete(key);\n const unsubscribe = this.valueSubscriptions.get(key);\n if (unsubscribe) {\n unsubscribe();\n this.valueSubscriptions.delete(key);\n }\n delete this.latestValues[key];\n this.removeValueFromRenderState(key, this.renderState);\n }\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue === null ? undefined : defaultValue, { owner: this });\n this.addValue(key, value);\n }\n return value;\n }\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key, target) {\n let value = this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options);\n if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\n }\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key, value) {\n this.baseTarget[key] = value;\n }\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key) {\n const { initial } = this.props;\n let valueFromInitial;\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(this.props, initial, this.presenceContext?.custom);\n if (variant) {\n valueFromInitial = variant[key];\n }\n }\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial;\n }\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key);\n if (target !== undefined && !isMotionValue(target))\n return target;\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key];\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement };\n","import { DOMKeyframesResolver, isMotionValue } from 'motion-dom';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n return props.style\n ? props.style[key]\n : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`;\n }\n });\n }\n }\n}\n\nexport { DOMVisualElement };\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key]);\n }\n}\n\nexport { renderHTML };\n","import { transformProps, defaultTransformValue, readTransformValue, isCSSVariableName } from 'motion-dom';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n]);\n\nexport { camelCaseAttributes };\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n","import { transformProps, getDefaultValueType } from 'motion-dom';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n return props[key];\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n","import { Fragment } from 'react';\nimport { HTMLVisualElement } from '../html/HTMLVisualElement.mjs';\nimport { SVGVisualElement } from '../svg/SVGVisualElement.mjs';\nimport { isSVGComponent } from './utils/is-svg-component.mjs';\n\nconst createDomVisualElement = (Component, options) => {\n return isSVGComponent(Component)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n });\n};\n\nexport { createDomVisualElement };\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n const props = visualElement.getProps();\n return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, visualElement);\n}\n\nexport { resolveVariant };\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n","import { motionValue } from 'motion-dom';\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n","import { isMotionValue } from 'motion-dom';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key);\n }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const index = repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n","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","/**\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","import { getValueTransition, makeAnimationInstant, frame, JSAnimation, AsyncMotionValueAnimation } from 'motion-dom';\nimport { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n const options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options));\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\n }\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease;\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n","import { getValueTransition, frame, positionalKeys } from 'motion-dom';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n continue;\n }\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\n","function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child);\n const numChildren = children.size;\n const maxStaggerDuration = (numChildren - 1) * staggerChildren;\n const delayIsFunction = typeof delayChildren === \"function\";\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren;\n}\n\nexport { calcChildStagger };\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { calcChildStagger } from '../utils/calc-child-stagger.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delay = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n for (const child of visualElement.variantChildren) {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(visualElement.variantChildren, child, delayChildren, staggerChildren, staggerDirection),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n }\n return Promise.all(animations);\n}\n\nexport { animateVariant };\n","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","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n","import { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nconst numVariantProps = variantProps.length;\nfunction getVariantContext(visualElement) {\n if (!visualElement)\n return undefined;\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {};\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial;\n }\n return context;\n }\n const context = {};\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i];\n const prop = visualElement.props[name];\n if (isVariantLabel(prop) || prop === false) {\n context[name] = prop;\n }\n }\n return context;\n}\n\nexport { getVariantContext };\n","import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\nimport { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs';\nimport { isAnimationControls } from '../../animation/utils/is-animation-controls.mjs';\nimport { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.mjs';\nimport { shallowCompare } from '../../utils/shallow-compare.mjs';\nimport { getVariantContext } from './get-variant-context.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\nconst numAnimationTypes = variantPriorityOrder.length;\nfunction animateList(visualElement) {\n return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n}\nfunction createAnimationState(visualElement) {\n let animate = animateList(visualElement);\n let state = createState();\n let isInitialRender = true;\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues = (type) => (acc, definition) => {\n const resolved = resolveVariant(visualElement, definition, type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined);\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved;\n acc = { ...acc, ...target, ...transitionEnd };\n }\n return acc;\n };\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType) {\n const { props } = visualElement;\n const context = getVariantContext(visualElement.parent) || {};\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations = [];\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set();\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys = {};\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity;\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i];\n const typeState = state[type];\n const prop = props[type] !== undefined\n ? props[type]\n : context[type];\n const propIsVariant = isVariantLabel(prop);\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited = prop === context[type] &&\n prop !== props[type] &&\n propIsVariant;\n if (isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount) {\n isInherited = false;\n }\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys };\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n continue;\n }\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant);\n let handledRemovedValues = false;\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop];\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {});\n if (activeDelta === false)\n resolvedValues = {};\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState;\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n };\n const markToAnimate = (key) => {\n shouldAnimateType = true;\n if (removedKeys.has(key)) {\n handledRemovedValues = true;\n removedKeys.delete(key);\n }\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n };\n for (const key in allKeys) {\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key))\n continue;\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false;\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev);\n }\n else {\n valueHasChanged = next !== prev;\n }\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key);\n }\n else {\n // If it's undefined, it's been removed.\n removedKeys.add(key);\n }\n }\n else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key);\n }\n else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true;\n }\n }\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false;\n }\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange;\n const needsAnimating = !willAnimateViaParent || handledRemovedValues;\n if (shouldAnimateType && needsAnimating) {\n animations.push(...definitionList.map((animation) => {\n const options = { type };\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (typeof animation === \"string\" &&\n isInitialRender &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent) {\n const { parent } = visualElement;\n const parentVariant = resolveVariant(parent, animation);\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } = parentVariant.transition || {};\n options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);\n }\n }\n return {\n animation: animation,\n options,\n };\n }));\n }\n }\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation = {};\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(visualElement, Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial);\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition;\n }\n }\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key);\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null;\n });\n animations.push({ animation: fallbackAnimation });\n }\n let shouldAnimate = Boolean(animations.length);\n if (isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount) {\n shouldAnimate = false;\n }\n isInitialRender = false;\n return shouldAnimate ? animate(animations) : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive)\n return Promise.resolve();\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive));\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState();\n /**\n * Temporarily disabling resetting this flag as it prevents components\n * with initial={false} from animating after being remounted, for instance\n * as the child of an Activity component.\n */\n // isInitialRender = true\n },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createTypeState(isActive = false) {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n}\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n };\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n","class Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n","import { isAnimationControls } from '../../../animation/utils/is-animation-controls.mjs';\nimport { createAnimationState } from '../../../render/utils/animation-state.mjs';\nimport { Feature } from '../Feature.mjs';\n\nclass AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() {\n this.node.animationState.reset();\n this.unmountControls?.();\n }\n}\n\nexport { AnimationFeature };\n","import { Feature } from '../Feature.mjs';\n\nlet id = 0;\nclass ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n }\n update() {\n if (!this.node.presenceContext)\n return;\n const { isPresent, onExitComplete } = this.node.presenceContext;\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return;\n }\n const exitAnimation = this.node.animationState.setActive(\"exit\", !isPresent);\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id);\n });\n }\n }\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {};\n if (onExitComplete) {\n onExitComplete(this.id);\n }\n if (register) {\n this.unmount = register(this.id);\n }\n }\n unmount() { }\n}\n\nexport { ExitAnimationFeature };\n","import { AnimationFeature } from './animation/index.mjs';\nimport { ExitAnimationFeature } from './animation/exit.mjs';\n\nconst animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n\nexport { animations };\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler);\n}\n\nexport { addDomEvent };\n","import { isPrimaryPointer } from 'motion-dom';\n\nfunction extractEventInfo(event) {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n };\n}\nconst addPointerInfo = (handler) => {\n return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n};\n\nexport { addPointerInfo, extractEventInfo };\n","import { addDomEvent } from './add-dom-event.mjs';\nimport { addPointerInfo } from './event-info.mjs';\n\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options);\n}\n\nexport { addPointerEvent };\n","import { mixNumber } from 'motion-dom';\n\nconst SCALE_PRECISION = 0.0001;\nconst SCALE_MIN = 1 - SCALE_PRECISION;\nconst SCALE_MAX = 1 + SCALE_PRECISION;\nconst TRANSLATE_PRECISION = 0.01;\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION;\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION;\nfunction calcLength(axis) {\n return axis.max - axis.min;\n}\nfunction isNear(value, target, maxDistance) {\n return Math.abs(value - target) <= maxDistance;\n}\nfunction calcAxisDelta(delta, source, target, origin = 0.5) {\n delta.origin = origin;\n delta.originPoint = mixNumber(source.min, source.max, delta.origin);\n delta.scale = calcLength(target) / calcLength(source);\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint;\n if ((delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)) {\n delta.scale = 1.0;\n }\n if ((delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)) {\n delta.translate = 0.0;\n }\n}\nfunction calcBoxDelta(delta, source, target, origin) {\n calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : undefined);\n calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : undefined);\n}\nfunction calcRelativeAxis(target, relative, parent) {\n target.min = parent.min + relative.min;\n target.max = target.min + calcLength(relative);\n}\nfunction calcRelativeBox(target, relative, parent) {\n calcRelativeAxis(target.x, relative.x, parent.x);\n calcRelativeAxis(target.y, relative.y, parent.y);\n}\nfunction calcRelativeAxisPosition(target, layout, parent) {\n target.min = layout.min - parent.min;\n target.max = target.min + calcLength(layout);\n}\nfunction calcRelativePosition(target, layout, parent) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x);\n calcRelativeAxisPosition(target.y, layout.y, parent.y);\n}\n\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear };\n","function eachAxis(callback) {\n return [callback(\"x\"), callback(\"y\")];\n}\n\nexport { eachAxis };\n","// Fixes https://github.com/motiondivision/motion/issues/2270\nconst getContextWindow = ({ current }) => {\n return current ? current.ownerDocument.defaultView : null;\n};\n\nexport { getContextWindow };\n","const distance = (a, b) => Math.abs(a - b);\nfunction distance2D(a, b) {\n // Multi-dimensional\n const xDelta = distance(a.x, b.x);\n const yDelta = distance(a.y, b.y);\n return Math.sqrt(xDelta ** 2 + yDelta ** 2);\n}\n\nexport { distance, distance2D };\n","import { frame, isPrimaryPointer, cancelFrame, frameData } from 'motion-dom';\nimport { pipe, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { extractEventInfo } from '../../events/event-info.mjs';\nimport { distance2D } from '../../utils/distance.mjs';\n\n/**\n * @internal\n */\nclass PanSession {\n constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3, } = {}) {\n /**\n * @internal\n */\n this.startEvent = null;\n /**\n * @internal\n */\n this.lastMoveEvent = null;\n /**\n * @internal\n */\n this.lastMoveEventInfo = null;\n /**\n * @internal\n */\n this.handlers = {};\n /**\n * @internal\n */\n this.contextWindow = window;\n this.updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const info = getPanInfo(this.lastMoveEventInfo, this.history);\n const isPanStarted = this.startEvent !== null;\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold;\n if (!isPanStarted && !isDistancePastThreshold)\n return;\n const { point } = info;\n const { timestamp } = frameData;\n this.history.push({ ...point, timestamp });\n const { onStart, onMove } = this.handlers;\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info);\n this.startEvent = this.lastMoveEvent;\n }\n onMove && onMove(this.lastMoveEvent, info);\n };\n this.handlePointerMove = (event, info) => {\n this.lastMoveEvent = event;\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true);\n };\n this.handlePointerUp = (event, info) => {\n this.end();\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;\n if (this.dragSnapToOrigin)\n resumeAnimation && resumeAnimation();\n if (!(this.lastMoveEvent && this.lastMoveEventInfo))\n return;\n const panInfo = getPanInfo(event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint), this.history);\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo);\n }\n onSessionEnd && onSessionEnd(event, panInfo);\n };\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event))\n return;\n this.dragSnapToOrigin = dragSnapToOrigin;\n this.handlers = handlers;\n this.transformPagePoint = transformPagePoint;\n this.distanceThreshold = distanceThreshold;\n this.contextWindow = contextWindow || window;\n const info = extractEventInfo(event);\n const initialInfo = transformPoint(info, this.transformPagePoint);\n const { point } = initialInfo;\n const { timestamp } = frameData;\n this.history = [{ ...point, timestamp }];\n const { onSessionStart } = handlers;\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history));\n this.removeListeners = pipe(addPointerEvent(this.contextWindow, \"pointermove\", this.handlePointerMove), addPointerEvent(this.contextWindow, \"pointerup\", this.handlePointerUp), addPointerEvent(this.contextWindow, \"pointercancel\", this.handlePointerUp));\n }\n updateHandlers(handlers) {\n this.handlers = handlers;\n }\n end() {\n this.removeListeners && this.removeListeners();\n cancelFrame(this.updatePoint);\n }\n}\nfunction transformPoint(info, transformPagePoint) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info;\n}\nfunction subtractPoint(a, b) {\n return { x: a.x - b.x, y: a.y - b.y };\n}\nfunction getPanInfo({ point }, history) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n };\n}\nfunction startDevicePoint(history) {\n return history[0];\n}\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return { x: 0, y: 0 };\n }\n let i = history.length - 1;\n let timestampedPoint = null;\n const lastPoint = lastDevicePoint(history);\n while (i >= 0) {\n timestampedPoint = history[i];\n if (lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)) {\n break;\n }\n i--;\n }\n if (!timestampedPoint) {\n return { x: 0, y: 0 };\n }\n const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);\n if (time === 0) {\n return { x: 0, y: 0 };\n }\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n };\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n return currentVelocity;\n}\n\nexport { PanSession };\n","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","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();\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 /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPointerEvent = null;\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n this.latestPanInfo = null;\n this.visualElement = visualElement;\n }\n start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement;\n if (presenceContext && presenceContext.isPresent === false)\n return;\n const onSessionStart = (event) => {\n 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.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.isDragging = true;\n this.currentDirection = null;\n this.resolveConstraints();\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true;\n this.visualElement.projection.target = undefined;\n }\n /**\n * Record gesture origin\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 this.latestPointerEvent = event;\n this.latestPanInfo = info;\n const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock)\n return;\n const { offset } = info;\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset);\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection);\n }\n return;\n }\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset);\n this.updateAxis(\"y\", info.point, offset);\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render();\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info);\n };\n const onSessionEnd = (event, info) => {\n this.latestPointerEvent = event;\n this.latestPanInfo = info;\n this.stop(event, info);\n this.latestPointerEvent = null;\n this.latestPanInfo = null;\n };\n const resumeAnimation = () => 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 distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n });\n }\n /**\n * @internal\n */\n stop(event, panInfo) {\n const finalEvent = event || this.latestPointerEvent;\n const finalPanInfo = panInfo || this.latestPanInfo;\n const isDragging = this.isDragging;\n this.cancel();\n if (!isDragging || !finalPanInfo || !finalEvent)\n return;\n const { velocity } = finalPanInfo;\n this.startAnimation(velocity);\n const { onDragEnd } = this.getProps();\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));\n }\n }\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false;\n const { projection, animationState } = this.visualElement;\n if (projection) {\n projection.isAnimationBlocked = false;\n }\n this.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.\", \"drag-constraints-ref\");\n const { projection } = this.visualElement;\n // TODO\n if (!projection || !projection.layout)\n return false;\n const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());\n let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));\n this.hasMutatedConstraints = !!userConstraints;\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints);\n }\n }\n return measuredConstraints;\n }\n startAnimation(velocity) {\n const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();\n const constraints = this.constraints || {};\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return;\n }\n let transition = (constraints && constraints[axis]) || {};\n if (dragSnapToOrigin)\n transition = { min: 0, max: 0 };\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000;\n const bounceDamping = dragElastic ? 40 : 10000000;\n const inertia = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n };\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia);\n });\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd);\n }\n startAxisValueAnimation(axis, transition) {\n const axisValue = this.getAxisMotionValue(axis);\n addValueToWillChange(this.visualElement, axis);\n return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false));\n }\n stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop());\n }\n 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","import { Feature } from '../../motion/features/Feature.mjs';\nimport { noop } from 'motion-utils';\nimport { VisualElementDragControls } from './VisualElementDragControls.mjs';\n\nclass DragGesture extends Feature {\n constructor(node) {\n super(node);\n this.removeGroupControls = noop;\n this.removeListeners = noop;\n this.controls = new VisualElementDragControls(node);\n }\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps();\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls);\n }\n this.removeListeners = this.controls.addListeners() || noop;\n }\n unmount() {\n this.removeGroupControls();\n this.removeListeners();\n }\n}\n\nexport { DragGesture };\n","import { frame } from 'motion-dom';\nimport { noop } from 'motion-utils';\nimport { addPointerEvent } from '../../events/add-pointer-event.mjs';\nimport { Feature } from '../../motion/features/Feature.mjs';\nimport { getContextWindow } from '../../utils/get-context-window.mjs';\nimport { PanSession } from './PanSession.mjs';\n\nconst asyncHandler = (handler) => (event, info) => {\n if (handler) {\n frame.postRender(() => handler(event, info));\n }\n};\nclass PanGesture extends Feature {\n constructor() {\n super(...arguments);\n this.removePointerDownListener = noop;\n }\n onPointerDown(pointerDownEvent) {\n this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n });\n }\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: onPan,\n onEnd: (event, info) => {\n delete this.session;\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info));\n }\n },\n };\n }\n mount() {\n this.removePointerDownListener = addPointerEvent(this.node.current, \"pointerdown\", (event) => this.onPointerDown(event));\n }\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers());\n }\n unmount() {\n this.removePointerDownListener();\n this.session && this.session.end();\n }\n}\n\nexport { PanGesture };\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nconst globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n};\n\nexport { globalProjectionState };\n","import { px } from 'motion-dom';\n\nfunction pixelsToPercent(pixels, axis) {\n if (axis.max === axis.min)\n return 0;\n return (pixels / (axis.max - axis.min)) * 100;\n}\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nconst correctBorderRadius = {\n correct: (latest, node) => {\n if (!node.target)\n return latest;\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest);\n }\n else {\n return latest;\n }\n }\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x);\n const y = pixelsToPercent(latest, node.target.y);\n return `${x}% ${y}%`;\n },\n};\n\nexport { correctBorderRadius, pixelsToPercent };\n","import { complex, mixNumber } from 'motion-dom';\n\nconst correctBoxShadow = {\n correct: (latest, { treeScale, projectionDelta }) => {\n const original = latest;\n const shadow = complex.parse(latest);\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5)\n return original;\n const template = complex.createTransformer(latest);\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0;\n // Calculate the overall context scale\n const xScale = projectionDelta.x.scale * treeScale.x;\n const yScale = projectionDelta.y.scale * treeScale.y;\n shadow[0 + offset] /= xScale;\n shadow[1 + offset] /= yScale;\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5);\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n shadow[2 + offset] /= averageScale;\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n shadow[3 + offset] /= averageScale;\n return template(shadow);\n },\n};\n\nexport { correctBoxShadow };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { frame, microtask } from 'motion-dom';\nimport { useContext, Component } from 'react';\nimport { usePresence } from '../../../components/AnimatePresence/use-presence.mjs';\nimport { LayoutGroupContext } from '../../../context/LayoutGroupContext.mjs';\nimport { SwitchLayoutGroupContext } from '../../../context/SwitchLayoutGroupContext.mjs';\nimport { globalProjectionState } from '../../../projection/node/state.mjs';\nimport { correctBorderRadius } from '../../../projection/styles/scale-border-radius.mjs';\nimport { correctBoxShadow } from '../../../projection/styles/scale-box-shadow.mjs';\nimport { addScaleCorrector } from '../../../projection/styles/scale-correction.mjs';\n\n/**\n * Track whether we've taken any snapshots yet. If not,\n * we can safely skip notification of didUpdate.\n *\n * Difficult to capture in a test but to prevent flickering\n * we must set this to true either on update or unmount.\n * Running `next-env/layout-id` in Safari will show this behaviour if broken.\n */\nlet hasTakenAnySnapshot = false;\nclass MeasureLayoutWithContext extends Component {\n /**\n * This only mounts projection nodes for components that\n * need measuring, we might want to do it for all components\n * in order to incorporate transforms\n */\n componentDidMount() {\n const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;\n const { projection } = visualElement;\n addScaleCorrector(defaultScaleCorrectors);\n if (projection) {\n if (layoutGroup.group)\n layoutGroup.group.add(projection);\n if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {\n switchLayoutGroup.register(projection);\n }\n if (hasTakenAnySnapshot) {\n projection.root.didUpdate();\n }\n projection.addEventListener(\"animationComplete\", () => {\n this.safeToRemove();\n });\n projection.setOptions({\n ...projection.options,\n onExitComplete: () => this.safeToRemove(),\n });\n }\n globalProjectionState.hasEverUpdated = true;\n }\n getSnapshotBeforeUpdate(prevProps) {\n const { layoutDependency, visualElement, drag, isPresent } = this.props;\n const { projection } = visualElement;\n if (!projection)\n return null;\n /**\n * TODO: We use this data in relegate to determine whether to\n * promote a previous element. There's no guarantee its presence data\n * will have updated by this point - if a bug like this arises it will\n * have to be that we markForRelegation and then find a new lead some other way,\n * perhaps in didUpdate\n */\n projection.isPresent = isPresent;\n hasTakenAnySnapshot = true;\n if (drag ||\n prevProps.layoutDependency !== layoutDependency ||\n layoutDependency === undefined ||\n prevProps.isPresent !== isPresent) {\n projection.willUpdate();\n }\n else {\n this.safeToRemove();\n }\n if (prevProps.isPresent !== isPresent) {\n if (isPresent) {\n projection.promote();\n }\n else if (!projection.relegate()) {\n /**\n * If there's another stack member taking over from this one,\n * it's in charge of the exit animation and therefore should\n * be in charge of the safe to remove. Otherwise we call it here.\n */\n frame.postRender(() => {\n const stack = projection.getStack();\n if (!stack || !stack.members.length) {\n this.safeToRemove();\n }\n });\n }\n }\n return null;\n }\n componentDidUpdate() {\n const { projection } = this.props.visualElement;\n if (projection) {\n projection.root.didUpdate();\n microtask.postRender(() => {\n if (!projection.currentAnimation && projection.isLead()) {\n this.safeToRemove();\n }\n });\n }\n }\n componentWillUnmount() {\n const { visualElement, layoutGroup, switchLayoutGroup: promoteContext, } = this.props;\n const { projection } = visualElement;\n hasTakenAnySnapshot = true;\n if (projection) {\n projection.scheduleCheckAfterUnmount();\n if (layoutGroup && layoutGroup.group)\n layoutGroup.group.remove(projection);\n if (promoteContext && promoteContext.deregister)\n promoteContext.deregister(projection);\n }\n }\n safeToRemove() {\n const { safeToRemove } = this.props;\n safeToRemove && safeToRemove();\n }\n render() {\n return null;\n }\n}\nfunction MeasureLayout(props) {\n const [isPresent, safeToRemove] = usePresence();\n const layoutGroup = useContext(LayoutGroupContext);\n return (jsx(MeasureLayoutWithContext, { ...props, layoutGroup: layoutGroup, switchLayoutGroup: useContext(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }));\n}\nconst defaultScaleCorrectors = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n};\n\nexport { MeasureLayout };\n","import { isMotionValue, motionValue } from 'motion-dom';\nimport { animateMotionValue } from '../interfaces/motion-value.mjs';\n\nfunction animateSingleValue(value, keyframes, options) {\n const motionValue$1 = isMotionValue(value) ? value : motionValue(value);\n motionValue$1.start(animateMotionValue(\"\", motionValue$1, keyframes, options));\n return motionValue$1.animation;\n}\n\nexport { animateSingleValue };\n","const compareByDepth = (a, b) => a.depth - b.depth;\n\nexport { compareByDepth };\n","import { addUniqueItem, removeItem } from 'motion-utils';\nimport { compareByDepth } from './compare-by-depth.mjs';\n\nclass FlatTree {\n constructor() {\n this.children = [];\n this.isDirty = false;\n }\n add(child) {\n addUniqueItem(this.children, child);\n this.isDirty = true;\n }\n remove(child) {\n removeItem(this.children, child);\n this.isDirty = true;\n }\n forEach(callback) {\n this.isDirty && this.children.sort(compareByDepth);\n this.isDirty = false;\n this.children.forEach(callback);\n }\n}\n\nexport { FlatTree };\n","import { time, frame, cancelFrame } from 'motion-dom';\nimport { secondsToMilliseconds } from 'motion-utils';\n\n/**\n * Timeout defined in ms\n */\nfunction delay(callback, timeout) {\n const start = time.now();\n const checkElapsed = ({ timestamp }) => {\n const elapsed = timestamp - start;\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed);\n callback(elapsed - timeout);\n }\n };\n frame.setup(checkElapsed, true);\n return () => cancelFrame(checkElapsed);\n}\nfunction delayInSeconds(callback, timeout) {\n return delay(callback, secondsToMilliseconds(timeout));\n}\n\nexport { delay, delayInSeconds };\n","import { mixNumber, percent, px } from 'motion-dom';\nimport { progress, circOut, noop } from 'motion-utils';\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"];\nconst numBorders = borders.length;\nconst asNumber = (value) => typeof value === \"string\" ? parseFloat(value) : value;\nconst isPx = (value) => typeof value === \"number\" || px.test(value);\nfunction mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(0, lead.opacity ?? 1, easeCrossfadeIn(progress));\n target.opacityExit = mixNumber(follow.opacity ?? 1, 0, easeCrossfadeOut(progress));\n }\n else if (isOnlyMember) {\n target.opacity = mixNumber(follow.opacity ?? 1, lead.opacity ?? 1, progress);\n }\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`;\n let followRadius = getRadius(follow, borderLabel);\n let leadRadius = getRadius(lead, borderLabel);\n if (followRadius === undefined && leadRadius === undefined)\n continue;\n followRadius || (followRadius = 0);\n leadRadius || (leadRadius = 0);\n const canMix = followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius);\n if (canMix) {\n target[borderLabel] = Math.max(mixNumber(asNumber(followRadius), asNumber(leadRadius), progress), 0);\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\";\n }\n }\n else {\n target[borderLabel] = leadRadius;\n }\n }\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(follow.rotate || 0, lead.rotate || 0, progress);\n }\n}\nfunction getRadius(values, radiusName) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius;\n}\n// /**\n// * We only want to mix the background color if there's a follow element\n// * that we're not crossfading opacity between. For instance with switch\n// * AnimateSharedLayout animations, this helps the illusion of a continuous\n// * element being animated but also cuts down on the number of paints triggered\n// * for elements where opacity is doing that work for us.\n// */\n// if (\n// !hasFollowElement &&\n// latestLeadValues.backgroundColor &&\n// latestFollowValues.backgroundColor\n// ) {\n// /**\n// * This isn't ideal performance-wise as mixColor is creating a new function every frame.\n// * We could probably create a mixer that runs at the start of the animation but\n// * the idea behind the crossfader is that it runs dynamically between two potentially\n// * changing targets (ie opacity or borderRadius may be animating independently via variants)\n// */\n// leadState.backgroundColor = followState.backgroundColor = mixColor(\n// latestFollowValues.backgroundColor as string,\n// latestLeadValues.backgroundColor as string\n// )(p)\n// }\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut);\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop);\nfunction compress(min, max, easing) {\n return (p) => {\n // Could replace ifs with clamp\n if (p < min)\n return 0;\n if (p > max)\n return 1;\n return easing(progress(min, max, p));\n };\n}\n\nexport { mixValues };\n","/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisInto(axis, originAxis) {\n axis.min = originAxis.min;\n axis.max = originAxis.max;\n}\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nfunction copyAxisDeltaInto(delta, originDelta) {\n delta.translate = originDelta.translate;\n delta.scale = originDelta.scale;\n delta.originPoint = originDelta.originPoint;\n delta.origin = originDelta.origin;\n}\n\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto };\n","import { percent, mixNumber } from 'motion-dom';\nimport { scalePoint } from './delta-apply.mjs';\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nfunction removePointDelta(point, translate, scale, originPoint, boxScale) {\n point -= translate;\n point = scalePoint(point, 1 / scale, originPoint);\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint);\n }\n return point;\n}\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nfunction removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {\n if (percent.test(translate)) {\n translate = parseFloat(translate);\n const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);\n translate = relativeProgress - sourceAxis.min;\n }\n if (typeof translate !== \"number\")\n return;\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin);\n if (axis === originAxis)\n originPoint -= translate;\n axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);\n axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);\n}\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {\n removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);\n}\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"];\nconst yKeys = [\"y\", \"scaleY\", \"originY\"];\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nfunction removeBoxTransforms(box, transforms, originBox, sourceBox) {\n removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);\n removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);\n}\n\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };\n","import { calcLength } from './delta-calc.mjs';\n\nfunction isAxisDeltaZero(delta) {\n return delta.translate === 0 && delta.scale === 1;\n}\nfunction isDeltaZero(delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);\n}\nfunction axisEquals(a, b) {\n return a.min === b.min && a.max === b.max;\n}\nfunction boxEquals(a, b) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);\n}\nfunction axisEqualsRounded(a, b) {\n return (Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max));\n}\nfunction boxEqualsRounded(a, b) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);\n}\nfunction aspectRatio(box) {\n return calcLength(box.x) / calcLength(box.y);\n}\nfunction axisDeltaEquals(a, b) {\n return (a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint);\n}\n\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };\n","import { addUniqueItem, removeItem } from 'motion-utils';\n\nclass NodeStack {\n constructor() {\n this.members = [];\n }\n add(node) {\n addUniqueItem(this.members, node);\n node.scheduleRender();\n }\n remove(node) {\n removeItem(this.members, node);\n if (node === this.prevLead) {\n this.prevLead = undefined;\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1];\n if (prevLead) {\n this.promote(prevLead);\n }\n }\n }\n relegate(node) {\n const indexOfNode = this.members.findIndex((member) => node === member);\n if (indexOfNode === 0)\n return false;\n /**\n * Find the next projection node that is present\n */\n let prevLead;\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i];\n if (member.isPresent !== false) {\n prevLead = member;\n break;\n }\n }\n if (prevLead) {\n this.promote(prevLead);\n return true;\n }\n else {\n return false;\n }\n }\n promote(node, preserveFollowOpacity) {\n const prevLead = this.lead;\n if (node === prevLead)\n return;\n this.prevLead = prevLead;\n this.lead = node;\n node.show();\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender();\n node.scheduleRender();\n node.resumeFrom = prevLead;\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true;\n }\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot;\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues;\n }\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true;\n }\n const { crossfade } = node.options;\n if (crossfade === false) {\n prevLead.hide();\n }\n /**\n * TODO:\n * - Test border radius when previous node was deleted\n * - boxShadow mixing\n * - Shared between element A in scrolled container and element B (scroll stays the same or changes)\n * - Shared between element A in transformed container and element B (transform stays the same or changes)\n * - Shared between element A in scrolled page and element B (scroll stays the same or changes)\n * ---\n * - Crossfade opacity of root nodes\n * - layoutId changes after animation\n * - layoutId changes mid animation\n */\n }\n }\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node;\n options.onExitComplete && options.onExitComplete();\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete();\n }\n });\n }\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false);\n });\n }\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined;\n }\n }\n}\n\nexport { NodeStack };\n","function buildProjectionTransform(delta, treeScale, latestTransform) {\n let transform = \"\";\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x;\n const yTranslate = delta.y.translate / treeScale.y;\n const zTranslate = latestTransform?.z || 0;\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `;\n }\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;\n }\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform;\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`;\n if (rotate)\n transform += `rotate(${rotate}deg) `;\n if (rotateX)\n transform += `rotateX(${rotateX}deg) `;\n if (rotateY)\n transform += `rotateY(${rotateY}deg) `;\n if (skewX)\n transform += `skewX(${skewX}deg) `;\n if (skewY)\n transform += `skewY(${skewY}deg) `;\n }\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x;\n const elementScaleY = delta.y.scale * treeScale.y;\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`;\n }\n return transform || \"none\";\n}\n\nexport { buildProjectionTransform };\n","import { statsBuffer, isSVGElement, isSVGSVGElement, frame, getValueTransition, cancelFrame, time, frameData, frameSteps, microtask, activeAnimations, motionValue, mixNumber } from 'motion-dom';\nimport { SubscriptionManager, clamp, noop } from 'motion-utils';\nimport { animateSingleValue } from '../../animation/animate/single-value.mjs';\nimport { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';\nimport { FlatTree } from '../../render/utils/flat-tree.mjs';\nimport { delay } from '../../utils/delay.mjs';\nimport { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';\nimport { mixValues } from '../animation/mix-values.mjs';\nimport { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';\nimport { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';\nimport { calcLength, calcRelativePosition, calcRelativeBox, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs';\nimport { removeBoxTransforms } from '../geometry/delta-remove.mjs';\nimport { createBox, createDelta } from '../geometry/models.mjs';\nimport { boxEqualsRounded, isDeltaZero, axisDeltaEquals, aspectRatio, boxEquals } from '../geometry/utils.mjs';\nimport { NodeStack } from '../shared/stack.mjs';\nimport { scaleCorrectors } from '../styles/scale-correction.mjs';\nimport { buildProjectionTransform } from '../styles/transform.mjs';\nimport { eachAxis } from '../utils/each-axis.mjs';\nimport { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';\nimport { globalProjectionState } from './state.mjs';\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n};\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"];\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000;\nlet id = 0;\nfunction resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {\n const { latestValues } = visualElement;\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key];\n visualElement.setStaticValue(key, 0);\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0;\n }\n }\n}\nfunction cancelTreeOptimisedTransformAnimations(projectionNode) {\n projectionNode.hasCheckedOptimisedAppear = true;\n if (projectionNode.root === projectionNode)\n return;\n const { visualElement } = projectionNode.options;\n if (!visualElement)\n return;\n const appearId = getOptimisedAppearId(visualElement);\n if (window.MotionHasOptimisedAnimation(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options;\n window.MotionCancelOptimisedAnimation(appearId, \"transform\", frame, !(layout || layoutId));\n }\n const { parent } = projectionNode;\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent);\n }\n}\nfunction createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {\n return class ProjectionNode {\n constructor(latestValues = {}, parent = defaultParent?.()) {\n /**\n * A unique ID generated for every projection node.\n */\n this.id = id++;\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n this.animationId = 0;\n this.animationCommitId = 0;\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n this.children = new Set();\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n this.options = {};\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n this.isTreeAnimating = false;\n this.isAnimationBlocked = false;\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n this.isLayoutDirty = false;\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n this.isProjectionDirty = false;\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n this.isSharedProjectionDirty = false;\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n this.isTransformDirty = false;\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n this.updateManuallyBlocked = false;\n this.updateBlockedByResize = false;\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n this.isUpdating = false;\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n this.isSVG = false;\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n this.needsReset = false;\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n this.shouldResetTransform = false;\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n this.hasCheckedOptimisedAppear = false;\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n this.treeScale = { x: 1, y: 1 };\n /**\n *\n */\n this.eventHandlers = new Map();\n this.hasTreeAnimated = false;\n // Note: Currently only running on root node\n this.updateScheduled = false;\n this.scheduleUpdate = () => this.update();\n this.projectionUpdateScheduled = false;\n this.checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false;\n this.clearAllSnapshots();\n }\n };\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n this.updateProjection = () => {\n this.projectionUpdateScheduled = false;\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0;\n }\n this.nodes.forEach(propagateDirtyNodes);\n this.nodes.forEach(resolveTargetDelta);\n this.nodes.forEach(calcProjection);\n this.nodes.forEach(cleanDirtyNodes);\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics);\n }\n };\n /**\n * Frame calculations\n */\n this.resolvedRelativeTargetAt = 0.0;\n this.hasProjected = false;\n this.isVisible = true;\n this.animationProgress = 0;\n /**\n * Shared layout\n */\n // TODO Only running on root node\n this.sharedNodes = new Map();\n this.latestValues = latestValues;\n this.root = parent ? parent.root || parent : this;\n this.path = parent ? [...parent.path, parent] : [];\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true;\n }\n if (this.root === this)\n this.nodes = new FlatTree();\n }\n addEventListener(name, handler) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager());\n }\n return this.eventHandlers.get(name).add(handler);\n }\n notifyListeners(name, ...args) {\n const subscriptionManager = this.eventHandlers.get(name);\n subscriptionManager && subscriptionManager.notify(...args);\n }\n hasListeners(name) {\n return this.eventHandlers.has(name);\n }\n /**\n * Lifecycles\n */\n mount(instance) {\n if (this.instance)\n return;\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance);\n this.instance = instance;\n const { layoutId, layout, visualElement } = this.options;\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance);\n }\n this.root.nodes.add(this);\n this.parent && this.parent.children.add(this);\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true;\n }\n if (attachResizeListener) {\n let cancelDelay;\n let innerWidth = 0;\n const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth;\n });\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth;\n if (newInnerWidth === innerWidth)\n return;\n innerWidth = newInnerWidth;\n this.root.updateBlockedByResize = true;\n cancelDelay && cancelDelay();\n cancelDelay = delay(resizeUnblockUpdate, 250);\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false;\n this.nodes.forEach(finishAnimation);\n }\n });\n }\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this);\n }\n // Only register the handler if it requires layout animation\n if (this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)) {\n this.addEventListener(\"didUpdate\", ({ delta, hasLayoutChanged, hasRelativeLayoutChanged, layout: newLayout, }) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined;\n this.relativeTarget = undefined;\n return;\n }\n // TODO: Check here if an animation exists\n const layoutTransition = this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition;\n const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged = !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout);\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeLayoutChanged;\n if (this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom;\n this.resumingFrom.resumingFrom = undefined;\n }\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n };\n if (visualElement.shouldReduceMotion ||\n this.options.layoutRoot) {\n animationOptions.delay = 0;\n animationOptions.type = false;\n }\n this.startAnimation(animationOptions);\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);\n }\n else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never commited to screen and look like a jumpy box.\n */\n if (!hasLayoutChanged) {\n finishAnimation(this);\n }\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete();\n }\n }\n this.targetLayout = newLayout;\n });\n }\n }\n unmount() {\n this.options.layoutId && this.willUpdate();\n this.root.nodes.remove(this);\n const stack = this.getStack();\n stack && stack.remove(this);\n this.parent && this.parent.children.delete(this);\n this.instance = undefined;\n this.eventHandlers.clear();\n cancelFrame(this.updateProjection);\n }\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true;\n }\n unblockUpdate() {\n this.updateManuallyBlocked = false;\n }\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize;\n }\n isTreeAnimationBlocked() {\n return (this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false);\n }\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked())\n return;\n this.isUpdating = true;\n this.nodes && this.nodes.forEach(resetSkewAndRotation);\n this.animationId++;\n }\n getTransformTemplate() {\n const { visualElement } = this.options;\n return visualElement && visualElement.getProps().transformTemplate;\n }\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true;\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete();\n return;\n }\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(this);\n }\n !this.root.isUpdating && this.root.startUpdate();\n if (this.isLayoutDirty)\n return;\n this.isLayoutDirty = true;\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.shouldResetTransform = true;\n node.updateScroll(\"snapshot\");\n if (node.options.layoutRoot) {\n node.willUpdate(false);\n }\n }\n const { layoutId, layout } = this.options;\n if (layoutId === undefined && !layout)\n return;\n const transformTemplate = this.getTransformTemplate();\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n this.updateSnapshot();\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\");\n }\n update() {\n this.updateScheduled = false;\n const updateWasBlocked = this.isUpdateBlocked();\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate();\n this.clearAllSnapshots();\n this.nodes.forEach(clearMeasurements);\n return;\n }\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes.forEach(clearIsLayoutDirty);\n return;\n }\n this.animationCommitId = this.animationId;\n if (!this.isUpdating) {\n this.nodes.forEach(clearIsLayoutDirty);\n }\n else {\n this.isUpdating = false;\n /**\n * Write\n */\n this.nodes.forEach(resetTransformStyle);\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes.forEach(updateLayout);\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes.forEach(notifyLayoutUpdate);\n }\n this.clearAllSnapshots();\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now();\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);\n frameData.timestamp = now;\n frameData.isProcessing = true;\n frameSteps.update.process(frameData);\n frameSteps.preRender.process(frameData);\n frameSteps.render.process(frameData);\n frameData.isProcessing = false;\n }\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true;\n microtask.read(this.scheduleUpdate);\n }\n }\n clearAllSnapshots() {\n this.nodes.forEach(clearSnapshot);\n this.sharedNodes.forEach(removeLeadSnapshots);\n }\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true;\n frame.preRender(this.updateProjection, false, true);\n }\n }\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate();\n }\n else {\n this.root.checkUpdateFailed();\n }\n });\n }\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance)\n return;\n this.snapshot = this.measure();\n if (this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)) {\n this.snapshot = undefined;\n }\n }\n updateLayout() {\n if (!this.instance)\n return;\n this.updateScroll();\n if (!(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty) {\n return;\n }\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n node.updateScroll();\n }\n }\n const prevLayout = this.layout;\n this.layout = this.measure(false);\n this.layoutCorrected = createBox();\n this.isLayoutDirty = false;\n this.projectionDelta = undefined;\n this.notifyListeners(\"measure\", this.layout.layoutBox);\n const { visualElement } = this.options;\n visualElement &&\n visualElement.notify(\"LayoutMeasure\", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);\n }\n updateScroll(phase = \"measure\") {\n let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);\n if (this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase) {\n needsMeasurement = false;\n }\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance);\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n };\n }\n }\n resetTransform() {\n if (!resetTransform)\n return;\n const isResetRequested = this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout;\n const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);\n const transformTemplate = this.getTransformTemplate();\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined;\n const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;\n if (isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)) {\n resetTransform(this.instance, transformTemplateValue);\n this.shouldResetTransform = false;\n this.scheduleRender();\n }\n }\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox();\n let layoutBox = this.removeElementScroll(pageBox);\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox);\n }\n roundBox(layoutBox);\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n };\n }\n measurePageBox() {\n const { visualElement } = this.options;\n if (!visualElement)\n return createBox();\n const box = visualElement.measureViewportBox();\n const wasInScrollRoot = this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot);\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root;\n if (scroll) {\n translateAxis(box.x, scroll.offset.x);\n translateAxis(box.y, scroll.offset.y);\n }\n }\n return box;\n }\n removeElementScroll(box) {\n const boxWithoutScroll = createBox();\n copyBoxInto(boxWithoutScroll, box);\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll;\n }\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n const { scroll, options } = node;\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box);\n }\n translateAxis(boxWithoutScroll.x, scroll.offset.x);\n translateAxis(boxWithoutScroll.y, scroll.offset.y);\n }\n }\n return boxWithoutScroll;\n }\n applyTransform(box, transformOnly = false) {\n const withTransforms = createBox();\n copyBoxInto(withTransforms, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n });\n }\n if (!hasTransform(node.latestValues))\n continue;\n transformBox(withTransforms, node.latestValues);\n }\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues);\n }\n return withTransforms;\n }\n removeTransform(box) {\n const boxWithoutTransform = createBox();\n copyBoxInto(boxWithoutTransform, box);\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i];\n if (!node.instance)\n continue;\n if (!hasTransform(node.latestValues))\n continue;\n hasScale(node.latestValues) && node.updateSnapshot();\n const sourceBox = createBox();\n const nodeBox = node.measurePageBox();\n copyBoxInto(sourceBox, nodeBox);\n removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);\n }\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues);\n }\n return boxWithoutTransform;\n }\n setTargetDelta(delta) {\n this.targetDelta = delta;\n this.root.scheduleUpdateProjection();\n this.isProjectionDirty = true;\n }\n setOptions(options) {\n this.options = {\n ...this.options,\n ...options,\n crossfade: options.crossfade !== undefined ? options.crossfade : true,\n };\n }\n clearMeasurements() {\n this.scroll = undefined;\n this.layout = undefined;\n this.snapshot = undefined;\n this.prevTransformTemplateValue = undefined;\n this.targetDelta = undefined;\n this.target = undefined;\n this.isLayoutDirty = false;\n }\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent)\n return;\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp) {\n this.relativeParent.resolveTargetDelta(true);\n }\n }\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead();\n this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);\n this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);\n this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize);\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId))\n return;\n this.resolvedRelativeTargetAt = frameData.timestamp;\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n relativeParent.layout &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta)\n return;\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox();\n this.targetWithTransforms = createBox();\n }\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target) {\n this.forceRelativeParentToResolveTarget();\n calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n }\n else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox);\n }\n else {\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n applyBoxDelta(this.target, this.targetDelta);\n }\n else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox);\n }\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false;\n const relativeParent = this.getClosestProjectingParent();\n if (relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1) {\n this.relativeParent = relativeParent;\n this.forceRelativeParentToResolveTarget();\n this.relativeTarget = createBox();\n this.relativeTargetOrigin = createBox();\n calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);\n }\n else {\n this.relativeParent = this.relativeTarget = undefined;\n }\n }\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++;\n }\n }\n getClosestProjectingParent() {\n if (!this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)) {\n return undefined;\n }\n if (this.parent.isProjecting()) {\n return this.parent;\n }\n else {\n return this.parent.getClosestProjectingParent();\n }\n }\n isProjecting() {\n return Boolean((this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout);\n }\n calcProjection() {\n const lead = this.getLead();\n const isShared = Boolean(this.resumingFrom) || this !== lead;\n let canSkip = true;\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false;\n }\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)) {\n canSkip = false;\n }\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false;\n }\n if (canSkip)\n return;\n const { layout, layoutId } = this.options;\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation);\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined;\n }\n if (!this.layout || !(layout || layoutId))\n return;\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox);\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x;\n const prevTreeScaleY = this.treeScale.y;\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {\n lead.target = lead.layout.layoutBox;\n lead.targetWithTransforms = createBox();\n }\n const { target } = lead;\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas();\n this.scheduleRender();\n }\n return;\n }\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas();\n }\n else {\n copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x);\n copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y);\n }\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);\n if (this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) ||\n !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) {\n this.hasProjected = true;\n this.scheduleRender();\n this.notifyListeners(\"projectionUpdate\", target);\n }\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++;\n }\n }\n hide() {\n this.isVisible = false;\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true;\n // TODO: Schedule render\n }\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender();\n if (notifyAll) {\n const stack = this.getStack();\n stack && stack.scheduleRender();\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined;\n }\n }\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta();\n this.projectionDelta = createDelta();\n this.projectionDeltaWithTransform = createDelta();\n }\n setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {\n const snapshot = this.snapshot;\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {};\n const mixedValues = { ...this.latestValues };\n const targetDelta = createDelta();\n if (!this.relativeParent ||\n !this.relativeParent.options.layoutRoot) {\n this.relativeTarget = this.relativeTargetOrigin = undefined;\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;\n const relativeLayout = createBox();\n const snapshotSource = snapshot ? snapshot.source : undefined;\n const layoutSource = this.layout ? this.layout.source : undefined;\n const isSharedLayoutAnimation = snapshotSource !== layoutSource;\n const stack = this.getStack();\n const isOnlyMember = !stack || stack.members.length <= 1;\n const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade));\n this.animationProgress = 0;\n let prevRelativeTarget;\n this.mixTargetDelta = (latest) => {\n const progress = latest / 1000;\n mixAxisDelta(targetDelta.x, delta.x, progress);\n mixAxisDelta(targetDelta.y, delta.y, progress);\n this.setTargetDelta(targetDelta);\n if (this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout) {\n calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);\n mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)) {\n this.isProjectionDirty = false;\n }\n if (!prevRelativeTarget)\n prevRelativeTarget = createBox();\n copyBoxInto(prevRelativeTarget, this.relativeTarget);\n }\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues;\n mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);\n }\n this.root.scheduleUpdateProjection();\n this.scheduleRender();\n this.animationProgress = progress;\n };\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);\n }\n startAnimation(options) {\n this.notifyListeners(\"animationStart\");\n this.currentAnimation?.stop();\n this.resumingFrom?.currentAnimation?.stop();\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation);\n this.pendingAnimation = undefined;\n }\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true;\n activeAnimations.layout++;\n this.motionValue || (this.motionValue = motionValue(0));\n this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {\n ...options,\n velocity: 0,\n isSync: true,\n onUpdate: (latest) => {\n this.mixTargetDelta(latest);\n options.onUpdate && options.onUpdate(latest);\n },\n onStop: () => {\n activeAnimations.layout--;\n },\n onComplete: () => {\n activeAnimations.layout--;\n options.onComplete && options.onComplete();\n this.completeAnimation();\n },\n });\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation;\n }\n this.pendingAnimation = undefined;\n });\n }\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined;\n this.resumingFrom.preserveOpacity = undefined;\n }\n const stack = this.getStack();\n stack && stack.exitAnimationComplete();\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined;\n this.notifyListeners(\"animationComplete\");\n }\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget);\n this.currentAnimation.stop();\n }\n this.completeAnimation();\n }\n applyTransformsToTarget() {\n const lead = this.getLead();\n let { targetWithTransforms, target, layout, latestValues } = lead;\n if (!targetWithTransforms || !target || !layout)\n return;\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {\n target = this.target || createBox();\n const xLength = calcLength(this.layout.layoutBox.x);\n target.x.min = lead.target.x.min;\n target.x.max = target.x.min + xLength;\n const yLength = calcLength(this.layout.layoutBox.y);\n target.y.min = lead.target.y.min;\n target.y.max = target.y.min + yLength;\n }\n copyBoxInto(targetWithTransforms, target);\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues);\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);\n }\n registerSharedNode(layoutId, node) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack());\n }\n const stack = this.sharedNodes.get(layoutId);\n stack.add(node);\n const config = node.options.initialPromotionConfig;\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity: config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n });\n }\n isLead() {\n const stack = this.getStack();\n return stack ? stack.lead === this : true;\n }\n getLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.lead || this : this;\n }\n getPrevLead() {\n const { layoutId } = this.options;\n return layoutId ? this.getStack()?.prevLead : undefined;\n }\n getStack() {\n const { layoutId } = this.options;\n if (layoutId)\n return this.root.sharedNodes.get(layoutId);\n }\n promote({ needsReset, transition, preserveFollowOpacity, } = {}) {\n const stack = this.getStack();\n if (stack)\n stack.promote(this, preserveFollowOpacity);\n if (needsReset) {\n this.projectionDelta = undefined;\n this.needsReset = true;\n }\n if (transition)\n this.setOptions({ transition });\n }\n relegate() {\n const stack = this.getStack();\n if (stack) {\n return stack.relegate(this);\n }\n else {\n return false;\n }\n }\n resetSkewAndRotation() {\n const { visualElement } = this.options;\n if (!visualElement)\n return;\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false;\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement;\n if (latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY) {\n hasDistortingTransform = true;\n }\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform)\n return;\n const resetValues = {};\n if (latestValues.z) {\n resetDistortingTransform(\"z\", visualElement, resetValues, this.animationValues);\n }\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(`rotate${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n resetDistortingTransform(`skew${transformAxes[i]}`, visualElement, resetValues, this.animationValues);\n }\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render();\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key]);\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key];\n }\n }\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender();\n }\n applyProjectionStyles(targetStyle, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp) {\n if (!this.instance || this.isSVG)\n return;\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\";\n return;\n }\n const transformTemplate = this.getTransformTemplate();\n if (this.needsReset) {\n this.needsReset = false;\n targetStyle.visibility = \"\";\n targetStyle.opacity = \"\";\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\";\n return;\n }\n const lead = this.getLead();\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1;\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\";\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\";\n this.hasProjected = false;\n }\n return;\n }\n targetStyle.visibility = \"\";\n const valuesToRender = lead.animationValues || lead.latestValues;\n this.applyTransformsToTarget();\n let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform);\n }\n targetStyle.transform = transform;\n const { x, y } = this.projectionDelta;\n targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit;\n }\n else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0;\n }\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined)\n continue;\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key];\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected = transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead);\n if (applyTo) {\n const num = applyTo.length;\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i]] = corrected;\n }\n }\n else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n this.options.visualElement.renderState.vars[key] = corrected;\n }\n else {\n targetStyle[key] = corrected;\n }\n }\n }\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\";\n }\n }\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined;\n }\n // Only run on root\n resetTree() {\n this.root.nodes.forEach((node) => node.currentAnimation?.stop());\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }\n };\n}\nfunction updateLayout(node) {\n node.updateLayout();\n}\nfunction notifyLayoutUpdate(node) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot;\n if (node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;\n const { animationType } = node.options;\n const isShared = snapshot.source !== node.layout.source;\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(axisSnapshot);\n axisSnapshot.min = layout[axis].min;\n axisSnapshot.max = axisSnapshot.min + length;\n });\n }\n else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis];\n const length = calcLength(layout[axis]);\n axisSnapshot.max = axisSnapshot.min + length;\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true;\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length;\n }\n });\n }\n const layoutDelta = createDelta();\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);\n const visualDelta = createDelta();\n if (isShared) {\n calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);\n }\n else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox);\n }\n const hasLayoutChanged = !isDeltaZero(layoutDelta);\n let hasRelativeLayoutChanged = false;\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent();\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox();\n calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);\n const relativeLayout = createBox();\n calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true;\n }\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout;\n node.relativeTargetOrigin = relativeSnapshot;\n node.relativeParent = relativeParent;\n }\n }\n }\n }\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n });\n }\n else if (node.isLead()) {\n const { onExitComplete } = node.options;\n onExitComplete && onExitComplete();\n }\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined;\n}\nfunction propagateDirtyNodes(node) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++;\n }\n if (!node.parent)\n return;\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty;\n }\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty));\n node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);\n}\nfunction cleanDirtyNodes(node) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false;\n}\nfunction clearSnapshot(node) {\n node.clearSnapshot();\n}\nfunction clearMeasurements(node) {\n node.clearMeasurements();\n}\nfunction clearIsLayoutDirty(node) {\n node.isLayoutDirty = false;\n}\nfunction resetTransformStyle(node) {\n const { visualElement } = node.options;\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\");\n }\n node.resetTransform();\n}\nfunction finishAnimation(node) {\n node.finishAnimation();\n node.targetDelta = node.relativeTarget = node.target = undefined;\n node.isProjectionDirty = true;\n}\nfunction resolveTargetDelta(node) {\n node.resolveTargetDelta();\n}\nfunction calcProjection(node) {\n node.calcProjection();\n}\nfunction resetSkewAndRotation(node) {\n node.resetSkewAndRotation();\n}\nfunction removeLeadSnapshots(stack) {\n stack.removeLeadSnapshot();\n}\nfunction mixAxisDelta(output, delta, p) {\n output.translate = mixNumber(delta.translate, 0, p);\n output.scale = mixNumber(delta.scale, 1, p);\n output.origin = delta.origin;\n output.originPoint = delta.originPoint;\n}\nfunction mixAxis(output, from, to, p) {\n output.min = mixNumber(from.min, to.min, p);\n output.max = mixNumber(from.max, to.max, p);\n}\nfunction mixBox(output, from, to, p) {\n mixAxis(output.x, from.x, to.x, p);\n mixAxis(output.y, from.y, to.y, p);\n}\nfunction hasOpacityCrossfade(node) {\n return (node.animationValues && node.animationValues.opacityExit !== undefined);\n}\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n};\nconst userAgentContains = (string) => typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string);\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint = userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop;\nfunction roundAxis(axis) {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min);\n axis.max = roundPoint(axis.max);\n}\nfunction roundBox(box) {\n roundAxis(box.x);\n roundAxis(box.y);\n}\nfunction shouldAnimatePositionOnly(animationType, snapshot, layout) {\n return (animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));\n}\nfunction checkNodeWasScrollRoot(node) {\n return node !== node.root && node.scroll?.wasRoot;\n}\n\nexport { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };\n","import { addDomEvent } from '../../events/add-dom-event.mjs';\nimport { createProjectionNode } from './create-projection-node.mjs';\n\nconst DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (ref, notify) => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body.scrollLeft,\n y: document.documentElement.scrollTop || document.body.scrollTop,\n }),\n checkIsScrollRoot: () => true,\n});\n\nexport { DocumentProjectionNode };\n","import { createProjectionNode } from './create-projection-node.mjs';\nimport { DocumentProjectionNode } from './DocumentProjectionNode.mjs';\n\nconst rootProjectionNode = {\n current: undefined,\n};\nconst HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({});\n documentNode.mount(window);\n documentNode.setOptions({ layoutScroll: true });\n rootProjectionNode.current = documentNode;\n }\n return rootProjectionNode.current;\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\";\n },\n checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n});\n\nexport { HTMLProjectionNode, rootProjectionNode };\n","import { DragGesture } from '../../gestures/drag/index.mjs';\nimport { PanGesture } from '../../gestures/pan/index.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\nimport { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\n\nconst drag = {\n pan: {\n Feature: PanGesture,\n },\n drag: {\n Feature: DragGesture,\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { drag };\n","import { hover, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\nimport { Feature } from '../motion/features/Feature.mjs';\n\nfunction handleHoverEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\");\n }\n const eventName = (\"onHover\" + lifecycle);\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass HoverGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\");\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\");\n });\n }\n unmount() { }\n}\n\nexport { HoverGesture };\n","import { pipe } from 'motion-utils';\nimport { addDomEvent } from '../events/add-dom-event.mjs';\nimport { Feature } from '../motion/features/Feature.mjs';\n\nclass FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n\nexport { FocusGesture };\n","import { press, frame } from 'motion-dom';\nimport { extractEventInfo } from '../events/event-info.mjs';\nimport { Feature } from '../motion/features/Feature.mjs';\n\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nclass PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, { useGlobalTarget: this.node.props.globalTapTarget });\n }\n unmount() { }\n}\n\nexport { PressGesture };\n","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nfunction observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n\nexport { observeIntersection };\n","import { Feature } from '../Feature.mjs';\nimport { observeIntersection } from './observers.mjs';\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nclass InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.unmount();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n return observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() { }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n\nexport { InViewFeature };\n","import { HoverGesture } from '../../gestures/hover.mjs';\nimport { FocusGesture } from '../../gestures/focus.mjs';\nimport { PressGesture } from '../../gestures/press.mjs';\nimport { InViewFeature } from './viewport/index.mjs';\n\nconst gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n\nexport { gestureAnimations };\n","import { HTMLProjectionNode } from '../../projection/node/HTMLProjectionNode.mjs';\nimport { MeasureLayout } from './layout/MeasureLayout.mjs';\n\nconst layout = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n};\n\nexport { layout };\n","import { animations } from '../../../motion/features/animations.mjs';\nimport { drag } from '../../../motion/features/drag.mjs';\nimport { gestureAnimations } from '../../../motion/features/gestures.mjs';\nimport { layout } from '../../../motion/features/layout.mjs';\n\nconst featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n};\n\nexport { featureBundle };\n","import { createDomVisualElement } from '../../dom/create-visual-element.mjs';\nimport { createMotionProxy } from '../create-proxy.mjs';\nimport { featureBundle } from './feature-bundle.mjs';\n\nconst motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement);\n\nexport { motion };\n","import type React from \"react\"\n/**\n * @fileoverview Type definitions for MobileBottomNav component\n * @module MobileBottomNav/types\n * @version 1.0.0\n */\n\nimport type { ReactNode, HTMLAttributes, ComponentPropsWithoutRef } from \"react\"\n\n\n/**\n * Visual variant of the navigation bar\n * @enum {string}\n * @description Defines the visual style of the bottom navigation\n */\nexport enum NavVariant {\n /** Glassmorphism effect with blur and transparency */\n GLASS = \"glass\",\n /** Solid background without transparency */\n SOLID = \"solid\",\n /** Transparent background - headless mode for custom styling */\n HEADLESS = \"headless\",\n}\n\n/**\n * Size preset for the navigation bar\n * @enum {string}\n * @description Controls the overall size and spacing of navigation elements\n */\nexport enum NavSize {\n /** Compact size - 56px height, smaller touch targets */\n SMALL = \"sm\",\n /** Default size - 72px height, optimal touch targets */\n MEDIUM = \"md\",\n /** Large size - 88px height, larger touch targets */\n LARGE = \"lg\",\n}\n\n/**\n * Position of the label relative to the icon\n * @enum {string}\n * @description Determines how labels are displayed in navigation items\n */\nexport enum LabelPosition {\n /** Label below the icon (default mobile pattern) */\n BELOW = \"below\",\n /** Label beside the icon (horizontal layout) */\n BESIDE = \"beside\",\n /** No label, icon only */\n HIDDEN = \"hidden\",\n}\n\n/**\n * Animation type for navigation interactions\n * @enum {string}\n * @description Defines the animation behavior for navigation items\n */\nexport enum AnimationType {\n /** Spring animation for natural feel */\n SPRING = \"spring\",\n /** Tween animation for precise timing */\n TWEEN = \"tween\",\n /** No animation */\n NONE = \"none\",\n}\n\n/**\n * State of a navigation item\n * @enum {string}\n * @description Represents the current state of a navigation item\n */\nexport enum NavItemState {\n /** Default inactive state */\n INACTIVE = \"inactive\",\n /** Currently selected/active item */\n ACTIVE = \"active\",\n /** Disabled and non-interactive */\n DISABLED = \"disabled\",\n}\n\n/**\n * Icon size preset\n * @enum {number}\n * @description Standard icon sizes in pixels\n */\nexport enum IconSize {\n /** Small icons - 18px */\n SMALL = 18,\n /** Medium icons - 24px (default) */\n MEDIUM = 24,\n /** Large icons - 28px */\n LARGE = 28,\n}\n\n/**\n * Z-index levels for layering\n * @enum {number}\n * @description Consistent z-index values for proper stacking\n */\nexport enum ZIndexLevel {\n /** Below default content */\n BELOW = 40,\n /** Default navigation level */\n DEFAULT = 50,\n /** Above most content */\n ELEVATED = 60,\n /** Maximum elevation */\n MAX = 100,\n}\n\n/**\n * Blur intensity for glassmorphism\n * @enum {number}\n * @description Backdrop blur values in pixels\n */\nexport enum BlurIntensity {\n /** Subtle blur - 8px */\n LIGHT = 8,\n /** Standard blur - 20px (default) */\n MEDIUM = 20,\n /** Heavy blur - 40px */\n HEAVY = 40,\n}\n\n/**\n * Border radius preset for navigation\n * @enum {string}\n * @description Defines the border radius style\n */\nexport enum NavBorderRadius {\n /** No border radius */\n NONE = \"none\",\n /** Small radius - 8px */\n SMALL = \"sm\",\n /** Medium radius - 16px (default) */\n MEDIUM = \"md\",\n /** Large radius - 24px */\n LARGE = \"lg\",\n /** Extra large radius - 32px */\n EXTRA_LARGE = \"xl\",\n /** Full rounded (pill shape) */\n FULL = \"full\",\n}\n\n/**\n * Gap spacing preset for items\n * @enum {number}\n * @description Standard gap values in rem units\n */\nexport enum NavGap {\n /** No gap */\n NONE = 0,\n /** Extra small - 0.25rem (4px) */\n EXTRA_SMALL = 0.25,\n /** Small - 0.5rem (8px) */\n SMALL = 0.5,\n /** Medium - 1rem (16px) */\n MEDIUM = 1,\n /** Large - 1.5rem (24px) */\n LARGE = 1.5,\n /** Extra large - 2rem (32px) */\n EXTRA_LARGE = 2,\n}\n\n/* ============================================\n Animation Configuration Types\n ============================================ */\n\n/**\n * Spring animation configuration\n * @interface SpringConfig\n * @description Configuration for spring-based animations\n */\nexport interface SpringConfig {\n /** Spring stiffness (default: 400) */\n stiffness: number\n /** Damping ratio (default: 30) */\n damping: number\n /** Mass of the animated element (default: 1) */\n mass: number\n}\n\n/**\n * Tween animation configuration\n * @interface TweenConfig\n * @description Configuration for tween-based animations\n */\nexport interface TweenConfig {\n /** Duration in seconds */\n duration: number\n /** Easing function name */\n ease: \"linear\" | \"easeIn\" | \"easeOut\" | \"easeInOut\"\n}\n\n/**\n * Animation configuration union type\n * @interface AnimationConfig\n * @description Complete animation configuration options\n */\nexport interface AnimationConfig {\n /** Type of animation to use */\n type: AnimationType\n /** Spring configuration (when type is SPRING) */\n spring?: SpringConfig\n /** Tween configuration (when type is TWEEN) */\n tween?: TweenConfig\n /** Scale factor for press animation */\n pressScale?: number\n /** Scale factor for hover animation */\n hoverScale?: number\n}\n\n/* ============================================\n Glassmorphism Configuration\n ============================================ */\n\n/**\n * Glassmorphism style configuration\n * @interface GlassConfig\n * @description Configuration for glassmorphism visual effects\n */\nexport interface GlassConfig {\n /** Blur intensity in pixels */\n blur: BlurIntensity | number\n /** Saturation percentage (100-200) */\n saturation: number\n /** Background opacity (0-1) */\n opacity: number\n /** Border opacity (0-1) */\n borderOpacity: number\n}\n\n/* ============================================\n Component Props Interfaces\n ============================================ */\n\n/**\n * Base props shared by all MobileBottomNav components\n * @interface BaseNavProps\n * @description Common properties for navigation components\n */\nexport interface BaseNavProps {\n /** Additional CSS classes */\n className?: string\n /** Inline styles */\n style?: React.CSSProperties\n /** Test ID for testing */\n \"data-testid\"?: string\n}\n\n/**\n * Motion-specific props for components using Framer Motion\n * @interface MotionProps\n * @description Props that are specific to Framer Motion components\n */\nexport interface MotionProps {\n onDrag?: (event: MouseEvent | TouchEvent | PointerEvent, info: any) => void\n onDragStart?: (event: MouseEvent | TouchEvent | PointerEvent, info: any) => void\n onDragEnd?: (event: MouseEvent | TouchEvent | PointerEvent, info: any) => void\n drag?: boolean | \"x\" | \"y\"\n dragConstraints?: any\n dragMomentum?: boolean\n dragElastic?: boolean\n dragPropagation?: boolean\n dragTransition?: any\n whileTap?: any\n whileHover?: any\n animate?: any\n initial?: any\n exit?: any\n transition?: any\n}\n\n/**\n * Root component props\n * @interface RootProps\n * @description Properties for the MobileBottomNav.Root component\n */\nexport interface RootProps extends BaseNavProps, Omit<HTMLAttributes<HTMLElement>, \"className\" | \"style\" | keyof MotionProps> {\n /** Child components (NavList, custom content) */\n children: ReactNode\n /** Visual variant of the navigation */\n variant?: NavVariant\n /** Size preset */\n size?: NavSize\n /** Z-index level */\n zIndex?: ZIndexLevel | number\n /** Show/hide the navigation */\n visible?: boolean\n /** Glassmorphism configuration (only for GLASS variant) */\n glassConfig?: Partial<GlassConfig>\n /** Animation configuration */\n animationConfig?: Partial<AnimationConfig>\n /** ARIA label for accessibility */\n \"aria-label\"?: string\n /** Use full width container (adds max-width and centers) */\n full?: boolean\n /** Border radius preset or custom value */\n rounded?: NavBorderRadius | number\n /** Gap between nav items (uses NavGap enum or custom rem value) */\n gap?: NavGap | number\n}\n\n/**\n * Props for the NavList component\n * @interface NavListProps\n * @extends {BaseNavProps}\n * @description Configuration for the navigation items container\n */\nexport interface NavListProps extends BaseNavProps, Omit<ComponentPropsWithoutRef<\"ul\">, \"className\" | \"style\"> {\n /** NavItem children */\n children: ReactNode\n /** Gap between items (in rem or px) */\n gap?: number\n /** Justify content alignment */\n justify?: \"start\" | \"center\" | \"end\" | \"around\" | \"between\" | \"evenly\"\n}\n\n/**\n * Props for the NavItem component\n * @interface NavItemProps\n * @extends {BaseNavProps}\n * @extends {Omit<ComponentPropsWithoutRef<\"button\">, \"className\" | \"style\" | \"children\">}\n * @description Configuration for individual navigation items\n */\nexport interface NavItemProps\n extends BaseNavProps,\n Omit<ComponentPropsWithoutRef<\"button\">, \"className\" | \"style\" | \"children\"> {\n /** Icon element to display */\n icon: ReactNode\n /** Label text */\n label: string\n /** Current state of the item */\n state?: NavItemState\n /** Label position relative to icon */\n labelPosition?: LabelPosition\n /** Click handler */\n onClick?: () => void\n /** Href for navigation (renders as anchor) */\n href?: string\n /** Icon size */\n iconSize?: IconSize | number\n /** Show badge indicator */\n badge?: ReactNode\n /** Accessible name override */\n \"aria-label\"?: string\n}\n\n/* ============================================\n Context Types\n ============================================ */\n\n/**\n * Navigation context value\n * @interface NavContextValue\n * @description Shared context for navigation components\n */\nexport interface NavContextValue {\n /** Current variant */\n variant: NavVariant\n /** Current size */\n size: NavSize\n /** Animation configuration */\n animationConfig: AnimationConfig\n /** Gap between items (inherited from Root) */\n gap?: NavGap | number\n /** Currently active item ID */\n activeItemId?: string\n /** Callback to set active item */\n setActiveItem?: (id: string) => void\n}\n\n/* ============================================\n Default Values\n ============================================ */\n\n/**\n * Default spring animation configuration\n * @constant\n */\nexport const DEFAULT_SPRING_CONFIG: SpringConfig = {\n stiffness: 400,\n damping: 30,\n mass: 1,\n}\n\n/**\n * Default tween animation configuration\n * @constant\n */\nexport const DEFAULT_TWEEN_CONFIG: TweenConfig = {\n duration: 0.2,\n ease: \"easeOut\",\n}\n\n/**\n * Default animation configuration\n * @constant\n */\nexport const DEFAULT_ANIMATION_CONFIG: AnimationConfig = {\n type: AnimationType.SPRING,\n spring: DEFAULT_SPRING_CONFIG,\n pressScale: 0.95,\n hoverScale: 1.05,\n}\n\n/**\n * Default glassmorphism configuration\n * @constant\n */\nexport const DEFAULT_GLASS_CONFIG: GlassConfig = {\n blur: BlurIntensity.MEDIUM,\n saturation: 180,\n opacity: 0.72,\n borderOpacity: 0.18,\n}\n\n/* ============================================\n Utility Types\n ============================================ */\n\n/**\n * Extract the value type from an enum\n * @template T - Enum type\n */\nexport type EnumValue<T> = T[keyof T]\n\n/**\n * Make specific keys optional\n * @template T - Base type\n * @template K - Keys to make optional\n */\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>\n","/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","/**\n * @fileoverview CVA style variants for MobileBottomNav component\n * @description Headless-friendly style system using class-variance-authority\n * @module MobileBottomNav/styles\n * @version 1.0.0\n */\n\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { NavVariant, NavSize, NavItemState, LabelPosition, IconSize } from \"./types\"\n\n/* ============================================\n Root Container Variants\n ============================================ */\n\n/**\n * Root container styles with variant support\n * @description Styles for the main navigation wrapper\n */\nexport const rootVariants = cva(\n [\n // Base positioning\n \"fixed bottom-0 left-0 right-0\",\n // Safe area padding (handled by CSS custom properties)\n \"pb-[env(safe-area-inset-bottom,0px)]\",\n \"pl-[env(safe-area-inset-left,0px)]\",\n \"pr-[env(safe-area-inset-right,0px)]\",\n // Hardware acceleration\n \"transform-gpu\",\n // Base transition\n \"transition-transform duration-300 ease-out\",\n ],\n {\n variants: {\n /**\n * Visual variant of the navigation\n */\n variant: {\n [NavVariant.GLASS]: [\n // Glassmorphism effect\n \"bg-white/[0.72] dark:bg-black/[0.72]\",\n \"backdrop-blur-xl backdrop-saturate-[180%]\",\n \"border-t border-white/[0.18] dark:border-white/[0.08]\",\n // Subtle shadow\n \"shadow-[0_-1px_3px_rgba(0,0,0,0.05)]\",\n ],\n [NavVariant.SOLID]: [\n // Solid background\n \"bg-background\",\n \"border-t border-border\",\n // More prominent shadow\n \"shadow-[0_-2px_10px_rgba(0,0,0,0.1)]\",\n ],\n [NavVariant.HEADLESS]: [\n // No default styles - fully customizable\n \"\",\n ],\n },\n /**\n * Size preset affecting height\n */\n size: {\n [NavSize.SMALL]: \"\",\n [NavSize.MEDIUM]: \"\",\n [NavSize.LARGE]: \"\",\n },\n /**\n * Visibility state\n */\n visible: {\n true: \"translate-y-0\",\n false: \"translate-y-full\",\n },\n /**\n * Full width with container and centering\n */\n full: {\n true: \"mx-auto max-w-screen-sm\",\n false: \"\",\n },\n /**\n * Border radius preset\n */\n rounded: {\n none: \"rounded-none\",\n sm: \"rounded-t-lg\",\n md: \"rounded-t-2xl\",\n lg: \"rounded-t-3xl\",\n xl: \"rounded-t-[2rem]\",\n full: \"rounded-t-full\",\n },\n },\n defaultVariants: {\n variant: NavVariant.GLASS,\n size: NavSize.MEDIUM,\n visible: true,\n full: false,\n rounded: \"none\",\n },\n },\n)\n\n/**\n * Extract variant props type for Root\n */\nexport type RootVariantProps = VariantProps<typeof rootVariants>\n\n/* ============================================\n Navigation List Variants\n ============================================ */\n\n/**\n * Navigation list styles\n * @description Styles for the ul element containing nav items\n */\nexport const navListVariants = cva(\n [\n // Flexbox layout\n \"flex items-center\",\n // Full width\n \"w-full\",\n // Reset list styles\n \"list-none m-0 p-0\",\n ],\n {\n variants: {\n /**\n * Size affecting padding and height\n */\n size: {\n [NavSize.SMALL]: \"h-14 px-2 py-1\",\n [NavSize.MEDIUM]: \"h-[4.5rem] px-4 py-2\",\n [NavSize.LARGE]: \"h-22 px-6 py-3\",\n },\n /**\n * Justify content alignment\n */\n justify: {\n start: \"justify-start\",\n center: \"justify-center\",\n end: \"justify-end\",\n around: \"justify-around\",\n between: \"justify-between\",\n evenly: \"justify-evenly\",\n },\n },\n defaultVariants: {\n size: NavSize.MEDIUM,\n justify: \"around\",\n },\n },\n)\n\n/**\n * Extract variant props type for NavList\n */\nexport type NavListVariantProps = VariantProps<typeof navListVariants>\n\n/* ============================================\n Navigation Item Variants\n ============================================ */\n\n/**\n * Navigation item styles\n * @description Styles for individual navigation buttons/links\n */\nexport const navItemVariants = cva(\n [\n // Flexbox centering\n \"flex items-center justify-center\",\n // Touch target minimum\n \"min-w-[44px] min-h-[44px]\",\n // Base padding\n \"px-3 py-2\",\n // Reset button styles\n \"bg-transparent border-none cursor-pointer\",\n \"no-underline\",\n // Typography\n \"text-[0.625rem] leading-none font-medium\",\n // Prevent text selection\n \"select-none\",\n // Remove tap highlight\n \"[-webkit-tap-highlight-color:transparent]\",\n // Touch action\n \"touch-manipulation\",\n // Transition\n \"transition-colors duration-200 ease-out\",\n // Focus styles\n \"focus-visible:outline-2 focus-visible:outline-current focus-visible:outline-offset-2 focus-visible:rounded-lg\",\n // Rounded for touch\n \"rounded-xl\",\n ],\n {\n variants: {\n /**\n * Current state of the item\n */\n state: {\n [NavItemState.INACTIVE]: [\"text-muted-foreground\", \"hover:text-foreground\", \"hover:bg-accent/50\"],\n [NavItemState.ACTIVE]: [\"text-primary\", \"bg-primary/10\"],\n [NavItemState.DISABLED]: [\"text-muted-foreground/50\", \"cursor-not-allowed\", \"pointer-events-none\"],\n },\n /**\n * Label position relative to icon\n */\n labelPosition: {\n [LabelPosition.BELOW]: \"flex-col gap-1\",\n [LabelPosition.BESIDE]: \"flex-row gap-2\",\n [LabelPosition.HIDDEN]: \"\",\n },\n /**\n * Size preset\n */\n size: {\n [NavSize.SMALL]: \"px-2 py-1.5\",\n [NavSize.MEDIUM]: \"px-3 py-2\",\n [NavSize.LARGE]: \"px-4 py-3\",\n },\n },\n defaultVariants: {\n state: NavItemState.INACTIVE,\n labelPosition: LabelPosition.BELOW,\n size: NavSize.MEDIUM,\n },\n },\n)\n\n/**\n * Extract variant props type for NavItem\n */\nexport type NavItemVariantProps = VariantProps<typeof navItemVariants>\n\n/* ============================================\n Icon Container Variants\n ============================================ */\n\n/**\n * Icon container styles\n * @description Styles for the icon wrapper\n */\nexport const iconVariants = cva([\"flex items-center justify-center\", \"relative\"], {\n variants: {\n /**\n * Icon size\n */\n size: {\n [IconSize.SMALL]: \"w-[18px] h-[18px]\",\n [IconSize.MEDIUM]: \"w-6 h-6\",\n [IconSize.LARGE]: \"w-7 h-7\",\n },\n },\n defaultVariants: {\n size: IconSize.MEDIUM,\n },\n})\n\n/**\n * Extract variant props type for Icon\n */\nexport type IconVariantProps = VariantProps<typeof iconVariants>\n\n/* ============================================\n Label Variants\n ============================================ */\n\n/**\n * Label text styles\n * @description Styles for the navigation item label\n */\nexport const labelVariants = cva([\"font-medium\", \"whitespace-nowrap overflow-hidden text-ellipsis\", \"max-w-16\"], {\n variants: {\n /**\n * Label visibility\n */\n position: {\n [LabelPosition.BELOW]: \"text-[0.625rem]\",\n [LabelPosition.BESIDE]: \"text-xs\",\n [LabelPosition.HIDDEN]: \"sr-only\",\n },\n /**\n * Size preset\n */\n size: {\n [NavSize.SMALL]: \"text-[0.5625rem]\",\n [NavSize.MEDIUM]: \"text-[0.625rem]\",\n [NavSize.LARGE]: \"text-xs\",\n },\n },\n defaultVariants: {\n position: LabelPosition.BELOW,\n size: NavSize.MEDIUM,\n },\n})\n\n/**\n * Extract variant props type for Label\n */\nexport type LabelVariantProps = VariantProps<typeof labelVariants>\n\n/* ============================================\n Badge Variants\n ============================================ */\n\n/**\n * Badge indicator styles\n * @description Styles for notification badges on nav items\n */\nexport const badgeVariants = cva(\n [\n \"absolute\",\n \"flex items-center justify-center\",\n \"rounded-full\",\n \"font-bold\",\n \"bg-destructive text-destructive-foreground\",\n \"border-2 border-background\",\n ],\n {\n variants: {\n /**\n * Badge type\n */\n type: {\n dot: \"w-2.5 h-2.5 -top-0.5 -right-0.5\",\n count: \"min-w-[1.125rem] h-[1.125rem] px-1 -top-1 -right-1.5 text-[0.625rem]\",\n },\n },\n defaultVariants: {\n type: \"dot\",\n },\n },\n)\n\n/**\n * Extract variant props type for Badge\n */\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n\n/* ============================================\n Spacer Utility\n ============================================ */\n\n/**\n * Spacer styles to prevent content from going under navigation\n * @description Used as a placeholder element below main content\n */\nexport const spacerVariants = cva([\"w-full\", \"pb-[env(safe-area-inset-bottom,0px)]\"], {\n variants: {\n /**\n * Size matching navigation height\n */\n size: {\n [NavSize.SMALL]: \"h-14\",\n [NavSize.MEDIUM]: \"h-[4.5rem]\",\n [NavSize.LARGE]: \"h-22\",\n },\n },\n defaultVariants: {\n size: NavSize.MEDIUM,\n },\n})\n\n/**\n * Extract variant props type for Spacer\n */\nexport type SpacerVariantProps = VariantProps<typeof spacerVariants>\n","\"use client\"\n\nimport type React from \"react\"\n\n/**\n * @fileoverview iOS Safari detection and fix hooks\n * @description Handles iOS 26 Safari viewport bugs with fixed positioning\n * @module MobileBottomNav/useIOSSafariFix\n * @version 1.0.0\n *\n * Known iOS 26 Safari Bugs (December 2025):\n * - Fixed elements shift when address bar shrinks/expands\n * - visualViewport.offsetTop doesn't reset after keyboard dismissal\n * - 100dvh creates gaps at bottom for overlays\n * - position: fixed breaks after keyboard interaction\n *\n * This hook provides workarounds for these issues.\n */\n\nimport { useEffect, useRef, useCallback } from \"react\"\n\n/**\n * iOS version detection result\n * @interface IOSVersion\n */\ninterface IOSVersion {\n /** Whether the device is running iOS */\n isIOS: boolean\n /** Whether the browser is Safari */\n isSafari: boolean\n /** Major iOS version number (e.g., 26 for iOS 26) */\n majorVersion: number | null\n /** Minor iOS version number */\n minorVersion: number | null\n /** Whether this is iOS 26 or later with known bugs */\n hasViewportBugs: boolean\n}\n\n/**\n * Detects iOS version and Safari browser\n * @returns {IOSVersion} iOS detection result\n */\nexport function detectIOSVersion(): IOSVersion {\n if (typeof window === \"undefined\" || typeof navigator === \"undefined\") {\n return {\n isIOS: false,\n isSafari: false,\n majorVersion: null,\n minorVersion: null,\n hasViewportBugs: false,\n }\n }\n\n const ua = navigator.userAgent\n const isIOS = /iPad|iPhone|iPod/.test(ua) || (navigator.platform === \"MacIntel\" && navigator.maxTouchPoints > 1)\n const isSafari = /Safari/.test(ua) && !/Chrome|CriOS|FxiOS|EdgiOS/.test(ua)\n\n let majorVersion: number | null = null\n let minorVersion: number | null = null\n\n // Extract iOS version from user agent\n const versionMatch = ua.match(/OS (\\d+)_(\\d+)/)\n if (versionMatch) {\n majorVersion = Number.parseInt(versionMatch[1], 10)\n minorVersion = Number.parseInt(versionMatch[2], 10)\n }\n\n // iOS 26 (which would be shown as version 26.x) has known viewport bugs\n // Note: iOS versions might appear as 18.x in some contexts due to marketing vs. internal versioning\n const hasViewportBugs = isIOS && majorVersion !== null && majorVersion >= 18\n\n return {\n isIOS,\n isSafari,\n majorVersion,\n minorVersion,\n hasViewportBugs,\n }\n}\n\n/**\n * Configuration for iOS Safari fix\n * @interface IOSSafariFixConfig\n */\nexport interface IOSSafariFixConfig {\n /** Enable scroll-based body fix (moves scroll from window to body) */\n enableScrollFix?: boolean\n /** Enable keyboard visibility detection */\n enableKeyboardFix?: boolean\n /** Callback when keyboard visibility changes */\n onKeyboardVisibilityChange?: (visible: boolean) => void\n /** Enable debug logging */\n debug?: boolean\n}\n\n/**\n * Hook to apply iOS Safari viewport bug fixes\n *\n * @param {IOSSafariFixConfig} config - Configuration options\n * @returns {{ isKeyboardVisible: boolean; iosInfo: IOSVersion }} Hook state\n *\n * @example\n * ```tsx\n * const { isKeyboardVisible, iosInfo } = useIOSSafariFix({\n * enableScrollFix: true,\n * enableKeyboardFix: true,\n * onKeyboardVisibilityChange: (visible) => console.log('Keyboard:', visible)\n * });\n * ```\n */\nexport function useIOSSafariFix(config: IOSSafariFixConfig = {}) {\n const { enableScrollFix = true, enableKeyboardFix = true, onKeyboardVisibilityChange, debug = false } = config\n\n const iosInfoRef = useRef<IOSVersion>(detectIOSVersion())\n const isKeyboardVisibleRef = useRef(false)\n const initialViewportHeightRef = useRef<number | null>(null)\n\n const log = useCallback(\n (message: string, ...args: unknown[]) => {\n if (debug) {\n console.log(`[iOS Safari Fix] ${message}`, ...args)\n }\n },\n [debug],\n )\n\n // Apply scroll fix for iOS 26\n useEffect(() => {\n const iosInfo = iosInfoRef.current\n\n if (!iosInfo.hasViewportBugs || !enableScrollFix) {\n return\n }\n\n log(\"Applying iOS Safari scroll fix\")\n\n // Add class to enable CSS workarounds\n document.documentElement.classList.add(\"ios-safari-fix\")\n\n if (iosInfo.majorVersion !== null && iosInfo.majorVersion >= 18) {\n document.documentElement.classList.add(\"ios-26-fix\")\n }\n\n return () => {\n document.documentElement.classList.remove(\"ios-safari-fix\", \"ios-26-fix\")\n }\n }, [enableScrollFix, log])\n\n // Keyboard visibility detection\n useEffect(() => {\n const iosInfo = iosInfoRef.current\n\n if (!iosInfo.isIOS || !enableKeyboardFix) {\n return\n }\n\n // Store initial viewport height\n if (typeof window !== \"undefined\" && window.visualViewport) {\n initialViewportHeightRef.current = window.visualViewport.height\n }\n\n const handleViewportResize = () => {\n if (!window.visualViewport || initialViewportHeightRef.current === null) {\n return\n }\n\n const currentHeight = window.visualViewport.height\n const heightDifference = initialViewportHeightRef.current - currentHeight\n\n // If viewport shrunk by more than 150px, keyboard is likely visible\n const keyboardVisible = heightDifference > 150\n\n if (keyboardVisible !== isKeyboardVisibleRef.current) {\n isKeyboardVisibleRef.current = keyboardVisible\n\n log(\"Keyboard visibility changed:\", keyboardVisible)\n\n if (keyboardVisible) {\n document.documentElement.classList.add(\"keyboard-visible\")\n document.documentElement.classList.remove(\"keyboard-dismissed\")\n } else {\n document.documentElement.classList.remove(\"keyboard-visible\")\n document.documentElement.classList.add(\"keyboard-dismissed\")\n\n // Remove the dismissed class after animation completes\n setTimeout(() => {\n document.documentElement.classList.remove(\"keyboard-dismissed\")\n }, 100)\n\n // iOS 26 fix: Force layout recalculation after keyboard dismissal\n if (iosInfo.hasViewportBugs) {\n requestAnimationFrame(() => {\n // Force a reflow to reset fixed positioning\n document.body.style.display = \"none\"\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n document.body.offsetHeight // Trigger reflow\n document.body.style.display = \"\"\n })\n }\n }\n\n onKeyboardVisibilityChange?.(keyboardVisible)\n }\n }\n\n const handleFocusIn = (e: FocusEvent) => {\n const target = e.target as HTMLElement\n if (target.tagName === \"INPUT\" || target.tagName === \"TEXTAREA\" || target.isContentEditable) {\n log(\"Input focused, preparing for keyboard\")\n }\n }\n\n const handleFocusOut = () => {\n // Give time for visualViewport to update\n setTimeout(() => {\n if (window.visualViewport && initialViewportHeightRef.current) {\n const heightDiff = initialViewportHeightRef.current - window.visualViewport.height\n if (heightDiff < 50) {\n // Keyboard is likely hidden, trigger fix\n if (iosInfoRef.current.hasViewportBugs) {\n log(\"Focus out detected, applying iOS 26 fix\")\n document.documentElement.classList.add(\"keyboard-dismissed\")\n setTimeout(() => {\n document.documentElement.classList.remove(\"keyboard-dismissed\")\n }, 100)\n }\n }\n }\n }, 100)\n }\n\n window.visualViewport?.addEventListener(\"resize\", handleViewportResize)\n document.addEventListener(\"focusin\", handleFocusIn)\n document.addEventListener(\"focusout\", handleFocusOut)\n\n return () => {\n window.visualViewport?.removeEventListener(\"resize\", handleViewportResize)\n document.removeEventListener(\"focusin\", handleFocusIn)\n document.removeEventListener(\"focusout\", handleFocusOut)\n document.documentElement.classList.remove(\"keyboard-visible\", \"keyboard-dismissed\")\n }\n }, [enableKeyboardFix, onKeyboardVisibilityChange, log])\n\n return {\n isKeyboardVisible: isKeyboardVisibleRef.current,\n iosInfo: iosInfoRef.current,\n }\n}\n\n/**\n * Hook to force reset fixed element positioning after iOS viewport bugs\n *\n * @param {React.RefObject<HTMLElement>} elementRef - Ref to the fixed element\n * @returns {{ forceReset: () => void }} Reset function\n *\n * @example\n * ```tsx\n * const navRef = useRef<HTMLElement>(null);\n * const { forceReset } = useIOSFixedReset(navRef);\n *\n * // Call forceReset() after keyboard dismissal or scroll issues\n * ```\n */\nexport function useIOSFixedReset(elementRef: React.RefObject<HTMLElement | null>) {\n const forceReset = useCallback(() => {\n const element = elementRef.current\n if (!element) return\n\n // Force GPU layer reset\n element.style.transform = \"translateZ(0) translateY(0.01px)\"\n\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n if (element) {\n element.style.transform = \"translateZ(0)\"\n }\n })\n })\n }, [elementRef])\n\n return { forceReset }\n}\n\nexport default useIOSSafariFix\n","\"use client\"\n\n/**\n * @fileoverview MobileBottomNav component with slot architecture\n * @description A composable bottom navigation component optimized for mobile devices\n * @module MobileBottomNav\n * @version 2.0.0 - iOS 26 compatibility update\n */\n\nimport * as React from \"react\"\nimport { motion, AnimatePresence } from \"motion/react\"\nimport { cn } from \"@/lib/utils\"\nimport {\n type RootProps,\n type NavListProps,\n type NavItemProps,\n type NavContextValue,\n NavVariant,\n NavSize,\n NavItemState,\n LabelPosition,\n IconSize,\n ZIndexLevel,\n NavBorderRadius,\n DEFAULT_ANIMATION_CONFIG,\n DEFAULT_GLASS_CONFIG,\n AnimationType,\n} from \"./types\"\nimport {\n rootVariants,\n navListVariants,\n navItemVariants,\n iconVariants,\n labelVariants,\n badgeVariants,\n spacerVariants,\n} from \"./MobileBottomNav.styles\"\nimport { useIOSSafariFix, useIOSFixedReset } from \"./useIOSSafariFix\"\nimport \"./MobileOptimizations.css\"\n\n/* ============================================\n Context\n ============================================ */\n\n/**\n * Navigation context for sharing configuration across components\n */\nconst NavContext = React.createContext<NavContextValue | null>(null)\n\n/**\n * Hook to access navigation context\n * @throws {Error} When used outside of MobileBottomNav.Root\n * @returns {NavContextValue} Navigation context value\n */\nfunction useNavContext(): NavContextValue {\n const context = React.useContext(NavContext)\n if (!context) {\n throw new Error(\"MobileBottomNav compound components must be used within MobileBottomNav.Root\")\n }\n return context\n}\n\n/* ============================================\n Root Component\n ============================================ */\n\n/**\n * Root container for the mobile bottom navigation\n *\n * @component\n * @example\n * \\`\\`\\`tsx\n * <MobileBottomNav.Root variant={NavVariant.GLASS} size={NavSize.MEDIUM}>\n * <MobileBottomNav.NavList>\n * {children}\n * </MobileBottomNav.NavList>\n * </MobileBottomNav.Root>\n * \\`\\`\\`\n *\n * @param {RootProps} props - Component props\n * @returns {React.ReactElement} Navigation root element\n */\nconst Root = React.forwardRef<HTMLElement, RootProps>(\n (\n {\n children,\n className,\n style,\n variant = NavVariant.GLASS,\n size = NavSize.MEDIUM,\n zIndex = ZIndexLevel.DEFAULT,\n visible = true,\n glassConfig = DEFAULT_GLASS_CONFIG,\n animationConfig = DEFAULT_ANIMATION_CONFIG,\n full = false,\n rounded = NavBorderRadius.NONE,\n gap,\n \"aria-label\": ariaLabel = \"Main navigation\",\n \"data-testid\": testId,\n ...props\n },\n ref,\n ) => {\n const internalRef = React.useRef<HTMLElement>(null)\n const combinedRef = (ref as React.RefObject<HTMLElement>) || internalRef\n\n const { iosInfo } = useIOSSafariFix({\n enableScrollFix: true,\n enableKeyboardFix: true,\n })\n\n const { forceReset } = useIOSFixedReset(combinedRef)\n\n React.useEffect(() => {\n if (visible && iosInfo.hasViewportBugs) {\n // Delay to ensure DOM is ready\n const timer = setTimeout(forceReset, 50)\n return () => clearTimeout(timer)\n }\n }, [visible, iosInfo.hasViewportBugs, forceReset])\n\n const contextValue = React.useMemo<NavContextValue>(\n () => ({\n variant,\n size,\n animationConfig: { ...DEFAULT_ANIMATION_CONFIG, ...animationConfig },\n gap,\n }),\n [variant, size, animationConfig, gap],\n )\n\n const customGlassStyles =\n variant === NavVariant.GLASS\n ? {\n \"--glass-blur\": `${glassConfig.blur ?? DEFAULT_GLASS_CONFIG.blur}px`,\n \"--glass-saturation\": `${glassConfig.saturation ?? DEFAULT_GLASS_CONFIG.saturation}%`,\n \"--glass-opacity\": glassConfig.opacity ?? DEFAULT_GLASS_CONFIG.opacity,\n \"--glass-border-opacity\": glassConfig.borderOpacity ?? DEFAULT_GLASS_CONFIG.borderOpacity,\n }\n : {}\n\n const roundedValue = typeof rounded === \"number\" ? undefined : rounded\n\n // Filter out props that conflict with motion's types\n const { onDrag: _onDrag, ...safeProps } = props as any\n\n return (\n <NavContext.Provider value={contextValue}>\n <AnimatePresence>\n {visible && (\n <motion.nav\n ref={combinedRef as React.Ref<HTMLElement>}\n className={cn(\n rootVariants({ variant, size, visible, full, rounded: roundedValue }),\n iosInfo.hasViewportBugs && \"mobile-nav-root--ios26\",\n className,\n )}\n style={\n {\n zIndex: typeof zIndex === \"number\" ? zIndex : zIndex,\n ...(typeof rounded === \"number\"\n ? { borderTopLeftRadius: `${rounded}rem`, borderTopRightRadius: `${rounded}rem` }\n : {}),\n ...customGlassStyles,\n ...style,\n } as React.CSSProperties\n }\n initial={{ y: \"100%\" }}\n animate={{ y: 0 }}\n exit={{ y: \"100%\" }}\n transition={{\n type: \"spring\",\n stiffness: 400,\n damping: 40,\n }}\n role=\"navigation\"\n aria-label={ariaLabel}\n data-testid={testId}\n data-ios-version={iosInfo.majorVersion}\n data-has-viewport-bugs={iosInfo.hasViewportBugs}\n {...(props as any)}\n >\n {children}\n </motion.nav>\n )}\n </AnimatePresence>\n </NavContext.Provider>\n )\n },\n)\nRoot.displayName = \"MobileBottomNav.Root\"\n\n/* ============================================\n NavList Component\n ============================================ */\n\n/**\n * Container for navigation items\n *\n * @component\n * @example\n * \\`\\`\\`tsx\n * <MobileBottomNav.NavList justify=\"around\">\n * <MobileBottomNav.NavItem icon={<HomeIcon />} label=\"Home\" />\n * </MobileBottomNav.NavList>\n * \\`\\`\\`\n *\n * @param {NavListProps} props - Component props\n * @returns {React.ReactElement} Navigation list element\n */\nconst NavList = React.forwardRef<HTMLUListElement, NavListProps>(\n ({ children, className, style, gap, justify = \"around\", \"data-testid\": testId, ...props }, ref) => {\n const { size, gap: contextGap } = useNavContext()\n const effectiveGap = gap ?? contextGap\n\n return (\n <ul\n ref={ref}\n className={cn(navListVariants({ size, justify }), className)}\n style={{\n gap: effectiveGap ? `${effectiveGap}rem` : undefined,\n ...style,\n }}\n role=\"menubar\"\n data-testid={testId}\n {...props}\n >\n {children}\n </ul>\n )\n },\n)\nNavList.displayName = \"MobileBottomNav.NavList\"\n\n/* ============================================\n NavItem Component\n ============================================ */\n\n/**\n * Individual navigation item with icon and label\n *\n * @component\n * @example\n * \\`\\`\\`tsx\n * <MobileBottomNav.NavItem\n * icon={<HomeIcon />}\n * label=\"Home\"\n * state={NavItemState.ACTIVE}\n * onClick={() => navigate('/home')}\n * />\n * \\`\\`\\`\n *\n * @param {NavItemProps} props - Component props\n * @returns {React.ReactElement} Navigation item element\n */\nconst NavItem = React.forwardRef<HTMLButtonElement, NavItemProps>(\n (\n {\n icon,\n label,\n className,\n style,\n state = NavItemState.INACTIVE,\n labelPosition = LabelPosition.BELOW,\n onClick,\n href,\n iconSize = IconSize.MEDIUM,\n badge,\n \"aria-label\": ariaLabel,\n \"data-testid\": testId,\n disabled,\n ...props\n },\n ref,\n ) => {\n const { size, animationConfig } = useNavContext()\n\n const effectiveState = disabled ? NavItemState.DISABLED : state\n const isDisabled = effectiveState === NavItemState.DISABLED\n\n const getAnimationProps = () => {\n if (animationConfig.type === AnimationType.NONE) {\n return {}\n }\n\n return {\n whileTap: isDisabled ? {} : { scale: animationConfig.pressScale ?? 0.95 },\n whileHover: isDisabled ? {} : { scale: animationConfig.hoverScale ?? 1.05 },\n transition:\n animationConfig.type === AnimationType.SPRING\n ? {\n type: \"spring\",\n stiffness: animationConfig.spring?.stiffness ?? 400,\n damping: animationConfig.spring?.damping ?? 30,\n }\n : {\n type: \"tween\",\n duration: animationConfig.tween?.duration ?? 0.2,\n ease: animationConfig.tween?.ease ?? \"easeOut\",\n },\n }\n }\n\n const content = (\n <>\n <span\n className={cn(iconVariants({ size: iconSize as IconSize }))}\n style={{\n width: typeof iconSize === \"number\" ? `${iconSize}px` : undefined,\n height: typeof iconSize === \"number\" ? `${iconSize}px` : undefined,\n }}\n >\n {icon}\n {badge && (\n <span\n className={cn(\n badgeVariants({\n type: typeof badge === \"number\" ? \"count\" : \"dot\",\n }),\n )}\n >\n {typeof badge === \"number\" ? badge : null}\n </span>\n )}\n </span>\n <span className={cn(labelVariants({ position: labelPosition, size }))}>{label}</span>\n </>\n )\n\n const commonProps = {\n className: cn(\n navItemVariants({\n state: effectiveState,\n labelPosition,\n size,\n }),\n className,\n ),\n style,\n \"aria-label\": ariaLabel ?? label,\n \"aria-current\": state === NavItemState.ACTIVE ? (\"page\" as const) : undefined,\n \"aria-disabled\": isDisabled,\n \"data-testid\": testId,\n role: \"menuitem\",\n ...getAnimationProps(),\n }\n\n // Type-safe props for motion elements\n const motionAnchorProps = {\n ...commonProps,\n href,\n // Omit HTML drag event handlers as they conflict with Motion\n ...(props as any),\n onDrag: undefined,\n onDragStart: undefined,\n onDragEnd: undefined,\n }\n\n const motionButtonProps = {\n ...commonProps,\n type: \"button\" as const,\n onClick,\n disabled: isDisabled,\n // Omit HTML drag event handlers as they conflict with Motion\n ...(props as any),\n onDrag: undefined,\n onDragStart: undefined,\n onDragEnd: undefined,\n }\n\n if (href && !isDisabled) {\n return (\n <li>\n <motion.a\n ref={ref as React.Ref<HTMLAnchorElement>}\n {...motionAnchorProps}\n >\n {content}\n </motion.a>\n </li>\n )\n }\n\n return (\n <li>\n <motion.button ref={ref} {...motionButtonProps}>\n {content}\n </motion.button>\n </li>\n )\n },\n)\nNavItem.displayName = \"MobileBottomNav.NavItem\"\n\n/* ============================================\n Spacer Component\n ============================================ */\n\n/**\n * Spacer component to prevent content from being hidden under navigation\n *\n * @component\n * @example\n * \\`\\`\\`tsx\n * <main>\n * {content}\n * <MobileBottomNav.Spacer />\n * </main>\n * \\`\\`\\`\n *\n * @param {object} props - Component props\n * @returns {React.ReactElement} Spacer element\n */\ninterface SpacerProps {\n /** Additional CSS classes */\n className?: string\n /** Size matching the navigation */\n size?: NavSize\n}\n\nconst Spacer: React.FC<SpacerProps> = ({ className, size = NavSize.MEDIUM }) => {\n return <div className={cn(spacerVariants({ size }), className)} aria-hidden=\"true\" />\n}\nSpacer.displayName = \"MobileBottomNav.Spacer\"\n\n/* ============================================\n Compound Component Export\n ============================================ */\n\n/**\n * MobileBottomNav compound component\n *\n * A fully accessible, mobile-optimized bottom navigation with:\n * - Slot-based architecture (Root, NavList, NavItem)\n * - Glassmorphism visual effects\n * - Motion animations\n * - Safe area support for notched devices\n * - Headless mode for custom styling\n *\n * @example\n * \\`\\`\\`tsx\n * <MobileBottomNav.Root variant={NavVariant.GLASS}>\n * <MobileBottomNav.NavList>\n * <MobileBottomNav.NavItem\n * icon={<Home />}\n * label=\"Home\"\n * state={NavItemState.ACTIVE}\n * />\n * <MobileBottomNav.NavItem\n * icon={<Search />}\n * label=\"Search\"\n * />\n * </MobileBottomNav.NavList>\n * </MobileBottomNav.Root>\n * \\`\\`\\`\n */\nexport const MobileBottomNav = {\n Root,\n NavList,\n NavItem,\n Spacer,\n}\n\nexport default MobileBottomNav\n"],"x_google_ignoreList":[0,1,2,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,299],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWA,IAAI,qBAAqB,OAAO,IAAI,6BAA6B,EAC/D,sBAAsB,OAAO,IAAI,iBAAiB;CACpD,SAAS,QAAQ,MAAM,QAAQ,UAAU;EACvC,IAAI,MAAM;AACV,OAAK,MAAM,aAAa,MAAM,KAAK;AACnC,OAAK,MAAM,OAAO,QAAQ,MAAM,KAAK,OAAO;AAC5C,MAAI,SAAS,QAAQ;AACnB,cAAW,EAAE;AACb,QAAK,IAAI,YAAY,OACnB,WAAU,aAAa,SAAS,YAAY,OAAO;QAChD,YAAW;AAClB,WAAS,SAAS;AAClB,SAAO;GACL,UAAU;GACJ;GACD;GACL,KAAK,KAAK,MAAM,SAAS,SAAS;GAClC,OAAO;GACR;;AAEH,SAAQ,WAAW;AACnB,SAAQ,MAAM;AACd,SAAQ,OAAO;;;;;;;;;;;;;;;ACtBf,kBAAiB,QAAQ,IAAI,aAC1B,WAAY;EACX,SAAS,yBAAyB,MAAM;AACtC,OAAI,QAAQ,KAAM,QAAO;AACzB,OAAI,eAAe,OAAO,KACxB,QAAO,KAAK,aAAa,yBACrB,OACA,KAAK,eAAe,KAAK,QAAQ;AACvC,OAAI,aAAa,OAAO,KAAM,QAAO;AACrC,WAAQ,MAAR;IACE,KAAK,oBACH,QAAO;IACT,KAAK,oBACH,QAAO;IACT,KAAK,uBACH,QAAO;IACT,KAAK,oBACH,QAAO;IACT,KAAK,yBACH,QAAO;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AGN,MAAM,uCACG;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,eAAe,CACjB;CAED,MAAM,sCACG;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,cAAc,CAChB;CAED,MAAMC,yCACG;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,eAAe,CACjB;CAED,MAAM,wCACG;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,gBAAgB,CAClB;CAGD,MAAM,yCACG;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAGD,MAAM,mDACG;EACL;EACA;EACA;EACA;EACD,GACD;EAAC;EAAe;EAAoB;EAAsB;EAAc,CACzE;AAED,QACE,4CAAC,eAAe;EAAS,OAAO;YAC9B,4CAAC,kBAAkB;GAAS,OAAO;GAChC;IAC0B;GACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjO9B,SAAgB,QAAQ,EACtB,UACA,WACA,OACA,cAAc,eAAe,aAC7B,MACA,cACA,eAAe,eAAe,cAC9B,gBAAgB,eAAe,eAC/B,oBAAoB,eAAe,mBACnC,kBAAkB,eAAe,iBACjC,YACA,0BACA,WAAW,eAAe,UAC1B,QAAQ,eAAe,OACvB,uBAAuB,OACvB,gBAAgB,MAChB,aACA,MACe;AAOf,QACE,4CAAC;EACc;EACP;EACQ;EACA;EACC;EACI;EACF;EACL;EACZ,YAAYC;EACF;EACH;EACe;EACP;EACF;YAEb,4CAnBe,MAAM;GAmBC;GAAkB;aAtBvB,OAAO,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