7 lines
98 KiB
JavaScript
7 lines
98 KiB
JavaScript
import{_ as X,r as b,aF as ue,D as v,E as C,F as c,a0 as m,a2 as W,a1 as A,aD as ne,G as u,T as F,K as ve,M as j,N as O,H as V,a6 as E,a4 as Ue,L as he,p as ht,aG as He,a9 as vt,an as mt,ak as pt,aH as ft,ab as Ge,ad as _t,at as gt,aI as wt,s as ie,c as K,u as Le,aJ as yt,w as Ee,ae as Dt,V as Q,aK as bt,af as kt,aL as Et,aM as Tt,$ as P,a as Ct,o as me,a8 as U,B as we,aN as Mt,aO as qe,a5 as fe,J as le,U as Ce,Y as Me,Z as xe,O as Ke,n as xt,aP as St,a7 as y,W as L,P as Vt,Q as Ot,aQ as se,aR as k,aE as R,aS as N,S as We,aT as At,az as _e,aU as Te,aV as $t,aW as Ie,I as ge,aX as _,C as Ht,aY as Lt,aZ as Wt}from"./index-eaaba80e.js";import{V as It,a as jt}from"./VCarouselItem-cc313579.js";import{V as Xe}from"./VContainer-a08551cf.js";import{V as Pt}from"./VTextarea-1b51a32b.js";import{V as je}from"./index-68f89f30.js";import{V as Ze,l as Yt}from"./listUser-1bea0b7c.js";import{n as Je}from"./news-card-2da79561.js";import{f as Rt}from"./index-ba42aa01.js";import{V as Ft,L as zt}from"./load-round-c259ad52.js";import{V as Bt}from"./vcardUser-89d76716.js";import{V as Nt}from"./VTextField-2f8cae6e.js";import{V as Ut,b as Gt}from"./VList-45bad4a0.js";import{V as qt}from"./VSwitch-d066cd58.js";import{V as Qe}from"./VTooltip-68ae19a1.js";import"./ssrBoot-ad5ab840.js";/* empty css */import"./VInput-90b12813.js";import"./VListItem-5da0d122.js";import"./icoUser-7d47b757.js";import"./VChip-dc7453ff.js";import"./VAlert-4429ce4f.js";import"./VSelectionControl-c3c69e7b.js";const Kt={setup(){const e=ne.slice(0,-1),t=b([{link:"newsimage/default.jpg"}]);return ue("api/navigation/carousels/",t),{burl:e,carous:t}}};function Xt(e,t,i,a,o,s){return v(),C(It,{cycle:"",interval:"10000",cover:"",height:"450","hide-delimiters":"","hide-delimiter-background":"","show-arrows":"hover",color:"white"},{default:c(()=>[(v(!0),m(A,null,W(a.carous,(l,n)=>(v(),C(jt,{key:n,src:`${a.burl}${l.link}`,cover:"",eager:""},{default:c(()=>[u(Xe,{"fill-height":"",fluid:"","pa-0":"","ma-0":"","pb-3":"",class:"flex-column h-100 d-flex"},{default:c(()=>[u(F,{class:"bgCard h-100 d-flex flex-column"},{default:c(()=>[u(ve,{class:"ma-2 text-h3 text-uppercase titles text-text_carous py-5 flex-column"},{default:c(()=>[u(j,null,{default:c(()=>[u(O,{class:"pa-0 pl-1 align-self-center"},{default:c(()=>[V(E(l.title),1)]),_:2},1024),u(O,{class:"flex-grow-0 pa-0 pr-1"},{default:c(()=>[u(Ue,{width:"50","aspect-ratio":1,src:`${a.burl}${l.sender}`,cover:""},null,8,["src"])]),_:2},1024)]),_:2},1024)]),_:2},1024),u(he,{class:"ml-2 mb-0 mb-2 w-50 flex-grow-0 pb-3 text-h6 bgText overflow-auto"},{default:c(()=>[u(Pt,{class:"text-text_carous mt-n3 text-black textareas pt-2 font-weight-medium","model-value":l.text,variant:"plain",readonly:"","auto-grow":"",rows:"1","hide-details":""},null,8,["model-value"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["src"]))),128))]),_:1})}const Zt=X(Kt,[["render",Xt]]);function Pe(e){const i=Math.abs(e);return Math.sign(e)*(i/((1/.501-2)*(1-i)+1))}function Ye(e){let{selectedElement:t,containerSize:i,contentSize:a,isRtl:o,currentScrollOffset:s,isHorizontal:l}=e;const n=l?t.clientWidth:t.clientHeight,r=l?t.offsetLeft:t.offsetTop,d=o&&l?a-r-n:r,h=i+s,p=n+d,f=n*.4;return d<=s?s=Math.max(d-f,0):h<=p&&(s=Math.min(s-(h-p-f),a-i)),s}function Jt(e){let{selectedElement:t,containerSize:i,contentSize:a,isRtl:o,isHorizontal:s}=e;const l=s?t.clientWidth:t.clientHeight,n=s?t.offsetLeft:t.offsetTop,r=o&&s?a-n-l/2-i/2:n+l/2-i/2;return Math.min(a-i,Math.max(0,r))}const et=Symbol.for("vuetify:v-slide-group"),Qt=ht({centerActive:Boolean,direction:{type:String,default:"horizontal"},symbol:{type:null,default:et},nextIcon:{type:He,default:"$next"},prevIcon:{type:He,default:"$prev"},showArrows:{type:[Boolean,String],validator:e=>typeof e=="boolean"||["always","desktop","mobile"].includes(e)},...vt(),...mt(),...pt(),...ft({selectedClass:"v-slide-group-item--active"})},"VSlideGroup"),tt=Ge()({name:"VSlideGroup",props:Qt(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:i}=t;const{isRtl:a}=_t(),{displayClasses:o,mobile:s}=gt(e),l=wt(e,e.symbol),n=ie(!1),r=ie(0),d=ie(0),h=ie(0),p=K(()=>e.direction==="horizontal"),{resizeRef:f,contentRect:I}=Le(),{resizeRef:w,contentRect:Y}=Le(),z=K(()=>l.selected.value.length?l.items.value.findIndex(D=>D.id===l.selected.value[0]):-1),g=K(()=>l.selected.value.length?l.items.value.findIndex(D=>D.id===l.selected.value[l.selected.value.length-1]):-1);if(yt){let D=-1;Ee(()=>[l.selected.value,I.value,Y.value,p.value],()=>{cancelAnimationFrame(D),D=requestAnimationFrame(()=>{if(I.value&&Y.value){const T=p.value?"width":"height";d.value=I.value[T],h.value=Y.value[T],n.value=d.value+1<h.value}if(z.value>=0&&w.value){const T=w.value.children[g.value];z.value===0||!n.value?r.value=0:e.centerActive?r.value=Jt({selectedElement:T,containerSize:d.value,contentSize:h.value,isRtl:a.value,isHorizontal:p.value}):n.value&&(r.value=Ye({selectedElement:T,containerSize:d.value,contentSize:h.value,isRtl:a.value,currentScrollOffset:r.value,isHorizontal:p.value}))}})})}const $=ie(!1);let M=0,H=0;function J(D){const T=p.value?"clientX":"clientY";H=(a.value&&p.value?-1:1)*r.value,M=D.touches[0][T],$.value=!0}function ee(D){if(!n.value)return;const T=p.value?"clientX":"clientY",G=a.value&&p.value?-1:1;r.value=G*(H+M-D.touches[0][T])}function nt(D){const T=h.value-d.value;r.value<0||!n.value?r.value=0:r.value>=T&&(r.value=T),$.value=!1}function lt(){f.value&&(f.value[p.value?"scrollLeft":"scrollTop"]=0)}const pe=ie(!1);function ot(D){if(pe.value=!0,!(!n.value||!w.value)){for(const T of D.composedPath())for(const G of w.value.children)if(G===T){r.value=Ye({selectedElement:G,containerSize:d.value,contentSize:h.value,isRtl:a.value,currentScrollOffset:r.value,isHorizontal:p.value});return}}}function rt(D){pe.value=!1}function dt(D){var T;!pe.value&&!(D.relatedTarget&&((T=w.value)!=null&&T.contains(D.relatedTarget)))&&q()}function ut(D){w.value&&(p.value?D.key==="ArrowRight"?q(a.value?"prev":"next"):D.key==="ArrowLeft"&&q(a.value?"next":"prev"):D.key==="ArrowDown"?q("next"):D.key==="ArrowUp"&&q("prev"),D.key==="Home"?q("first"):D.key==="End"&&q("last"))}function q(D){var T,G,Oe,Ae,$e;if(w.value)if(!D)(T=bt(w.value)[0])==null||T.focus();else if(D==="next"){const te=(G=w.value.querySelector(":focus"))==null?void 0:G.nextElementSibling;te?te.focus():q("first")}else if(D==="prev"){const te=(Oe=w.value.querySelector(":focus"))==null?void 0:Oe.previousElementSibling;te?te.focus():q("last")}else D==="first"?(Ae=w.value.firstElementChild)==null||Ae.focus():D==="last"&&(($e=w.value.lastElementChild)==null||$e.focus())}function ye(D){const T=r.value+(D==="prev"?-1:1)*d.value;r.value=kt(T,0,h.value-d.value)}const ct=K(()=>{let D=r.value>h.value-d.value?-(h.value-d.value)+Pe(h.value-d.value-r.value):-r.value;r.value<=0&&(D=Pe(-r.value));const T=a.value&&p.value?-1:1;return{transform:`translate${p.value?"X":"Y"}(${T*D}px)`,transition:$.value?"none":"",willChange:$.value?"transform":""}}),De=K(()=>({next:l.next,prev:l.prev,select:l.select,isSelected:l.isSelected})),be=K(()=>{switch(e.showArrows){case"always":return!0;case"desktop":return!s.value;case!0:return n.value||Math.abs(r.value)>0;case"mobile":return s.value||n.value||Math.abs(r.value)>0;default:return!s.value&&(n.value||Math.abs(r.value)>0)}}),Se=K(()=>Math.abs(r.value)>0),Ve=K(()=>h.value>Math.abs(r.value)+d.value);return Dt(()=>u(e.tag,{class:["v-slide-group",{"v-slide-group--vertical":!p.value,"v-slide-group--has-affixes":be.value,"v-slide-group--is-overflowing":n.value},o.value,e.class],style:e.style,tabindex:pe.value||l.selected.value.length?-1:0,onFocus:dt},{default:()=>{var D,T,G;return[be.value&&u("div",{key:"prev",class:["v-slide-group__prev",{"v-slide-group__prev--disabled":!Se.value}],onClick:()=>Se.value&&ye("prev")},[((D=i.prev)==null?void 0:D.call(i,De.value))??u(je,null,{default:()=>[u(Q,{icon:a.value?e.nextIcon:e.prevIcon},null)]})]),u("div",{key:"container",ref:f,class:"v-slide-group__container",onScroll:lt},[u("div",{ref:w,class:"v-slide-group__content",style:ct.value,onTouchstartPassive:J,onTouchmovePassive:ee,onTouchendPassive:nt,onFocusin:ot,onFocusout:rt,onKeydown:ut},[(T=i.default)==null?void 0:T.call(i,De.value)])]),be.value&&u("div",{key:"next",class:["v-slide-group__next",{"v-slide-group__next--disabled":!Ve.value}],onClick:()=>Ve.value&&ye("next")},[((G=i.next)==null?void 0:G.call(i,De.value))??u(je,null,{default:()=>[u(Q,{icon:a.value?e.prevIcon:e.nextIcon},null)]})])]}})),{selected:l.selected,scrollTo:ye,scrollOffset:r,focus:q}}}),it=Ge()({name:"VSlideGroupItem",props:Et(),emits:{"group:selected":e=>!0},setup(e,t){let{slots:i}=t;const a=Tt(e,et);return()=>{var o;return(o=i.default)==null?void 0:o.call(i,{isSelected:a.isSelected.value,select:a.select,toggle:a.toggle,selectedClass:a.selectedClass.value})}}}),ei={props:{digitalData:{type:Object,default:{}}},setup(){const e=ne.slice(0,-1);return{model:b(!1),burl:e}}};function ti(e,t,i,a,o,s){const l=P("vue3-autocounter");return v(),C(F,{class:"d-flex ml-3"},{default:c(()=>[u(Ze,{class:"mx-auto",elevation:"0","max-width":"813"},{default:c(()=>[u(tt,{modelValue:a.model,"onUpdate:modelValue":t[0]||(t[0]=n=>a.model=n),class:"pa-0","selected-class":"bg-primary",mandatory:"","show-arrows":""},{default:c(()=>[(v(!0),m(A,null,W(i.digitalData,n=>(v(),C(it,{key:n},{default:c(()=>[u(F,{class:"ma-2 mt-4 d-flex flex-column",height:"100",width:"169",elevation:"0"},{default:c(()=>[u(F,{class:"h-100 text-center g text-black_grey"},{default:c(()=>[u(ve,{class:"statstyle my-2 py-0 text-overline font-weight-bold"},{default:c(()=>[V(E(n.status),1)]),_:2},1024),u(he,{class:"numstyle mt-4 py-0 font-weight-bold"},{default:c(()=>[u(l,{ref_for:!0,ref:"counter",startAmount:0,endAmount:Number(n.num),duration:1},null,8,["endAmount"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})}const ii=X(ei,[["render",ti]]);const si={name:"calendar-full",props:{initial:{type:String,default:"multiMonthYear"}},setup(e){const t=Ct({plugins:[dayGridPlugin,interactionPlugin,timeGridPlugin,listPlugin,multiMonthPlugin],initialView:e.initial,dayMaxEventRows:3,locale:"ru",buttonText:{today:"Сегодня",month:"Месяц",week:"Неделя",day:"День",list:"Список",year:"Год"},firstDay:"1",events:[],editable:!0,headerToolbar:{left:"prev",center:"title",right:"next"},aspectRatio:1,multiMonthMaxColumns:2,displayEventEnd:!0,height:"100%",stickyHeaderDates:!0,dayMaxEventRows:2,moreLinkContent:function(a){return a.shortText+" события"},views:{multiMonthYear:{moreLinkContent:function(a){return a.num}}},allDayText:"Весь день",noEventsContent:"На сегодня событий нет",selectable:!0,dateClick:a=>{console.log(a.date)}});function i(){U.get("api/general_vacation/generalvacation/").then(a=>{for(let o in a.data)o=="План-график"&&a.data[o].map(s=>{t.events.push({description:"description for All Day Event",title:s.name,start:s.start_work_period,end:s.end_work_period})})})}return me(()=>{i()}),{calendarOptions:t}}};function ai(e,t,i,a,o,s){const l=P("full-calendar");return v(),C(l,{options:a.calendarOptions},null,8,["options"])}const ni=X(si,[["render",ai]]);const Re=we(),li={components:{newsCard:Je},setup(){const e=b([]);Mt(()=>{e.value=[]});const t=b([]),i=ne.slice(0,-1),a=b(""),o=b(0),s=b(1),l=b(2),n=qe();let r=`api/navigation/news/?name=${n.path}&page=${s.value-1}&selected=${l.value}`;n.path=="/news"&&"id"in n.query&&(r=`api/navigation/news/?name=${n.path}&page=${s.value-1}&selected=${l.value}&id=${n.query.id}`),ue(r,t);const d=(g,$)=>{U.post("api/navigation/news/",{news:g,scores:$}).then(M=>{t.value.result[t.value.result.findIndex(H=>H.id==g)].scores=M.data})},h=()=>{U.post("api/navigation/news/",{news:o.value,text:a.value}).then(g=>{t.value.result[t.value.result.findIndex($=>$.id==g.data.news)].comment=g.data.comment}),a.value=""},p=(g,$)=>{U.post("api/navigation/news/",{delid:g,news:$}).then(M=>{t.value.result[t.value.result.findIndex(H=>H.id==M.data.news)].comment=M.data.comment})},f=()=>{ue(`api/navigation/news/?name=${n.path}&page=${s.value-1}&selected=${l.value}`,t)};return Ee(()=>Re.cod2user,(g,$)=>{g&&ue(`api/navigation/news/?name=${n.path}&page=${s.value-1}&selected=${l.value}`,t)},{deep:!0}),Ee(()=>l,(g,$)=>{g&&ue(`api/navigation/news/?name=${n.path}&page=${s.value-1}&selected=${g.value}`,t)},{deep:!0}),{newss:t,burl:i,limitText:g=>{let M=new DOMParser().parseFromString(g,"text/html").body.textContent||"";M=M.replaceAll('src="/media/uploads',`src="${ne}media/uploads`);const H=M.split(" ").slice(0,25);return`${M.split(" ").slice(0,25).join(" ")} ${H.length<25?"":"..."}`},toggleIncrementLike:d,accountStore:Re,dateformat:g=>Rt(new Date(g),"dd.MM.yyyy HH:mm"),splitname:g=>g.familyname+" "+g.name[0]+"."+g.parentname[0]+".",textcomment:a,openComent:g=>{o.value=g},addComment:h,idnews:o,deletComment:p,pagelistNews:f,divs:e,page:s,selecnews:l,route:n}}},oi={class:"flex-column h-100"};function ri(e,t,i,a,o,s){const l=P("news-card");return v(),m("div",oi,[(v(!0),m(A,null,W(a.newss.result,(n,r)=>(v(),m("div",{key:r},[u(l,{news:n},null,8,["news"])]))),128))])}const di=X(li,[["render",ri],["__scopeId","data-v-695c6a26"]]),ui={components:{newsCard:Je},setup(){const e=b([]),t=b(0),i=b(1),a=b(8),o=qe(),s=b(""),l=b(!1),n=()=>{U.get(`api/navigation/newscrossroad/?name=${o.path}&page=${i.value-1}&countpage=${a.value}`).then(r=>{e.value=r.data.result,t.value=r.data.countpage})};return n(),{newsAll:e,countetnews:t,page:i,countpage:a,loadNewsAll:n,galleryimges:s,dialogfotoOne:l}}};function ci(e,t,i,a,o,s){const l=P("news-card");return v(),C(j,null,{default:c(()=>[u(O,{class:"flex-column d-flex"},{default:c(()=>[u(j,{class:"mt-0 h-0 overflow-auto"},{default:c(()=>[(v(!0),m(A,null,W(a.newsAll,(n,r)=>(v(),C(O,{key:r,class:"pb-1 pt-0",lg:"12",md:"6",sm:"6"},{default:c(()=>[u(l,{news:n},null,8,["news"]),u(Ce,{modelValue:a.dialogfotoOne,"onUpdate:modelValue":t[1]||(t[1]=d=>a.dialogfotoOne=d),width:"w-100",height:"900",class:"flex-column"},{default:c(()=>[u(F,{class:"pa-4 h-100 flex-column d-flex"},{default:c(()=>[u(j,{class:"flex-grow-0 justify-end"},{default:c(()=>[u(O,{class:"pa-0 flex-grow-0"},{default:c(()=>[u(le,{density:"compact",variant:"text",icon:"mdi-close",onClick:t[0]||(t[0]=d=>a.dialogfotoOne=!1)})]),_:1})]),_:1}),u(j,null,{default:c(()=>[u(O,{class:"flex-column h_cards pa-0"},{default:c(()=>[u(Ue,{class:"d-flex",src:`${e.burl}${a.galleryimges}`},null,8,["src"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:2},1024))),128))]),_:1}),u(fe,{class:"mt-3"}),u(j,{class:"flex-grow-0 ma-0 align-items-center"},{default:c(()=>[u(O,{class:"flex-column d-flex pa-0 align-end"},{default:c(()=>[u(le,{size:"small",variant:"text",icon:"mdi-newspaper",color:"blue-darken-4",to:"/news"})]),_:1}),u(O,{class:"py-0 pl-0 flex-grow-0 text-end align-self-center text-caption font-weight-bold text-no-wrap"},{default:c(()=>[V(" Всего новостей: "+E(a.countetnews),1)]),_:1})]),_:1})]),_:1})]),_:1})}const hi=X(ui,[["render",ci]]);const vi={props:{UserDialog:{type:Boolean,default:!1},loging:{type:Number,default:0}},setup(e,{emit:t}){const i=we(),a=b([]),o=b(!1),s=async()=>{const h=await xt.get("api/accounts/getuser/?userlogin="+e.loging);a.value=h.data},l=()=>[{title:"Отдел:",info:a.value.department},{title:"ФИО:",info:a.value.fio},{title:"Должность:",info:a.value.post}],n=()=>[{title:"E-mail: ",info:a.value.email},{title:"Телефон: ",info:a.value.tel},{title:"Комната: ",info:a.value.room},{title:"Логин: ",info:a.value.login}];function r(){e.UserDialog=!1}const d=K({get:()=>e.UserDialog,set:h=>t("update:UserDialog",h)});return s(),{menusCloses:r,userlinks:a,accountStore:i,basicInformation:l,subInformation:n,checkremote:Me,spravURL:xe,tab:o,getUserDialog:d}}};function mi(e,t,i,a,o,s){return v(),C(Ce,{modelValue:a.getUserDialog,"onUpdate:modelValue":t[1]||(t[1]=l=>a.getUserDialog=l),persistent:"",width:"600"},{default:c(()=>[u(F,null,{default:c(()=>[u(Ke,{class:"align-self-end pt-0"},{default:c(()=>[u(le,{color:"modal_btn",variant:"text",onClick:t[0]||(t[0]=l=>a.menusCloses())},{default:c(()=>[V(" Закрыть "+E(i.UserDialog),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const pi=X(vi,[["render",mi]]),fi={components:{VcardUser:Bt,listUser:Yt},props:{idpos:{type:Number,default:""},namepos:{type:String,default:""}},setup(e,{emit:t}){const i=b({}),a=b(""),o=b(""),s=()=>{t("searchClose")};me(()=>{U.get(`api/general_vacation/dailyload/?id=${e.idpos}`).then(r=>{i.value=r.data.daily})});const l=async r=>{a.value=r},n=K({get(){let r={};return Object.keys(i.value).map(d=>{let h=i.value[d].filter(p=>p.fio.toLowerCase().includes(o.value.toLowerCase()));h.length>0&&(r[d]=h)}),r}});return{onSubmit:s,checkremote:Me,searchname:o,spravURL:xe,t_dailyRound:i,result:n,getcard:l,iduser:a}}};function _i(e,t,i,a,o,s){const l=P("list-user");return v(),m("div",null,[u(F,{class:"bg-white pa-1 px-0",width:"550"},{default:c(()=>[u(F,{class:"mx-auto overflow-auto mx-0 px-0",width:"550",height:"600",flat:""},{default:c(()=>[u(ve,{class:"fixed-bar bg-white"},{default:c(()=>[u(j,{class:"bggrad"},{default:c(()=>[u(O,{class:"text-center text-black_and_white"},{default:c(()=>[V(E(i.namepos),1)]),_:1})]),_:1}),u(j,null,{default:c(()=>[u(O,{class:"pa-0 mb-1"},{default:c(()=>[u(fe,{class:""}),u(Nt,{modelValue:a.searchname,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchname=n),clearable:"","prepend-inner-icon":"mdi-magnify","hide-details":"",class:"ma-0",label:"Поиск",rows:"1","no-resize":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),(v(!0),m(A,null,W(a.result,(n,r)=>(v(),m("div",{key:r,class:"px-3 ddd"},[u(Ut,{class:"py-0"},{default:c(()=>[u(Gt,null,{default:c(()=>[V(E(r),1)]),_:2},1024)]),_:2},1024),(v(!0),m(A,null,W(n,d=>(v(),m("div",{key:d},[u(l,{author:d},null,8,["author"])]))),128))]))),128))]),_:1}),u(fe,{class:""}),u(Ke,{class:"pb-0",style:{"place-content":"end"}},{default:c(()=>[u(le,{color:"more_details_btn",variant:"text",onClick:a.onSubmit},{default:c(()=>[V(" Закрыть ")]),_:1},8,["onClick"])]),_:1})]),_:1})])}const gi=X(fi,[["render",_i]]);const wi={components:{CardUsers:pi,DialogSearch:gi},setup(){const e=b([]),t=b(""),i=b(""),a=b(""),o=b(!1),s=b({}),l=b([]),n=b({}),r=b(""),d=b(!1),h=b(""),p=b({}),f=b(!1),I=we(),w=async H=>{d.value=!0,h.value=H},Y=(H,J)=>{i.value=H,a.value=J,o.value=!o.value,U.get(`api/general_vacation/dailyload/?id=${H}`).then(ee=>{s.value=ee.data,p.value=JSON.parse(JSON.stringify(ee.data.daily))})},z=ne.slice(0,-1);function g(){U.get("api/feedback/feedbackdata/").then(H=>{e.value=H.data.results})}const $=H=>{const J=new FormData;J.append("dailyfiles",l.value[0]),U.post(`api/general_vacation/dailyroundup/?excel=${H}`,J).then(ee=>{n.value=ee.data,M()}),l.value=""};function M(){U.get("api/general_vacation/dailyload/").then(H=>{t.value=H.data.daily})}return St(),me(()=>{M(),g()}),{t_daily:t,detailRound:Y,dialogDetailRound:o,t_dailyRound:s,dailyfiles:l,onPickFile:$,info:n,checkremote:Me,searchname:r,spravURL:xe,menuGetUserDialog:d,iduser:h,getcard:w,result:p,idpos:i,namepos:a,changeData:f,baseURL:ne,burl:z,accountStore:I}}},yi={class:"d-flex h-100"},Di={class:"text-center"};function bi(e,t,i,a,o,s){const l=P("vue3-autocounter"),n=P("dialog-search");return v(),m("div",yi,[a.t_daily.length>0?(v(),C(F,{key:0,class:"h-100 w-100 d-flex flex-column"},{default:c(()=>[(v(!0),m(A,null,W(a.t_daily,r=>Vt((v(),C(j,{key:r},{default:c(()=>[u(fe),u(O,null,{default:c(()=>[u(F,{class:"ma-2 d-flex flex-column",height:"100",elevation:"0"},{default:c(()=>[u(F,{class:"h-100 text-center text-black_grey bg-black_and_white"},{default:c(()=>[u(ve,{class:"statstyle py-0 text-xl-overline text-lg-subtitle-1 text-md-h5 font-weight-bold bg-black_and_white"},{default:c(()=>[V(E(r.position__name),1)]),_:2},1024),u(he,{onClick:d=>a.detailRound(r.position,r.position__name),class:"numstyle mt-2 py-0 font-weight-bold pointer bg-black_and_white"},{default:c(()=>[u(l,{ref_for:!0,ref:"counter",startAmount:0,endAmount:Number(r.user__count),duration:2},null,8,["endAmount"])]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)),[[Ot,r.position!=6]])),128))]),_:1})):(v(),C(F,{key:1,class:"h-100 w-100 d-flex justify-center flex-column",image:`${a.burl}/media/newsimage/2023/09/28/sea.jpg`},{default:c(()=>[u(j,{class:"flex-grow-0"},{default:c(()=>[u(O,{class:"py-0"},{default:c(()=>[a.accountStore.user.is_staff?(v(),C(qt,{key:0,modelValue:a.changeData,"onUpdate:modelValue":t[0]||(t[0]=r=>a.changeData=r),class:"pl-3 d-flex justify-end",color:"white",onClick:t[1]||(t[1]=r=>a.changeData=!a.changeData)},null,8,["modelValue"])):y("",!0)]),_:1})]),_:1}),u(j,{class:"ma-3"},{default:c(()=>[a.changeData?(v(),C(he,{key:0,class:"d-flex flex-column align-self-center"},{default:c(()=>[u(Ft,{accept:".xlsx",modelValue:a.dailyfiles,"onUpdate:modelValue":t[2]||(t[2]=r=>a.dailyfiles=r),variant:"underlined",density:"compact","hide-details":"",class:"pt-2 ml-0 text-white"},null,8,["modelValue"]),u(le,{class:"align-self-center",icon:"mdi-google-play text-white",size:"x-large",variant:"text",color:"teal-darken-4",disabled:a.dailyfiles==0,onClick:t[3]||(t[3]=r=>a.onPickFile("roundfilse"))},null,8,["disabled"])]),_:1})):(v(),C(he,{key:1,class:"w-100"},{default:c(()=>[u(j,{class:"text-white text-center text-lg-h5 h-100","align-content":"center",justify:"center"},{default:c(()=>[V(" Данные не загружены ")]),_:1})]),_:1}))]),_:1})]),_:1},8,["image"])),L("div",Di,[u(Ce,{modelValue:a.dialogDetailRound,"onUpdate:modelValue":t[5]||(t[5]=r=>a.dialogDetailRound=r),width:"500"},{default:c(()=>[u(n,{idpos:a.idpos,namepos:a.namepos,onSearchClose:t[4]||(t[4]=r=>a.dialogDetailRound=!a.dialogDetailRound)},null,8,["idpos","namepos"])]),_:1},8,["modelValue"])])])}const ki=X(wi,[["render",bi]]);var Ei=Object.defineProperty,Ti=(e,t,i)=>t in e?Ei(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Z=(e,t,i)=>(Ti(e,typeof t!="symbol"?t+"":t,i),i);/**
|
||
* vue-cal v4.8.1
|
||
* (c) 2022 Antoni Andre <antoniandre.web@gmail.com>
|
||
* @license MIT
|
||
*/let re,Fe,ze,B,de={},ae={};class Ci{constructor(t){Z(this,"_vuecal",null),Z(this,"selectCell",(i=!1,a,o)=>{this._vuecal.$emit("cell-click",o?{date:a,split:o}:a),this._vuecal.clickToNavigate||i?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout(()=>this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",o?{date:a,split:o}:a)))}),Z(this,"keyPressEnterCell",(i,a)=>{this._vuecal.$emit("cell-keypress-enter",a?{date:i,split:a}:i),this._vuecal.switchToNarrowerView()}),Z(this,"getPosition",i=>{const{left:a,top:o}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:s,clientY:l}="ontouchstart"in window&&i.touches?i.touches[0]:i;return{x:s-a,y:l-o}}),Z(this,"minutesAtCursor",i=>{let a=0,o={x:0,y:0};const{timeStep:s,timeCellHeight:l,timeFrom:n}=this._vuecal.$props;return typeof i=="number"?a=i:typeof i=="object"&&(o=this.getPosition(i),a=Math.round(o.y*s/parseInt(l)+n)),{minutes:Math.max(Math.min(a,1440),0),cursorCoords:o}}),this._vuecal=t}}let x,S,ke;class Mi{constructor(t,i){Z(this,"_vuecal",null),Z(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""}),this._vuecal=t,x=i}createAnEvent(t,i,a){if(typeof t=="string"&&(t=x.stringToDate(t)),!(t instanceof Date))return!1;const o=x.dateToMinutes(t),s=o+(i=1*i||120),l=x.addMinutes(new Date(t),i);a.end&&(typeof a.end=="string"&&(a.end=x.stringToDate(a.end)),a.endTimeMinutes=x.dateToMinutes(a.end));const n={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:t,startTimeMinutes:o,end:l,endTimeMinutes:s,segments:null,...a};return typeof this._vuecal.onEventCreate!="function"||this._vuecal.onEventCreate(n,()=>this.deleteAnEvent(n))?(n.startDateF!==n.endDateF&&(n.daysCount=x.countDays(n.start,n.end)),this._vuecal.mutableEvents.push(n),this._vuecal.addEventsToView([n]),this._vuecal.emitWithEvent("event-create",n),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(n),originalEvent:null}),n):void 0}addEventSegment(t){t.segments||(t.segments={},t.segments[x.formatDateLite(t.start)]={start:t.start,startTimeMinutes:t.startTimeMinutes,endTimeMinutes:1440,isFirstDay:!0,isLastDay:!1});const i=t.segments[x.formatDateLite(t.end)];i&&(i.isLastDay=!1,i.endTimeMinutes=1440);const a=x.addDays(t.end,1),o=x.formatDateLite(a);return a.setHours(0,0,0,0),t.segments[o]={start:a,startTimeMinutes:0,endTimeMinutes:t.endTimeMinutes,isFirstDay:!1,isLastDay:!0},t.end=x.addMinutes(a,t.endTimeMinutes),t.daysCount=Object.keys(t.segments).length,o}removeEventSegment(t){let i=Object.keys(t.segments).length;if(i<=1)return x.formatDateLite(t.end);delete t.segments[x.formatDateLite(t.end)],i--;const a=x.subtractDays(t.end,1),o=x.formatDateLite(a),s=t.segments[o];return i?s&&(s.isLastDay=!0,s.endTimeMinutes=t.endTimeMinutes):t.segments=null,t.daysCount=i||1,t.end=a,o}createEventSegments(t,i,a){const o=i.getTime(),s=a.getTime();let l,n,r,d=t.start.getTime(),h=t.end.getTime(),p=!1;for(t.end.getHours()||t.end.getMinutes()||(h-=1e3),t.segments={},t.repeat?(l=o,n=Math.min(s,t.repeat.until?x.stringToDate(t.repeat.until).getTime():s)):(l=Math.max(o,d),n=Math.min(s,h));l<=n;){let f=!1;const I=x.addDays(new Date(l),1).setHours(0,0,0,0);let w,Y,z,g;if(t.repeat){const $=new Date(l),M=x.formatDateLite($);(p||t.occurrences&&t.occurrences[M])&&(p||(d=t.occurrences[M].start,r=new Date(d).setHours(0,0,0,0),h=t.occurrences[M].end),p=!0,f=!0),w=l===r,Y=M===x.formatDateLite(new Date(h)),z=new Date(w?d:l),g=x.formatDateLite(z),Y&&(p=!1)}else f=!0,w=l===d,Y=n===h&&I>n,z=w?t.start:new Date(l),g=x.formatDateLite(w?t.start:z);f&&(t.segments[g]={start:z,startTimeMinutes:w?t.startTimeMinutes:0,endTimeMinutes:Y?t.endTimeMinutes:1440,isFirstDay:w,isLastDay:Y}),l=I}return t}deleteAnEvent(t){this._vuecal.emitWithEvent("event-delete",t),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter(i=>i._eid!==t._eid),this._vuecal.view.events=this._vuecal.view.events.filter(i=>i._eid!==t._eid)}checkCellOverlappingEvents(t,i){ke=t.slice(0),S={},t.forEach(o=>{ke.shift(),S[o._eid]||(S[o._eid]={overlaps:[],start:o.start,position:0}),S[o._eid].position=0,ke.forEach(s=>{S[s._eid]||(S[s._eid]={overlaps:[],start:s.start,position:0});const l=this.eventInRange(s,o.start,o.end),n=i.overlapsPerTimeStep?x.datesInSameTimeStep(o.start,s.start,i.timeStep):1;if(o.background||o.allDay||s.background||s.allDay||!l||!n){let r,d;(r=(S[o._eid]||{overlaps:[]}).overlaps.indexOf(s._eid))>-1&&S[o._eid].overlaps.splice(r,1),(d=(S[s._eid]||{overlaps:[]}).overlaps.indexOf(o._eid))>-1&&S[s._eid].overlaps.splice(d,1),S[s._eid].position--}else S[o._eid].overlaps.push(s._eid),S[o._eid].overlaps=[...new Set(S[o._eid].overlaps)],S[s._eid].overlaps.push(o._eid),S[s._eid].overlaps=[...new Set(S[s._eid].overlaps)],S[s._eid].position++})});let a=0;for(const o in S){const s=S[o],l=s.overlaps.map(n=>({id:n,start:S[n].start}));l.push({id:o,start:s.start}),l.sort((n,r)=>n.start<r.start?-1:n.start>r.start?1:n.id>r.id?-1:1),s.position=l.findIndex(n=>n.id===o),a=Math.max(this.getOverlapsStreak(s,S),a)}return[S,a]}getOverlapsStreak(t,i={}){let a=t.overlaps.length+1,o=[];return t.overlaps.forEach(s=>{o.includes(s)||t.overlaps.filter(l=>l!==s).forEach(l=>{i[l].overlaps.includes(s)||o.push(l)})}),o=[...new Set(o)],a-=o.length,a}eventInRange(t,i,a){if(t.allDay||!this._vuecal.time){const l=new Date(t.start).setHours(0,0,0,0);return new Date(t.end).setHours(23,59,0,0)>=new Date(i).setHours(0,0,0,0)&&l<=new Date(a).setHours(0,0,0,0)}const o=t.start.getTime(),s=t.end.getTime();return o<a.getTime()&&s>i.getTime()}}const xi={class:"vuecal__flex vuecal__weekdays-headings"},Si=["onClick"],Vi={class:"vuecal__flex weekday-label",grow:""},Oi={class:"full"},Ai={class:"small"},$i={class:"xsmall"},Hi={key:0},Li={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""},oe=(e,t)=>{const i=e.__vccOpts||e;for(const[a,o]of t)i[a]=o;return i},st=oe({inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},methods:{selectCell(e,t){e.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=e),this.utils.cell.selectCell(!1,e,t)},cleanupHeading:e=>({label:e.full,date:e.date,...e.today?{today:e.today}:{}})},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let e=!1;return this.weekDays.map((t,i)=>{const a=this.utils.date.addDays(this.view.startDate,this.vuecal.startWeekOnSunday?i-1:i);return{hide:t.hide,full:t.label,small:t.short||t.label.substr(0,3),xsmall:t.short||t.label.substr(0,1),...this.view.id==="week"?{dayOfMonth:a.getDate(),date:a,today:!e&&this.utils.date.isToday(a)&&!e++}:{}}})},cellWidth(){return 100/(7-this.weekDays.reduce((e,t)=>e+t.hide,0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return this.view.id==="week"&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}},[["render",function(e,t,i,a,o,s){return v(),m("div",xi,[(v(!0),m(A,null,W(s.headings,(l,n)=>(v(),m(A,{key:n},[l.hide?y("",!0):(v(),m("div",{key:0,class:R(["vuecal__flex vuecal__heading",{today:l.today,clickable:s.cellHeadingsClickable}]),style:N(s.weekdayCellStyles),onClick:r=>s.view.id==="week"&&s.selectCell(l.date,r),onDblclick:t[0]||(t[0]=r=>s.view.id==="week"&&s.vuecal.dblclickToNavigate&&i.switchToNarrowerView())},[u(_e,{name:`slide-fade--${i.transitionDirection}`,appear:s.vuecal.transitions},{default:c(()=>[(v(),m("div",{class:"vuecal__flex",column:"",key:!!s.vuecal.transitions&&`${n}-${l.dayOfMonth}`},[L("div",Vi,[k(e.$slots,"weekday-heading",{heading:s.cleanupHeading(l),view:s.view},()=>[L("span",Oi,E(l.full),1),L("span",Ai,E(l.small),1),L("span",$i,E(l.xsmall),1),l.dayOfMonth?(v(),m("span",Hi," "+E(l.dayOfMonth),1)):y("",!0)])]),s.vuecal.hasSplits&&s.vuecal.stickySplitLabels?(v(),m("div",Li,[(v(!0),m(A,null,W(s.vuecal.daySplits,(r,d)=>(v(),m("div",{class:R(["day-split-header",r.class||!1]),key:d},[k(e.$slots,"split-label",{split:r,view:s.view},()=>[V(E(r.label),1)])],2))),128))])):y("",!0)]))]),_:2},1032,["name","appear"])],46,Si))],64))),128))])}]]),Wi={class:"vuecal__header"},Ii={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},ji=["onDragenter","onDragleave","onClick","aria-label"],Pi={key:1,class:"vuecal__title-bar"},Yi=["aria-label"],Ri={class:"vuecal__flex vuecal__title",grow:""},Fi=["aria-label"],zi={key:0,class:"vuecal__flex vuecal__split-days-headers"},Bi=oe({inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:st},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date(new Date().setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(e){this.vuecal.transitionDirection=e}},broaderView(){const{enabledViews:e}=this.vuecal;return e[e.indexOf(this.view.id)-1]},showDaySplits(){return this.view.id==="day"&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}},[["render",function(e,t,i,a,o,s){const l=P("weekdays-headings");return v(),m("div",Wi,[i.options.hideViewSelector?y("",!0):(v(),m("div",Ii,[(v(!0),m(A,null,W(i.viewProps.views,(n,r)=>(v(),m(A,{key:r},[n.enabled?(v(),m("button",{key:0,class:R(["vuecal__view-btn",{"vuecal__view-btn--active":s.view.id===r,"vuecal__view-btn--highlighted":e.highlightedControl===r}]),type:"button",onDragenter:d=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(d,r,e.$data),onDragleave:d=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(d,r,e.$data),onClick:d=>s.switchView(r,null,!0),"aria-label":`${n.label} view`},E(n.label),43,ji)):y("",!0)],64))),128))])),i.options.hideTitleBar?y("",!0):(v(),m("div",Pi,[L("button",{class:R(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":e.highlightedControl==="previous"}]),type:"button",onClick:t[0]||(t[0]=(...n)=>s.previous&&s.previous(...n)),onDragenter:t[1]||(t[1]=n=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(n,"previous",e.$data)),onDragleave:t[2]||(t[2]=n=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(n,"previous",e.$data)),"aria-label":`Previous ${s.view.id}`},[k(e.$slots,"arrow-prev")],42,Yi),L("div",Ri,[u(_e,{name:i.options.transitions?`slide-fade--${s.transitionDirection}`:""},{default:c(()=>[(v(),C(At(s.broaderView?"button":"span"),{type:!!s.broaderView&&"button",key:`${s.view.id}${s.view.startDate.toString()}`,onClick:t[3]||(t[3]=n=>!!s.broaderView&&s.switchToBroaderView()),"aria-label":!!s.broaderView&&`Go to ${s.broaderView} view`},{default:c(()=>[k(e.$slots,"title")]),_:3},8,["type","aria-label"]))]),_:3},8,["name"])]),i.options.todayButton?(v(),m("button",{key:0,class:R(["vuecal__today-btn",{"vuecal__today-btn--highlighted":e.highlightedControl==="today"}]),type:"button",onClick:t[4]||(t[4]=(...n)=>s.goToToday&&s.goToToday(...n)),onDragenter:t[5]||(t[5]=n=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(n,"today",e.$data)),onDragleave:t[6]||(t[6]=n=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(n,"today",e.$data)),"aria-label":"Today"},[k(e.$slots,"today-button")],34)):y("",!0),L("button",{class:R(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":e.highlightedControl==="next"}]),type:"button",onClick:t[7]||(t[7]=(...n)=>s.next&&s.next(...n)),onDragenter:t[8]||(t[8]=n=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(n,"next",e.$data)),onDragleave:t[9]||(t[9]=n=>i.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(n,"next",e.$data)),"aria-label":`Next ${s.view.id}`},[k(e.$slots,"arrow-next")],42,Fi)])),i.viewProps.weekDaysInHeader?(v(),C(l,{key:2,"week-days":i.weekDays,"transition-direction":s.transitionDirection,"switch-to-narrower-view":i.switchToNarrowerView},Te({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:c(({heading:n,view:r})=>[k(e.$slots,"weekday-heading",{heading:n,view:r})]),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:c(({split:n})=>[k(e.$slots,"split-label",{split:n,view:s.view})]),key:"1"}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):y("",!0),u(_e,{name:`slide-fade--${s.transitionDirection}`},{default:c(()=>[s.showDaySplits?(v(),m("div",zi,[(v(!0),m(A,null,W(i.daySplits,(n,r)=>(v(),m("div",{class:R(["day-split-header",n.class||!1]),key:r},[k(e.$slots,"split-label",{split:n,view:s.view.id},()=>[V(E(n.label),1)])],2))),128))])):y("",!0)]),_:3},8,["name"])])}]]),Ni=["draggable"],Ui={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},overlaps:{type:Array,default:()=>[]},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(e,t=!1){if("ontouchstart"in window&&!t)return!1;const{clickHoldAnEvent:i,focusAnEvent:a,resizeAnEvent:o,dragAnEvent:s}=this.domEvents;if(a._eid===this.event._eid&&i._eid===this.event._eid)return!0;this.focusEvent(),i._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(i.timeoutId=setTimeout(()=>{o._eid||s._eid||(i._eid=this.event._eid,this.event.deleting=!0)},i.timeout))},onMouseUp(e){this.domEvents.focusAnEvent._eid!==this.event._eid||this.touch.dragged||(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(e){e.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(e){e.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(e){if(typeof this.vuecal.onEventClick!="function")return;const{clientX:t,clientY:i}=e.touches[0],{startX:a,startY:o,dragThreshold:s}=this.touch;(Math.abs(t-a)>s||Math.abs(i-o)>s)&&(this.touch.dragged=!0)},onTouchStart(e){this.touch.startX=e.touches[0].clientX,this.touch.startY=e.touches[0].clientY,this.onMouseDown(e,!0)},onEnterKeypress(e){if(typeof this.vuecal.onEventClick=="function")return this.vuecal.onEventClick(this.event,e)},onDblClick(e){if(typeof this.vuecal.onEventDblclick=="function")return this.vuecal.onEventDblclick(this.event,e)},onDragStart(e){this.dnd&&this.dnd.eventDragStart(e,this.event)},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(e=!1){if("ontouchstart"in window&&!e)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(e){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:e}=this.domEvents,t=e._eid;if(t!==this.event._eid){if(t){const i=this.view.events.find(a=>a._eid===t);i&&(i.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),e._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:e,endTimeMinutes:t}=this.segment||this.event;let i=e-this.vuecal.timeFrom;const a=Math.max(Math.round(i*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);i=Math.min(t,this.vuecal.timeTo)-this.vuecal.timeFrom;const o=Math.round(i*this.vuecal.timeCellHeight/this.vuecal.timeStep);return{top:a,height:Math.max(o-a,5)}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||this.view.id==="month"||this.allDay)return{};let e=100/Math.min(this.overlaps.length+1,this.overlapsStreak),t=100/(this.overlaps.length+1)*this.eventPosition;this.vuecal.minEventWidth&&e<this.vuecal.minEventWidth&&(e=this.vuecal.minEventWidth,t=(100-this.vuecal.minEventWidth)/this.overlaps.length*this.eventPosition);const{top:i,height:a}=this.eventDimensions;return{top:`${i}px`,height:`${a}px`,width:`${e}%`,left:this.event.left&&`${this.event.left}px`||`${t}%`}},eventClasses(){const{isFirstDay:e,isLastDay:t}=this.segment||{};return{[this.event.class]:!!this.event.class,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&e&&!t,"event-middle":this.segment&&!e&&!t,"event-end":this.segment&&t&&!e}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:e,background:t,daysCount:i}=this.event;return this.vuecal.editEvents.drag&&e&&!t&&i===1},resizable(){const{editEvents:e,time:t}=this.vuecal;return e.resize&&this.event.resizable&&t&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&this.view.id!=="month"},dnd(){return this.modules.dnd}}},Gi=["data-split","aria-label","onTouchstart","onMousedown","onDragover","onDrop"],qi={key:0,class:"cell-time-labels"},Ki=["innerHTML"],Xi={key:2,class:"vuecal__cell-events"},Zi=["title"],at=oe({inject:["vuecal","utils","modules","view","domEvents"],components:{Event:oe(Ui,[["render",function(e,t,i,a,o,s){return v(),m("div",{class:R(["vuecal__event",s.eventClasses]),style:N(s.eventStyles),tabindex:"0",onFocus:t[4]||(t[4]=(...l)=>s.focusEvent&&s.focusEvent(...l)),onKeypress:t[5]||(t[5]=We(se((...l)=>s.onEnterKeypress&&s.onEnterKeypress(...l),["stop"]),["enter"])),onMouseenter:t[6]||(t[6]=(...l)=>s.onMouseEnter&&s.onMouseEnter(...l)),onMouseleave:t[7]||(t[7]=(...l)=>s.onMouseLeave&&s.onMouseLeave(...l)),onTouchstart:t[8]||(t[8]=se((...l)=>s.onTouchStart&&s.onTouchStart(...l),["stop"])),onMousedown:t[9]||(t[9]=l=>s.onMouseDown(l)),onMouseup:t[10]||(t[10]=(...l)=>s.onMouseUp&&s.onMouseUp(...l)),onTouchend:t[11]||(t[11]=(...l)=>s.onMouseUp&&s.onMouseUp(...l)),onTouchmove:t[12]||(t[12]=(...l)=>s.onTouchMove&&s.onTouchMove(...l)),onDblclick:t[13]||(t[13]=(...l)=>s.onDblClick&&s.onDblClick(...l)),draggable:s.draggable,onDragstart:t[14]||(t[14]=l=>s.draggable&&s.onDragStart(l)),onDragend:t[15]||(t[15]=l=>s.draggable&&s.onDragEnd())},[s.vuecal.editEvents.delete&&i.event.deletable?(v(),m("div",{key:0,class:"vuecal__event-delete",onClick:t[0]||(t[0]=se((...l)=>s.deleteEvent&&s.deleteEvent(...l),["stop"])),onTouchstart:t[1]||(t[1]=se((...l)=>s.touchDeleteEvent&&s.touchDeleteEvent(...l),["stop"]))},E(s.vuecal.texts.deleteEvent),33)):y("",!0),k(e.$slots,"event",{event:i.event,view:s.view.id}),s.resizable?(v(),m("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:t[2]||(t[2]=se((...l)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...l),["stop","prevent"])),onTouchstart:t[3]||(t[3]=se((...l)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...l),["stop","prevent"]))},null,32)):y("",!0)],46,Ni)}]])},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:e}){let t=e.classList.contains("vuecal__cell-split")?e:this.vuecal.findAncestor(e,"vuecal__cell-split");return t&&(t=t.attributes["data-split"].value,parseInt(t).toString()===t.toString()&&(t=parseInt(t))),t||null},splitClasses(e){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===e.id,[e.class]:!!e.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(this.eventsCount===1?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(e){return this.vuecal.isDOMElementAnEvent(e)},selectCell(e,t=!1){const i=this.splitsCount?this.getSplitAtCursor(e):null;this.utils.cell.selectCell(t,this.timeAtCursor,i),this.timeAtCursor=null},onCellkeyPressEnter(e){this.isSelected||this.onCellFocus(e);const t=this.splitsCount?this.getSplitAtCursor(e):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,t),this.timeAtCursor=null},onCellFocus(e){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const t=this.splitsCount?this.getSplitAtCursor(e):null,i=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",t?{date:i,split:t}:i)}},onCellMouseDown(e,t=null,i=!1){if("ontouchstart"in window&&!i)return!1;this.isSelected||this.onCellFocus(e);const{clickHoldACell:a,focusAnEvent:o}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,a.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:s,cursorCoords:{y:l}}=this.vuecal.minutesAtCursor(e);this.timeAtCursor.setMinutes(s);const n=this.isDOMElementAnEvent(e.target);!n&&o._eid&&((this.view.events.find(r=>r._eid===o._eid)||{}).focused=!1),this.editEvents.create&&!n&&this.setUpEventCreation(e,l)},setUpEventCreation(e,t){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:i}=this.domEvents;if(i.startCursorY=t,i.split=this.splitsCount?this.getSplitAtCursor(e):null,i.start=this.timeAtCursor,this.options.snapToTime){let a=60*this.timeAtCursor.getHours()+this.timeAtCursor.getMinutes();const o=a+this.options.snapToTime/2;a=o-o%this.options.snapToTime,i.start.setHours(0,a,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(e)},setUpCellHoldTimer(e){const{clickHoldACell:t}=this.domEvents;t.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,t.split=this.splitsCount?this.getSplitAtCursor(e):null,t.timeoutId=setTimeout(()=>{if(t.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:i}=this.utils.event.createAnEvent(this.timeAtCursor,null,t.split?{split:t.split}:{});t.eventCreated=i}},t.timeout)},onCellTouchStart(e,t=null){this.onCellMouseDown(e,t,!0)},onCellClick(e){this.isDOMElementAnEvent(e.target)||this.selectCell(e)},onCellDblClick(e){const t=new Date(this.data.startDate);t.setMinutes(this.vuecal.minutesAtCursor(e).minutes);const i=this.splitsCount?this.getSplitAtCursor(e):null;this.vuecal.$emit("cell-dblclick",i?{date:t,split:i}:t),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(e){e.stopPropagation(),e.preventDefault();const t=new Date(this.data.startDate),{cursorCoords:i,minutes:a}=this.vuecal.minutesAtCursor(e);t.setMinutes(a);const o=this.splitsCount?this.getSplitAtCursor(e):null;this.vuecal.$emit("cell-contextmenu",{date:t,...i,...o||{},e})}},computed:{dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return this.minTimestamp!==null&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:e}=this.options,{isYearsOrYearView:t}=this.vuecal;return!(!e.length||!e.includes(this.data.formattedDate)||t)||this.isBeforeMinDate||this.isAfterMaxDate},isSelected:{get(){let e=!1;const{selectedDate:t}=this.view;return e=this.view.id==="years"?t.getFullYear()===this.data.startDate.getFullYear():this.view.id==="year"?t.getFullYear()===this.data.startDate.getFullYear()&&t.getMonth()===this.data.startDate.getMonth():t.getTime()===this.data.startDate.getTime(),e},set(e){this.view.selectedDate=e,this.vuecal.$emit("update:selected-date",this.view.selectedDate)}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map(e=>{let{from:t,to:i}=e;return t=Math.max(t,this.options.timeFrom),i=Math.min(i,this.options.timeTo),{...e,height:(i-t)*this.timeScale,top:(t-this.options.timeFrom)*this.timeScale}})},events(){const{startDate:e,endDate:t}=this.data;let i=[];if(!["years","year"].includes(this.view.id)||this.options.eventsCountOnYearView){if(i=this.view.events.slice(0),this.view.id==="month"&&i.push(...this.view.outOfScopeEvents),i=i.filter(a=>this.utils.event.eventInRange(a,e,t)),this.options.showAllDayEvents&&this.view.id!=="month"&&(i=i.filter(a=>!!a.allDay===this.allDay)),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:a,timeTo:o}=this.options;i=i.filter(s=>{const l=s.daysCount>1&&s.segments[this.data.formattedDate]||{},n=s.daysCount===1&&s.startTimeMinutes<o&&s.endTimeMinutes>a,r=s.daysCount>1&&l.startTimeMinutes<o&&l.endTimeMinutes>a;return s.allDay||n||r||!1})}!this.options.time||!this.isWeekOrDayView||this.options.showAllDayEvents&&this.allDay||i.sort((a,o)=>a.start<o.start?-1:1),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return i},eventsCount(){return this.events.length},splits(){return this.cellSplits.map((e,t)=>{const i=this.events.filter(s=>s.split===e.id),[a,o]=this.utils.event.checkCellOverlappingEvents(i.filter(s=>!s.background&&!s.allDay),this.options);return{...e,overlaps:a,overlapsStreak:o,events:i}})},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:e,timeTo:t}=this.options;return this.data.today&&this.isWeekOrDayView&&e&&!this.allDay&&this.nowInMinutes<=t},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const e=this.nowInMinutes-this.options.timeFrom;return Math.round(e*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}},[["render",function(e,t,i,a,o,s){const l=P("event");return v(),C($t,{class:R(["vuecal__cell",s.cellClasses]),name:`slide-fade--${s.transitionDirection}`,tag:"div",appear:i.options.transitions,style:N(s.cellStyles)},{default:c(()=>[(v(!0),m(A,null,W(s.splitsCount?s.splits:1,(n,r)=>(v(),m("div",{class:R(["vuecal__flex vuecal__cell-content",s.splitsCount&&s.splitClasses(n)]),key:i.options.transitions?`${s.view.id}-${i.data.content}-${r}`:r,"data-split":!!s.splitsCount&&n.id,column:"",tabindex:"0","aria-label":i.data.content,onFocus:t[0]||(t[0]=d=>s.onCellFocus(d)),onKeypress:t[1]||(t[1]=We(d=>s.onCellkeyPressEnter(d),["enter"])),onTouchstart:d=>!s.isDisabled&&s.onCellTouchStart(d,s.splitsCount?n.id:null),onMousedown:d=>!s.isDisabled&&s.onCellMouseDown(d,s.splitsCount?n.id:null),onClick:t[2]||(t[2]=d=>!s.isDisabled&&s.onCellClick(d)),onDblclick:t[3]||(t[3]=d=>!s.isDisabled&&s.onCellDblClick(d)),onContextmenu:t[4]||(t[4]=d=>!s.isDisabled&&i.options.cellContextmenu&&s.onCellContextMenu(d)),onDragenter:t[5]||(t[5]=d=>!s.isDisabled&&i.editEvents.drag&&s.dnd&&s.dnd.cellDragEnter(d,e.$data,i.data.startDate)),onDragover:d=>!s.isDisabled&&i.editEvents.drag&&s.dnd&&s.dnd.cellDragOver(d,e.$data,i.data.startDate,s.splitsCount?n.id:null),onDragleave:t[6]||(t[6]=d=>!s.isDisabled&&i.editEvents.drag&&s.dnd&&s.dnd.cellDragLeave(d,e.$data,i.data.startDate)),onDrop:d=>!s.isDisabled&&i.editEvents.drag&&s.dnd&&s.dnd.cellDragDrop(d,e.$data,i.data.startDate,s.splitsCount?n.id:null)},[i.options.showTimeInCells&&i.options.time&&s.isWeekOrDayView&&!i.allDay?(v(),m("div",qi,[(v(!0),m(A,null,W(s.vuecal.timeCells,(d,h)=>(v(),m("span",{class:"cell-time-label",key:h},E(d.label),1))),128))])):y("",!0),s.isWeekOrDayView&&!i.allDay&&s.specialHours.length?(v(!0),m(A,{key:1},W(s.specialHours,(d,h)=>(v(),m("div",{class:R(["vuecal__special-hours",`vuecal__special-hours--day${d.day} ${d.class}`]),style:N(`height: ${d.height}px;top: ${d.top}px`)},[d.label?(v(),m("div",{key:0,class:"special-hours-label",innerHTML:d.label},null,8,Ki)):y("",!0)],6))),256)):y("",!0),k(e.$slots,"cell-content",{events:s.events,selectCell:d=>s.selectCell(d,!0),split:!!s.splitsCount&&n}),s.eventsCount&&(s.isWeekOrDayView||s.view.id==="month"&&i.options.eventsOnMonthView)?(v(),m("div",Xi,[(v(!0),m(A,null,W(s.splitsCount?n.events:s.events,(d,h)=>(v(),C(l,{key:h,"cell-formatted-date":i.data.formattedDate,event:d,"all-day":i.allDay,"cell-events":s.splitsCount?n.events:s.events,overlaps:((s.splitsCount?n.overlaps[d._eid]:e.cellOverlaps[d._eid])||[]).overlaps,"event-position":((s.splitsCount?n.overlaps[d._eid]:e.cellOverlaps[d._eid])||[]).position,"overlaps-streak":s.splitsCount?n.overlapsStreak:e.cellOverlapsStreak},{event:c(({event:p,view:f})=>[k(e.$slots,"event",{view:f,event:p})]),_:2},1032,["cell-formatted-date","event","all-day","cell-events","overlaps","event-position","overlaps-streak"]))),128))])):y("",!0)],42,Gi))),128)),s.timelineVisible?(v(),m("div",{class:"vuecal__now-line",style:N(`top: ${s.todaysTimePosition}px`),key:i.options.transitions?`${s.view.id}-now-line`:"now-line",title:s.utils.date.formatTime(s.vuecal.now)},null,12,Zi)):y("",!0)]),_:3},8,["class","name","appear","style"])}]]),Ji={key:0,class:"vuecal__all-day-text",style:{width:"3em"}},Qi=oe({inject:["vuecal","view","editEvents"],components:{"vuecal-cell":at},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}},[["render",function(e,t,i,a,o,s){const l=P("vuecal-cell");return v(),m("div",{class:"vuecal__flex vuecal__all-day",style:N(i.cellOrSplitMinWidth&&{height:i.height})},[i.cellOrSplitMinWidth?y("",!0):(v(),m("div",Ji,[L("span",null,E(i.label),1)])),L("div",{class:R(["vuecal__flex vuecal__cells",`${s.view.id}-view`]),grow:"",style:N(i.cellOrSplitMinWidth?`min-width: ${i.cellOrSplitMinWidth}px`:"")},[(v(!0),m(A,null,W(i.cells,(n,r)=>(v(),C(l,{key:r,options:i.options,"edit-events":s.editEvents,data:n,"all-day":!0,"cell-width":i.options.hideWeekdays.length&&(s.vuecal.isWeekView||s.vuecal.isMonthView)&&s.vuecal.cellWidth,"min-timestamp":i.options.minTimestamp,"max-timestamp":i.options.maxTimestamp,"cell-splits":i.daySplits},{event:c(({event:d,view:h})=>[k(e.$slots,"event",{view:h,event:d})]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],6)],4)}]]),es=["lang"],ts=L("i",{class:"angle"},null,-1),is=L("i",{class:"angle"},null,-1),ss={class:"default"},as={key:0,class:"vuecal__flex vuecal__body",grow:""},ns=["onBlur","innerHTML"],ls=["innerHTML"],os=["innerHTML"],rs={class:"vuecal__flex",row:"",grow:""},ds={key:0,class:"vuecal__time-column"},us=L("span",{class:"vuecal__time-cell-line"},null,-1),cs={class:"vuecal__time-cell-label"},hs={key:1,class:"vuecal__flex vuecal__week-numbers",column:""},vs=["wrap","column"],ms=["onBlur","innerHTML"],ps=["innerHTML"],fs=["innerHTML"],_s=["wrap"],gs=["innerHTML"],ws=["innerHTML"],ys={key:2,class:"vuecal__cell-events-count"},Ds={key:3,class:"vuecal__no-event"},bs=["onBlur","innerHTML"],ks=["innerHTML"],Es={key:2,class:"vuecal__event-time"},Ts={key:0},Cs={key:1,class:"days-to-end"},Ms=["innerHTML"],xs={key:0,class:"vuecal__scrollbar-check"},Ss=[L("div",null,null,-1)],ce={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},Be=["years","year","month","week","day"],Ne=new class{constructor(e,t=!1){Z(this,"texts",{}),Z(this,"dateToMinutes",i=>60*i.getHours()+i.getMinutes()),B=this,this._texts=e,t||!Date||Date.prototype.addDays||this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return B.addDays(this,e)},Date.prototype.subtractDays=function(e){return B.subtractDays(this,e)},Date.prototype.addHours=function(e){return B.addHours(this,e)},Date.prototype.subtractHours=function(e){return B.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return B.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return B.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return B.getWeek(this)},Date.prototype.isToday=function(){return B.isToday(this)},Date.prototype.isLeapYear=function(){return B.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return B.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return B.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return Fe!==new Date().getDate()&&(re=new Date,Fe=re.getDate(),ze=`${re.getFullYear()}-${re.getMonth()}-${re.getDate()}`),ze}addDays(e,t){const i=new Date(e.valueOf());return i.setDate(i.getDate()+t),i}subtractDays(e,t){const i=new Date(e.valueOf());return i.setDate(i.getDate()-t),i}addHours(e,t){const i=new Date(e.valueOf());return i.setHours(i.getHours()+t),i}subtractHours(e,t){const i=new Date(e.valueOf());return i.setHours(i.getHours()-t),i}addMinutes(e,t){const i=new Date(e.valueOf());return i.setMinutes(i.getMinutes()+t),i}subtractMinutes(e,t){const i=new Date(e.valueOf());return i.setMinutes(i.getMinutes()-t),i}getWeek(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),i=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-i);const a=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-a)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const t=e.getFullYear();return!(t%400)||t%100&&!(t%4)}getPreviousFirstDayOfWeek(e=null,t){const i=e&&new Date(e.valueOf())||new Date,a=t?7:6;return i.setDate(i.getDate()-(i.getDay()+a)%7),i}stringToDate(e){return e instanceof Date?e:(e.length===10&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,t){typeof e=="string"&&(e=e.replace(/-/g,"/")),typeof t=="string"&&(t=t.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,1,0);const i=60*(new Date(t).getTimezoneOffset()-new Date(e).getTimezoneOffset())*1e3;return Math.ceil((t-e-i)/864e5)}datesInSameTimeStep(e,t,i){return Math.abs(e.getTime()-t.getTime())<=60*i*1e3}formatDate(e,t="YYYY-MM-DD",i=null){if(i||(i=this._texts),t||(t="YYYY-MM-DD"),t==="YYYY-MM-DD")return this.formatDateLite(e);de={},ae={};const a={YYYY:()=>this._hydrateDateObject(e,i).YYYY,YY:()=>this._hydrateDateObject(e,i).YY(),M:()=>this._hydrateDateObject(e,i).M,MM:()=>this._hydrateDateObject(e,i).MM(),MMM:()=>this._hydrateDateObject(e,i).MMM(),MMMM:()=>this._hydrateDateObject(e,i).MMMM(),MMMMG:()=>this._hydrateDateObject(e,i).MMMMG(),D:()=>this._hydrateDateObject(e,i).D,DD:()=>this._hydrateDateObject(e,i).DD(),S:()=>this._hydrateDateObject(e,i).S(),d:()=>this._hydrateDateObject(e,i).d,dd:()=>this._hydrateDateObject(e,i).dd(),ddd:()=>this._hydrateDateObject(e,i).ddd(),dddd:()=>this._hydrateDateObject(e,i).dddd(),HH:()=>this._hydrateTimeObject(e,i).HH,H:()=>this._hydrateTimeObject(e,i).H,hh:()=>this._hydrateTimeObject(e,i).hh,h:()=>this._hydrateTimeObject(e,i).h,am:()=>this._hydrateTimeObject(e,i).am,AM:()=>this._hydrateTimeObject(e,i).AM,mm:()=>this._hydrateTimeObject(e,i).mm,m:()=>this._hydrateTimeObject(e,i).m};return t.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(o,s)=>{const l=a[s.replace(/\{|\}/g,"")];return l!==void 0?l():s})}formatDateLite(e){const t=e.getMonth()+1,i=e.getDate();return`${e.getFullYear()}-${t<10?"0":""}${t}-${i<10?"0":""}${i}`}formatTime(e,t="HH:mm",i=null,a=!1){let o=!1;if(a){const[n,r,d]=[e.getHours(),e.getMinutes(),e.getSeconds()];n+r+d===141&&(o=!0)}if(e instanceof Date&&t==="HH:mm")return o?"24:00":this.formatTimeLite(e);ae={},i||(i=this._texts);const s=this._hydrateTimeObject(e,i),l=t.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(n,r)=>{const d=s[r.replace(/\{|\}/g,"")];return d!==void 0?d:r});return o?l.replace("23:59","24:00"):l}formatTimeLite(e){const t=e.getHours(),i=e.getMinutes();return`${(t<10?"0":"")+t}:${(i<10?"0":"")+i}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,t){if(de.D)return de;const i=e.getFullYear(),a=e.getMonth()+1,o=e.getDate(),s=(e.getDay()-1+7)%7;return de={YYYY:i,YY:()=>i.toString().substring(2),M:a,MM:()=>(a<10?"0":"")+a,MMM:()=>t.months[a-1].substring(0,3),MMMM:()=>t.months[a-1],MMMMG:()=>(t.monthsGenitive||t.months)[a-1],D:o,DD:()=>(o<10?"0":"")+o,S:()=>this._nth(o),d:s+1,dd:()=>t.weekDays[s][0],ddd:()=>t.weekDays[s].substr(0,3),dddd:()=>t.weekDays[s]},de}_hydrateTimeObject(e,t){if(ae.am)return ae;let i,a;e instanceof Date?(i=e.getHours(),a=e.getMinutes()):(i=Math.floor(e/60),a=Math.floor(e%60));const o=i%12?i%12:12,s=(t||{am:"am",pm:"pm"})[i===24||i<12?"am":"pm"];return ae={H:i,h:o,HH:(i<10?"0":"")+i,hh:(o<10?"0":"")+o,am:s,AM:s.toUpperCase(),m:a,mm:(a<10?"0":"")+a},ae}}(ce),Vs={name:"vue-cal",components:{"vuecal-cell":at,"vuecal-header":Bi,WeekdaysHeadings:st,AllDayBar:Qi},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showTimeInCells:{type:Boolean,default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:1440},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...ce},utils:{date:!!this.disableDatePrototypes&&Ne.removePrototypes()||Ne,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(e){if(typeof this.locale=="object")return this.texts=Object.assign({},ce,e),void this.utils.date.updateTexts(this.texts);if(this.locale==="en"){const t=await _(()=>import("./en.es-713916b0.js"),[]);this.texts=Object.assign({},ce,t)}else((t,i)=>{const a=t[i];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((o,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+i)))})})(Object.assign({"./i18n/ar.json":()=>_(()=>import("./ar.es-4173cb29.js"),[]),"./i18n/bg.json":()=>_(()=>import("./bg.es-3542f853.js"),[]),"./i18n/bn.json":()=>_(()=>import("./bn.es-55ab5212.js"),[]),"./i18n/bs.json":()=>_(()=>import("./bs.es-ba9dd541.js"),[]),"./i18n/ca.json":()=>_(()=>import("./ca.es-3f4af411.js"),[]),"./i18n/cs.json":()=>_(()=>import("./cs.es-4bf8e61a.js"),[]),"./i18n/da.json":()=>_(()=>import("./da.es-084484fb.js"),[]),"./i18n/de.json":()=>_(()=>import("./de.es-0185602c.js"),[]),"./i18n/el.json":()=>_(()=>import("./el.es-b3db55e7.js"),[]),"./i18n/en.json":()=>_(()=>import("./en.es-713916b0.js"),[]),"./i18n/es.json":()=>_(()=>import("./es.es-2f81ef8f.js"),[]),"./i18n/et.json":()=>_(()=>import("./et.es-feab242e.js"),[]),"./i18n/fa.json":()=>_(()=>import("./fa.es-e30ec481.js"),[]),"./i18n/fr.json":()=>_(()=>import("./fr.es-fd781cdb.js"),[]),"./i18n/he.json":()=>_(()=>import("./he.es-ab017da7.js"),[]),"./i18n/hr.json":()=>_(()=>import("./hr.es-8ff4208c.js"),[]),"./i18n/hu.json":()=>_(()=>import("./hu.es-a826dbea.js"),[]),"./i18n/id.json":()=>_(()=>import("./id.es-09894c24.js"),[]),"./i18n/is.json":()=>_(()=>import("./is.es-9608cdad.js"),[]),"./i18n/it.json":()=>_(()=>import("./it.es-8f484e02.js"),[]),"./i18n/ja.json":()=>_(()=>import("./ja.es-b7fc0eb9.js"),[]),"./i18n/ka.json":()=>_(()=>import("./ka.es-446e6e19.js"),[]),"./i18n/ko.json":()=>_(()=>import("./ko.es-45e7d699.js"),[]),"./i18n/lt.json":()=>_(()=>import("./lt.es-bc184482.js"),[]),"./i18n/mn.json":()=>_(()=>import("./mn.es-5fa17a96.js"),[]),"./i18n/nl.json":()=>_(()=>import("./nl.es-f5998f61.js"),[]),"./i18n/no.json":()=>_(()=>import("./no.es-7a7b8685.js"),[]),"./i18n/pl.json":()=>_(()=>import("./pl.es-2dc4cbea.js"),[]),"./i18n/pt-br.json":()=>_(()=>import("./pt-br.es-82c2bfad.js"),[]),"./i18n/ro.json":()=>_(()=>import("./ro.es-0b230c59.js"),[]),"./i18n/ru.json":()=>_(()=>import("./ru.es-3bc3c295.js"),[]),"./i18n/sk.json":()=>_(()=>import("./sk.es-477d958c.js"),[]),"./i18n/sl.json":()=>_(()=>import("./sl.es-7f9e39ca.js"),[]),"./i18n/sq.json":()=>_(()=>import("./sq.es-484abfbf.js"),[]),"./i18n/sr.json":()=>_(()=>import("./sr.es-79173882.js"),[]),"./i18n/sv.json":()=>_(()=>import("./sv.es-cc28424b.js"),[]),"./i18n/tr.json":()=>_(()=>import("./tr.es-73d31d0a.js"),[]),"./i18n/uk.json":()=>_(()=>import("./uk.es-72aa5132.js"),[]),"./i18n/vi.json":()=>_(()=>import("./vi.es-e48f04c7.js"),[]),"./i18n/zh-cn.json":()=>_(()=>import("./zh-cn.es-d3b0ce92.js"),[]),"./i18n/zh-hk.json":()=>_(()=>import("./zh-hk.es-f0804a56.js"),[])}),`./i18n/${e}.json`).then(t=>{this.texts=Object.assign({},ce,t.default),this.utils.date.updateTexts(this.texts)})},loadDragAndDrop(){_(()=>import("./drag-and-drop.es-801b9187.js"),[]).then(e=>{const{DragAndDrop:t}=e;this.modules.dnd=new t(this)}).catch(()=>console.warn("Vue Cal: Missing drag & drop module."))},validateView(e){return Be.includes(e)||(console.error(`Vue Cal: invalid active-view parameter provided: "${e}".
|
||
A valid view must be one of: ${Be.join(", ")}.`),e="week"),this.enabledViews.includes(e)||(console.warn(`Vue Cal: the provided active-view "${e}" is disabled. Using the "${this.enabledViews[0]}" view instead.`),e=this.enabledViews[0]),e},switchToNarrowerView(e=null){this.transitionDirection="right";const t=this.enabledViews[this.enabledViews.indexOf(this.view.id)+1];t&&this.switchView(t,e)},switchView(e,t=null,i=!1){e=this.validateView(e);const a=this.utils.date,o=this.view.startDate&&this.view.startDate.getTime();if(this.transitions&&i){if(this.view.id===e)return;const n=this.enabledViews;this.transitionDirection=n.indexOf(this.view.id)>n.indexOf(e)?"left":"right"}const s=this.view.id;switch(this.view.events=[],this.view.id=e,this.view.firstCellDate=null,this.view.lastCellDate=null,t||(t=this.view.selectedDate||this.view.startDate),e){case"years":this.view.startDate=new Date(25*Math.floor(t.getFullYear()/25)||2e3,0,1),this.view.endDate=new Date(this.view.startDate.getFullYear()+25,0,1),this.view.endDate.setSeconds(-1);break;case"year":this.view.startDate=new Date(t.getFullYear(),0,1),this.view.endDate=new Date(t.getFullYear()+1,0,1),this.view.endDate.setSeconds(-1);break;case"month":{this.view.startDate=new Date(t.getFullYear(),t.getMonth(),1),this.view.endDate=new Date(t.getFullYear(),t.getMonth()+1,1),this.view.endDate.setSeconds(-1);let n=new Date(this.view.startDate);if(n.getDay()!==(this.startWeekOnSunday?0:1)&&(n=a.getPreviousFirstDayOfWeek(n,this.startWeekOnSunday)),this.view.firstCellDate=n,this.view.lastCellDate=a.addDays(n,41),this.view.lastCellDate.setHours(23,59,59,0),this.hideWeekends){if([0,6].includes(this.view.firstCellDate.getDay())){const r=this.view.firstCellDate.getDay()!==6||this.startWeekOnSunday?1:2;this.view.firstCellDate=a.addDays(this.view.firstCellDate,r)}if([0,6].includes(this.view.startDate.getDay())){const r=this.view.startDate.getDay()===6?2:1;this.view.startDate=a.addDays(this.view.startDate,r)}if([0,6].includes(this.view.lastCellDate.getDay())){const r=this.view.lastCellDate.getDay()!==0||this.startWeekOnSunday?1:2;this.view.lastCellDate=a.subtractDays(this.view.lastCellDate,r)}if([0,6].includes(this.view.endDate.getDay())){const r=this.view.endDate.getDay()===0?2:1;this.view.endDate=a.subtractDays(this.view.endDate,r)}}break}case"week":{t=a.getPreviousFirstDayOfWeek(t,this.startWeekOnSunday);const n=this.hideWeekends?5:7;this.view.startDate=this.hideWeekends&&this.startWeekOnSunday?a.addDays(t,1):t,this.view.startDate.setHours(0,0,0,0),this.view.endDate=a.addDays(t,n),this.view.endDate.setSeconds(-1);break}case"day":this.view.startDate=t,this.view.startDate.setHours(0,0,0,0),this.view.endDate=new Date(t),this.view.endDate.setHours(23,59,59,0)}this.addEventsToView();const l=this.view.startDate&&this.view.startDate.getTime();if((s!==e||l!==o)&&(this.$emit("update:activeView",e),this.ready)){const n=this.view.startDate,r={view:e,startDate:n,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate,outOfScopeEvents:this.view.outOfScopeEvents.map(this.cleanupEvent)}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:a.getWeek(this.startWeekOnSunday?a.addDays(n,1):n)}:{}};this.$emit("view-change",r)}},previous(){this.previousNext(!1)},next(){this.previousNext()},previousNext(e=!0){const t=this.utils.date;this.transitionDirection=e?"right":"left";const i=e?1:-1;let a=null;const{startDate:o,id:s}=this.view;switch(s){case"years":a=new Date(o.getFullYear()+25*i,0,1);break;case"year":a=new Date(o.getFullYear()+1*i,1,1);break;case"month":a=new Date(o.getFullYear(),o.getMonth()+1*i,1);break;case"week":a=t[e?"addDays":"subtractDays"](t.getPreviousFirstDayOfWeek(o,this.startWeekOnSunday),7);break;case"day":a=t[e?"addDays":"subtractDays"](o,1);const l=a.getDay(),n=this.startWeekOnSunday?l:(l||7)-1;if(this.weekDays[n].hide){const r=this.weekDays.map((h,p)=>({...h,i:p}));let d=0;e?([...r.slice(n),...r].find(h=>(d++,!h.hide)).i,d--):[...r,...r.slice(0,n)].reverse().find(h=>(d++,!h.hide)).i,a=t[e?"addDays":"subtractDays"](a,d)}}a&&this.switchView(s,a)},addEventsToView(e=[]){const t=this.utils.event,{startDate:i,endDate:a,firstCellDate:o,lastCellDate:s}=this.view;if(e.length||(this.view.events=[]),!(e=e.length?e:[...this.mutableEvents])||this.isYearsOrYearView&&!this.eventsCountOnYearView)return;let l=e.filter(n=>t.eventInRange(n,i,a));this.isYearsOrYearView||this.isMonthView&&!this.eventsOnMonthView||(l=l.map(n=>n.daysCount>1?t.createEventSegments(n,o||i,s||a):n)),this.view.events.push(...l),this.isMonthView&&(this.view.outOfScopeEvents=[],e.forEach(n=>{(t.eventInRange(n,o,i)||t.eventInRange(n,a,s))&&(this.view.events.some(r=>r._eid===n._eid)||this.view.outOfScopeEvents.push(n))}))},findAncestor(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e},isDOMElementAnEvent(e){return e.classList.contains("vuecal__event")||this.findAncestor(e,"vuecal__event")},onMouseMove(e){const{resizeAnEvent:t,dragAnEvent:i,dragCreateAnEvent:a}=this.domEvents;(t._eid!==null||i._eid!==null||a.start)&&(e.preventDefault(),t._eid?this.eventResizing(e):this.dragToCreateEvent&&a.start&&this.eventDragCreation(e))},onMouseUp(e){const{focusAnEvent:t,resizeAnEvent:i,clickHoldAnEvent:a,clickHoldACell:o,dragCreateAnEvent:s}=this.domEvents,{_eid:l}=a,{_eid:n}=i;let r=!1;const{event:d,start:h}=s,p=this.isDOMElementAnEvent(e.target),f=t.mousedUp;if(t.mousedUp=!1,p&&(this.domEvents.cancelClickEventCreation=!0),o.eventCreated)return;if(n){const{originalEnd:w,originalEndTimeMinutes:Y,endTimeMinutes:z}=i,g=this.view.events.find($=>$._eid===i._eid);if(r=z&&z!==Y,g&&g.end.getTime()!==w.getTime()){const $=this.mutableEvents.find(J=>J._eid===i._eid);$.endTimeMinutes=g.endTimeMinutes,$.end=g.end;const M=this.cleanupEvent(g),H={...this.cleanupEvent(g),end:w,endTimeMinutes:g.originalEndTimeMinutes};this.$emit("event-duration-change",{event:M,oldDate:i.originalEnd,originalEvent:H}),this.$emit("event-change",{event:M,originalEvent:H})}g&&(g.resizing=!1),i._eid=null,i.start=null,i.split=null,i.segment=null,i.originalEndTimeMinutes=null,i.originalEnd=null,i.endTimeMinutes=null,i.startCell=null,i.endCell=null}else h&&(d&&(this.emitWithEvent("event-drag-create",d),s.event.resizing=!1),s.start=null,s.split=null,s.event=null);p||n||this.unfocusEvent(),a.timeoutId&&!l&&(clearTimeout(a.timeoutId),a.timeoutId=null),o.timeoutId&&(clearTimeout(o.timeoutId),o.timeoutId=null);const I=typeof this.onEventClick=="function";if(f&&!r&&!l&&!d&&I){let w=this.view.events.find(Y=>Y._eid===t._eid);return!w&&this.isMonthView&&(w=this.view.outOfScopeEvents.find(Y=>Y._eid===t._eid)),w&&this.onEventClick(w,e)}},onKeyUp(e){e.keyCode===27&&this.cancelDelete()},eventResizing(e){const{resizeAnEvent:t}=this.domEvents,i=this.view.events.find(d=>d._eid===t._eid)||{segments:{}},{minutes:a,cursorCoords:o}=this.minutesAtCursor(e),s=i.segments&&i.segments[t.segment],{date:l,event:n}=this.utils,r=Math.max(a,this.timeFrom+1,(s||i).startTimeMinutes+1);if(i.endTimeMinutes=t.endTimeMinutes=r,this.snapToTime){const d=i.endTimeMinutes+this.snapToTime/2;i.endTimeMinutes=d-d%this.snapToTime}if(s&&(s.endTimeMinutes=i.endTimeMinutes),i.end.setHours(0,i.endTimeMinutes,i.endTimeMinutes===1440?-1:0,0),this.resizeX&&this.isWeekView){i.daysCount=l.countDays(i.start,i.end);const d=this.cellsEl,h=d.offsetWidth/d.childElementCount,p=Math.floor(o.x/h);if(t.startCell===null&&(t.startCell=p-(i.daysCount-1)),t.endCell!==p){t.endCell=p;const f=l.addDays(i.start,p-t.startCell),I=Math.max(l.countDays(i.start,f),1);if(I!==i.daysCount){let w=null;w=I>i.daysCount?n.addEventSegment(i):n.removeEventSegment(i),t.segment=w,i.endTimeMinutes+=.001}}}this.$emit("event-resizing",{_eid:i._eid,end:i.end,endTimeMinutes:i.endTimeMinutes})},eventDragCreation(e){const{dragCreateAnEvent:t}=this.domEvents,{start:i,startCursorY:a,split:o}=t,s=new Date(i),{minutes:l,cursorCoords:{y:n}}=this.minutesAtCursor(e);if(t.event||!(Math.abs(a-n)<this.dragToCreateThreshold))if(t.event){if(s.setHours(0,l,l===1440?-1:0,0),this.snapToTime){let h=60*s.getHours()+s.getMinutes();const p=h+this.snapToTime/2;h=p-p%this.snapToTime,s.setHours(0,h,0,0)}const r=i<s,{event:d}=t;d.start=r?i:s,d.end=r?s:i,d.startTimeMinutes=60*d.start.getHours()+d.start.getMinutes(),d.endTimeMinutes=60*d.end.getHours()+d.end.getMinutes()}else{if(t.event=this.utils.event.createAnEvent(i,1,{split:o}),!t.event)return t.start=null,t.split=null,void(t.event=null);t.event.resizing=!0}},unfocusEvent(){const{focusAnEvent:e,clickHoldAnEvent:t}=this.domEvents,i=this.view.events.find(a=>a._eid===(e._eid||t._eid));e._eid=null,t._eid=null,i&&(i.focused=!1,i.deleting=!1)},cancelDelete(){const{clickHoldAnEvent:e}=this.domEvents;if(e._eid){const t=this.view.events.find(i=>i._eid===e._eid);t&&(t.deleting=!1),e._eid=null,e.timeoutId=null}},onEventTitleBlur(e,t){if(t.title===e.target.innerHTML)return;const i=t.title;t.title=e.target.innerHTML;const a=this.cleanupEvent(t);this.$emit("event-title-change",{event:a,oldTitle:i}),this.$emit("event-change",{event:a,originalEvent:{...a,title:i}})},updateMutableEvents(){const e=this.utils.date;this.mutableEvents=[],this.events.forEach(t=>{const i=typeof t.start=="string"?e.stringToDate(t.start):t.start,a=e.formatDateLite(i),o=e.dateToMinutes(i);let s=null;typeof t.end=="string"&&t.end.includes("24:00")?(s=new Date(t.end.replace(" 24:00","")),s.setHours(23,59,59,0)):s=typeof t.end=="string"?e.stringToDate(t.end):t.end;let l=e.formatDateLite(s),n=e.dateToMinutes(s);n&&n!==1440||(!this.time||typeof t.end=="string"&&t.end.length===10?s.setHours(23,59,59,0):s.setSeconds(s.getSeconds()-1),l=e.formatDateLite(s),n=1440);const r=a!==l;t=Object.assign({...this.utils.event.eventDefaults},t,{_eid:`${this._.uid}_${this.eventIdIncrement++}`,segments:r?{}:null,start:i,startTimeMinutes:o,end:s,endTimeMinutes:n,daysCount:r?e.countDays(i,s):1,class:t.class}),this.mutableEvents.push(t)})},minutesAtCursor(e){return this.utils.cell.minutesAtCursor(e)},createEvent(e,t,i={}){return this.utils.event.createAnEvent(e,t,i)},cleanupEvent(e){return e={...e},["segments","deletable","deleting","titleEditable","resizable","resizing","draggable","dragging","draggingStatic","focused"].forEach(t=>{t in e&&delete e[t]}),e.repeat||delete e.repeat,e},emitWithEvent(e,t){this.$emit(e,this.cleanupEvent(t))},updateSelectedDate(e){if((e=e&&typeof e=="string"?this.utils.date.stringToDate(e):new Date(e))&&e instanceof Date){const{selectedDate:t}=this.view;t&&(this.transitionDirection=t.getTime()>e.getTime()?"left":"right"),e.setHours(0,0,0,0),t&&t.getTime()===e.getTime()||(this.view.selectedDate=e),this.switchView(this.view.id)}this.$emit("update:selected-date",this.view.selectedDate)},getWeekNumber(e){const t=this.utils.date,i=this.firstCellDateWeekNumber+e,a=this.startWeekOnSunday?1:0;return i>52?t.getWeek(t.addDays(this.view.firstCellDate,7*e+a)):i},timeTick(){this.now=new Date,this.timeTickerIds[1]=setTimeout(this.timeTick,6e4)},updateDateTexts(){this.utils.date.updateTexts(this.texts)},alignWithScrollbar(){if(document.getElementById("vuecal-align-with-scrollbar"))return;const e=this.$refs.vuecal.getElementsByClassName("vuecal__scrollbar-check")[0],t=e.offsetWidth-e.children[0].offsetWidth;if(t){const i=document.createElement("style");i.id="vuecal-align-with-scrollbar",i.type="text/css",i.innerHTML=`.vuecal--view-with-time .vuecal__weekdays-headings,.vuecal--view-with-time .vuecal__all-day {padding-right: ${t}px}`,document.head.appendChild(i)}},cellOrSplitHasEvents:(e,t=null)=>e.length&&(!t&&e.length||t&&e.some(i=>i.split===t.id))},created(){this.utils.cell=new Ci(this),this.utils.event=new Mi(this,this.utils.date),this.loadLocale(this.locale),this.editEvents.drag&&this.loadDragAndDrop(),this.updateMutableEvents(this.events),this.view.id=this.currentView,this.selectedDate?this.updateSelectedDate(this.selectedDate):(this.view.selectedDate=new Date,this.switchView(this.currentView)),this.time&&this.watchRealTime&&(this.timeTickerIds[0]=setTimeout(this.timeTick,1e3*(60-this.now.getSeconds())))},mounted(){const e=this.utils.date,t="ontouchstart"in window,{resize:i,drag:a,create:o,delete:s,title:l}=this.editEvents,n=this.onEventClick&&typeof this.onEventClick=="function";(i||a||o||s||l||n)&&window.addEventListener(t?"touchend":"mouseup",this.onMouseUp),(i||a||o&&this.dragToCreateEvent)&&window.addEventListener(t?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),l&&window.addEventListener("keyup",this.onKeyUp),t&&(this.$refs.vuecal.oncontextmenu=function(h){h.preventDefault(),h.stopPropagation()}),this.hideBody||this.alignWithScrollbar();const r=this.view.startDate,d={view:this.view.id,startDate:r,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:e.getWeek(this.startWeekOnSunday?e.addDays(r,1):r)}:{}};this.$emit("ready",d),this.ready=!0},beforeUnmount(){const e="ontouchstart"in window;window.removeEventListener(e?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),window.removeEventListener(e?"touchend":"mouseup",this.onMouseUp),window.removeEventListener("keyup",this.onKeyUp),this.timeTickerIds[0]&&clearTimeout(this.timeTickerIds[0]),this.timeTickerIds[1]&&clearTimeout(this.timeTickerIds[1]),this.timeTickerIds=[null,null]},computed:{editEvents(){return this.editableEvents&&typeof this.editableEvents=="object"?{title:!!this.editableEvents.title,drag:!!this.editableEvents.drag,resize:!!this.editableEvents.resize,create:!!this.editableEvents.create,delete:!!this.editableEvents.delete}:{title:!!this.editableEvents,drag:!!this.editableEvents,resize:!!this.editableEvents,create:!!this.editableEvents,delete:!!this.editableEvents}},views(){return{years:{label:this.texts.years,enabled:!this.disableViews.includes("years")},year:{label:this.texts.year,enabled:!this.disableViews.includes("year")},month:{label:this.texts.month,enabled:!this.disableViews.includes("month")},week:{label:this.texts.week,enabled:!this.disableViews.includes("week")},day:{label:this.texts.day,enabled:!this.disableViews.includes("day")}}},currentView(){return this.validateView(this.activeView)},enabledViews(){return Object.keys(this.views).filter(e=>this.views[e].enabled)},hasTimeColumn(){return this.time&&this.isWeekOrDayView},isShortMonthView(){return this.isMonthView&&this.eventsOnMonthView==="short"},firstCellDateWeekNumber(){const e=this.utils.date,t=this.view.firstCellDate;return e.getWeek(this.startWeekOnSunday?e.addDays(t,1):t)},timeCells(){const e=[];for(let t=this.timeFrom,i=this.timeTo;t<i;t+=this.timeStep)e.push({hours:Math.floor(t/60),minutes:t%60,label:this.utils.date.formatTime(t,this.TimeFormat),value:t});return e},TimeFormat(){return this.timeFormat||(this.twelveHour?"h:mm{am}":"HH:mm")},daySplits(){return(this.splitDays.filter(e=>!e.hide)||[]).map((e,t)=>({...e,id:e.id||t+1}))},hasSplits(){return this.daySplits.length&&this.isWeekOrDayView},hasShortEvents(){return this.showAllDayEvents==="short"},cellOrSplitMinWidth(){let e=null;return this.hasSplits&&this.minSplitWidth?e=this.visibleDaysCount*this.minSplitWidth*this.daySplits.length:this.minCellWidth&&this.isWeekView&&(e=this.visibleDaysCount*this.minCellWidth),e},allDayBar(){let e=this.allDayBarHeight||null;return e&&!isNaN(e)&&(e+="px"),{cells:this.viewCells,options:this.$props,label:this.texts.allDay,shortEvents:this.hasShortEvents,daySplits:this.hasSplits&&this.daySplits||[],cellOrSplitMinWidth:this.cellOrSplitMinWidth,height:e}},minTimestamp(){let e=null;return this.minDate&&typeof this.minDate=="string"?e=this.utils.date.stringToDate(this.minDate):this.minDate&&this.minDate instanceof Date&&(e=this.minDate),e?e.getTime():null},maxTimestamp(){let e=null;return this.maxDate&&typeof this.maxDate=="string"?e=this.utils.date.stringToDate(this.maxDate):this.maxDate&&this.minDate instanceof Date&&(e=this.maxDate),e?e.getTime():null},weekDays(){let{weekDays:e,weekDaysShort:t=[]}=this.texts;return e=e.slice(0).map((i,a)=>({label:i,...t.length?{short:t[a]}:{},hide:this.hideWeekends&&a>=5||this.hideWeekdays.length&&this.hideWeekdays.includes(a+1)})),this.startWeekOnSunday&&e.unshift(e.pop()),e},weekDaysInHeader(){return this.isMonthView||this.isWeekView&&!this.minCellWidth&&!(this.hasSplits&&this.minSplitWidth)},months(){return this.texts.months.map(e=>({label:e}))},specialDayHours(){return this.specialHours&&Object.keys(this.specialHours).length?Array(7).fill("").map((e,t)=>{let i=this.specialHours[t+1]||[];return Array.isArray(i)||(i=[i]),e=[],i.forEach(({from:a,to:o,class:s,label:l},n)=>{e[n]={day:t+1,from:[null,void 0].includes(a)?null:1*a,to:[null,void 0].includes(o)?null:1*o,class:s||"",label:l||""}}),e}):{}},viewTitle(){const e=this.utils.date;let t="";const i=this.view.startDate,a=i.getFullYear(),o=i.getMonth();switch(this.view.id){case"years":t=this.texts.years;break;case"year":t=a;break;case"month":t=`${this.months[o].label} ${a}`;break;case"week":{const s=this.view.endDate,l=i.getFullYear();let n=this.texts.months[i.getMonth()];this.xsmall&&(n=n.substring(0,3));let r=`${n} ${l}`;if(s.getMonth()!==i.getMonth()){const d=s.getFullYear();let h=this.texts.months[s.getMonth()];this.xsmall&&(h=h.substring(0,3)),r=l===d?`${n} - ${h} ${l}`:this.small?`${n.substring(0,3)} ${l} - ${h.substring(0,3)} ${d}`:`${n} ${l} - ${h} ${d}`}t=`${this.texts.week} ${e.getWeek(this.startWeekOnSunday?e.addDays(i,1):i)} (${r})`;break}case"day":t=this.utils.date.formatDate(i,this.texts.dateFormat,this.texts)}return t},viewCells(){const e=this.utils.date;let t=[],i=null,a=!1;this.watchRealTime||(this.now=new Date);const o=this.now;switch(this.view.id){case"years":i=this.view.startDate.getFullYear(),t=Array.apply(null,Array(25)).map((s,l)=>{const n=new Date(i+l,0,1),r=new Date(i+l+1,0,1);return r.setSeconds(-1),{startDate:n,formattedDate:e.formatDateLite(n),endDate:r,content:i+l,current:i+l===o.getFullYear()}});break;case"year":i=this.view.startDate.getFullYear(),t=Array.apply(null,Array(12)).map((s,l)=>{const n=new Date(i,l,1),r=new Date(i,l+1,1);return r.setSeconds(-1),{startDate:n,formattedDate:e.formatDateLite(n),endDate:r,content:this.xsmall?this.months[l].label.substr(0,3):this.months[l].label,current:l===o.getMonth()&&i===o.getFullYear()}});break;case"month":{const s=this.view.startDate.getMonth(),l=new Date(this.view.firstCellDate);a=!1,t=Array.apply(null,Array(42)).map((n,r)=>{const d=e.addDays(l,r),h=new Date(d);h.setHours(23,59,59,0);const p=!a&&e.isToday(d)&&!a++;return{startDate:d,formattedDate:e.formatDateLite(d),endDate:h,content:d.getDate(),today:p,outOfScope:d.getMonth()!==s,class:`vuecal__cell--day${d.getDay()||7}`}}),(this.hideWeekends||this.hideWeekdays.length)&&(t=t.filter(n=>{const r=n.startDate.getDay()||7;return!(this.hideWeekends&&r>=6||this.hideWeekdays.length&&this.hideWeekdays.includes(r))}));break}case"week":{a=!1;const s=this.view.startDate,l=this.weekDays;t=l.map((n,r)=>{const d=e.addDays(s,this.startWeekOnSunday?r-1:r),h=new Date(d);h.setHours(23,59,59,0);const p=(d.getDay()||7)-1;return{startDate:d,formattedDate:e.formatDateLite(d),endDate:h,today:!a&&e.isToday(d)&&!a++,specialHours:this.specialDayHours[p]||[]}}).filter((n,r)=>!l[r].hide);break}case"day":{const s=this.view.startDate,l=new Date(this.view.startDate);l.setHours(23,59,59,0);const n=(s.getDay()||7)-1;t=[{startDate:s,formattedDate:e.formatDateLite(s),endDate:l,today:e.isToday(s),specialHours:this.specialDayHours[n]||[]}];break}}return t},visibleDaysCount(){return this.isDayView?1:7-this.weekDays.reduce((e,t)=>e+t.hide,0)},cellWidth(){return 100/this.visibleDaysCount},cssClasses(){const{resizeAnEvent:e,dragAnEvent:t,dragCreateAnEvent:i}=this.domEvents;return{[`vuecal--${this.view.id}-view`]:!0,[`vuecal--${this.locale}`]:this.locale,"vuecal--no-time":!this.time,"vuecal--view-with-time":this.hasTimeColumn,"vuecal--week-numbers":this.showWeekNumbers&&this.isMonthView,"vuecal--twelve-hour":this.twelveHour,"vuecal--click-to-navigate":this.clickToNavigate,"vuecal--hide-weekends":this.hideWeekends,"vuecal--split-days":this.hasSplits,"vuecal--sticky-split-labels":this.hasSplits&&this.stickySplitLabels,"vuecal--overflow-x":this.minCellWidth&&this.isWeekView||this.hasSplits&&this.minSplitWidth,"vuecal--small":this.small,"vuecal--xsmall":this.xsmall,"vuecal--resizing-event":e._eid,"vuecal--drag-creating-event":i.event,"vuecal--dragging-event":t._eid,"vuecal--events-on-month-view":this.eventsOnMonthView,"vuecal--short-events":this.isMonthView&&this.eventsOnMonthView==="short","vuecal--has-touch":typeof window<"u"&&"ontouchstart"in window}},isYearsOrYearView(){return["years","year"].includes(this.view.id)},isYearsView(){return this.view.id==="years"},isYearView(){return this.view.id==="year"},isMonthView(){return this.view.id==="month"},isWeekOrDayView(){return["week","day"].includes(this.view.id)},isWeekView(){return this.view.id==="week"},isDayView(){return this.view.id==="day"}},watch:{events:{handler(e,t){this.updateMutableEvents(e),this.addEventsToView()},deep:!0},locale(e){this.loadLocale(e)},selectedDate(e){this.updateSelectedDate(e)},activeView(e){this.switchView(e)}}},Os=oe(Vs,[["render",function(e,t,i,a,o,s){const l=P("vuecal-header"),n=P("all-day-bar"),r=P("weekdays-headings"),d=P("vuecal-cell");return v(),m("div",{class:R(["vuecal__flex vuecal",s.cssClasses]),column:"",ref:"vuecal",lang:i.locale},[u(l,{options:e.$props,"edit-events":s.editEvents,"view-props":{views:s.views,weekDaysInHeader:s.weekDaysInHeader},"week-days":s.weekDays,"has-splits":s.hasSplits,"day-splits":s.daySplits,"switch-to-narrower-view":s.switchToNarrowerView},Te({"arrow-prev":c(()=>[k(e.$slots,"arrow-prev",{},()=>[V(" "),ts,V(" ")])]),"arrow-next":c(()=>[k(e.$slots,"arrow-next",{},()=>[V(" "),is,V(" ")])]),"today-button":c(()=>[k(e.$slots,"today-button",{},()=>[L("span",ss,E(o.texts.today),1)])]),title:c(()=>[k(e.$slots,"title",{title:s.viewTitle,view:o.view},()=>[V(E(s.viewTitle),1)])]),_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:c(({heading:h,view:p})=>[k(e.$slots,"weekday-heading",{heading:h,view:p})]),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:c(({split:h})=>[k(e.$slots,"split-label",{split:h,view:o.view.id})]),key:"1"}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),i.hideBody?y("",!0):(v(),m("div",as,[u(_e,{name:`slide-fade--${o.transitionDirection}`,appear:i.transitions},{default:c(()=>[(v(),m("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:!!i.transitions&&o.view.id,column:""},[i.showAllDayEvents&&s.hasTimeColumn&&(!s.cellOrSplitMinWidth||s.isDayView&&!i.minSplitWidth)?(v(),C(n,Ie(ge({key:0},s.allDayBar)),{event:c(({event:h,view:p})=>[k(e.$slots,"event",{view:p,event:h},()=>[s.editEvents.title&&h.titleEditable?(v(),m("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:f=>s.onEventTitleBlur(f,h),innerHTML:h.title},null,40,ns)):h.title?(v(),m("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,ls)):y("",!0),!h.content||s.hasShortEvents||s.isShortMonthView?y("",!0):(v(),m("div",{key:2,class:"vuecal__event-content",innerHTML:h.content},null,8,os))])]),_:3},16)):y("",!0),L("div",{class:R(["vuecal__bg",{vuecal__flex:!s.hasTimeColumn}]),column:""},[L("div",rs,[s.hasTimeColumn?(v(),m("div",ds,[i.showAllDayEvents&&s.cellOrSplitMinWidth&&(!s.isDayView||i.minSplitWidth)?(v(),m("div",{key:0,class:"vuecal__all-day-text",style:N({height:s.allDayBar.height})},[L("span",null,E(o.texts.allDay),1)],4)):y("",!0),(v(!0),m(A,null,W(s.timeCells,(h,p)=>(v(),m("div",{class:"vuecal__time-cell",key:p,style:N(`height: ${i.timeCellHeight}px`)},[k(e.$slots,"time-cell",{hours:h.hours,minutes:h.minutes},()=>[us,L("span",cs,E(h.label),1)])],4))),128))])):y("",!0),i.showWeekNumbers&&s.isMonthView?(v(),m("div",hs,[(v(),m(A,null,W(6,h=>L("div",{class:"vuecal__flex vuecal__week-number-cell",key:h,grow:""},[k(e.$slots,"week-number-cell",{week:s.getWeekNumber(h-1)},()=>[V(E(s.getWeekNumber(h-1)),1)])])),64))])):y("",!0),L("div",{class:R(["vuecal__flex vuecal__cells",`${o.view.id}-view`]),grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,column:!!s.cellOrSplitMinWidth},[s.cellOrSplitMinWidth&&s.isWeekView?(v(),C(r,{key:0,"transition-direction":o.transitionDirection,"week-days":s.weekDays,"switch-to-narrower-view":s.switchToNarrowerView,style:N(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},Te({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:c(({heading:h,view:p})=>[k(e.$slots,"weekday-heading",{heading:h,view:p})]),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:c(({split:h})=>[k(e.$slots,"split-label",{split:h,view:o.view.id})]),key:"1"}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style"])):s.hasSplits&&i.stickySplitLabels&&i.minSplitWidth?(v(),m("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",style:N(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(v(!0),m(A,null,W(s.daySplits,(h,p)=>(v(),m("div",{class:R(["day-split-header",h.class||!1]),key:p},[k(e.$slots,"split-label",{split:h,view:o.view.id},()=>[V(E(h.label),1)])],2))),128))],4)):y("",!0),i.showAllDayEvents&&s.hasTimeColumn&&(s.isWeekView&&s.cellOrSplitMinWidth||s.isDayView&&s.hasSplits&&i.minSplitWidth)?(v(),C(n,Ie(ge({key:2},s.allDayBar)),{event:c(({event:h,view:p})=>[k(e.$slots,"event",{view:p,event:h},()=>[s.editEvents.title&&h.titleEditable?(v(),m("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:f=>s.onEventTitleBlur(f,h),innerHTML:h.title},null,40,ms)):h.title?(v(),m("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,ps)):y("",!0),!h.content||s.hasShortEvents||s.isShortMonthView?y("",!0):(v(),m("div",{key:2,class:"vuecal__event-content",innerHTML:h.content},null,8,fs))])]),_:3},16)):y("",!0),L("div",{class:"vuecal__flex",ref:h=>o.cellsEl=h,grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,style:N(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(v(!0),m(A,null,W(s.viewCells,(h,p)=>(v(),C(d,{key:p,options:e.$props,"edit-events":s.editEvents,data:h,"cell-width":i.hideWeekdays.length&&(s.isWeekView||s.isMonthView)&&s.cellWidth,"min-timestamp":s.minTimestamp,"max-timestamp":s.maxTimestamp,"cell-splits":s.hasSplits&&s.daySplits||[]},{"cell-content":c(({events:f,split:I,selectCell:w})=>[k(e.$slots,"cell-content",{cell:h,view:o.view,goNarrower:w,events:f},()=>[I&&!i.stickySplitLabels?(v(),m("div",{key:0,class:"split-label",innerHTML:I.label},null,8,gs)):y("",!0),h.content?(v(),m("div",{key:1,class:"vuecal__cell-date",innerHTML:h.content},null,8,ws)):y("",!0),(s.isMonthView&&!i.eventsOnMonthView||s.isYearsOrYearView&&i.eventsCountOnYearView)&&f.length?(v(),m("div",ys,[k(e.$slots,"events-count",{view:o.view,events:f},()=>[V(E(f.length),1)])])):y("",!0),!s.cellOrSplitHasEvents(f,I)&&s.isWeekOrDayView?(v(),m("div",Ds,[k(e.$slots,"no-event",{},()=>[V(E(o.texts.noEvent),1)])])):y("",!0)])]),event:c(({event:f,view:I})=>[k(e.$slots,"event",{view:I,event:f},()=>[s.editEvents.title&&f.titleEditable?(v(),m("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,f),innerHTML:f.title},null,40,bs)):f.title?(v(),m("div",{key:1,class:"vuecal__event-title",innerHTML:f.title},null,8,ks)):y("",!0),!i.time||f.allDay||s.isMonthView&&(f.allDay||i.showAllDayEvents==="short")||s.isShortMonthView?y("",!0):(v(),m("div",Es,[V(E(o.utils.date.formatTime(f.start,s.TimeFormat)),1),f.endTimeMinutes?(v(),m("span",Ts," - "+E(o.utils.date.formatTime(f.end,s.TimeFormat,null,!0)),1)):y("",!0),f.daysCount>1&&(f.segments[h.formattedDate]||{}).isFirstDay?(v(),m("small",Cs," +"+E(f.daysCount-1)+E((o.texts.day[0]||"").toLowerCase()),1)):y("",!0)])),!f.content||s.isMonthView&&f.allDay&&i.showAllDayEvents==="short"||s.isShortMonthView?y("",!0):(v(),m("div",{key:3,class:"vuecal__event-content",innerHTML:f.content},null,8,Ms))])]),"no-event":c(()=>[k(e.$slots,"no-event",{},()=>[V(E(o.texts.noEvent),1)])]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],12,_s)],10,vs)])],2)]))]),_:3},8,["name","appear"]),o.ready?y("",!0):(v(),m("div",xs,Ss))]))],10,es)}]]);const As={components:{VueCal:Os},setup(){const e=b([]);function t(){U.get("api/general_vacation/generalvacation/").then(o=>{console.log(o.data,"----------------------");for(let s in o.data)s=="План-график"&&o.data[s].map(l=>{e.value.push({name:l.name,start:l.start_work_period,end:l.end_work_period,content:l.name})})})}me(()=>{t()});const i=b(null);function a(o){const s=new Date(o);let l="сегодня";return s.getFullYear()!="1970"&&(l=`${s.getDate()} число`),l}return{events:e,selectedDate:i,f_generalvacation:t,dayformat:a}}};function $s(e,t,i,a,o,s){const l=P("vue-cal");return v(),C(j,null,{default:c(()=>[u(O,{class:"flex-column pr-0"},{default:c(()=>[u(F,{class:"h-100"},{default:c(()=>[u(l,{locale:"ru",xsmall:"",time:!1,"hide-view-selector":"","disable-views":["years","year","week","day"],"events-count-on-year-view":"","active-view":"month",events:a.events,todayButton:"",onCellFocus:t[1]||(t[1]=n=>a.selectedDate=n)},{"arrow-prev":c(()=>[u(Q,{icon:"mdi-menu-left"})]),"arrow-next":c(()=>[u(Q,{icon:"mdi-menu-right"})]),"today-button":c(()=>[u(Qe,{text:"Сегодня",location:"bottom"},{activator:c(({props:n})=>[u(Q,ge({onClick:t[0]||(t[0]=r=>a.selectedDate=new Date)},n,{icon:"mdi-crosshairs-gps",size:"x-small",class:"pt-1 pr-3",color:"more_details_btn"}),null,16)]),_:1})]),_:1},8,["events"])]),_:1})]),_:1}),u(O,null,{default:c(()=>[u(F,{class:"h-100"},{default:c(()=>[u(ve,{class:"text-center"},{default:c(()=>[V("События на "+E(a.dayformat(a.selectedDate)),1)]),_:1}),u(l,{locale:"ru",xsmall:"",time:!1,"hide-view-selector":"",hideTitleBar:"",split:"","header-format":"DD",events:a.events,"active-view":"day","disable-views":["years","year","month","week"],"selected-date":a.selectedDate},{"arrow-prev":c(()=>[u(Q,{icon:"mdi-menu-left"})]),"arrow-next":c(()=>[u(Q,{icon:"mdi-menu-right"})]),"today-button":c(()=>[]),_:1},8,["events","selected-date"])]),_:1})]),_:1})]),_:1})}const Hs=X(As,[["render",$s]]);const Ls={components:{CarouselList:Zt,CarouselNumbers:ii,CalendarFull:ni,NewsListHome:di,LoadRound:zt,DigitalLetna:ki,EventCalendar:Hs,NewsHome:hi},setup(){const e=Ht(),t=b([]),i=b(null),a=we();Lt(),me(()=>{o()});const o=()=>{U.get("api/watcher/selectedlinks/").then(s=>{t.value=s.data})};return{accountStore:a,appStore:e,favoritLinks:o,favorit:t,toggle:i}}};function Ws(e,t,i,a,o,s){const l=P("Carousel-list"),n=P("event-calendar"),r=P("digital-letna"),d=P("news-home");return v(),C(Xe,{fluid:"",class:"d-flex mx-0 pa-0"},{default:c(()=>[u(j,{class:"ma-2"},{default:c(()=>[u(O,{class:"d-flex flex-column",lg:"7",md:"12",cols:"12"},{default:c(()=>[u(j,{class:"flex-grow-0"},{default:c(()=>[u(O,{class:"pa-1"},{default:c(()=>[u(l)]),_:1})]),_:1}),u(j,{style:{height:"250px"}},{default:c(()=>[u(O,{class:"d-flex flex-column pa-1"},{default:c(()=>[u(n)]),_:1})]),_:1})]),_:1}),u(O,{class:"d-flex flex-column",lg:"5",md:"12",cols:"12"},{default:c(()=>[u(j,null,{default:c(()=>[u(O,{class:"d-flex flex-column"},{default:c(()=>[u(j,null,{default:c(()=>[u(O,{lg:"4",md:"2",cols:"12",class:"pa-1",style:{"min-height":"250px"}},{default:c(()=>[u(r)]),_:1}),u(O,{class:"d-flex flex-column pa-1",lg:"8",md:"10",cols:"12",style:{"min-height":"550px"}},{default:c(()=>[u(F,{class:"h-100 d-flex flex-column"},{default:c(()=>[u(j,{class:"d-flex justify-md-center"},{default:c(()=>[u(O,{class:"flex-column d-flex"},{default:c(()=>[u(d)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),u(j,{class:"flex-grow-0"},{default:c(()=>[u(O,{class:"pa-1"},{default:c(()=>[u(F,{class:"flex-colmn"},{default:c(()=>[u(Ze,{class:R(["mx-auto",a.favorit.length>10?"mx-n3":""]),"max-width":"800"},{default:c(()=>[u(tt,{"show-arrows":""},{default:c(()=>[(v(!0),m(A,null,W(a.favorit,h=>(v(),C(it,{key:h},{default:c(()=>[u(Wt,{modelValue:a.toggle,"onUpdate:modelValue":t[0]||(t[0]=p=>a.toggle=p),divided:"",variant:"outlined"},{default:c(()=>[u(Qe,{text:h.pages__page,location:"top"},{activator:c(({props:p})=>[u(le,ge(p,{icon:h.pages__ico,to:h.pages__fullPath}),null,16,["icon","to"])]),_:2},1032,["text"])]),_:2},1032,["modelValue"])]),_:2},1024))),128))]),_:1})]),_:1},8,["class"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const na=X(Ls,[["render",Ws]]);export{na as default};
|