{"version":3,"file":"BookCallModal.DPC2OF6F.mjs","names":["useState","handleClose"],"sources":["https:/framerusercontent.com/modules/wESYKqtNVzUAAfD3HCI7/XswNU3sTvJ6gY3HUKLp9/BookCallModal.js"],"sourcesContent":["// Book a call modal — wraps the Cal.com embed in a portal-mounted modal\n// styled to match the case-study modal on /portfolio-open1. The modal can\n// be opened from anywhere on the site by dispatching a window event:\n//\n//   window.dispatchEvent(new CustomEvent(\"book-call:open\"))\n//\n// And closed similarly with \"book-call:close\". The component listens for\n// these events so any button anywhere can trigger it without prop drilling.\n//\n// While open, the modal also dispatches floating-chat:hide so the chat pill\n// ducks out, matching how the case-study modal behaves.\n//\n// v3 — portal-mount to #ej-portal-host (appended to <html>) instead of\n// document.body. Framer applies a transform to body-level wrappers for\n// breakpoint scaling on mobile; any position:fixed descendant becomes\n// trapped by that transformed ancestor (per CSS spec). On Safari mobile\n// this caused the nav to paint over the modal because the nav lives in\n// #ej-portal-host (transform-free) and the modal was still trapped under\n// the body transform. Moving the modal to the same host fixes the stack.\n//\n// v2 — bumped z-index from 1000100 to 2147483646.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";// v3: shared portal host. Same #ej-portal-host that GlobalStyles,\n// StickyNavBlur, and FloatingChat use. Appended to <html> so it sits\n// outside any Framer body-level transform.\nlet hostEl=null;function getPortalHost(){if(typeof document===\"undefined\")return null;const existing=document.getElementById(\"ej-portal-host\");if(existing){hostEl=existing;return existing;}if(hostEl&&hostEl.isConnected)return hostEl;hostEl=document.createElement(\"div\");hostEl.id=\"ej-portal-host\";hostEl.setAttribute(\"aria-hidden\",\"true\");document.documentElement.appendChild(hostEl);return hostEl;}/**\n * Book Call Modal\n *\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function BookCallModal(props){const{calLink=\"ejordanill/15min\",backgroundColor=\"#FFFFFF\",accentColor=\"#000000\",title=\"Book a call\",subtitle=\"Grab 15 minutes on my calendar — let's chat about your project.\"}=props;const[open,setOpen]=useState(false);const[host,setHost]=useState(null);const[embedReady,setEmbedReady]=useState(false);const[iframeLoaded,setIframeLoaded]=useState(false);useEffect(()=>{setHost(getPortalHost());},[]);useEffect(()=>{if(typeof window===\"undefined\")return;const handleOpen=()=>setOpen(true);const handleClose=()=>setOpen(false);window.addEventListener(\"book-call:open\",handleOpen);window.addEventListener(\"book-call:close\",handleClose);return()=>{window.removeEventListener(\"book-call:open\",handleOpen);window.removeEventListener(\"book-call:close\",handleClose);};},[]);useEffect(()=>{if(typeof window===\"undefined\")return;window.dispatchEvent(new CustomEvent(open?\"floating-chat:hide\":\"floating-chat:show\"));},[open]);useEffect(()=>{if(!open)setIframeLoaded(false);},[open]);useEffect(()=>{if(!open)return;if(typeof document===\"undefined\")return;if(embedReady)return;const existing=document.querySelector(\"script[data-bookcall-cal-embed]\");if(existing){setEmbedReady(true);return;}const script=document.createElement(\"script\");script.dataset.bookcallCalEmbed=\"true\";script.async=true;script.src=\"https://app.cal.com/embed/embed.js\";script.onload=()=>setEmbedReady(true);document.head.appendChild(script);},[open,embedReady]);useEffect(()=>{if(typeof document===\"undefined\")return;if(!open)return;const original=document.body.style.overflow;document.body.style.overflow=\"hidden\";return()=>{document.body.style.overflow=original;};},[open]);useEffect(()=>{if(typeof window===\"undefined\")return;if(!open)return;const handleKey=e=>{if(e.key===\"Escape\")setOpen(false);};window.addEventListener(\"keydown\",handleKey);return()=>window.removeEventListener(\"keydown\",handleKey);},[open]);const handleClose=()=>setOpen(false);const embedUrl=`https://cal.com/${calLink}?embed=true&theme=light&hideEventTypeDetails=false&background-color=ffffff`;const SOLID_WHITE=\"#FFFFFF\";const modalContent=/*#__PURE__*/_jsx(AnimatePresence,{children:open&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:[.4,0,.2,1]},style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,width:\"100vw\",height:\"100vh\",zIndex:2147483646,background:\"rgba(255,255,255,0.4)\",backdropFilter:\"blur(40px)\",WebkitBackdropFilter:\"blur(40px)\",display:\"flex\",alignItems:typeof window!==\"undefined\"&&window.innerWidth<=768?\"flex-start\":\"center\",justifyContent:\"center\",overflowY:\"auto\",overflowX:\"hidden\",padding:typeof window!==\"undefined\"&&window.innerWidth<=768?\"20px\":\"20px\",boxSizing:\"border-box\"},onClick:e=>{if(e.target===e.currentTarget)handleClose();},children:/*#__PURE__*/_jsxs(motion.div,{initial:{scale:.95,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:20},transition:{duration:.4,ease:[.4,0,.2,1]},style:{position:\"relative\",background:SOLID_WHITE,borderRadius:24,boxShadow:\"0 20px 60px rgba(0,0,0,0.15)\",width:\"100%\",maxWidth:900,minHeight:600,maxHeight:\"90vh\",overflow:\"hidden\",padding:0,display:\"flex\",flexDirection:\"column\",margin:\"auto\"},children:[/*#__PURE__*/_jsx(motion.button,{type:\"button\",onClick:handleClose,\"aria-label\":\"Close booking modal\",style:{all:\"unset\",position:\"absolute\",top:16,right:16,fontSize:32,color:accentColor,cursor:\"pointer\",fontWeight:400,zIndex:2,borderRadius:\"50%\",width:46,height:46,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},onMouseEnter:e=>e.currentTarget.style.background=\"#D1D1D1\",onMouseLeave:e=>e.currentTarget.style.background=\"transparent\",children:/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",top:-3},children:\"\\xd7\"})}),/*#__PURE__*/_jsxs(\"div\",{style:{padding:\"32px 40px 16px 40px\",background:SOLID_WHITE,borderBottom:\"1px solid rgba(0,0,0,0.06)\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:22,fontWeight:600,letterSpacing:\"-0.02em\",color:accentColor,marginBottom:4},children:title}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:14,color:\"rgba(0,0,0,0.6)\",letterSpacing:\"-0.01em\"},children:subtitle})]}),/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,position:\"relative\",background:SOLID_WHITE},children:[/*#__PURE__*/_jsx(AnimatePresence,{children:!iframeLoaded&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:SOLID_WHITE,zIndex:1},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:6},children:[0,.15,.3].map((delay,i)=>/*#__PURE__*/_jsx(motion.span,{animate:{y:[0,-6,0],opacity:[.3,1,.3]},transition:{duration:1.2,repeat:Infinity,delay,ease:\"easeInOut\"},style:{width:8,height:8,background:accentColor,borderRadius:\"50%\",display:\"inline-block\"}},i))})})}),/*#__PURE__*/_jsx(\"iframe\",{title:\"Book a call with Eric\",src:embedUrl,onLoad:()=>setIframeLoaded(true),style:{width:\"100%\",height:\"100%\",minHeight:540,border:\"none\",display:\"block\",colorScheme:\"light\",background:SOLID_WHITE},allow:\"camera; microphone; autoplay; encrypted-media; fullscreen; picture-in-picture\"})]})]})})});// v3: portal-mount to the shared #ej-portal-host appended to <html>.\n// This is the same host used by GlobalStyles, StickyNavBlur, and\n// FloatingChat. Mounting here puts the modal at the top of the\n// stacking context tree on the same plane as the nav, so its\n// z-index of 2147483646 actually wins on Safari mobile.\nif(!host)return null;return /*#__PURE__*/createPortal(modalContent,host);}addPropertyControls(BookCallModal,{calLink:{type:ControlType.String,title:\"Cal Username/Event\",defaultValue:\"ejordanill/15min\",description:\"The slug after cal.com/ — e.g. ejordanill/15min.\"},title:{type:ControlType.String,title:\"Modal Title\",defaultValue:\"Book a call\"},subtitle:{type:ControlType.String,title:\"Modal Subtitle\",defaultValue:\"Grab 15 minutes on my calendar — let's chat about your project.\",displayTextArea:true},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BookCallModal\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"1\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BookCallModal.map"],"mappings":"4QAwBgB,SAAS,GAAe,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,KAAK,IAAM,EAAS,SAAS,eAAe,iBAAiB,CAAkP,OAA9O,GAAU,EAAO,EAAgB,GAAa,GAAQ,EAAO,YAAmB,GAAO,EAAO,SAAS,cAAc,MAAM,CAAC,EAAO,GAAG,iBAAiB,EAAO,aAAa,cAAc,OAAO,CAAC,SAAS,gBAAgB,YAAY,EAAO,CAAQ,GAQpY,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,UAAQ,mBAAmB,kBAAgB,UAAU,cAAY,UAAU,QAAM,cAAc,WAAS,mEAAmE,EAAW,CAAC,EAAK,GAASA,EAAS,GAAM,CAAM,CAAC,EAAK,GAASA,EAAS,KAAK,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,GAAM,CAAC,MAAc,CAAC,EAAQ,GAAe,CAAC,EAAG,EAAE,CAAC,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAe,EAAQ,GAAK,CAAOC,MAAgB,EAAQ,GAAM,CAA6G,OAA5G,EAAO,iBAAiB,iBAAiB,EAAW,CAAC,EAAO,iBAAiB,kBAAkBA,EAAY,KAAW,CAAC,EA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