{"version":3,"file":"CountUp.DOmY9fv3.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","p","_e","de","useInView","useReducedMotion","init_framer_motion_DhsWWWsN","init_framer_BL70qLPA","addPropertyControls","ControlType","useIsStaticRenderer","CountUp","props","ref","isStatic","inView","reduceMotion","current","setCurrent","value","start","from","frame","startTime","total","duration","step","now","t","eased","shown","decimals","separator","font","style","prefix","suffix","init_CountUp"],"sources":["https:/framerusercontent.com/modules/w3B2KohTcJVHnIwpslju/zgbSlBwjF43eUAlgwlkI/CountUp.js"],"sourcesContent":["import{jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView,useReducedMotion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{value,from,duration,decimals,prefix,suffix,separator,font,color,style}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();const inView=useInView(ref,{once:true,amount:.4});const reduceMotion=useReducedMotion();// Start on the real figure so server-rendered HTML, link previews and no-JS readers never see 0.\nconst[current,setCurrent]=useState(value);// Count up from the high end (70% of the target) rather than from zero.\nconst start=Math.max(from,value*.7);useEffect(()=>{if(isStatic||reduceMotion){setCurrent(value);return;}if(!inView)return;let frame=0;let startTime=0;const total=Math.max(.1,duration)*1e3;const step=now=>{if(!startTime)startTime=now;const t=Math.min(1,(now-startTime)/total);const eased=1-Math.pow(1-t,4);setCurrent(start+(value-start)*eased);if(t<1)frame=requestAnimationFrame(step);};frame=requestAnimationFrame(step);return()=>cancelAnimationFrame(frame);},[inView,value,start,duration,isStatic,reduceMotion]);const shown=current.toLocaleString(\"en-US\",{minimumFractionDigits:decimals,maximumFractionDigits:decimals,useGrouping:separator});return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{position:\"relative\",width:\"max-content\",fontFamily:\"Instrument Serif, Georgia, serif\",color,...font,...style},children:[prefix,shown,suffix]});}addPropertyControls(CountUp,{value:{type:ControlType.Number,title:\"To\",defaultValue:20,min:0,max:1e6,displayStepper:true},from:{type:ControlType.Number,title:\"From\",defaultValue:0,min:0,max:1e6,displayStepper:true},duration:{type:ControlType.Number,title:\"Seconds\",defaultValue:1.6,min:.1,max:6,step:.1},decimals:{type:ControlType.Number,title:\"Decimals\",defaultValue:0,min:0,max:3,displayStepper:true},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},separator:{type:ControlType.Boolean,title:\"Commas\",defaultValue:true},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#33a9ff\"},font:{type:ControlType.Font,title:\"Size\",controls:\"extended\",defaultFontType:\"serif\",defaultValue:{fontSize:\"clamp(1.5rem, 1rem + 1.6vw, 2rem)\",lineHeight:\"1.1em\",textAlign:\"center\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp.map"],"mappings":"A,wPAGG,SAAwBgB,EAAQ,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,WAAS,WAAS,SAAO,SAAO,YAAU,OAAK,QAAM,SAAOC,EAAYC,EAAIlB,EAAO,IAAI,EAAQmB,EAASJ,EAAoB,EAAQK,EAAOX,EAAUS,EAAI,CAAC,KAAK,GAAK,OAAO,EAAE,CAAC,EAAQG,EAAaX,EAAiB,EAC1Q,CAACY,EAAQC,GAAYtB,EAASuB,CAAK,EAClCC,EAAM,KAAK,IAAIC,EAAKF,EAAM,EAAE,EAAEpB,MAAc,CAAC,GAAGe,GAAUE,EAAa,CAACE,EAAWC,CAAK,EAAE,MAAO,CAAC,GAAG,CAACJ,EA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