{"version":3,"file":"Counter.Dded2Xbb.mjs","names":["useState","useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/sK5bPBcCGFjTUwpq8hQw/L8Qi4ldsEsh8ji0DA21l/Counter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{useViewportScroll,useInView}from\"framer-motion\";// Created by FramerOverrides.com\n// CONTROLS FOR NUMBER 1\nconst START_NUMBER1=5.4;const END_NUMBER1=6.86;const DURATION_SECONDS1=1.4;// END OF CONTROLS\n// CONTROLS FOR NUMBER 2\nconst START_NUMBER2=0;const END_NUMBER2=13.94;const DURATION_SECONDS2=1;// END OF CONTROLS\n// CONTROLS FOR NUMBER 3\nconst START_NUMBER3=4600;const END_NUMBER3=4;const DURATION_SECONDS3=.6;// END OF CONTROLS\nfunction useCountUp(start,end,durationSeconds,decimals=2){const[count,setCount]=useState(start);const{scrollY}=useViewportScroll();const ref=useRef();const isInView=useInView(ref);useEffect(()=>{if(isInView){const steps=durationSeconds*60// 60 FPS\n;const increment=(end-start)/steps;const interval=setInterval(()=>{setCount(prevCount=>{const nextCount=prevCount+increment;if(nextCount>=end){clearInterval(interval);return end;}return nextCount;});},1e3/60)// 60 FPS\n;return()=>clearInterval(interval);}},[start,end,durationSeconds,isInView,decimals]);return{count:count.toFixed(decimals),ref};}export function CountUpNumber1(){const{count,ref}=useCountUp(START_NUMBER1,END_NUMBER1,DURATION_SECONDS1);return{text:count.toLocaleString(),ref:ref};}export function CountUpNumber2(){const{count,ref}=useCountUp(START_NUMBER2,END_NUMBER2,DURATION_SECONDS2);return{text:count.toLocaleString(),ref:ref};}export function CountUpNumber3(){const{count,ref}=useCountUp(START_NUMBER3,END_NUMBER3,DURATION_SECONDS3);return{text:count.toLocaleString(),ref:ref};}function useCountdown(start,end,durationSeconds){const[count,setCount]=useState(start);const{scrollY}=useViewportScroll();const ref=useRef();const isInView=useInView(ref);useEffect(()=>{if(isInView){const steps=durationSeconds*60// 60 FPS\n;const decrement=(start-end)/steps;const interval=setInterval(()=>{setCount(prevCount=>{const nextCount=prevCount-decrement;if(nextCount<=end){clearInterval(interval);return end;}return nextCount;});},1e3/60)// 60 FPS\n;return()=>clearInterval(interval);}},[start,end,durationSeconds,isInView]);return{count:Math.round(count),ref};}export function CountDownNumber1(){const{count,ref}=useCountdown(START_NUMBER1,END_NUMBER1,DURATION_SECONDS1);return{text:count.toLocaleString(),ref:ref};}export function CountDownNumber2(){const{count,ref}=useCountdown(START_NUMBER2,END_NUMBER2,DURATION_SECONDS2);return{text:count.toLocaleString(),ref:ref};}export function CountDownNumber3(){const{count,ref}=useCountdown(START_NUMBER3,END_NUMBER3,DURATION_SECONDS3);return{text:count.toLocaleString(),ref:ref};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withCountUpNumber1(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CountUpNumber1(props)});};}withCountUpNumber1.displayName=\"CountUpNumber1\";export function withCountUpNumber2(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CountUpNumber2(props)});};}withCountUpNumber2.displayName=\"CountUpNumber2\";export function withCountUpNumber3(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CountUpNumber3(props)});};}withCountUpNumber3.displayName=\"CountUpNumber3\";export function withCountDownNumber1(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CountDownNumber1(props)});};}withCountDownNumber1.displayName=\"CountDownNumber1\";export function withCountDownNumber2(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CountDownNumber2(props)});};}withCountDownNumber2.displayName=\"CountDownNumber2\";export function withCountDownNumber3(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...CountDownNumber3(props)});};}withCountDownNumber3.displayName=\"CountDownNumber3\";\nexport const __FramerMetadata__ = {\"exports\":{\"CountUpNumber1\":{\"type\":\"override\",\"name\":\"CountUpNumber1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountUpNumber1\":{\"type\":\"reactHoc\",\"name\":\"withCountUpNumber1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CountUpNumber2\":{\"type\":\"override\",\"name\":\"CountUpNumber2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountUpNumber2\":{\"type\":\"reactHoc\",\"name\":\"withCountUpNumber2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountUpNumber3\":{\"type\":\"reactHoc\",\"name\":\"withCountUpNumber3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CountDownNumber1\":{\"type\":\"override\",\"name\":\"CountDownNumber1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountDownNumber1\":{\"type\":\"reactHoc\",\"name\":\"withCountDownNumber1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CountDownNumber2\":{\"type\":\"override\",\"name\":\"CountDownNumber2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CountDownNumber3\":{\"type\":\"override\",\"name\":\"CountDownNumber3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountDownNumber3\":{\"type\":\"reactHoc\",\"name\":\"withCountDownNumber3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountDownNumber2\":{\"type\":\"reactHoc\",\"name\":\"withCountDownNumber2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CountUpNumber3\":{\"type\":\"override\",\"name\":\"CountUpNumber3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],"mappings":"2OAOA,SAAS,EAAW,EAAM,EAA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