import{useContext as t}from"react";import{__rest as r}from"../../../../node_modules/tslib/tslib.es6.js";import{MotionContext as n}from"../../context/MotionContext/index.js";import{PresenceContext as o}from"../../context/PresenceContext.js";import{useConstant as i}from"../../utils/use-constant.js";import{checkIfControllingVariants as a,checkIfVariantNode as e,resolveVariantFromProps as s}from"../../render/utils/variants.js";import{isAnimationControls as u}from"../../animation/animation-controls.js";import{resolveMotionValue as m}from"../../value/utils/resolve-motion-value.js";function l(t,r,n,o){var i=t.scrapeMotionValuesFromProps,a=t.createRenderState,e=t.onMount,s={latestValues:v(r,n,o,i),renderState:a()};return e&&(s.mount=function(t){return e(r,t,s)}),s}var f=function(r){return function(a,e){var s=t(n),u=t(o);return e?l(r,a,s,u):i((function(){return l(r,a,s,u)}))}};function v(t,n,o,i){var l={},f=!1===(null==o?void 0:o.initial),v=i(t);for(var c in v)l[c]=m(v[c]);var p=t.initial,d=t.animate,j=a(t),x=e(t);n&&x&&!j&&!1!==t.inherit&&(null!=p||(p=n.initial),null!=d||(d=n.animate));var b=f||!1===p?d:p;b&&"boolean"!=typeof b&&!u(b)&&(Array.isArray(b)?b:[b]).forEach((function(n){var o=s(t,n);if(o){var i=o.transitionEnd;o.transition;var a=r(o,["transitionEnd","transition"]);for(var e in a)l[e]=a[e];for(var e in i)l[e]=i[e]}}));return l}export{f as makeUseVisualState};
//# sourceMappingURL=use-visual-state.js.map
