{"version":3,"file":"CountUp.Bv4foido.mjs","names":["useState","useRef","useEffect","startTransition","_jsx","_jsxs","__esmMin","window","te","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","p","init_jsx_runtime","ce","addPropertyControls","init_framer_BWzg2IRg","ControlType","CountUp","props","targetValue","duration","prefix","suffix","decimals","separator","textColor","font","style","count","setCount","isInView","setIsInView","hasAnimated","setHasAnimated","elementRef","observer","entry","startTime","animate","elapsed","progress","easeOutQuart","currentCount","displayValue","num","fixed","parts","init_CountUp"],"sources":["https:/framerusercontent.com/modules/TLpTKWGrnGmSAFZznkz2/Bh3UEth3Y7DVzlc1jx7J/CountUp.js"],"sourcesContent":["// Number count up component with CMS integration\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{targetValue=1e3,duration=2e3,prefix=\"\",suffix=\"\",decimals=0,separator=true,textColor=\"#000000\",font,style}=props;const[count,setCount]=useState(0);const[isInView,setIsInView]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const elementRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){startTransition(()=>setIsInView(true));}},{threshold:.1});if(elementRef.current){observer.observe(elementRef.current);}return()=>{if(elementRef.current){observer.unobserve(elementRef.current);}};},[hasAnimated]);useEffect(()=>{if(!isInView||hasAnimated)return;const startTime=Date.now();const startValue=0;const animate=()=>{const currentTime=Date.now();const elapsed=currentTime-startTime;const progress=Math.min(elapsed/duration,1);const easeOutQuart=1-Math.pow(1-progress,4);const currentCount=startValue+(targetValue-startValue)*easeOutQuart;startTransition(()=>setCount(currentCount));if(progress<1){requestAnimationFrame(animate);}else{startTransition(()=>{setCount(targetValue);setHasAnimated(true);});}};requestAnimationFrame(animate);},[isInView,targetValue,duration,hasAnimated]);const formatNumber=num=>{const fixed=num.toFixed(decimals);if(!separator)return fixed;const parts=fixed.split(\".\");parts[0]=parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g,\".\");return parts.join(\".\");};const displayValue=formatNumber(count);return /*#__PURE__*/_jsx(\"div\",{ref:elementRef,style:{...style,position:\"relative\",width:\"max-content\",minWidth:\"max-content\"},children:/*#__PURE__*/_jsxs(\"span\",{style:{color:textColor,...font,whiteSpace:\"nowrap\"},children:[prefix,displayValue,suffix]})});}addPropertyControls(CountUp,{targetValue:{type:ControlType.Number,title:\"Target Value\",defaultValue:1e3,min:0,step:1},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2e3,min:100,max:1e4,step:100,unit:\"ms\"},decimals:{type:ControlType.Number,title:\"Decimals\",defaultValue:0,min:0,max:4,step:1},separator:{type:ControlType.Boolean,title:\"Separator\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\",placeholder:\"$\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\",placeholder:\"+\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp.map"],"mappings":"A,oNAIG,SAAwBmB,EAAQC,EAAM,CAAC,GAAK,CAACC,cAAY,IAAIC,WAAS,IAAIC,SAAO,GAAGC,SAAO,GAAGC,WAAS,EAAEC,YAAU,G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