{"version":3,"file":"CalendlyPopupButton.CmTOsiIU.mjs","names":["useState","useRef","useMemo","useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/f6iYdxrEzxuFiXayGZpF/b77A6DOPpwYeoUVnbyj8/CalendlyPopupButton.js"],"sourcesContent":["// Calendly Popup Button — Framer code component (prewarmed iframe version)\n// Mounts the booking iframe immediately on load, hidden with\n// visibility (not display:none) so the browser fully loads and\n// paints it in the background. Clicking the button just reveals it.\n// No container: the iframe fills the overlay and Calendly's\n// PopupText embed draws its own floating card on the dimmed backdrop.\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useRef,useState}from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";// Single source of truth for the booking link.\nconst DEFAULT_CALENDLY_URL=\"https://calendly.com/d/dvwq-99c-pwv/extenteam\";// Inject preconnect + dns-prefetch hints once so the iframe's\n// connections start as early as possible.\nlet hinted=false;function ensureConnectionHints(){if(hinted||typeof document===\"undefined\")return;hinted=true;const hosts=[\"https://calendly.com\",\"https://assets.calendly.com\"];for(const href of hosts){for(const rel of[\"preconnect\",\"dns-prefetch\"]){if(document.querySelector(`link[rel=\"${rel}\"][href=\"${href}\"]`))continue;const link=document.createElement(\"link\");link.rel=rel;link.href=href;if(rel===\"preconnect\")link.crossOrigin=\"anonymous\";document.head.appendChild(link);}}}// Build the embed URL. embed_domain/embed_type make Calendly render\n// its popup layout (its own card on a transparent background);\n// hide_gdpr_banner removes the cookie banner inside the frame.\nfunction buildEmbedURL(rawURL){try{const url=new URL(rawURL);url.searchParams.set(\"embed_type\",\"PopupText\");if(typeof window!==\"undefined\"){url.searchParams.set(\"embed_domain\",window.location.hostname);}url.searchParams.set(\"hide_gdpr_banner\",\"1\");return url.toString();}catch{return rawURL;}}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function CalendlyPopupButton(props){const{calendlyURL,label,background,textColor,radius,padding,fontSize,fontWeight,prewarm}=props;const isStatic=useIsStaticRenderer();const[mounted,setMounted]=useState(false)// iframe exists in DOM\n;const[open,setOpen]=useState(false)// overlay visible\n;const[loaded,setLoaded]=useState(false)// iframe finished loading\n;const closeButtonRef=useRef(null);const targetURL=calendlyURL||DEFAULT_CALENDLY_URL;const embedURL=useMemo(()=>buildEmbedURL(targetURL),[targetURL]);// Prewarm on load: mount the hidden iframe right away. No idle\n// delay — the sooner it mounts, the sooner it's ready.\nuseEffect(()=>{if(isStatic||typeof window===\"undefined\")return;ensureConnectionHints();if(prewarm===\"onLoad\")setMounted(true);},[isStatic,prewarm]);const handleHover=useCallback(()=>{if(isStatic)return;ensureConnectionHints();if(prewarm!==\"onClick\")setMounted(true);},[isStatic,prewarm]);const handleOpen=useCallback(()=>{if(isStatic||typeof window===\"undefined\")return;setMounted(true);setOpen(true);},[isStatic]);const handleClose=useCallback(()=>setOpen(false),[]);// Close on Escape, and lock body scroll while open.\nuseEffect(()=>{if(!open||typeof document===\"undefined\")return;const onKey=e=>{if(e.key===\"Escape\")handleClose();};document.addEventListener(\"keydown\",onKey);const previousOverflow=document.body.style.overflow;document.body.style.overflow=\"hidden\";closeButtonRef.current?.focus();return()=>{document.removeEventListener(\"keydown\",onKey);document.body.style.overflow=previousOverflow;};},[open,handleClose]);const buttonStyle=useMemo(()=>({position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:`${padding}px`,border:\"none\",borderRadius:`${radius}px`,background,color:textColor,textDecoration:\"none\",textAlign:\"center\",whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\",cursor:isStatic?\"default\":\"pointer\",fontFamily:\"Inter, sans-serif\",fontSize:`${fontSize}px`,fontWeight,lineHeight:1,userSelect:\"none\"}),[background,fontSize,fontWeight,isStatic,padding,radius,textColor]);const overlay=mounted&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":\"Schedule a meeting\",style:{position:\"fixed\",inset:0,zIndex:2147483e3,background:\"rgba(15, 23, 42, 0.55)\",// visibility keeps the iframe rendering while\n// hidden, so it's fully painted before opening.\n// display:none would deprioritize it.\nvisibility:open?\"visible\":\"hidden\",opacity:open?1:0,pointerEvents:open?\"auto\":\"none\",transition:\"opacity 0.15s ease\"},children:[/*#__PURE__*/_jsx(\"button\",{ref:closeButtonRef,type:\"button\",onClick:handleClose,\"aria-label\":\"Close scheduling window\",style:{position:\"absolute\",top:\"16px\",right:\"16px\",zIndex:2,width:\"40px\",height:\"40px\",border:\"none\",borderRadius:\"50%\",background:\"rgba(255, 255, 255, 0.92)\",color:\"#0F172A\",fontSize:\"20px\",lineHeight:1,cursor:\"pointer\",boxShadow:\"0 2px 8px rgba(15, 23, 42, 0.25)\"},children:\"\\xd7\"}),!loaded&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#FFFFFF\",fontFamily:\"Inter, sans-serif\",fontSize:\"15px\"},children:\"Loading scheduler…\"}),/*#__PURE__*/_jsx(\"iframe\",{src:embedURL,title:\"Calendly scheduling\",loading:\"eager\",allowTransparency:true,onLoad:()=>setLoaded(true),style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:\"none\",background:\"transparent\",opacity:loaded?1:0,transition:\"opacity 0.2s ease\"}})]}),document.body):null;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",style:buttonStyle,onClick:isStatic?undefined:handleOpen,onPointerEnter:isStatic?undefined:handleHover,onFocus:isStatic?undefined:handleHover,disabled:isStatic,\"aria-label\":label,children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"flex\",width:\"100%\",height:\"100%\",alignItems:\"center\",justifyContent:\"center\",textAlign:\"center\",lineHeight:1},children:label})}),overlay]});}addPropertyControls(CalendlyPopupButton,{calendlyURL:{type:ControlType.String,title:\"Calendly URL\",defaultValue:DEFAULT_CALENDLY_URL,placeholder:\"https://calendly.com/...\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Book a Demo\"},prewarm:{type:ControlType.Enum,title:\"Prewarm\",defaultValue:\"onLoad\",options:[\"onLoad\",\"onHover\",\"onClick\"],optionTitles:[\"On Load\",\"On Hover\",\"On Click\"]},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#2762EA\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:40,min:0,max:200,step:1,unit:\"px\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:8,min:0,max:64,step:1,unit:\"px\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:8,max:64,step:1,unit:\"px\"},fontWeight:{type:ControlType.Enum,title:\"Weight\",defaultValue:400,options:[400,500,600,700],optionTitles:[\"400\",\"500\",\"600\",\"700\"],displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CalendlyPopupButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CalendlyPopupButton.map"],"mappings":"wPASiB,SAAS,GAAuB,CAAI,QAAQ,OAAO,SAAW,KAAmB,GAAO,GAAwE,IAAI,IAAM,IAAQ,CAAxE,uBAAuB,6BAAqD,EAAG,IAAI,IAAM,IAAM,CAAC,aAAa,cAAc,EAAE,CAAC,GAAG,SAAS,cAAc,aAAa,EAAI,WAAW,EAAK,GAAG,EAAE,SAAS,IAAM,EAAK,SAAS,cAAc,MAAM,EAAE,EAAK,IAAI,EAAI,EAAK,KAAK,EAAQ,IAAM,eAAa,EAAK,YAAY,aAAY,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