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