{"version":3,"file":"Read_TIme.D4tSM2g3.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/sfEuj1NBeQynd4qU6vUg/S1a644txFQwt97vBtza0/Read_TIme.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// Apply this to the RichText layer itself\nexport function CaptureContent(Component){return props=>{const ref=useRef(null);useEffect(()=>{if(typeof window===\"undefined\"||!ref.current)return;const captureText=()=>{if(!ref.current)return;// We're already wrapping the RichText - just query THIS element\nconst textElements=ref.current.querySelectorAll(\"h1, h2, h3, h4, h5, h6, p, li\");const allText=Array.from(textElements).map(el=>(el.textContent||\"\").trim()).filter(text=>text.length>0).join(\" \");if(allText.length>50){window.__blogContent=allText;window.dispatchEvent(new CustomEvent(\"contentReady\"));console.log(`✓ Captured from THIS container: ${allText.length} chars`);console.log(`First 100: \"${allText.substring(0,100)}\"`);}};// Try immediately and on delays\ncaptureText();const timeout1=setTimeout(captureText,100);const timeout2=setTimeout(captureText,500);const timeout3=setTimeout(captureText,1e3);return()=>{clearTimeout(timeout1);clearTimeout(timeout2);clearTimeout(timeout3);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,children:/*#__PURE__*/_jsx(Component,{...props})});};}// On tag component - keep this the same\nexport function InjectReadTime(Component){return props=>{const ref=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;const updateTag=()=>{if(!ref.current)return;const pTag=ref.current.querySelector('[data-framer-name=\"TagText\"] p');if(pTag&&window.__blogContent){const words=window.__blogContent.trim().split(/\\s+/).filter(Boolean).length;const minutes=Math.max(1,Math.ceil(words/200));pTag.textContent=`${minutes} min read`;console.log(`✓ ${minutes} min (${words} words)`);}};window.addEventListener(\"contentReady\",updateTag);setTimeout(updateTag,200);setTimeout(updateTag,600);setTimeout(updateTag,1200);return()=>window.removeEventListener(\"contentReady\",updateTag);},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"InjectReadTime\":{\"type\":\"reactHoc\",\"name\":\"InjectReadTime\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CaptureContent\":{\"type\":\"reactHoc\",\"name\":\"CaptureContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Read_TIme.map"],"mappings":"kIACA,SAAgB,EAAe,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,KAAK,CAEwJ,OAFvJ,MAAc,CAAC,GAAU,IAAS,QAAa,CAAC,EAAI,QAAQ,OAAO,IAAM,MAAgB,CAAC,GAAG,CAAC,EAAI,QAAQ,OAC1L,IAAM,EAAa,EAAI,QAAQ,iBAAiB,gCAAgC,CAAO,EAAQ,MAAM,KAAK,EAAa,CAAC,IAAI,IAAK,EAAG,aAAa,IAAI,MAAM,CAAC,CAAC,OAAO,GAAM,EAAK,OAAO,EAAE,CAAC,KAAK,IAAI,CAAI,EAAQ,OAAO,KAAI,EAAO,cAAc,EAAQ,EAAO,cAAc,IAAI,YAAY,eAAe,CAAC,CAAC,QAAQ,IAAI,mCAAmC,EAAQ,OAAO,QAAQ,CAAC,QAAQ,IAAI,eAAe,EAAQ,UAAU,EAAE,IAAI,CAAC,GAAG,GAC1a,GAAa,CAAC,IAAM,EAAS,WAAW,EAAY,IAAI,CAAO,EAAS,WAAW,EAAY,IAAI,CAAO,EAAS,WAAW,EAAY,IAAI,CAAC,UAAU,CAAC,aAAa,EAAS,CAAC,aAAa,EAAS,CAAC,aAAa,EAAS,GAAK,EAAE,CAAC,CAAqB,EAAK,MAAM,CAAK,MAAI,SAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAAC,CAAC,EACjU,SAAgB,EAAe,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAIA,EAAO,KAAK,CAAomB,OAAnmB,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO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