{"version":3,"file":"SQ_Embed.DHBVdUOD.mjs","names":["React.useRef","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","p","de","RenderTarget","addPropertyControls","init_framer_DcxuU94H","ControlType","SQEmbed","props","ref","onCanvas","el","html","cancelled","scripts","old","s","a","waitLoad","res","label","init_SQ_Embed"],"sources":["https:/framerusercontent.com/modules/5bUPIBIqVBspYHufTvWb/ddAblkb2YiWWQEh1srQq/SQ_Embed.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * SQ Embed: renders an embed snippet copied exactly from the Squarespace page\n * (HubSpot meetings, Infusionsoft forms, etc.) and runs its scripts in order.\n * Old-site (SQ) pages only.\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-auto\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 300\n */export default function SQEmbed(props){const{html,label}=props;const ref=React.useRef(null);const onCanvas=RenderTarget.current()===RenderTarget.canvas;React.useEffect(()=>{const el=ref.current;if(!el||onCanvas||!html)return;let cancelled=false;el.innerHTML=html;const scripts=Array.from(el.querySelectorAll(\"script\"));const run=async()=>{for(const old of scripts){if(cancelled)return;const s=document.createElement(\"script\");for(const a of Array.from(old.attributes))s.setAttribute(a.name,a.value);if(old.src){const waitLoad=!old.async&&!old.defer;await new Promise(res=>{s.onload=()=>res();s.onerror=()=>res();old.parentNode?.replaceChild(s,old);if(!waitLoad)res();});}else{s.text=old.text;old.parentNode?.replaceChild(s,old);}}};run();return()=>{cancelled=true;el.innerHTML=\"\";};},[html,onCanvas]);if(onCanvas){return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,width:\"100%\",minHeight:120,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",border:\"2px dashed rgba(27,27,27,0.3)\",fontFamily:\"sans-serif\",fontSize:14,color:\"rgba(27,27,27,0.6)\",textAlign:\"center\",padding:16,boxSizing:\"border-box\"},children:[label||\"Embed\",\" (live embed renders on the published site)\"]});}return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...props.style,width:\"100%\"}});}addPropertyControls(SQEmbed,{label:{type:ControlType.String,title:\"Label\"},html:{type:ControlType.String,title:\"Embed Code\",displayTextArea:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SQEmbed\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-auto\",\"framerIntrinsicHeight\":\"300\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"600\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SQ_Embed.map"],"mappings":"A,gMAQG,SAAwBY,EAAQ,EAAM,CAAC,GAAK,CAAC,OAAK,SAAOC,EAAYC,EAAId,EAAa,IAAI,EAAQe,EAASP,EAAa,QAAQ,IAAIA,EAAa,OAAihC,OAA1gCL,MAAoB,CAAC,IAAMa,EAAGF,EAAI,QAAQ,GAAG,CAACE,GAAID,GAAU,CAACE,EAAK,OAAO,IAAIC,EAAU,GAAM,EAAG,UAAUD,EAAK,IAAME,EAAQ,MAAM,KAAKH,EAAG,iBAAiB,QAAQ,CAAC,EAAqa,OAAN,SAA1Y,CAAC,IAAI,IAAMI,KAAOD,EAAQ,CAAC,GAAGD,EAAU,OAAO,IAAMG,EAAE,SAAS,cAAc,QAAQ,EAAE,IAAI,IAAMC,KAAK,MAAM,KAAKF,EAAI,UAAU,EAAEC,EAAE,aAAaC,EAAE,KAAKA,EAAE,KAAK,EAAE,GAAGF,EAAI,IAAI,CAAC,IAAMG,EAAS,CAACH,EAAI,OAAO,CAACA,EAAI,MAAM,MAAM,IAAI,QAAQ,GAAK,CAAC,EAAE,WAAWI,EAAI,EAAE,EAAE,YAAYA,EAAI,EAAEJ,EAAI,YAAY,aAAaC,EAAED,CAAG,EAAM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