{"version":3,"file":"CountUp.aSENJs2c.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/j1y9dI16Dk00ZpbJWznX/r8BL1iwD9gKKt9pYcVaJ/CountUp.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const CountUpStyles={container:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\"}};export function CountUp({start=0,end=100,speed=100,gapSize=4,prefixText=\"\",suffixText=\"\",textSize=36,letterSpacing=0,selectedFont={fontFamily:\"Inter\",fontWeight:500,systemFont:true},textColor=\"#D3D3D3\",startOnViewport=false}){const[count,setCount]=useState(start);const[isVisible,setIsVisible]=useState(false);const containerRef=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>setIsVisible(entry.isIntersecting));if(containerRef.current)observer.observe(containerRef.current);return()=>containerRef.current&&observer.unobserve(containerRef.current);},[]);useEffect(()=>{if(!isVisible&&startOnViewport)return;const intervalId=setInterval(()=>{setCount(prevCount=>Math.min(prevCount+1,end));},speed);return()=>clearInterval(intervalId);},[isVisible,start,end,speed,startOnViewport]);return /*#__PURE__*/_jsxs(motion.div,{ref:containerRef,style:{...CountUpStyles.container,gap:`${gapSize}px`,fontSize:`${textSize}px`,fontFamily:selectedFont.fontFamily,fontWeight:selectedFont.fontWeight,color:textColor,letterSpacing:`${letterSpacing}px`},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:selectedFont.fontFamily,fontWeight:selectedFont.fontWeight,color:textColor,letterSpacing:`${letterSpacing}px`},children:prefixText}),/*#__PURE__*/_jsx(\"span\",{style:{letterSpacing:`${letterSpacing}px`},children:count.toLocaleString(\"en-US\")}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:selectedFont.fontFamily,fontWeight:selectedFont.fontWeight,color:textColor,letterSpacing:`${letterSpacing}px`},children:suffixText})]});}addPropertyControls(CountUp,{startOnViewport:{type:ControlType.Boolean,title:\"Viewport\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},selectedFont:{title:\"Font\",type:ControlType.Font,defaultValue:{fontFamily:\"Inter\",fontWeight:500,systemFont:true}},textSize:{title:\"Font Size\",type:ControlType.Number,min:8,max:240,step:1},textColor:{type:ControlType.Color,title:\"Font Color\"},letterSpacing:{// new control for letter spacing\ntitle:\"Letter Spacing\",type:ControlType.Number,defaultValue:0,min:-20,max:20,step:.5},start:{type:ControlType.Number,title:\"Start Number\",defaultValue:0,displayStepper:true},end:{type:ControlType.Number,title:\"End Number\",defaultValue:10,displayStepper:true},prefixText:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},suffixText:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},gapSize:{type:ControlType.Number,title:\"Gap Size\",defaultValue:4,min:0,max:100,step:4},speed:{type:ControlType.Number,title:\"Speed (ms)\",defaultValue:100,min:0,max:2e3,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"CountUp\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp.map"],"mappings":"gPAAyR,SAAgB,EAAQ,CAAC,QAAM,EAAE,MAAI,IAAI,QAAM,IAAI,UAAQ,EAAE,aAAW,GAAG,aAAW,GAAG,WAAS,GAAG,gBAAc,EAAE,eAAa,CAAC,WAAW,QAAQ,WAAW,IAAI,WAAW,EAAI,EAAE,YAAU,UAAU,kBAAgB,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,CAAK,EAAO,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAQ,EAAaC,EAAO,IAAI,EAAwd,OAAtd,MAAc,CAAC,IAAM,EAAS,IAAI,sBAAsB,CAAC,KAAS,EAAa,EAAM,cAAc,CAAC,EAAiE,OAA5D,EAAa,SAAQ,EAAS,QAAQ,EA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