{"version":3,"file":"StatTicker.fSXLkay_.mjs","names":["useState","useCallback","__esmMin","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","_e","J","init_jsx_runtime","ce","init_framer_Bf4_tcb2","useIsStaticRenderer","assignRef","ref","value","buildRollers","strips","walker","root","textNodes","n","textNode","fragment","char","slot","cellHeight","sizer","strip","i","cell","withDigitTicker","node","setNode","isStatic","combinedRef","original","lineHeight","overlay","observer","doneTimer","finish","roll","count","delay","index","STAGGER","DURATION","EASE","entries","Component","props","init_StatTicker"],"sources":["https:/framerusercontent.com/modules/Y4CjHri2HajqRBlrSO3Z/0gCLuT8GNP1NauUBRgmc/StatTicker.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";// Odometer-style \"ticker\" for the portfolio outcome stats: each digit rolls\n// up through 0–9 and lands on its value when the card scrolls into view.\n// It never edits the text React rendered: it lays a cloned copy of the text\n// over the original (which stays in place, hidden, so layout doesn't move),\n// rolls the digits in the clone, then removes it and shows the real text.\nconst DURATION=1600;const STAGGER=90;const EASE=\"cubic-bezier(0.16, 1, 0.3, 1)\";function assignRef(ref,value){if(typeof ref===\"function\"){ref(value);return;}if(ref){ref.current=value;}}function buildRollers(root,cellHeight){const strips=[];const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);const textNodes=[];for(let n=walker.nextNode();n;n=walker.nextNode())textNodes.push(n);for(const textNode of textNodes){const fragment=document.createDocumentFragment();for(const char of textNode.nodeValue??\"\"){if(!/\\d/.test(char)){fragment.appendChild(document.createTextNode(char));continue;}const slot=document.createElement(\"span\");slot.style.cssText=`display:inline-block;position:relative;height:${cellHeight}px;overflow-y:clip;overflow-x:visible;vertical-align:top`;// Invisible copy of the final digit gives the slot its exact width\nconst sizer=document.createElement(\"span\");sizer.textContent=char;sizer.style.visibility=\"hidden\";const strip=document.createElement(\"span\");strip.style.cssText=`position:absolute;left:0;right:0;top:0;display:flex;flex-direction:column;align-items:center;transform:translateY(0);will-change:transform`;for(let i=0;i<20;i++){const cell=document.createElement(\"span\");cell.textContent=String(i%10);cell.style.cssText=`display:block;height:${cellHeight}px;line-height:${cellHeight}px`;strip.appendChild(cell);}strip.dataset.target=String(10+Number(char));slot.append(sizer,strip);fragment.appendChild(slot);strips.push(strip);}textNode.replaceWith(fragment);}return strips;}/**\n * @framerDisableUnlink\n */export function withDigitTicker(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[node,setNode]=useState(null);const isStatic=useIsStaticRenderer();const combinedRef=useCallback(value=>{setNode(value);assignRef(ref,value);},[ref]);useEffect(()=>{if(typeof window===\"undefined\"||isStatic||!node)return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;const original=node.firstElementChild;if(!original||!/\\d/.test(original.textContent??\"\"))return;const lineHeight=parseFloat(getComputedStyle(original).lineHeight);const cellHeight=Number.isFinite(lineHeight)?lineHeight:original.getBoundingClientRect().height;const overlay=original.cloneNode(true);overlay.setAttribute(\"aria-hidden\",\"true\");overlay.style.position=\"absolute\";overlay.style.inset=\"0\";overlay.style.margin=\"0\";const strips=buildRollers(overlay,cellHeight);if(getComputedStyle(node).position===\"static\")node.style.position=\"relative\";node.appendChild(overlay);original.style.visibility=\"hidden\";let observer=null;let doneTimer=null;const finish=()=>{overlay.remove();original.style.visibility=\"\";};const roll=()=>{const count=strips.length;strips.forEach((strip,index)=>{// Rightmost digits travel furthest, like a real odometer.\nconst delay=(count-1-index)*STAGGER;strip.style.transition=`transform ${DURATION}ms ${EASE} ${delay}ms`;strip.style.transform=`translateY(-${Number(strip.dataset.target)*cellHeight}px)`;});doneTimer=window.setTimeout(finish,DURATION+STAGGER*count+50);};if(typeof IntersectionObserver===\"undefined\"){window.requestAnimationFrame(roll);}else{observer=new IntersectionObserver(entries=>{if(!entries[0]?.isIntersecting)return;observer?.disconnect();window.requestAnimationFrame(roll);},{threshold:.5});observer.observe(node);}return()=>{observer?.disconnect();if(doneTimer!==null)window.clearTimeout(doneTimer);finish();};},[node,isStatic]);return /*#__PURE__*/_jsx(Component,{ref:combinedRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withDigitTicker\":{\"type\":\"reactHoc\",\"name\":\"withDigitTicker\",\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StatTicker.map"],"mappings":"A,kMAKgF,SAASa,EAAU,EAAI,EAAM,CAAI,OAAOC,GAAM,WAAYA,EAAIC,CAAK,EAAaD,IAAK,EAAI,QAAQC,EAAO,CAAC,SAASC,EAAa,EAAK,EAAW,CAAC,IAAMC,EAAO,CAAC,EAAQC,EAAO,SAAS,iBAAiBC,EAAK,WAAW,SAAS,EAAQC,EAAU,CAAC,EAAE,IAAI,IAAIC,EAAEH,EAAO,SAAS,EAAEG,EAAE,EAAEH,EAAO,SAAS,EAAEE,EAAU,KAAKC,CAAC,EAAE,IAAI,IAAMC,KAAYF,EAAU,CAAC,IAAMG,EAAS,SAAS,uBAAuB,EAAE,IAAI,IAAMC,KAAQF,EAAS,WAAW,GAAG,CAAC,GAAG,CAAC,KAAK,KAAKE,CAAI,EAAE,CAACD,EAAS,YAAY,SAAS,eAAeC,CAAI,CAAC,EAAE,QAAS,CAAC,IAAMC,EAAK,SAAS,cAAc,MAAM,EAAE,EAAK,MAAM,QAAQ,iDAAiDC,EAAW,0DACjtB,IAAMC,EAAM,SAAS,cAAc,MAAM,EAAE,EAAM,YAAYH,EAAK,EAAM,MAAM,WAAW,SAAS,IAAMI,EAAM,SAAS,cAAc,MAAM,EAAE,EAAM,MAAM,QAAQ,6IAA6I,IAAI,IAAIC,EAAE,EAAEA,EAAE,GAAG,IAAI,CAAC,IAAMC,EAAK,SAAS,cAAc,MAAM,EAAE,EAAK,YAAY,OAAOD,EAAE,EAAE,EAAE,EAAK,MAAM,QAAQ,wBAAwBH,EAAW,iBAAiBA,EAAW,IA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