{"version":3,"file":"CountUpStat.DWkDyVJb.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/zU98bgEtJBVBuo0xD9ja/ubEPI6yJjGukpwLyLB8i/CountUpStat.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const HEAD_FONT=\"'Montserrat', 'Helvetica Neue', sans-serif\";const BODY_FONT=\"'Archivo', 'Helvetica Neue', sans-serif\";/**\n * A big stat that counts up from 0 when scrolled into view.\n * e.g. \"51%\" — of every dollar given away. Static under\n * prefers-reduced-motion and on the Framer canvas.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 320\n */export default function CountUpStat(props){const{value,prefix,suffix,label,numberColor,labelColor,size,align,style}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=React.useRef(null);const[display,setDisplay]=React.useState(value);const started=React.useRef(false);React.useEffect(()=>{setDisplay(value);},[value]);React.useEffect(()=>{if(isCanvas||typeof window===\"undefined\")return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;if(!(\"IntersectionObserver\"in window))return;const io=new IntersectionObserver(entries=>{if(!entries.some(e=>e.isIntersecting)||started.current)return;started.current=true;io.disconnect();const t0=performance.now();const dur=1400;const tick=t=>{const p=Math.min(1,(t-t0)/dur);// ease-out cubic\nconst eased=1-Math.pow(1-p,3);setDisplay(Math.round(value*eased));if(p<1)requestAnimationFrame(tick);};setDisplay(0);requestAnimationFrame(tick);},{threshold:.5});if(ref.current)io.observe(ref.current);return()=>io.disconnect();},[isCanvas,value]);const numSize=size===\"xl\"?\"clamp(64px, 10vw, 120px)\":\"clamp(44px, 6vw, 72px)\";return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{display:\"flex\",flexDirection:\"column\",alignItems:align===\"center\"?\"center\":\"flex-start\",gap:8,...style},children:[/*#__PURE__*/_jsxs(\"div\",{style:{fontFamily:HEAD_FONT,fontWeight:800,fontSize:numSize,lineHeight:1,letterSpacing:\"-0.03em\",color:numberColor,fontVariantNumeric:\"tabular-nums\"},children:[prefix,display.toLocaleString(\"en-US\"),suffix]}),label?/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:BODY_FONT,fontWeight:400,fontSize:16,lineHeight:1.45,color:labelColor,maxWidth:360,textAlign:align===\"center\"?\"center\":\"left\"},children:label}):null]});}addPropertyControls(CountUpStat,{value:{type:ControlType.Number,title:\"Value\",defaultValue:51,min:0,max:1e5,step:1},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"%\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"of every dollar given is given away\",displayTextArea:true},numberColor:{type:ControlType.Color,title:\"Number\",defaultValue:\"#4d9ee9\"},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#000000\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"lg\",\"xl\"],optionTitles:[\"Large\",\"XL\"],defaultValue:\"xl\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\"],optionTitles:[\"Left\",\"Center\"],defaultValue:\"left\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUpStat\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"320\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUpStat.map"],"mappings":"oNAQG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,SAAO,SAAO,QAAM,cAAY,aAAW,OAAK,QAAM,SAAO,EAAY,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAIA,EAAa,IAAI,EAAO,CAAC,EAAQ,GAAYC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