var y=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var S=(o,n)=>{for(var a in n)y(o,a,{get:n[a],enumerable:!0})},D=(o,n,a,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of F(n))!B.call(o,r)&&r!==a&&y(o,r,{get:()=>n[r],enumerable:!(c=I(n,r))||c.enumerable});return o};var O=o=>D(y({},"__esModule",{value:!0}),o);var G={};S(G,{default:()=>z});module.exports=O(G);var E=require("react"),e=require("@chakra-ui/react"),p=require("react-icons/bs"),M=require("ics");var d=require("react"),$=require("react/jsx-runtime"),U=(0,d.createContext)(void 0);var w=()=>(0,d.useContext)(U);var t=require("react/jsx-runtime"),T=o=>{let n=o.getFullYear(),a=o.getMonth()+1,c=o.getDate(),r=o.getHours(),f=o.getMinutes();return[n,a,c,r,f]},k=({isOpen:o,onClose:n,reminderCollection:a})=>{let{rootRef:c}=w(),r=async(s,i,g)=>{let C={start:T(new Date(s*1e3)),duration:{hours:24},title:i,description:g},u=`${i}.ics`,x=await new Promise((R,v)=>{(0,M.createEvent)(C,(h,b)=>{h&&v(h),R(new File([b],u,{type:"plain/text"}))})}),m=URL.createObjectURL(x),l=document.createElement("a");l.href=m,l.download=u,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(m)},f=(s,i,g)=>{let C=new Date(s*1e3).toISOString().replace(/-|:|\.\d+/g,""),u=new Date(s*1e3+1*24*60*60*1e3).toISOString().replace(/-|:|\.\d+/g,""),x=encodeURIComponent(i),m=encodeURIComponent(g),l="https://calendar.google.com/calendar/u/0/r/eventedit",R=`dates=${C}/${u}&text=${x}&details=${m}&location=&allday=false`;return`${l}?${R}`};return(0,t.jsxs)(e.Modal,{blockScrollOnMount:!1,isOpen:o,onClose:n,portalProps:{containerRef:c},children:[(0,t.jsx)(e.ModalOverlay,{}),(0,t.jsxs)(e.ModalContent,{children:[(0,t.jsx)(e.ModalHeader,{color:"foreground",fontSize:"md",children:"Add reminder to your calender"}),(0,t.jsx)(e.ModalCloseButton,{}),(0,t.jsxs)(e.ModalBody,{pb:4,children:[(0,t.jsxs)(e.Flex,{justifyContent:"space-between",alignItems:"center",mb:1,children:[(0,t.jsxs)(e.Flex,{alignItems:"center",children:[(0,t.jsx)(e.Icon,{as:p.BsGoogle,h:"4",w:"4",color:"mutedForeground"}),(0,t.jsx)(e.Text,{ml:"2",fontSize:"sm",children:"Google Calender"})]}),(0,t.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>{let s=f(a?.stats?.startDate,a?.profile?.name,`Get your hands on ${a?.profile?.name} NFT Collection. Mint powered by Bandit.`);window.open(s)},children:"Add"})]}),(0,t.jsxs)(e.Flex,{justifyContent:"space-between",alignItems:"center",mv:"6",children:[(0,t.jsxs)(e.Flex,{alignItems:"center",children:[(0,t.jsx)(e.Icon,{as:p.BsApple,h:"4",w:"4",color:"mutedForeground"}),(0,t.jsx)(e.Text,{ml:"2",fontSize:"sm",children:"iCalender"})]}),(0,t.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>{r(a?.stats?.startDate,a?.profile?.name,`Get your hands on ${a?.profile?.name} NFT Collection. Mint powered by Bandit.`).catch(s=>console.log(s))},children:"Add"})]})]})]})]})},z=k;
