{"version":3,"file":"LoadingEmbeds.xb68v3KX.mjs","names":["__esmMin","init_ssg_sandbox_shims","init_jsx_runtime","c","init_npm_react_18_3_1","ce","window","isEmbedIframe","src","EMBED_PATTERNS","pattern","getEmbedType","createLoadingOverlay","overlay","spinnerContainer","spinner","text","addAnimationStyles","style","addLoadingStateToIframe","iframe","embedType","container","containerPosition","hasLoaded","loadStartTime","removeOverlay","loadTime","timeout","scanForEmbeds","allIframes","embedCount","htmlIframe","index","watchForNewEmbeds","observer","mutations","mutation","node","iframes","withDebugEmbedLoader","Component","props","init_LoadingEmbeds"],"sources":["https:/framerusercontent.com/modules/8c2gm42R43baQg54Twxy/TmHV6ShebSy0SZ9emsDp/LoadingEmbeds.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";/**\n * Auto Embed Loader with Debug Mode\n *\n * Shows loading state for embeds + detailed console logging\n * to help debug why spinner might not be visible\n */const EMBED_PATTERNS=[\"hsforms.com\",\"hubspot\",\"tickettailor.com\",\"luma.co\",\"lu.ma\",\"eventbrite\",\"typeform\",\"calendly\",\"airtable.com/embed\",\"airtable.com/shr\",\"forms.gle\",\"docs.google.com/forms\"];function isEmbedIframe(src){if(!src)return false;return EMBED_PATTERNS.some(pattern=>src.includes(pattern));}function getEmbedType(src){if(src.includes(\"hsforms.com\")||src.includes(\"hubspot\"))return\"HubSpot Form\";if(src.includes(\"tickettailor.com\"))return\"Ticket Tailor\";if(src.includes(\"luma.co\"))return\"Luma\";if(src.includes(\"eventbrite\"))return\"Eventbrite\";if(src.includes(\"typeform\"))return\"Typeform\";if(src.includes(\"calendly\"))return\"Calendly\";if(src.includes(\"airtable\"))return\"Airtable\";return\"Embed\";}function createLoadingOverlay(){console.log(\"🎨 Creating loading overlay...\");const overlay=document.createElement(\"div\");overlay.className=\"embed-loading-overlay\";overlay.style.cssText=`\n        position: absolute;\n        inset: 0;\n        top: 0 !important;\n        left: 0 !important;\n        right: 0 !important;\n        bottom: 0 !important;\n        background: rgba(255, 255, 255, 0.98);\n        backdrop-filter: blur(10px);\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        z-index: 99999;\n        gap: 20px;\n        opacity: 1;\n        transition: opacity 0.4s ease;\n        pointer-events: none;\n    `;// Spinner container\nconst spinnerContainer=document.createElement(\"div\");spinnerContainer.style.cssText=`\n        position: relative;\n        width: 64px;\n        height: 64px;\n    `;// Outer spinner\nconst spinner=document.createElement(\"div\");spinner.style.cssText=`\n        width: 100%;\n        height: 100%;\n        border: 4px solid rgba(108, 92, 231, 0.1);\n        border-top: 4px solid #6C5CE7;\n        border-radius: 50%;\n        animation: embedSpin 1s linear infinite;\n    `;spinnerContainer.appendChild(spinner);// Loading text\nconst text=document.createElement(\"div\");text.textContent=\"Loading...\";text.style.cssText=`\n        color: #6C5CE7;\n        font-size: 16px;\n        font-weight: 600;\n        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n        letter-spacing: 0.5px;\n    `;overlay.appendChild(spinnerContainer);overlay.appendChild(text);console.log(\"✅ Loading overlay created\");return overlay;}function addAnimationStyles(){if(document.getElementById(\"embed-loader-styles\")){console.log(\"ℹ️ Animation styles already exist\");return;}console.log(\"📝 Adding animation styles...\");const style=document.createElement(\"style\");style.id=\"embed-loader-styles\";style.textContent=`\n        @keyframes embedSpin {\n            0% { transform: rotate(0deg); }\n            100% { transform: rotate(360deg); }\n        }\n        \n        .embed-loading-overlay {\n            pointer-events: none !important;\n        }\n        \n        .embed-loading-overlay.fade-out {\n            opacity: 0 !important;\n        }\n    `;document.head.appendChild(style);console.log(\"✅ Animation styles added\");}function addLoadingStateToIframe(iframe){// Check if already processed\nif(iframe.dataset.embedLoaderAdded===\"true\"){console.log(\"⏭️ Iframe already has loader\");return;}const src=iframe.getAttribute(\"src\")||iframe.src;console.log(\"🔍 Checking iframe:\",src?src.substring(0,60)+\"...\":\"no src\");if(!isEmbedIframe(src)){console.log(\"⏭️ Not an embed iframe, skipping\");return;}iframe.dataset.embedLoaderAdded=\"true\";const embedType=getEmbedType(src);console.log(`🎯 Adding loading state to ${embedType}`);const container=iframe.parentElement;if(!container){console.error(\"❌ No parent container found for iframe\");return;}console.log(\"📦 Parent container:\",container.tagName,container.className);// Make sure container is positioned\nconst containerPosition=window.getComputedStyle(container).position;console.log(\"📐 Container position:\",containerPosition);if(containerPosition===\"static\"){container.style.position=\"relative\";console.log(\"✅ Changed container to position: relative\");}// Create loading overlay\nconst overlay=createLoadingOverlay();container.appendChild(overlay);console.log(\"✅ Loading overlay added to DOM\");console.log(\"📏 Overlay dimensions:\",{width:overlay.offsetWidth,height:overlay.offsetHeight,display:window.getComputedStyle(overlay).display,zIndex:window.getComputedStyle(overlay).zIndex});let hasLoaded=false;const loadStartTime=Date.now();const removeOverlay=()=>{if(hasLoaded){console.log(\"⏭️ Already removed overlay\");return;}hasLoaded=true;const loadTime=Date.now()-loadStartTime;console.log(`✅ ${embedType} loaded in ${loadTime}ms, removing overlay`);overlay.classList.add(\"fade-out\");setTimeout(()=>{if(overlay.parentNode){overlay.parentNode.removeChild(overlay);console.log(\"🗑️ Overlay removed from DOM\");}},400);};// Listen for iframe load\niframe.addEventListener(\"load\",()=>{console.log(`📡 ${embedType} load event fired`);removeOverlay();});// Check if iframe is already loaded\ntry{if(iframe.contentWindow?.document?.readyState===\"complete\"){console.log(`ℹ️ ${embedType} already loaded`);setTimeout(removeOverlay,100);}}catch(e){console.log(\"ℹ️ Cross-origin iframe, will rely on load event\");}// Fallback timeout\nconst timeout=window.setTimeout(()=>{console.log(`⏱️ ${embedType} timeout after 10s, removing overlay`);removeOverlay();},1e4);// Cleanup\nconst cleanup=()=>{clearTimeout(timeout);iframe.removeEventListener(\"load\",removeOverlay);};iframe._embedLoaderCleanup=cleanup;}function scanForEmbeds(){console.log(\"🔍 Starting embed scan...\");const allIframes=document.querySelectorAll(\"iframe\");console.log(`   Found ${allIframes.length} total iframes`);let embedCount=0;allIframes.forEach((iframe,index)=>{const htmlIframe=iframe;const src=htmlIframe.getAttribute(\"src\")||htmlIframe.src;console.log(`   Iframe ${index+1}:`,src?src.substring(0,60)+\"...\":\"no src\");if(isEmbedIframe(src)){embedCount++;console.log(`   ✓ This is an embed (${getEmbedType(src)})`);addLoadingStateToIframe(htmlIframe);}});if(embedCount===0){console.log(\"⚠️ No embed iframes found yet\");}else{console.log(`✅ Processed ${embedCount} embed(s)`);}}function watchForNewEmbeds(){console.log(\"👀 Starting mutation observer...\");const observer=new MutationObserver(mutations=>{mutations.forEach(mutation=>{// New nodes added\nmutation.addedNodes.forEach(node=>{if(node.nodeName===\"IFRAME\"){console.log(\"🆕 New iframe added to DOM\");const iframe=node;const src=iframe.getAttribute(\"src\")||iframe.src;console.log(\"   Source:\",src?src.substring(0,60)+\"...\":\"no src\");addLoadingStateToIframe(iframe);}if(node instanceof Element){const iframes=node.querySelectorAll(\"iframe\");if(iframes.length>0){console.log(`🆕 ${iframes.length} iframe(s) added in new element`);iframes.forEach(iframe=>{addLoadingStateToIframe(iframe);});}}});// Attribute changes (lazy-loaded src)\nif(mutation.type===\"attributes\"&&mutation.attributeName===\"src\"&&mutation.target.nodeName===\"IFRAME\"){console.log(\"🔄 Iframe src attribute changed\");addLoadingStateToIframe(mutation.target);}});});observer.observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:[\"src\"]});console.log(\"✅ Mutation observer active\");return observer;}export function withDebugEmbedLoader(Component){return props=>{useEffect(()=>{console.log(\"=\".repeat(60));console.log(\"🚀 DEBUG EMBED LOADER ACTIVATED\");console.log(\"=\".repeat(60));// Add animation styles first\naddAnimationStyles();// Initial scan\nconsole.log(\"\\n📋 INITIAL SCAN (1 second delay)\");setTimeout(()=>{scanForEmbeds();},1e3);// Second scan\nconsole.log(\"\\n📋 SECOND SCAN (3 second delay)\");setTimeout(()=>{scanForEmbeds();},3e3);// Start watching for new embeds\nconst observer=watchForNewEmbeds();console.log(\"\\n✅ Setup complete - watching for embeds\");console.log(\"=\".repeat(60));return()=>{observer.disconnect();console.log(\"\\n🛑 Debug Embed Loader deactivated\");};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDebugEmbedLoader\":{\"type\":\"reactHoc\",\"name\":\"withDebugEmbedLoader\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoadingEmbeds.map"],"mappings":"A,gIAKsM,SAASO,EAAc,EAAI,CAAsB,OAAjBC,EAAwBC,EAAe,KAAK,GAASD,EAAI,SAASE,CAAO,CAAC,EAA/D,EAAiE,CAAC,SAASC,EAAa,EAAI,CAAwW,OAApWH,EAAI,SAAS,aAAa,GAAGA,EAAI,SAAS,SAAS,EAAQ,eAAkBA,EAAI,SAAS,kBAAkB,EAAQ,gBAAmBA,EAAI,SAAS,SAAS,EAAQ,OAAUA,EAAI,SAAS,YAAY,EAAQ,aAAgBA,EAAI,SAAS,UAAU,EAAQ,WAAcA,EAAI,SAAS,UAAU,EAAQ,WAAcA,EAAI,SAAS,UAAU,EAAQ,WAAiB,OAAQ,CAAC,SAASI,GAAsB,CAAC,QAAQ,IAAI,gCAAgC,EAAE,IAAMC,EAAQ,SAAS,cAAc,KAAK,EAAE,EAAQ,UAAU,wBAAwB,EAAQ,MAAM,QAAQ;;;;;;;;;;;;;;;;;;MAmB93B,IAAMC,EAAiB,SAAS,cAAc,KAAK,EAAE,EAAiB,MAAM,QAAQ;;;;MAKpF,IAAMC,EAAQ,SAAS,cAAc,KAAK,EAAE,EAAQ,MAAM,QAAQ;;;;;;;MAO5DD,EAAiB,YAAYC,CAAO,EAC1C,IAAMC,EAAK,SAAS,cAAc,KAAK,EAMwE,MANtE,GAAK,YAAY,aAAa,EAAK,MAAM,QAAQ;;;;;;MAMpFH,EAAQ,YAAYC,CAAgB,EAAED,EAAQ,YAAYG,CAAI,EAAE,QAAQ,IAAI,2BAA2B,EAASH,CAAQ,CAAC,SAASI,GA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