{"version":3,"file":"Counter.D9y_AbsU.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/xhqpKpVvQ63Ax6m0fpz5/OpWcznMh6t4sEY9r65Y6/Counter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useRef,useEffect,useState}from\"react\";import{motion,useInView,animate}from\"framer-motion\";// =====================================================================\n// Scroll and interaction overrides for the Moonclaf site.\n// Subtle-but-premium intensity.\n// =====================================================================\nconst easePremium=[.22,1,.36,1];// Readers who ask for less motion get the finished state immediately —\n// these overrides start at opacity 0, so without this they would see\n// nothing at all.\nfunction usePrefersReducedMotion(){const[reduced,setReduced]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"||!window.matchMedia)return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");setReduced(mq.matches);const onChange=()=>setReduced(mq.matches);mq.addEventListener(\"change\",onChange);return()=>mq.removeEventListener(\"change\",onChange);},[]);return reduced;}// ---- Scroll reveal: fade + slide-up + blur-to-sharp -----------------\nfunction reveal(Component,distance,duration,delay){return /*#__PURE__*/forwardRef((props,ref)=>{const localRef=useRef(null);const[settled,setSettled]=useState(false);const reduced=usePrefersReducedMotion();const inView=useInView(localRef,{once:true,margin:\"0px 0px -30% 0px\"});const shown=reduced||inView;return /*#__PURE__*/_jsx(motion.div,{ref:localRef,initial:{opacity:0,y:distance,filter:\"blur(8px)\"},animate:shown?{opacity:1,y:0,filter:\"blur(0px)\"}:{opacity:0,y:distance,filter:\"blur(8px)\"},transition:reduced?{duration:0}:{duration,ease:easePremium,delay},onAnimationComplete:()=>setSettled(true),style:{width:\"100%\",// Dropped once the animation is done: a permanent\n// will-change keeps a GPU layer alive for nothing.\nwillChange:settled?\"auto\":\"transform, opacity, filter\"},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props})});});}export function withScrollReveal(Component){return reveal(Component,28,1.1,0);}export function withReveal1(Component){return reveal(Component,28,1.1,0);}export function withReveal2(Component){return reveal(Component,28,1.1,.1);}export function withReveal3(Component){return reveal(Component,28,1.1,.2);}export function withReveal4(Component){return reveal(Component,28,1.1,.3);}// ---- Count-up for stat numbers --------------------------------------\n// Finds the deepest text node, parses a leading integer, then animates\n// from 0 up to it on scroll-into-view, preserving prefix/suffix\n// (e.g. \"+\", \"%\"). Non-numeric text (fractions etc.) is left untouched.\nexport function withCountUp(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const wrapRef=useRef(null);const reduced=usePrefersReducedMotion();const inView=useInView(wrapRef,{once:true,margin:\"-15% 0px\"});useEffect(()=>{if(!inView||reduced)return;const root=wrapRef.current;if(!root)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);let node=null;while(walker.nextNode()){const t=walker.currentNode;if(t.textContent&&/\\d/.test(t.textContent)){node=t;break;}}if(!node)return;const original=(node.textContent||\"\").trim();const match=original.match(RegExp(\"^(\\\\D*)(\\\\d[\\\\d,]*)(.*)$\",\"s\"));if(!match)return;const prefix=match[1];const target=parseInt(match[2].replace(/,/g,\"\"),10);const suffix=match[3];const controls=animate(0,target,{duration:1.4,ease:easePremium,onUpdate:val=>{if(node)node.textContent=prefix+Math.round(val)+suffix;},onComplete:()=>{if(node)node.textContent=original;}});return()=>{controls.stop();// Always restore the authored text, even if the reader\n// scrolls away mid-count.\nif(node)node.textContent=original;};},[inView,reduced]);return /*#__PURE__*/_jsx(\"div\",{ref:wrapRef,style:{width:\"100%\"},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props})});});}// ---- Card hover: scale + lift ---------------------------------------\nexport function withCardHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const reduced=usePrefersReducedMotion();return /*#__PURE__*/_jsx(motion.div,{style:{width:\"100%\"},initial:{scale:1,y:0},whileHover:reduced?undefined:{scale:1.025,y:-8},transition:{type:\"spring\",stiffness:300,damping:26},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props})});});}// ---- Reveal + card hover combined (for work cards) ------------------\nexport function withRevealCard(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const localRef=useRef(null);const[settled,setSettled]=useState(false);const reduced=usePrefersReducedMotion();const inView=useInView(localRef,{once:true,margin:\"0px 0px -30% 0px\"});const shown=reduced||inView;return /*#__PURE__*/_jsx(motion.div,{ref:localRef,initial:{opacity:0,y:28,filter:\"blur(8px)\"},animate:shown?{opacity:1,y:0,filter:\"blur(0px)\"}:{opacity:0,y:28,filter:\"blur(8px)\"},transition:reduced?{duration:0}:{duration:1.1,ease:easePremium},whileHover:reduced?undefined:{scale:1.025,y:-8},onAnimationComplete:()=>setSettled(true),style:{width:\"100%\",willChange:settled?\"auto\":\"transform, opacity, filter\"},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props})});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRevealCard\":{\"type\":\"reactHoc\",\"name\":\"withRevealCard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReveal2\":{\"type\":\"reactHoc\",\"name\":\"withReveal2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReveal1\":{\"type\":\"reactHoc\",\"name\":\"withReveal1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountUp\":{\"type\":\"reactHoc\",\"name\":\"withCountUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCardHover\":{\"type\":\"reactHoc\",\"name\":\"withCardHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollReveal\":{\"type\":\"reactHoc\",\"name\":\"withScrollReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReveal4\":{\"type\":\"reactHoc\",\"name\":\"withReveal4\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReveal3\":{\"type\":\"reactHoc\",\"name\":\"withReveal3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],"mappings":"+MAOA,SAAS,GAAyB,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAA4S,OA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