{"version":3,"file":"Counter.sDPdRI3Z.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/a4ENzu8V9hWjk6LDkmhH/SBXqpihv9JL1UJYNJojl/Counter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{animate,motion,useInView,useMotionValue,useTransform}from\"framer-motion\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Format number with commas\nfunction formatNumberWithCommas(number){return number.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g,\",\");}function AnimatedCounter({from,to,duration,fontFamily,fontSize,color,lineHeight,fontWeight}){const count=useMotionValue(from);// Transform count value to formatted string\nconst rounded=useTransform(count,latest=>{return formatNumberWithCommas(Math.round(latest));});const ref=useRef(null);const inView=useInView(ref);// Animate count while in view\nuseEffect(()=>{if(inView){animate(count,to,{duration});}},[count,inView,to,duration]);return /*#__PURE__*/_jsx(motion.span,{ref:ref,style:{fontFamily,fontSize,color,lineHeight,fontWeight},children:inView?rounded:formatNumberWithCommas(to)});}AnimatedCounter.defaultProps={from:0,to:15,duration:2.5,fontFamily:\"Arial\",fontSize:24,color:\"#000000\",lineHeight:1.5,fontWeight:\"normal\"};addPropertyControls(AnimatedCounter,{from:{type:ControlType.Number,title:\"From\",defaultValue:0,min:0,step:1},to:{type:ControlType.Number,title:\"To\",defaultValue:15,min:0,step:1},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2.5,min:0,step:.1,displayStepper:true},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Arial\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:24,min:12,max:72,step:1},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1.5,min:0,step:.1,displayStepper:true},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",defaultValue:\"normal\",options:[\"normal\",\"bold\",\"bolder\",\"lighter\",\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"]}});export default AnimatedCounter;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],"mappings":"8PACA,SAAS,EAAuB,EAAO,CAAC,OAAO,EAAO,SAAS,CAAC,CAAC,QAAQ,wBAAwB,GAAG,CAAE,CAAC,SAAS,EAAgB,CAAC,OAAK,KAAG,WAAS,aAAW,WAAS,QAAM,aAAW,cAAY,CAAC,IAAM,EAAM,EAAe,CAAI,EAC7N,EAAQ,EAAa,EAAM,GAAgB,EAAuB,KAAK,MAAM,CAAM,CAAC,CAAG,EAAQ,EAAIA,EAAO,IAAI,EAAQ,EAAO,EAAU,CAAG,EAC1D,OAAtF,MAAc,CAAI,GAAQ,EAAQ,EAAM,EAAG,CAAC,UAAQ,CAAC,CAAG,EAAE,CAAC,EAAM,EAAO,EAAG,CAAQ,CAAC,EAAsB,EAAK,EAAO,KAAK,CAAK,MAAI,MAAM,CAAC,aAAW,WAAS,QAAM,aAAW,YAAU,EAAE,SAAS,EAAO,EAAQ,EAAuB,CAAE,CAAC,CAAC,CAAE,iBAHvM,IAAgF,IAAoC,IAAoD,EAGgC,EAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,IAAI,WAAW,QAAQ,SAAS,GAAG,MAAM,UAAU,WAAW,IAAI,WAAW,QAAQ,EAAE,EAAoB,EAAgB,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,OAAO,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,KAAK,EAAY,OAAO,MAAM,KAAK,aAAa,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,WAAW,aAAa,IAAI,IAAI,EAAE,KAAK,GAAG,eAAe,EAA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