{"version":3,"file":"shared-lib.DK17KDkl.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/wojFYexl8SPIb3a9lOzf/ifJDbYeTnKNlyEJNxxwC/LeadsifySpeedOverrides.js"],"sourcesContent":["// Leadsify speed overrides (Oct 2026).\n//\n// Framer marks an image as lazy only when it can work out where the image sits on the page. Inside components\n// that switch variants per breakpoint, and in CMS lists, it can't, so those images download straight away,\n// even far below the fold, and compete with the top of the page for bandwidth (on /blog that was over 1 MB).\n// These overrides set the browser's native loading behaviour on an image layer explicitly.\n//\n// withLazyImage      below-the-fold images: the browser fetches them when they come near the viewport\n// withPriorityImage  the one main image at the top of a page: fetched first, at high priority\n// withLazyMount      video embeds (YouTube) and other heavy components: the page first shows an empty box of the\n//                    same size, and the component (with its thumbnail) is added when it comes near the viewport\n// withLazyRichTextImages  on a CMS rich text layer (blog post and case study body): Framer writes the images\n//                    inside the text without a loading attribute, so every image in a long post downloads with\n//                    the first screen; this marks them lazy, and the browser fetches each near the viewport\n//\n// For tickers and carousels placed on a page, use withLazyInside in LeadsifyLazyInside.tsx. Keep this file to\n// imports that Framer's typings list: smart components that use these overrides could not publish otherwise.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{cloneElement,forwardRef,isValidElement,useEffect,useMemo,useRef,useState}from\"react\";import{RenderTarget}from\"framer\";function withImageLoading(Component,loading){return /*#__PURE__*/forwardRef(function LeadsifyImageLoading(props,ref){const background=props.background;if(!background||typeof background!==\"object\"||!background.src){return /*#__PURE__*/_jsx(Component,{ref:ref,...props});}return /*#__PURE__*/_jsx(Component,{ref:ref,...props,background:{...background,...loading}});});}export function withLazyImage(Component){return withImageLoading(Component,{loading:\"lazy\"});}export function withPriorityImage(Component){return withImageLoading(Component,{loading:\"eager\",fetchPriority:\"high\"});}export function withLazyMount(Component){return /*#__PURE__*/forwardRef(function LeadsifyLazyMount(props,ref){const onCanvas=RenderTarget.current()===RenderTarget.canvas;const holder=useRef(null);const[show,setShow]=useState(false);useEffect(()=>{if(show||onCanvas)return;const el=holder.current;if(!el||typeof IntersectionObserver===\"undefined\"){setShow(true);return;}const io=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){io.disconnect();setShow(true);}},{rootMargin:\"400px 400px\"});io.observe(el);return()=>io.disconnect();},[show,onCanvas]);if(show||onCanvas)return /*#__PURE__*/_jsx(Component,{ref:ref,...props});return /*#__PURE__*/_jsx(\"div\",{ref:holder,\"aria-hidden\":\"true\",style:{width:\"100%\",height:\"100%\",borderRadius:props.style?.borderRadius}});});}export function withLazyRichTextImages(Component){return /*#__PURE__*/forwardRef(function LeadsifyLazyRichTextImages(props,ref){const children=useMemo(()=>lazyImages(props.children,0),[props.children]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,children:children});});}function lazyImages(node,depth){if(node==null||typeof node!==\"object\"||depth>8)return node;if(Array.isArray(node)){let changed=false;const out=node.map(child=>{const next=lazyImages(child,depth+1);if(next!==child)changed=true;return next;});return changed?out:node;}if(!/*#__PURE__*/isValidElement(node))return node;const p=node.props;if(node.type===\"img\"){if(p.loading)return node;return /*#__PURE__*/cloneElement(node,{loading:\"lazy\",decoding:\"async\"});}if(p&&p.children!=null){const kids=lazyImages(p.children,depth+1);if(kids!==p.children)return /*#__PURE__*/cloneElement(node,undefined,kids);}return node;}\nexport const __FramerMetadata__ = {\"exports\":{\"withLazyImage\":{\"type\":\"reactHoc\",\"name\":\"withLazyImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLazyMount\":{\"type\":\"reactHoc\",\"name\":\"withLazyMount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLazyRichTextImages\":{\"type\":\"reactHoc\",\"name\":\"withLazyRichTextImages\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPriorityImage\":{\"type\":\"reactHoc\",\"name\":\"withPriorityImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LeadsifySp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