{"version":3,"file":"Random_Count.CyOscu4F.mjs","names":["useState","useRef","__esmMin","te","init_npm_react_18_3_1","de","init_jsx_runtime","c","ce","_e","useInView","init_framer_motion_4S6DXN7I","withFakeViewCount400","withFakeViewCount5000","init_Random_Count","viewCount","setViewCount","ref","inView","interval","newCount","prev","Component","props"],"sources":["https:/framerusercontent.com/modules/ss6gKSJc8PZHm0jynO9o/lvjRouZGTM2TWPlnPocP/Random_Count.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition,useRef}from\"react\";import{useInView}from\"framer-motion\";export const withFakeViewCount400=Component=>{return props=>{const[viewCount,setViewCount]=useState(400)// Initial view count\n;const ref=useRef();const inView=useInView(ref);useEffect(()=>{if(!inView)return;const updateViewCount=()=>{startTransition(()=>setViewCount(prev=>{const change=Math.floor(Math.random()*3)-1// Randomly -1, 0, or +1\n    ;const newCount=prev+change;return Math.min(Math.max(newCount,413),420)// Clamp to range 400–415\n    ;}));};const interval=setInterval(updateViewCount,Math.random()*500+1e3)// Update every 3-6 seconds\n;return()=>clearInterval(interval)// Cleanup on unmount\n;},[inView]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,text:viewCount.toString()});};};export const withFakeViewCount5000=Component=>{return props=>{const[viewCount,setViewCount]=useState(5143)// Initial view count\n;const ref=useRef();const inView=useInView(ref);useEffect(()=>{if(!inView)return;const updateViewCount=()=>{startTransition(()=>setViewCount(prev=>{const change=Math.floor(Math.random()*3)-1// Randomly -1, 0, or +1\n    ;const newCount=prev+change;return Math.min(Math.max(newCount,5e3),5200)// Clamp to range 400–415\n    ;}));};const interval=setInterval(updateViewCount,Math.random()*100+500)// Update every 3-6 seconds\n;return()=>clearInterval(interval)// Cleanup on unmount\n;},[inView]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,text:viewCount.toString()});};};\nexport const __FramerMetadata__ = {\"exports\":{\"withFakeViewCount400\":{\"type\":\"reactHoc\",\"name\":\"withFakeViewCount400\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFakeViewCount5000\":{\"type\":\"reactHoc\",\"name\":\"withFakeViewCount5000\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Random_Count.map"],"mappings":"A,0OAA0J,EAAqB,GAAmB,GAAO,CAAC,GAAK,CAACe,EAAUC,GAAchB,EAAS,GAAG,EAC7OiB,EAAIhB,EAAO,EAAQiB,EAAOR,EAAUO,CAAG,EAIjC,OAJmCT,MAAc,CAAC,GAAG,CAACU,EAAO,OAE/D,IAAMC,EAAS,gBAFiF,CAAChB,MAAoBa,EAAa,GAAM,CAC9I,IAAMI,EAASC,GAD6I,KAAK,MAAM,KAAK,OAAO,EAAE,CAAC,EAAE,GAC7J,OAAO,KAAK,IAAI,KAAK,IAAID,EAAS,GAAG,EAAE,GAAG,CACrE,CAAC,CAAC,CAAE,EAA6C,KAAK,OAAO,EAAE,IAAI,GAAG,EAC1E,UAAU,cAAcD,CAAQ,CAChC,EAAE,CAACD,CAAM,CAAC,EAAsB,gBAAKI,EAAU,CAAC,GAAGC,EAAU,MAAI,KAAKR,EAAU,SAAS,CAAC,CAAC,CAAE,EAAiB,EAAsB,GAAmB,GAAO,CAAC,GAAK,CAACA,EAAUC,GAAchB,EAAS,IAAI,EACpMiB,EAAIhB,EAAO,EAAQiB,EAAOR,EAAUO,CAAG,EAIjC,OAJmCT,MAAc,CAAC,GAAG,CAACU,EAAO,OAE/D,IAAMC,EAAS,gBAFiF,CAAChB,MAAoBa,EAAa,GAAM,CAC9I,IAAMI,EAASC,GAD6I,KAAK,MAAM,KAAK,OAAO,EAAE,CAAC,EAAE,GAC7J,OAAO,KAAK,IAAI,KAAK,IAAID,EAAS,GAAG,EAAE,IAAI,CACtE,CAAC,CAAC,CAAE,EAA6C,KAAK,OAAO,EAAE,IAAI,GAAG,EAC1E,UAAU,cAAcD,CAAQ,CAChC,EAAE,CAACD,CAAM,CAAC,EAAsB,gBAAKI,EAAU,CAAC,GAAGC,EAAU,MAAI,KAAKR,EAAU,SAAS,CAAC,CAAC,CAAE,C"}