{"version":3,"file":"CaseStudyHTML.CAQDymMB.mjs","names":["useRef","useMemo","__esmMin","init_npm_react_18_3_1","pe","window","ce","init_jsx_runtime","c","de","init_ssg_sandbox_shims","RenderTarget","init_framer_BWFVvmND","split","scripts","markup","html","src","attrs","code","BASE_CSS","watchBookingHeight","w","d","f","scopedDocument","prop","root","sel","list","id","value","target","CaseStudyHTML","props","ref","done","run","doc","s","el","style","init_CaseStudyHTML"],"sources":["https:/framerusercontent.com/modules/bZIt9NfzX1vhQHt3BHdH/XVHgLxrcIHQr2PPW6DI1/CaseStudyHTML.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useMemo,useRef}from\"react\";import{RenderTarget}from\"framer\";const BASE_CSS=\"<style>.vcs{width:100%!important;left:0!important;margin-left:0!important}\"+\".vcs [id]{scroll-margin-top:96px}\"+// Keep the GHL booking calendar visible. form_embed.js hides it until a\n// handshake that does not complete on this site.\n'.vcs iframe[src*=\"widget/booking\"]{opacity:1!important;visibility:visible!important;pointer-events:auto!important;position:relative!important;left:0!important;display:block!important;min-height:640px}</style>';function split(html){const scripts=[];const markup=html.replace(/<script\\b([^>]*)>([\\s\\S]*?)<\\/script>/gi,(_m,attrs,code)=>{const src=/\\bsrc\\s*=\\s*[\"']([^\"']+)[\"']/i.exec(attrs);if(src)scripts.push({src:src[1]});else if(code.trim())scripts.push({code});return\"\";});return{markup:BASE_CSS+markup,scripts};}// Size GHL booking iframes from the widget's own height messages.\nfunction watchBookingHeight(){const w=window;if(w.__vidaBookingHeight)return;w.__vidaBookingHeight=true;window.addEventListener(\"message\",e=>{if(!/leadconnectorhq\\.com|msgsndr\\.com/.test(e.origin))return;const d=e.data;if(!Array.isArray(d)||d[0]!==\"highlevel.setHeight\")return;if(!d[1]||!d[1].height)return;document.querySelectorAll('iframe[src*=\"widget/booking\"]').forEach(f=>{if(f.contentWindow===e.source)f.style.setProperty(\"height\",d[1].height+\"px\",\"important\");});});}function scopedDocument(root){return new Proxy(document,{get(target,prop){if(prop===\"querySelector\")return sel=>root.querySelector(sel)??document.querySelector(sel);if(prop===\"querySelectorAll\")return sel=>{const list=root.querySelectorAll(sel);return list.length?list:document.querySelectorAll(sel);};if(prop===\"getElementById\")return id=>root.querySelector(\"#\"+CSS.escape(id))??document.getElementById(id);const value=Reflect.get(target,prop,target);return typeof value===\"function\"?value.bind(target):value;}});}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function CaseStudyHTML(props){const{html,style}=props;const ref=useRef(null);const{markup,scripts}=useMemo(()=>split(html||\"\"),[html]);useEffect(()=>{watchBookingHeight();const target=RenderTarget.current();if(target===RenderTarget.canvas||target===RenderTarget.thumbnail||target===RenderTarget.export)return;const root=ref.current;if(!root)return;let done=false;const run=()=>{if(done||!root.isConnected||root.getClientRects().length===0)return;done=true;window.removeEventListener(\"resize\",run);const doc=scopedDocument(root);for(const s of scripts){if(s.src){if(!document.querySelector(`script[src=\"${s.src}\"]`)){const el=document.createElement(\"script\");el.src=s.src;el.async=true;document.body.appendChild(el);}continue;}try{new Function(\"document\",s.code).call(window,doc);}catch(e){console.warn(\"[CaseStudyHTML]\",e);}}};run();if(!done)window.addEventListener(\"resize\",run);return()=>window.removeEventListener(\"resize\",run);},[scripts]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",...style},suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:markup}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CaseStudyHTML\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CaseStudyHTML.map"],"mappings":"A,gMAEmN,SAASa,EAAM,EAAK,CAAC,IAAMC,EAAQ,CAAC,EAAQC,EAAOC,EA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