{"version":3,"file":"CalcomEmbed.DMh0f1PD.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/mf7TBMc3ZcwuZ2fl52Hj/EXXlziEhZXVOCfiJsKEG/CalcomEmbed.js"],"sourcesContent":["// Cal.com embed component with responsive design and theme selection\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function CalcomEmbed(props){const{username=\"example\",theme=\"light\",hideEventTypeDetails=false,hideBranding=false}=props;const containerRef=useRef(null);const[isLoaded,setIsLoaded]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;// Load Cal.com embed script\nconst script=document.createElement(\"script\");script.src=\"https://app.cal.com/embed/embed.js\";script.async=true;script.onload=()=>{startTransition(()=>setIsLoaded(true));};document.head.appendChild(script);return()=>{// Cleanup script if component unmounts\nconst existingScript=document.querySelector('script[src=\"https://app.cal.com/embed/embed.js\"]');if(existingScript){document.head.removeChild(existingScript);}};},[]);useEffect(()=>{if(!isLoaded||typeof window===\"undefined\")return;// Initialize Cal embed when script is loaded and username changes\nconst initEmbed=()=>{if(window.Cal){window.Cal(\"init\",{origin:\"https://app.cal.com\"});}};// Small delay to ensure DOM is ready\nconst timer=setTimeout(initEmbed,100);return()=>clearTimeout(timer);},[isLoaded,username,theme,hideEventTypeDetails,hideBranding]);const embedUrl=`https://app.cal.com/${username}`;const embedParams=new URLSearchParams({theme:theme,...hideEventTypeDetails&&{\"hide-event-type-details\":\"1\"},...hideBranding&&{branding:\"0\"}});const fullEmbedUrl=`${embedUrl}?${embedParams.toString()}`;return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",minHeight:\"600px\",position:\"relative\",overflow:\"hidden\",borderRadius:\"8px\",backgroundColor:theme===\"dark\"?\"#1a1a1a\":\"#ffffff\"},children:[/*#__PURE__*/_jsx(\"iframe\",{src:fullEmbedUrl,width:\"100%\",height:\"100%\",style:{border:\"none\",borderRadius:\"8px\",minHeight:\"600px\"},allow:\"camera; microphone; geolocation; display-capture\",\"data-cal-link\":username,\"data-cal-config\":JSON.stringify({theme:theme,hideEventTypeDetails:hideEventTypeDetails,branding:hideBranding?false:true}),title:`Cal.com booking for ${username}`,loading:\"lazy\"}),!isLoaded&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:theme===\"dark\"?\"#1a1a1a\":\"#f8f9fa\",color:theme===\"dark\"?\"#ffffff\":\"#333333\",fontSize:\"16px\",fontFamily:\"system-ui, -apple-system, sans-serif\"},children:\"Loading calendar...\"})]});}addPropertyControls(CalcomEmbed,{username:{type:ControlType.String,title:\"Cal.com Username\",defaultValue:\"example\",placeholder:\"Enter your Cal.com username\"},theme:{type:ControlType.Enum,title:\"Theme\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"],defaultValue:\"light\",displaySegmentedControl:true},hideEventTypeDetails:{type:ControlType.Boolean,title:\"Hide Event Details\",defaultValue:false,enabledTitle:\"Hidden\",disabledTitle:\"Visible\"},hideBranding:{type:ControlType.Boolean,title:\"Hide Cal.com Branding\",defaultValue:false,enabledTitle:\"Hidden\",disabledTitle:\"Visible\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CalcomEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CalcomEmbed.map"],"mappings":"gNAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,WAAS,UAAU,QAAM,QAAQ,uBAAqB,GAAM,eAAa,IAAO,EAAY,EAAaA,EAAO,KAAK,C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