{"version":3,"file":"Number.C4a6TkAT.mjs","names":[],"sources":["https:/framerusercontent.com/modules/jm941bifERhB6bGTXJoT/BksgS3RJBhxoM5VLhMYa/Number.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useInView,useMotionValue,useTransform,animate}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export function AnimatedNumber(props){const ref=React.useRef(null);const isInView=useInView(ref,{once:true});const number=useMotionValue(props.startFrom);const formattedNumber=useTransform(number,latest=>{const value=props.formatNumber?Math.round(latest).toLocaleString():latest.toFixed(props.decimalPlaces);return`${value}${props.suffix}`;});React.useEffect(()=>{if(isInView){animate(number,props.targetNumber,{duration:props.duration,ease:props.easing});}},[isInView]);return /*#__PURE__*/_jsx(motion.div,{ref:ref,style:{fontFamily:props.font,fontWeight:props.fontWeight,fontSize:props.fontSize,color:props.textColor,whiteSpace:\"nowrap\",lineHeight:props.lineHeight,letterSpacing:`${props.letterSpacing}px`,...props.style},children:formattedNumber});}AnimatedNumber.defaultProps={targetNumber:1e3,startFrom:0,duration:2,easing:\"easeInOut\",textColor:\"#000\",formatNumber:true,decimalPlaces:0,font:\"Inter, sans-serif\",fontSize:24,fontWeight:600,lineHeight:1.2,letterSpacing:0};addPropertyControls(AnimatedNumber,{targetNumber:{type:ControlType.Number,title:\"Target Value\",defaultValue:1e3,min:0,max:1e6},startFrom:{type:ControlType.Number,title:\"Start From\",defaultValue:0,min:0,max:1e6},duration:{type:ControlType.Number,title:\"Duration (s)\",min:.1,max:30,step:.1,defaultValue:2},easing:{type:ControlType.Enum,title:\"Easing\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\"],defaultValue:\"easeInOut\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000\"},font:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter, sans-serif\"},fontSize:{type:ControlType.Number,title:\"Font Size\",min:8,max:300,step:1,defaultValue:24},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"],optionTitles:[\"Thin\",\"Extra Light\",\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"],defaultValue:\"600\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",min:.5,max:5,step:.1,defaultValue:1.2,displayStepper:true},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",min:-5,max:50,step:.1,defaultValue:0,unit:\"px\",displayStepper:true},formatNumber:{type:ControlType.Boolean,title:\"Format Number\",defaultValue:true},decimalPlaces:{type:ControlType.Number,title:\"Decimals\",min:0,max:5,step:1,defaultValue:0,hidden:props=>props.formatNumber},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\",placeholder:\"e.g., B, %, $\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"AnimatedNumber\":{\"type\":\"reactComponent\",\"name\":\"AnimatedNumber\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Number.map"],"mappings":"4ZAA2M,SAAgB,EAAe,EAAM,CAAC,IAAM,EAAI,EAAa,KAAK,CAAO,EAAS,EAAU,EAAI,CAAC,MAAK,CAAK,EAAC,CAAO,EAAO,EAAe,EAAM,UAAU,CAAO,EAAgB,EAAa,EAAO,GAAQ,CAAC,IAAM,EAAM,EAAM,aAAa,KAAK,MAAM,EAAO,CAAC,gBAAgB,CAAC,EAAO,QAAQ,EAAM,cAAc,CAAC,SAAS,IAAQ,EAAM,QAAU,EAAC,CAAiI,MAAhI,GAAgB,IAAI,CAAC,AAAG,GAAU,EAAQ,EAAO,EAAM,aAAa,CAAC,SAAS,EAAM,SAAS,KAAK,EAAM,MAAO,EAAC,AAAG,EAAC,CAAC,CAAS,EAAC,CAAqB,EAAK,EAAO,I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