{"version":3,"file":"BookCallModal.BoxZI4Bc.mjs","names":["useState"],"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":"uQAwBgB,SAAS,GAAe,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,KAAK,IAAM,EAAS,SAAS,eAAe,gBAAgB,EAAmP,OAA9O,GAAU,EAAO,EAAgB,GAAa,GAAQ,EAAO,YAAmB,GAAO,EAAO,SAAS,cAAc,KAAK,EAAE,EAAO,GAAG,iBAAiB,EAAO,aAAa,cAAc,MAAM,EAAE,SAAS,gBAAgB,YAAY,CAAM,EAAS,EAAO,CAQ3Y,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,UAAQ,mBAAmB,kBAAgB,UAAU,cAAY,UAAU,QAAM,cAAc,WAAS,mEAAmE,EAAW,CAAC,EAAK,GAASA,EAAS,EAAK,EAAO,CAAC,EAAK,GAASA,EAAS,IAAI,EAAO,CAAC,EAAW,GAAeA,EAAS,EAAK,EAAO,CAAC,EAAa,GAAiBA,EAAS,EAAK,EAAE,MAAc,CAAC,EAAQ,EAAc,CAAC,CAAE,EAAE,CAAC,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAe,EAAQ,EAAI,EAAQ,MAAgB,EAAQ,EAAK,EAA8G,OAA5G,EAAO,iBAAiB,iBAAiB,CAAU,EAAE,EAAO,iBAAiB,kBAAkB,CAAW,MAAY,C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