{"version":3,"file":"QuickCount.BFKnSiZZ.mjs","names":["useRef","useCallback","__esmMin","init_ssg_sandbox_shims","ne","window","de","init_jsx_runtime","J","init_npm_react_18_3_1","ce","isStaticRenderer","init_framer_BisrWwwE","setComposedRef","ref","value","withQuickCount","hostRef","hasAnimatedRef","hasStartedRef","startTimeRef","rafRef","setRef","node","root","walker","textNode","matchedParts","current","match","leading","target","trailing","reducedMotion","setValue","easeOutCubic","t","step","start","now","progress","eased","observer","entries","Component","props","init_QuickCount"],"sources":["https:/framerusercontent.com/modules/cINPc3NASE7RdhByCs0z/E5Lw5ImWhv0pE0JQhbd8/QuickCount.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";import{isStaticRenderer}from\"framer\";function setComposedRef(ref,value){if(!ref)return;if(typeof ref===\"function\"){ref(value);return;}ref.current=value;}export function withQuickCount(Component){return /*#__PURE__*/forwardRef(function WithQuickCount(props,ref){const hostRef=useRef(null);const hasAnimatedRef=useRef(false);const hasStartedRef=useRef(false);const startTimeRef=useRef(null);const rafRef=useRef(null);const setRef=useCallback(node=>{hostRef.current=node;setComposedRef(ref,node);},[ref]);useEffect(()=>{if(typeof window===\"undefined\")return;if(isStaticRenderer())return;if(hasAnimatedRef.current)return;const root=hostRef.current;if(!root)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);let textNode=null;let matchedParts=null;while(walker.nextNode()){const current=walker.currentNode;if(!(current instanceof Text))continue;const source=current.nodeValue??\"\";const match=source.match(/^([^\\d]*)(\\d+)([^\\d]*)$/);if(!match)continue;const prefix=match[1]??\"\";if(prefix.includes(\"/\"))continue;if(match[2]){textNode=current;matchedParts=match;break;}}if(!textNode||!matchedParts)return;const leading=matchedParts[1]??\"\";const target=Number.parseInt(matchedParts[2]??\"100\",10)||100;const trailing=matchedParts[3]??\"\";const reducedMotion=window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;const setValue=value=>{textNode.nodeValue=`${leading}${value}${trailing}`;};if(reducedMotion){setValue(target);hasAnimatedRef.current=true;return;}const duration=800;const easeOutCubic=t=>1-Math.pow(1-t,3);const step=now=>{const start=startTimeRef.current??now;const progress=Math.min(1,(now-start)/duration);const eased=easeOutCubic(progress);const value=Math.round(target*eased);setValue(value);if(progress<1){rafRef.current=window.requestAnimationFrame(step);}else{hasAnimatedRef.current=true;rafRef.current=null;}};const observer=new IntersectionObserver(entries=>{const entry=entries[0];if(!entry?.isIntersecting)return;observer.disconnect();if(hasAnimatedRef.current||hasStartedRef.current)return;hasStartedRef.current=true;startTimeRef.current=performance.now();setValue(0);rafRef.current=window.requestAnimationFrame(step);},{threshold:.2});observer.observe(root);return()=>{observer.disconnect();if(rafRef.current!==null){window.cancelAnimationFrame(rafRef.current);rafRef.current=null;}};},[]);return /*#__PURE__*/_jsx(Component,{ref:setRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withQuickCount\":{\"type\":\"reactHoc\",\"name\":\"withQuickCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./QuickCount.map"],"mappings":"A,iMAA2I,SAASa,EAAe,EAAI,EAAM,CAAKC,IAAc,OAAOA,GAAM,WAAYA,EAAIC,CAAK,EAAU,EAAI,QAAQA,EAAM,CAAC,SAAgBC,EAAe,EAAU,CAAC,MAAoB,gBAAW,SAAwB,EAAM,EAAI,CAAC,IAAMC,EAAQjB,EAAO,IAAI,EAAQkB,EAAelB,EAAO,EAAK,EAAQmB,EAAcnB,EAAO,EAAK,EAAQoB,EAAapB,EAAO,IAAI,EAAQqB,EAAOrB,EAAO,IAAI,EAAQsB,EAAOrB,EAAY,GAAM,CAAC,EAAQ,QAAQsB,EAAKV,EAAeC,EAAIS,CAAI,CAAE,EAAE,CAACT,CAAG,CAAC,EAA8yD,OAA5yDJ,MAAc,CAAoE,GAAzDL,IAAS,QAAsBM,EAAiB,GAAYO,EAAe,QAAQ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