{"version":3,"file":"CountUp.DGft8V-X.mjs","names":["CountUp","useState","useRef","containerStyle","textStyle","useState","useRef","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","p","_e","de","init_framer_DxfB3JJo","addPropertyControls","ControlType","CountUp$1","props","count","setCount","isVisible","setIsVisible","hasAnimated","setHasAnimated","ref","observer","entry","start","increment","targetNumber","duration","updateCounter","containerStyle$1","textStyle$1","font","fontSize","lineHeight","init_CountUp_1","CountUp","containerStyle","textStyle","init_CountUp"],"sources":["https:/framerusercontent.com/modules/hEvX0S0Q0JpjYZpRDZk3/uKr4x1gMWk8PXAL8UZ7h/CountUp_1.js","https:/framerusercontent.com/modules/AuZFvgNw1RhWkzPn2WwQ/CSY4c5LDfmWYRow7XzaO/CountUp.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{targetNumber,duration,font,color,fontSize,lineHeight}=props;const[count,setCount]=useState(0);const[isVisible,setIsVisible]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){setIsVisible(true);setHasAnimated(true);let start=0;const increment=targetNumber/(duration*60);const updateCounter=()=>{start+=increment;if(start<targetNumber){setCount(Math.ceil(start));requestAnimationFrame(updateCounter);}else{setCount(targetNumber);}};updateCounter();}},{threshold:.1});if(ref.current){observer.observe(ref.current);}return()=>{if(ref.current){observer.unobserve(ref.current);}};},[targetNumber,duration,hasAnimated]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,ref:ref,children:/*#__PURE__*/_jsxs(\"span\",{style:{...textStyle,fontFamily:font,color:color,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,opacity:isVisible?1:0,transition:\"opacity 0.5s ease-in-out\"},children:[count,\"+\"]})});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const textStyle={fontWeight:\"400\",letterSpacing:\"0em\",textAlign:\"center\",margin:\"0\"};// Adding property controls for Framer\naddPropertyControls(CountUp,{targetNumber:{type:ControlType.Number,title:\"Target Number\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:2,step:.1},font:{type:ControlType.String,title:\"Font Family\",defaultValue:\"inter\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"},fontSize:{type:ControlType.Number,title:\"Font Size (px)\",defaultValue:54,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height (px)\",defaultValue:54,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp_1.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{targetNumber,duration,font,color,fontSize,lineHeight}=props;const[count,setCount]=useState(0);const[isVisible,setIsVisible]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){setIsVisible(true);setHasAnimated(true);let start=0;const increment=targetNumber/(duration*60);const updateCounter=()=>{start+=increment;if(start<targetNumber){setCount(Math.ceil(start));requestAnimationFrame(updateCounter);}else{setCount(targetNumber);}};updateCounter();}},{threshold:.1});if(ref.current){observer.observe(ref.current);}return()=>{if(ref.current){observer.unobserve(ref.current);}};},[targetNumber,duration,hasAnimated]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,ref:ref,children:/*#__PURE__*/_jsxs(\"span\",{style:{...textStyle,fontFamily:font,color:color,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,opacity:isVisible?1:0,transition:\"opacity 0.5s ease-in-out\"},children:[count,\"+\"]})});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const textStyle={fontWeight:\"400\",letterSpacing:\"0em\",textAlign:\"center\",margin:\"0\"};// Adding property controls for Framer\naddPropertyControls(CountUp,{targetNumber:{type:ControlType.Number,title:\"Target Number\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:2,step:.1},font:{type:ControlType.String,title:\"Font Family\",defaultValue:\"inter\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"},fontSize:{type:ControlType.Number,title:\"Font Size (px)\",defaultValue:54,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height (px)\",defaultValue:54,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp.map"],"mappings":"A,+LAMG,SAAwBA,EAAQ,EAAM,CAAC,GAAK,CAAC,eAAa,WAAS,OAAK,QAAM,WAAS,cAAYmB,EAAW,CAACC,EAAMC,GAAUpB,EAAS,CAAC,EAAO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