{"version":3,"file":"GoogleCalendarButton.CLNs6Bfg.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/GKLHVvXGXw7k1ArtTExU/2iBVIT9pUumcZCyVtzZG/GoogleCalendarButton.js"],"sourcesContent":["// Google Calendar Button Component\n// Creates a button that opens Google Calendar with pre-filled event details\n// All event parameters and button styling are exposed as Framer property controls\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function GoogleCalendarButton(props){const{eventTitle,startDate,endDate,timezone,description,locationText=\"Conference Room A\",locationLink=\"\",googleMeetLink=\"\",buttonText,style}=props;const[isHovered,setIsHovered]=useState(false);// Destructure location with defaults\nconst location={text:locationText||\"Conference Room A\",link:locationLink||\"\"};// Properly destructure buttonStyle with defaults\nconst buttonStyle={font:props.buttonStyle?.font||{fontFamily:\"Inter\",fontSize:\"18px\",fontWeight:600,letterSpacing:\"-0.01em\",lineHeight:\"1em\"},color:props.buttonStyle?.color!==undefined&&props.buttonStyle?.color!==null&&props.buttonStyle?.color!==\"\"?props.buttonStyle.color:\"transparent\",textColor:props.buttonStyle?.textColor||\"#FFFFFF\",borderRadius:props.buttonStyle?.borderRadius??0,padding:props.buttonStyle?.padding||\"12px\",borderWidth:props.buttonStyle?.borderWidth??1,borderColor:props.buttonStyle?.borderColor!==undefined&&props.buttonStyle?.borderColor!==null&&props.buttonStyle?.borderColor!==\"\"?props.buttonStyle.borderColor:\"transparent\",borderStyle:props.buttonStyle?.borderStyle||\"solid\"};// Properly destructure icon with defaults\nconst icon={show:props.icon?.show??true,file:props.icon?.file||\"https://upload.wikimedia.org/wikipedia/commons/a/a5/Google_Calendar_icon_%282020%29.svg\",size:props.icon?.size??20,gap:props.icon?.gap??8,position:props.icon?.position||\"before\"};// Properly destructure hoverStyle with defaults\nconst hoverStyle={fill:props.hoverStyle?.fill,border:props.hoverStyle?.border,textColor:props.hoverStyle?.textColor,opacity:props.hoverStyle?.opacity??1,scale:props.hoverStyle?.scale??1,transition:props.hoverStyle?.transition||{type:\"tween\",duration:.1}};// Set default file if not provided\nconst iconFile=icon.file||\"https://upload.wikimedia.org/wikipedia/commons/a/a5/Google_Calendar_icon_%282020%29.svg\";// Convert Framer Motion transition to CSS transition string\nconst getCSSTransition=transition=>{if(!transition)return\"all 0.1s ease\";const duration=transition.duration||.1;let easeValue=\"ease\";if(typeof transition.ease===\"string\"){easeValue=transition.ease;}else if(Array.isArray(transition.ease)){// Convert cubic-bezier array to CSS format\neaseValue=`cubic-bezier(${transition.ease.join(\", \")})`;}return`all ${duration}s ${easeValue}`;};const formatDateForCalendar=dateString=>{if(!dateString)return\"\";const date=new Date(dateString);return date.toISOString().replace(/[-:]/g,\"\").split(\".\")[0]+\"Z\";};const createCalendarUrl=()=>{const baseUrl=\"https://www.google.com/calendar/event?action=TEMPLATE\";// Use link if provided, otherwise use text\nconst locationValue=locationLink||locationText;// Build description with location and Google Meet link\nlet fullDescription=description||\"\";// Add location to description\nif(locationText){fullDescription+=fullDescription?`\n\nLocation: ${locationText}`:`Location: ${locationText}`;}// Add Google Meet link to description\nif(googleMeetLink){fullDescription+=fullDescription?`\n\nGoogle Meet: ${googleMeetLink}`:`Google Meet: ${googleMeetLink}`;}const params=new URLSearchParams({text:eventTitle||\"Event\",dates:`${formatDateForCalendar(startDate)}/${formatDateForCalendar(endDate)}`,ctz:timezone||\"UTC\",details:fullDescription,location:locationValue||\"\"});return`${baseUrl}&${params.toString()}`;};const handleClick=()=>{if(typeof window!==\"undefined\"){window.open(createCalendarUrl(),\"_blank\",\"noopener,noreferrer\");}};return /*#__PURE__*/_jsxs(\"button\",{onClick:handleClick,style:{...style,position:\"relative\",backgroundColor:isHovered&&hoverStyle.fill?hoverStyle.fill:buttonStyle.color||\"transparent\",color:isHovered&&hoverStyle.textColor?hoverStyle.textColor:buttonStyle.textColor,border:isHovered&&hoverStyle.border?`${buttonStyle.borderWidth}px ${buttonStyle.borderStyle} ${hoverStyle.border}`:`${buttonStyle.borderWidth}px ${buttonStyle.borderStyle} ${buttonStyle.borderColor}`,borderRadius:buttonStyle.borderRadius,padding:buttonStyle.padding,cursor:\"pointer\",transition:getCSSTransition(hoverStyle.transition),width:\"max-content\",display:\"flex\",alignItems:\"center\",gap:icon.show?`${icon.gap}px`:0,flexDirection:icon.position===\"after\"?\"row\":\"row\",opacity:isHovered?hoverStyle.opacity:1,transform:isHovered?`scale(${hoverStyle.scale})`:\"scale(1)\",...buttonStyle.font},onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),\"aria-label\":`Add ${eventTitle} to Google Calendar`,children:[icon.show&&icon.position===\"before\"&&/*#__PURE__*/_jsx(\"img\",{src:icon.file,alt:\"Icon\",style:{width:icon.size,height:icon.size,objectFit:\"contain\"}}),buttonText,icon.show&&icon.position===\"after\"&&/*#__PURE__*/_jsx(\"img\",{src:icon.file,alt:\"Icon\",style:{width:icon.size,height:icon.size,objectFit:\"contain\"}})]});}addPropertyControls(GoogleCalendarButton,{eventTitle:{type:ControlType.String,title:\"Event Title\",defaultValue:\"Team Meeting\"},startDate:{type:ControlType.Date,title:\"Start Date\",displayTime:true},endDate:{type:ControlType.Date,title:\"End Date\",displayTime:true},timezone:{type:ControlType.Enum,title:\"Timezone\",defaultValue:\"UTC\",options:[\"Etc/GMT+12\",\"Etc/GMT+11\",\"Etc/GMT+10\",\"Etc/GMT+9\",\"Etc/GMT+8\",\"Etc/GMT+7\",\"Etc/GMT+6\",\"Etc/GMT+5\",\"Etc/GMT+4\",\"Etc/GMT+3\",\"Etc/GMT+2\",\"Etc/GMT+1\",\"UTC\",\"Etc/GMT-1\",\"Etc/GMT-2\",\"Etc/GMT-3\",\"Etc/GMT-4\",\"Etc/GMT-5\",\"Etc/GMT-6\",\"Etc/GMT-7\",\"Etc/GMT-8\",\"Etc/GMT-9\",\"Etc/GMT-10\",\"Etc/GMT-11\",\"Etc/GMT-12\",\"Etc/GMT-13\",\"Etc/GMT-14\"],optionTitles:[\"GMT-12\",\"GMT-11\",\"GMT-10\",\"GMT-9\",\"GMT-8\",\"GMT-7\",\"GMT-6\",\"GMT-5\",\"GMT-4\",\"GMT-3\",\"GMT-2\",\"GMT-1\",\"GMT+0\",\"GMT+1\",\"GMT+2\",\"GMT+3\",\"GMT+4\",\"GMT+5\",\"GMT+6\",\"GMT+7\",\"GMT+8\",\"GMT+9\",\"GMT+10\",\"GMT+11\",\"GMT+12\",\"GMT+13\",\"GMT+14\"]},description:{type:ControlType.String,title:\"Description\",defaultValue:\"Join us for our weekly team meeting\",displayTextArea:true},locationText:{type:ControlType.String,title:\"Location Text\",defaultValue:\"Conference Room A\",placeholder:\"e.g., Conference Room A\"},locationLink:{type:ControlType.Link,title:\"Location Link\",defaultValue:\"\"},googleMeetLink:{type:ControlType.String,title:\"Google Meet Link\",defaultValue:\"\",placeholder:\"e.g., https://meet.google.com/abc-defg-hij\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Add to Google Calendar\"},buttonStyle:{type:ControlType.Object,title:\"Button Style\",controls:{font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"18px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},color:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\",optional:true},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:1,min:0,max:10,step:1},borderColor:{type:ControlType.Color,title:\"Border Color\",optional:true},borderStyle:{type:ControlType.Enum,title:\"Border Style\",options:[\"solid\",\"dashed\",\"dotted\",\"double\",\"none\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\",\"None\"],defaultValue:\"solid\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:50,step:1},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px\"}},defaultValue:{font:{variant:\"Semibold\",fontSize:\"18px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},color:\"#000000\",textColor:\"#FFFFFF\",borderWidth:1,borderStyle:\"solid\",borderRadius:0,padding:\"12px\"}},hoverStyle:{type:ControlType.Object,title:\"Hover Style\",controls:{fill:{type:ControlType.Color,title:\"Fill\",optional:true},border:{type:ControlType.Color,title:\"Border\",optional:true},textColor:{type:ControlType.Color,title:\"Text Color\",optional:true},opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:1,min:0,max:1,step:.1},scale:{type:ControlType.Number,title:\"Scale\",defaultValue:1,min:.8,max:1.2,step:.05},transition:{type:ControlType.Transition,title:\"Transition\"}},defaultValue:{opacity:1,scale:1,transition:{type:\"tween\",duration:.1}}},icon:{type:ControlType.Object,title:\"Icon\",controls:{show:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true},file:{type:ControlType.File,title:\"Icon File\",allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\"]},size:{type:ControlType.Number,title:\"Icon Size\",defaultValue:20,min:12,max:48,step:1},gap:{type:ControlType.Number,title:\"Gap to Text\",defaultValue:8,min:0,max:24,step:1},position:{type:ControlType.Enum,title:\"Icon Position\",options:[\"before\",\"after\"],optionTitles:[\"Before\",\"After\"],defaultValue:\"before\",displaySegmentedControl:true}},defaultValue:{show:true,size:20,gap:8,position:\"before\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GoogleCalendarButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GoogleCalendarButton.map"],"mappings":"+LAMG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,aAAW,YAAU,UAAQ,WAAS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