{"version":3,"file":"withAnimatedText.Dr7dRdMX.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/xvqNH2N4J4PkWBgEJTyR/Vbw9gt5GUCNbbDfLWawi/withAnimatedText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{stagger,useAnimate,useInView}from\"framer-motion\";const MIN_FONT_SIZE=\"2rem\";const MAX_FONT_SIZE=\"40rem\";export function withAnimateChar(Component){return props=>{const[completed,setCompleted]=useState(false);const[scopeRef,animate]=useAnimate();const isInView=useInView(scopeRef,{amount:.5});const easeOutCirc=[.075,.82,.165,1];const easeInCirc=[.6,.04,.98,.335];const settings={delay:stagger(.1)};useEffect(()=>{if(isInView){animate(\"span\",{y:[\"100%\",0]},{...settings,duration:2,ease:easeOutCirc,onPlay:()=>scopeRef.current.style.opacity=1,onComplete:()=>setCompleted(true)});}else{animate(\"span\",{y:[0,\"-100%\"]},{...settings,duration:1,ease:easeInCirc});}},[isInView]);useEffect(()=>{const text=scopeRef.current.querySelector(\".framer-text\");text.style.display=\"flex\";text.style.justifyContent=\"center\";text.style.fontSize=`clamp(${MIN_FONT_SIZE}, 28cqi, ${MAX_FONT_SIZE})`;text.innerHTML=text.textContent.split(\"\").map((character,index)=>`<span style=\"display: inline-block\">${character}</span>`).join(\"\");},[]);return /*#__PURE__*/ _jsx(Component,{...props,style:{...props.style,opacity:0},ref:scopeRef});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAnimateChar\":{\"type\":\"reactHoc\",\"name\":\"withAnimateChar\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./withAnimatedText.map"],"mappings":"wLAAgM,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAS,GAAS,EAAW,EAAQ,EAAS,EAAU,EAAS,CAAC,OAAO,EAAE,C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