{"version":3,"file":"AddToCalendar.B2pm4FFd.mjs","names":[],"sources":["https:/framerusercontent.com/modules/NDwELLPhXaHji3OBGPyW/bGecM3r7IqCSU6xCi5Wh/AddToCalendar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";export function withAddEventToCalendar(Component){return props=>{const{style,...rest}=props;const eventName=\"Taking Octoparty to 30,000 feet\";const eventDescription=\"Your flight to ICE Barcelona\";const eventLocation=\"Malta International Airport\";// Define dates in Malta time (UTC+2)\nconst startDate=\"20250119T130000\"// 13:00 PM Malta time\n;const endDate=\"20250119T150000\"// 15:00 PM Barcelona time next day\n;const timeZone=\"Europe/Malta\";const generateGoogleCalendarUrl=()=>{const baseUrl=\"https://calendar.google.com/calendar/r/eventedit\";const params=new URLSearchParams({text:eventName,details:eventDescription,location:eventLocation,dates:`${startDate}/${endDate}`,ctz:timeZone});return`${baseUrl}?${params.toString()}`;};const generateAppleCalendarUrl=()=>{// Get current timestamp in correct format\nconst now=new Date().toISOString().replace(/[-:]/g,\"\").split(\".\")[0]+\"Z\";// Create Apple Calendar URL with explicit time zone\nconst baseUrl=\"data:text/calendar;charset=utf8,\";const calendarContent=encodeURIComponent(`BEGIN:VCALENDAR\nPRODID:-//Your Company//Your App//EN\nVERSION:2.0\nCALSCALE:GREGORIAN\nMETHOD:PUBLISH\nBEGIN:VEVENT\nUID:${new Date().getTime()}@yourdomain.com\nDTSTAMP:${now}\nDTSTART;TZID=Europe/Malta:${startDate}\nDTEND;TZID=Europe/Malta:${endDate}\nSUMMARY:${eventName}\nDESCRIPTION:${eventDescription}\nLOCATION:${eventLocation}\nSTATUS:CONFIRMED\nSEQUENCE:0\nBEGIN:VTIMEZONE\nTZID:Europe/Malta\nBEGIN:STANDARD\nDTSTART:20241027T020000\nRRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10\nTZOFFSETFROM:+0200\nTZOFFSETTO:+0100\nEND:STANDARD\nBEGIN:DAYLIGHT\nDTSTART:20240331T020000\nRRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3\nTZOFFSETFROM:+0100\nTZOFFSETTO:+0200\nEND:DAYLIGHT\nEND:VTIMEZONE\nEND:VEVENT\nEND:VCALENDAR`);return baseUrl+calendarContent;};const addToIOSCalendar=()=>{const icsFile=generateAppleCalendarUrl();const anchor=document.createElement(\"a\");anchor.href=icsFile;anchor.style.display=\"none\";anchor.setAttribute(\"download\",\"event.ics\");fetch(icsFile).then(response=>response.blob()).then(blob=>{const blobUrl=URL.createObjectURL(blob);anchor.href=blobUrl;document.body.appendChild(anchor);anchor.click();document.body.removeChild(anchor);setTimeout(()=>URL.revokeObjectURL(blobUrl),100);});};const handleClick=()=>{const userAgent=navigator.userAgent.toLowerCase();const isIOS=/iphone|ipad|ipod/.test(userAgent);const isMac=/macintosh/.test(userAgent)&&navigator.maxTouchPoints>0;if(isIOS||isMac){addToIOSCalendar();}else{window.open(generateGoogleCalendarUrl(),\"_blank\");}};return /*#__PURE__*/_jsx(Component,{...rest,style:style,onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAddEventToCalendar\":{\"type\":\"reactHoc\",\"name\":\"withAddEventToCalendar\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AddToCalendar.map"],"mappings":"yHAA2C,SAAgB,EAAuB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,QAAM,GAAG,GAAM,EAAY,EAAU,kCAAwC,EAAiB,+BAAqC,EAAc,8BAC7P,EAAU,kBACT,EAAQ,kBACsB,MAAsP,oDAAzI,IAAI,gBAAgB,CAAC,KAAK,EAAU,QAAQ,EAAiB,SAAS,EAAc,MAAM,GAAG,EAAU,GAAG,IAAU,IAAI,eAAS,CAAC,CAA4B,UAAU,GAAW,MAA6B,CAClW,IAAM,EAAI,IAAI,MAAM,CAAC,aAAa,CAAC,QAAQ,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,G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