{"version":3,"file":"CountUp_Thousands.CKyIC6SS.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/goxsOyBo6M17ee22DuMc/K2rHzrdpcchZUyn03ehr/CountUp_Thousands.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const QUOTED=/^([\"']).*\\1$/;const GENERIC_FAMILIES=new Set([\"serif\",\"sans-serif\",\"monospace\",\"cursive\",\"fantasy\",\"system-ui\",\"ui-serif\",\"ui-sans-serif\",\"ui-monospace\",\"ui-rounded\",\"inherit\",\"initial\",\"unset\"]);// A family name like \"Source Serif 4\" is not a valid unquoted CSS identifier —\n// one of its components starts with a digit — so the browser throws out the\n// whole font-family declaration and the text silently falls back. Quote each.\nfunction cssFontFamily(value){return(value||\"\").split(\",\").map(part=>part.trim()).filter(Boolean).map(part=>QUOTED.test(part)||GENERIC_FAMILIES.has(part.toLowerCase())?part:`\"${part.replace(/[\"']/g,\"\")}\"`).join(\", \");}/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{targetNumber,duration,font,color,fontSize,lineHeight,fontWeight}=props;// On the canvas there is no scrolling viewport to intersect, so the\n// animation never starts. Show the real target number there instead of\n// sitting at 0 — otherwise editing Target Number looks like it does nothing.\nconst isStatic=useIsStaticRenderer();const[count,setCount]=useState(0);const[isVisible,setIsVisible]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);useEffect(()=>{if(isStatic)return;const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){setIsVisible(true);setHasAnimated(true);let start=0;const increment=targetNumber/(duration*60);const updateCounter=()=>{start+=increment;if(start<targetNumber){setCount(Math.ceil(start));requestAnimationFrame(updateCounter);}else{setCount(targetNumber);}};updateCounter();}},{threshold:.1});const element=ref.current;if(element){observer.observe(element);}return()=>{if(element){observer.unobserve(element);}};},[targetNumber,duration,hasAnimated,isStatic]);const shown=isStatic?targetNumber:count;return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,ref:ref,children:/*#__PURE__*/_jsx(\"span\",{style:{...textStyle,fontFamily:cssFontFamily(font),color:color,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,fontWeight:fontWeight,opacity:isStatic||isVisible?1:0,transition:\"opacity 0.5s ease-in-out\"},children:shown.toLocaleString()})});}// Styles are written in object syntax\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const textStyle={letterSpacing:\"0em\",textAlign:\"center\",margin:\"0\"};// Adding property controls for Framer\naddPropertyControls(CountUp,{targetNumber:{type:ControlType.Number,title:\"Target Number\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:2,step:.1},font:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Source Serif 4, serif\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgb(255, 255, 255)\"},fontSize:{type:ControlType.Number,title:\"Font Size (px)\",defaultValue:54,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height (px)\",defaultValue:54,unit:\"px\"},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:\"400\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp_Thousands.map"],"mappings":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