"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[345],{345:function(e,t,n){n.r(t),n.d(t,{default:function(){return k}});n(7042);var s=n(6252),a=n(3577),r={class:"calendar"},i={key:1,class:"no-events"},o={key:2,class:"event upcoming-event"},u=["textContent"],d=["textContent"],l={class:"time"},c={key:3,class:"event-list"},v=["textContent"],m=["textContent"],f=["textContent"];function h(e,t,n,h,p,g){var w=(0,s.up)("Loading");return(0,s.wg)(),(0,s.iD)("div",r,[e.loading?((0,s.wg)(),(0,s.j4)(w,{key:0})):e.events.length?e.events.length>0?((0,s.wg)(),(0,s.iD)("div",o,[(0,s._)("div",{class:"date",textContent:(0,a.zw)(e.formatDate(e.events[0].start))},null,8,u),(0,s._)("div",{class:"summary",textContent:(0,a.zw)(e.events[0].summary)},null,8,d),(0,s._)("div",l,(0,a.zw)(e.formatTime(e.events[0].start,!1))+" - "+(0,a.zw)(e.formatTime(e.events[0].end,!1)),1)])):(0,s.kq)("",!0):((0,s.wg)(),(0,s.iD)("div",i," No events found ")),e.events.length>1?((0,s.wg)(),(0,s.iD)("div",c,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.events.slice(1,n.maxEvents),(function(t){return(0,s.wg)(),(0,s.iD)("div",{class:"event",key:t.id},[(0,s._)("div",{class:"date col-2",textContent:(0,a.zw)(e.formatDate(t.start))},null,8,v),(0,s._)("div",{class:"time col-2",textContent:(0,a.zw)(e.formatTime(t.start,!1))},null,8,m),(0,s._)("div",{class:"summary col-8",textContent:(0,a.zw)(t.summary)},null,8,f)])})),128))])):(0,s.kq)("",!0)])}var p=n(8534),g=(n(5666),n(9653),n(1249),n(6977),n(6813)),w=n(1232),x={name:"Calendar",components:{Loading:w.Z},mixins:[g.Z],props:{maxEvents:{type:Number,required:!1,default:10},refreshSeconds:{type:Number,required:!1,default:600}},data:function(){return{events:[],loading:!1}},methods:{refresh:function(){var e=(0,p.Z)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loading=!0,e.prev=1,e.next=4,this.request("calendar.get_upcoming_events");case 4:this.events=e.sent.map((function(e){return e.start&&(e.start=new Date(e.start.dateTime||e.start.date)),e.end&&(e.end=new Date(e.end.dateTime||e.end.date)),e}));case 5:return e.prev=5,this.loading=!1,e.finish(5);case 8:case"end":return e.stop()}}),e,this,[[1,,5,8]])})));function t(){return e.apply(this,arguments)}return t}()},mounted:function(){this.refresh(),setInterval(this.refresh,parseInt((1e3*this.refreshSeconds).toFixed(0)))}},y=n(3744);const C=(0,y.Z)(x,[["render",h],["__scopeId","data-v-44a3b988"]]);var k=C}}]);
//# sourceMappingURL=345-legacy.dcb6e74e.js.map