{"version":3,"file":"AnimatedNumberCounter.BCvj0Usa.mjs","names":["useState","useRef","_Fragment","useEffect","useLayoutEffect","__esmMin","window","le","init_ssg_sandbox_shims","init_npm_react_18_3_1","l","_e","p","init_jsx_runtime","ce","de","motion","useInView","animate","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_D1IzEvwH","RenderTarget","ControlType","AnimatedNumberCounter","props","animation","color","isCanvas","Tag","MotionTag","isDefault","mode","initial","start","value","transition","format","n","decimals","commas","shown","setShown","end","sizer","setSizer","anim","setAnim","ref","inView","doneKey","seenInView","useIsoLayoutEffect","finished","run","to","from","v","countUp","init_AnimatedNumberCounter"],"sources":["https:/framerusercontent.com/modules/derx9sMtjp89UNB6MwBT/GsjjIhTJcOKPwuCzqeUT/AnimatedNumberCounter.js"],"sourcesContent":["import{jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useRef,useState}from\"react\";import{animate,motion,useInView}from\"framer-motion\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// T-238: our copy of Framer University's \"Animated Number Counter\" (marketplace module qpjhCcDm4G1NbFAlpMKV), same\n// controls and behaviour. One change: the server HTML and the first render carry the END number, so crawlers and AI\n// agents read the real figure. Before the first paint in the browser it goes back to its start and counts up as before.\n// The original's object controls (\"Animation\", \"Color\") are flat controls here (Trigger, Replay, Duration, Bounce, Color\n// mode, Color, Start/End color, Angle): Framer's API cannot write object controls, flat ones it can.\nconst useIsoLayoutEffect=typeof window===\"undefined\"?useEffect:useLayoutEffect;// T-242 (Karim): some parents swap variants while hovered, which mounts a new counter each time, and every new counter\n// counted up from the start again. A counter that has started is remembered here (per page and figures), so a\n// remounted copy shows the end number at once. Leaving the viewport forgets it, so Replay still works on scroll.\nconst finished=new Set;/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function AnimatedNumberCounter(props){const{mode,start,end,value,decimals,commas}=props;const animation={trigger:props.trigger,replay:props.replay,transition:{type:\"spring\",duration:props.duration,bounce:props.bounce}};const color={mode:props.colorMode,color:props.textColor,startColor:props.startColor,endColor:props.endColor,angle:props.angle};const isCanvas=RenderTarget.current()===RenderTarget.canvas;const Tag=props.tag;const MotionTag=motion[props.tag];const isDefault=mode==\"default\";const initial=isDefault?start:value;const transition=isDefault?animation.transition:props.transition;const format=n=>{let t=n.toFixed(decimals);if(commas)t=t.replace(/\\B(?=(\\d{3})+(?!\\d))/g,\",\");return t;};// shown: the number on screen; sizer: the invisible copy that reserves the width of the target number\nconst[shown,setShown]=useState(isDefault?end:initial);const[sizer,setSizer]=useState(isDefault?end:initial);const[anim,setAnim]=useState(null);const ref=useRef(null);const inView=useInView(ref,{once:!animation.replay,amount:\"some\"});const doneKey=`${typeof document===\"undefined\"?\"\":document.location.pathname}|${start}|${end}|${props.prefix}|${props.suffix}`;const seenInView=useRef(false);// back to the original starting state before the first paint (server HTML keeps the end number)\nuseIsoLayoutEffect(()=>{if(isDefault&&!isCanvas&&!finished.has(doneKey)){setShown(start);setSizer(start);}},[]);const run=(from,to)=>{if(isCanvas)return;if(anim)anim.stop();setSizer(to);setAnim(animate(from,to,{...transition,onUpdate:v=>setShown(v)}));};const countUp=()=>{if(finished.has(doneKey)){setSizer(end);setShown(end);return;}// remembered from the start of the count: a copy mounted mid-count shows the end number, not a restart\nfinished.add(doneKey);run(start,end);};useEffect(()=>{if(isDefault&&animation.trigger==\"appear\")countUp();},[]);useEffect(()=>{if(isDefault&&animation.trigger==\"layerInView\"){if(inView){seenInView.current=true;countUp();}else if(seenInView.current){// scrolled away: reset so it counts again when it comes back (Replay)\nif(anim)anim.stop();finished.delete(doneKey);setShown(start);}}},[inView]);useEffect(()=>{if(!isDefault)run(shown,value);},[value]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(Tag,{style:{...props.style,margin:0,opacity:0,pointerEvents:\"none\",userSelect:\"none\",textWrap:props.balance?\"balance\":undefined,fontVariantNumeric:props.monospace?\"tabular-nums\":undefined,textAlign:\"center\",...props.font},children:[props.prefix,format(isCanvas?initial:sizer),props.suffix]}),/*#__PURE__*/_jsxs(MotionTag,{ref:ref,style:{position:\"absolute\",inset:0,userSelect:props.userSelect?\"auto\":\"none\",fontVariantNumeric:props.monospace?\"tabular-nums\":undefined,margin:0,...color.mode==\"solid\"?{color:color.color}:{WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundImage:`linear-gradient(${color.angle}deg, ${color.startColor}, ${color.endColor})`},textDecoration:props.decoration,textWrap:props.balance?\"balance\":undefined,textAlign:\"center\",...props.font,...props.style},children:[props.prefix,format(isCanvas?initial:shown),props.suffix]})]});}AnimatedNumberCounter.displayName=\"Animated Number Counter\";addPropertyControls(AnimatedNumberCounter,{mode:{type:ControlType.Enum,options:[\"default\",\"variants\"],optionTitles:[\"Default\",\"Variants\"],displaySegmentedControl:true},value:{type:ControlType.Number,defaultValue:0,hidden:p=>p.mode!==\"variants\"},start:{type:ControlType.Number,defaultValue:0,hidden:p=>p.mode!==\"default\"},end:{type:ControlType.Number,defaultValue:100,hidden:p=>p.mode!==\"default\"},trigger:{type:ControlType.Enum,defaultValue:\"layerInView\",options:[\"appear\",\"layerInView\"],optionTitles:[\"Appear\",\"Layer in View\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",hidden:p=>p.mode!==\"default\"},replay:{type:ControlType.Boolean,defaultValue:true,hidden:p=>p.mode!==\"default\"||p.trigger!==\"layerInView\"},duration:{type:ControlType.Number,defaultValue:1,min:0,max:10,step:.1,unit:\"s\",hidden:p=>p.mode!==\"default\"},bounce:{type:ControlType.Number,defaultValue:0,min:0,max:1,step:.05,hidden:p=>p.mode!==\"default\"},transition:{type:ControlType.Transition,defaultValue:{type:\"spring\",duration:1,bounce:0},hidden:p=>p.mode!==\"variants\"},decimals:{type:ControlType.Enum,defaultValue:0,options:[0,1,2,3],optionTitles:[\"Off\",\"1\",\"2\",\"3\"],displaySegmentedControl:true},commas:{type:ControlType.Boolean,defaultValue:true},font:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1}},colorMode:{type:ControlType.Enum,defaultValue:\"solid\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],displaySegmentedControl:true},textColor:{type:ControlType.Color,defaultValue:\"#000\",hidden:p=>p.colorMode!==\"solid\"},startColor:{type:ControlType.Color,defaultValue:\"#000\",hidden:p=>p.colorMode!==\"gradient\"},endColor:{type:ControlType.Color,defaultValue:\"#FFF\",hidden:p=>p.colorMode!==\"gradient\"},angle:{type:ControlType.Number,defaultValue:180,min:-360,max:360,unit:\"\\xb0\",hidden:p=>p.colorMode!==\"gradient\"},prefix:{type:ControlType.String,placeholder:\"Prefix\"},suffix:{type:ControlType.String,placeholder:\"Suffix\"},decoration:{type:ControlType.Enum,defaultValue:\"none\",options:[\"none\",\"underline\",\"line-through\"],optionTitles:[\"None\",\"Underline\",\"Strikethrough\"]},balance:{type:ControlType.Boolean,defaultValue:false},userSelect:{type:ControlType.Boolean,defaultValue:true},tag:{type:ControlType.Enum,defaultValue:\"p\",displaySegmentedControl:true,options:[\"h1\",\"h2\",\"h3\",\"p\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"P\"]},monospace:{type:ControlType.Boolean,defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedNumberCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedNumberCounter.map"],"mappings":"A,2RAWG,SAAwBwB,EAAsB,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,MAAI,QAAM,WAAS,UAAQC,EAAYC,EAAU,CAAC,QAAQD,EAAM,QAAQ,OAAOA,EAAM,OAAO,WAAW,CAAC,KAAK,SAAS,S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