UNPKG

vue3-calendar-component

Version:

A comprehensive Vue 3 Calendar component with Vuetify 3, TypeScript, and advanced features

1 lines 59.1 kB
(function(v,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("dayjs"),require("vue"),require("vuetify/components"),require("vuetify/components/VIcon"),require("vuetify")):typeof define=="function"&&define.amd?define(["exports","dayjs","vue","vuetify/components","vuetify/components/VIcon","vuetify"],N):(v=typeof globalThis<"u"?globalThis:v||self,N(v.Vue3CalendarComponent={},v.dayjs,v.Vue,v.components,v.VIcon,v.Vuetify))})(this,function(v,N,e,D,P,Ue){"use strict";function I(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Q={exports:{}},Ge=Q.exports,Ee;function Re(){return Ee||(Ee=1,function(r,l){(function(n,t){r.exports=t()})(Ge,function(){var n="day";return function(t,i,h){var m=function(f){return f.add(4-f.isoWeekday(),n)},V=i.prototype;V.isoWeekYear=function(){return m(this).year()},V.isoWeek=function(f){if(!this.$utils().u(f))return this.add(7*(f-this.isoWeek()),n);var y,w,k,M,g=m(this),o=(y=this.isoWeekYear(),w=this.$u,k=(w?h.utc:h)().year(y).startOf("year"),M=4-k.isoWeekday(),k.isoWeekday()>4&&(M+=7),k.add(M,n));return g.diff(o,"week")+1},V.isoWeekday=function(f){return this.$utils().u(f)?this.day()||7:this.day(this.day()%7?f:f-7)};var s=V.startOf;V.startOf=function(f,y){var w=this.$utils(),k=!!w.u(y)||y;return w.p(f)==="isoweek"?k?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(f,y)}}})}(Q)),Q.exports}var Ze=Re();const Se=I(Ze);var X={exports:{}},Ke=X.exports,_e;function Qe(){return _e||(_e=1,function(r,l){(function(n,t){r.exports=t(N)})(Ke,function(n){function t(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=t(n),h={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function m(s,f,y){var w=h[y];return Array.isArray(w)&&(w=w[f?0:1]),w.replace("%d",s)}var V={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(s){return s+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:m,m,mm:m,h:m,hh:m,d:m,dd:m,M:m,MM:m,y:m,yy:m}};return i.default.locale(V,null,!0),V})}(X)),X.exports}Qe();var j={exports:{}},Xe=j.exports,Be;function je(){return Be||(Be=1,function(r,l){(function(n,t){r.exports=t()})(Xe,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(n){var t=["th","st","nd","rd"],i=n%100;return"["+n+(t[(i-20)%10]||t[i]||t[0])+"]"}}})}(j)),j.exports}je();const be={dayJsLocale:"en",status:{open:"Open",planned:"Planned",overdue:"Overdue",completed:"Completed",cancelled:"Cancelled"},views:{agenda:{noEvents:"No events scheduled for this day",buttons:{markEventCompleted:"Mark as Completed",cancelEvent:"Cancel Event"}}},toolbar:{buttons:{month:"Month",week:"Week",day:"Day",agenda:"Agenda",today:"Today",previous:"Previous",next:"Next"},filters:{statusLabel:"Filter by status",filterByCategory:"Filter by category"},searchPlaceholder:"Search events...",clearFilters:"Clear Filters",activeFilters:function(r){return`${r} filter${r>1?"s":""} active`}},formats:{date:"MM/DD/YYYY",time:"HH:mm",day:"dddd, MMMM D, YYYY",startOfWeek:"MMM D",endOfWeek:"MMM D, YYYY",month:"MMMM YYYY",duration(r,l,n){const t=[];return r>0&&t.push(`${r} d`),l>0&&t.push(`${l} h`),n>0&&t.push(`${n} m`),t.join(", ")}}},A=e.ref(be);function q(){const r=t=>{A.value=t,t.dayJsLocale?N.locale(t.dayJsLocale):N.locale("en"),console.log(N().format("MMMM D, YYYY"))},l=t=>{const i=t?N(t):N();return A.value.dayJsLocale?i.locale(A.value.dayJsLocale):i},n=e.computed(()=>t=>{const i=t?N(t):N();return A.value.dayJsLocale?i.locale(A.value.dayJsLocale):i});return{current:A,setLocale:r,createLocalizedDayjs:l,localizedDayjs:n}}const et={class:"calendar-title"},tt={class:"text-h6"},nt=e.defineComponent({components:{VBtn:D.VBtn,VIcon:D.VIcon,VToolbar:D.VToolbar,VSpacer:D.VSpacer,VBtnToggle:D.VBtnToggle,VProgressLinear:D.VProgressLinear},__name:"CalendarToolbarButtons",props:{currentDate:{},currentView:{},loading:{type:Boolean,default:!1}},emits:["view-change","date-change","navigate-previous","navigate-next","navigate-today"],setup(r,{emit:l}){const n=q(),{localizedDayjs:t}=n,i=r,h=l,m=e.computed(()=>{const s=t.value(i.currentDate);switch(i.currentView){case"week":{const f=t.value(s.startOf("week")).format(n.current.value.formats.startOfWeek??"MMM D"),y=t.value(s.endOf("week")).format(n.current.value.formats.endOfWeek??"MMM D, YYYY");return`${f} - ${y}`}case"day":case"agenda":return s.format(n.current.value.formats.day??"dddd, MMMM D, YYYY");case"month":default:return s.format(n.current.value.formats.month??"MMMM YYYY")}}),V=s=>{s&&s!==i.currentView&&h("view-change",{oldView:i.currentView,newView:s,currentDate:i.currentDate})};return(s,f)=>(e.openBlock(),e.createBlock(e.unref(D.VToolbar),{density:"compact",class:"calendar-toolbar"},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VBtn),{title:e.unref(n).current.value.toolbar.buttons.previous||"Previous",icon:"",disabled:s.loading,onClick:f[0]||(f[0]=y=>s.$emit("navigate-previous"))},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VIcon),null,{default:e.withCtx(()=>f[3]||(f[3]=[e.createTextVNode("mdi-chevron-left")])),_:1,__:[3]})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(D.VBtn),{title:e.unref(n).current.value.toolbar.buttons.next||"Next",icon:"",disabled:s.loading,onClick:f[1]||(f[1]=y=>s.$emit("navigate-next"))},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VIcon),null,{default:e.withCtx(()=>f[4]||(f[4]=[e.createTextVNode("mdi-chevron-right")])),_:1,__:[4]})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(D.VBtn),{variant:"text",disabled:s.loading,class:"mx-2",onClick:f[2]||(f[2]=y=>s.$emit("navigate-today"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.today||"Today"),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(D.VSpacer)),e.createElementVNode("div",et,[e.createElementVNode("h2",tt,e.toDisplayString(m.value),1)]),e.createVNode(e.unref(D.VSpacer)),e.createVNode(e.unref(D.VBtnToggle),{"model-value":s.currentView,mandatory:"",variant:"outlined",divided:"",class:"view-toggle","onUpdate:modelValue":V},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VBtn),{value:"month",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.month||"Month"),1)]),_:1}),e.createVNode(e.unref(D.VBtn),{value:"week",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.week||"Week"),1)]),_:1}),e.createVNode(e.unref(D.VBtn),{value:"day",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.day||"Day"),1)]),_:1}),e.createVNode(e.unref(D.VBtn),{value:"agenda",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.toolbar.buttons.agenda||"Agenda"),1)]),_:1})]),_:1},8,["model-value"]),s.loading?(e.openBlock(),e.createBlock(e.unref(D.VProgressLinear),{key:0,indeterminate:"",color:"primary",class:"position-absolute",style:{bottom:"0",left:"0",right:"0"}})):e.createCommentVNode("",!0)]),_:1}))}}),F=(r,l)=>{const n=r.__vccOpts||r;for(const[t,i]of l)n[t]=i;return n},ee=F(nt,[["__scopeId","data-v-ce23c6f9"]]);var te={exports:{}},rt=te.exports,Te;function at(){return Te||(Te=1,function(r,l){(function(n,t){r.exports=t()})(rt,function(){var n,t,i=1e3,h=6e4,m=36e5,V=864e5,s=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=31536e6,y=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,k={years:f,months:y,days:V,hours:m,minutes:h,seconds:i,milliseconds:1,weeks:6048e5},M=function(B){return B instanceof T},g=function(B,a,c){return new T(B,c,a.$l)},o=function(B){return t.p(B)+"s"},$=function(B){return B<0},C=function(B){return $(B)?Math.ceil(B):Math.floor(B)},b=function(B){return Math.abs(B)},u=function(B,a){return B?$(B)?{negative:!0,format:""+b(B)+a}:{negative:!1,format:""+B+a}:{negative:!1,format:""}},T=function(){function B(c,d,_){var S=this;if(this.$d={},this.$l=_,c===void 0&&(this.$ms=0,this.parseFromMilliseconds()),d)return g(c*k[o(d)],this);if(typeof c=="number")return this.$ms=c,this.parseFromMilliseconds(),this;if(typeof c=="object")return Object.keys(c).forEach(function(x){S.$d[o(x)]=c[x]}),this.calMilliseconds(),this;if(typeof c=="string"){var Y=c.match(w);if(Y){var z=Y.slice(2).map(function(x){return x!=null?Number(x):0});return this.$d.years=z[0],this.$d.months=z[1],this.$d.weeks=z[2],this.$d.days=z[3],this.$d.hours=z[4],this.$d.minutes=z[5],this.$d.seconds=z[6],this.calMilliseconds(),this}}return this}var a=B.prototype;return a.calMilliseconds=function(){var c=this;this.$ms=Object.keys(this.$d).reduce(function(d,_){return d+(c.$d[_]||0)*k[_]},0)},a.parseFromMilliseconds=function(){var c=this.$ms;this.$d.years=C(c/f),c%=f,this.$d.months=C(c/y),c%=y,this.$d.days=C(c/V),c%=V,this.$d.hours=C(c/m),c%=m,this.$d.minutes=C(c/h),c%=h,this.$d.seconds=C(c/i),c%=i,this.$d.milliseconds=c},a.toISOString=function(){var c=u(this.$d.years,"Y"),d=u(this.$d.months,"M"),_=+this.$d.days||0;this.$d.weeks&&(_+=7*this.$d.weeks);var S=u(_,"D"),Y=u(this.$d.hours,"H"),z=u(this.$d.minutes,"M"),x=this.$d.seconds||0;this.$d.milliseconds&&(x+=this.$d.milliseconds/1e3,x=Math.round(1e3*x)/1e3);var Z=u(x,"S"),Ce=c.negative||d.negative||S.negative||Y.negative||z.negative||Z.negative,Me=Y.format||z.format||Z.format?"T":"",K=(Ce?"-":"")+"P"+c.format+d.format+S.format+Me+Y.format+z.format+Z.format;return K==="P"||K==="-P"?"P0D":K},a.toJSON=function(){return this.toISOString()},a.format=function(c){var d=c||"YYYY-MM-DDTHH:mm:ss",_={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return d.replace(s,function(S,Y){return Y||String(_[S])})},a.as=function(c){return this.$ms/k[o(c)]},a.get=function(c){var d=this.$ms,_=o(c);return _==="milliseconds"?d%=1e3:d=_==="weeks"?C(d/k[_]):this.$d[_],d||0},a.add=function(c,d,_){var S;return S=d?c*k[o(d)]:M(c)?c.$ms:g(c,this).$ms,g(this.$ms+S*(_?-1:1),this)},a.subtract=function(c,d){return this.add(c,d,!0)},a.locale=function(c){var d=this.clone();return d.$l=c,d},a.clone=function(){return g(this.$ms,this)},a.humanize=function(c){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!c)},a.valueOf=function(){return this.asMilliseconds()},a.milliseconds=function(){return this.get("milliseconds")},a.asMilliseconds=function(){return this.as("milliseconds")},a.seconds=function(){return this.get("seconds")},a.asSeconds=function(){return this.as("seconds")},a.minutes=function(){return this.get("minutes")},a.asMinutes=function(){return this.as("minutes")},a.hours=function(){return this.get("hours")},a.asHours=function(){return this.as("hours")},a.days=function(){return this.get("days")},a.asDays=function(){return this.as("days")},a.weeks=function(){return this.get("weeks")},a.asWeeks=function(){return this.as("weeks")},a.months=function(){return this.get("months")},a.asMonths=function(){return this.as("months")},a.years=function(){return this.get("years")},a.asYears=function(){return this.as("years")},B}(),E=function(B,a,c){return B.add(a.years()*c,"y").add(a.months()*c,"M").add(a.days()*c,"d").add(a.hours()*c,"h").add(a.minutes()*c,"m").add(a.seconds()*c,"s").add(a.milliseconds()*c,"ms")};return function(B,a,c){n=c,t=c().$utils(),c.duration=function(S,Y){var z=c.locale();return g(S,{$l:z},Y)},c.isDuration=M;var d=a.prototype.add,_=a.prototype.subtract;a.prototype.add=function(S,Y){return M(S)?E(this,S,1):d.bind(this)(S,Y)},a.prototype.subtract=function(S,Y){return M(S)?E(this,S,-1):_.bind(this)(S,Y)}}})}(te)),te.exports}var ot=at();const it=I(ot);var ne={exports:{}},st=ne.exports,ve;function lt(){return ve||(ve=1,function(r,l){(function(n,t){r.exports=t()})(st,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,i,h){var m=i.prototype,V=m.format;h.en.formats=n,m.format=function(s){s===void 0&&(s="YYYY-MM-DDTHH:mm:ssZ");var f=this.$locale().formats,y=function(w,k){return w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(M,g,o){var $=o&&o.toUpperCase();return g||k[o]||n[o]||k[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(C,b,u){return b||u.slice(1)})})}(s,f===void 0?{}:f);return V.call(this,y)}}})}(ne)),ne.exports}var ct=lt();const dt=I(ct);var re={exports:{}},ut=re.exports,Ne;function mt(){return Ne||(Ne=1,function(r,l){(function(n,t){r.exports=t()})(ut,function(){return function(n,t,i){n=n||{};var h=t.prototype,m={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function V(f,y,w,k){return h.fromToBase(f,y,w,k)}i.en.relativeTime=m,h.fromToBase=function(f,y,w,k,M){for(var g,o,$,C=w.$locale().relativeTime||m,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],u=b.length,T=0;T<u;T+=1){var E=b[T];E.d&&(g=k?i(f).diff(w,E.d,!0):w.diff(f,E.d,!0));var B=(n.rounding||Math.round)(Math.abs(g));if($=g>0,B<=E.r||!E.r){B<=1&&T>0&&(E=b[T-1]);var a=C[E.l];M&&(B=M(""+B)),o=typeof a=="string"?a.replace("%d",B):a(B,y,E.l,$);break}}if(y)return o;var c=$?C.future:C.past;return typeof c=="function"?c(o):c.replace("%s",o)},h.to=function(f,y){return V(f,y,this,!0)},h.from=function(f,y){return V(f,y,this)};var s=function(f){return f.$u?i.utc():i()};h.toNow=function(f){return this.to(s(this),f)},h.fromNow=function(f){return this.from(s(this),f)}}})}(re)),re.exports}var ft=mt();const ht=I(ft);var ae={exports:{}},pt=ae.exports,Ye;function gt(){return Ye||(Ye=1,function(r,l){(function(n,t){r.exports=t()})(pt,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(i,h,m){var V,s=function(k,M,g){g===void 0&&(g={});var o=new Date(k),$=function(C,b){b===void 0&&(b={});var u=b.timeZoneName||"short",T=C+"|"+u,E=t[T];return E||(E=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:u}),t[T]=E),E}(M,g);return $.formatToParts(o)},f=function(k,M){for(var g=s(k,M),o=[],$=0;$<g.length;$+=1){var C=g[$],b=C.type,u=C.value,T=n[b];T>=0&&(o[T]=parseInt(u,10))}var E=o[3],B=E===24?0:E,a=o[0]+"-"+o[1]+"-"+o[2]+" "+B+":"+o[4]+":"+o[5]+":000",c=+k;return(m.utc(a).valueOf()-(c-=c%1e3))/6e4},y=h.prototype;y.tz=function(k,M){k===void 0&&(k=V);var g,o=this.utcOffset(),$=this.toDate(),C=$.toLocaleString("en-US",{timeZone:k}),b=Math.round(($-new Date(C))/1e3/60),u=15*-Math.round($.getTimezoneOffset()/15)-b;if(!Number(u))g=this.utcOffset(0,M);else if(g=m(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(u,!0),M){var T=g.utcOffset();g=g.add(o-T,"minute")}return g.$x.$timezone=k,g},y.offsetName=function(k){var M=this.$x.$timezone||m.tz.guess(),g=s(this.valueOf(),M,{timeZoneName:k}).find(function(o){return o.type.toLowerCase()==="timezonename"});return g&&g.value};var w=y.startOf;y.startOf=function(k,M){if(!this.$x||!this.$x.$timezone)return w.call(this,k,M);var g=m(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return w.call(g,k,M).tz(this.$x.$timezone,!0)},m.tz=function(k,M,g){var o=g&&M,$=g||M||V,C=f(+m(),$);if(typeof k!="string")return m(k).tz($);var b=function(B,a,c){var d=B-60*a*1e3,_=f(d,c);if(a===_)return[d,a];var S=f(d-=60*(_-a)*1e3,c);return _===S?[d,_]:[B-60*Math.min(_,S)*1e3,Math.max(_,S)]}(m.utc(k,o).valueOf(),C,$),u=b[0],T=b[1],E=m(u).utcOffset(T);return E.$x.$timezone=$,E},m.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},m.tz.setDefault=function(k){V=k}}})}(ae)),ae.exports}var yt=gt();const kt=I(yt);var oe={exports:{}},Dt=oe.exports,Oe;function Vt(){return Oe||(Oe=1,function(r,l){(function(n,t){r.exports=t()})(Dt,function(){var n="minute",t=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(h,m,V){var s=m.prototype;V.utc=function(o){var $={date:o,utc:!0,args:arguments};return new m($)},s.utc=function(o){var $=V(this.toDate(),{locale:this.$L,utc:!0});return o?$.add(this.utcOffset(),n):$},s.local=function(){return V(this.toDate(),{locale:this.$L,utc:!1})};var f=s.parse;s.parse=function(o){o.utc&&(this.$u=!0),this.$utils().u(o.$offset)||(this.$offset=o.$offset),f.call(this,o)};var y=s.init;s.init=function(){if(this.$u){var o=this.$d;this.$y=o.getUTCFullYear(),this.$M=o.getUTCMonth(),this.$D=o.getUTCDate(),this.$W=o.getUTCDay(),this.$H=o.getUTCHours(),this.$m=o.getUTCMinutes(),this.$s=o.getUTCSeconds(),this.$ms=o.getUTCMilliseconds()}else y.call(this)};var w=s.utcOffset;s.utcOffset=function(o,$){var C=this.$utils().u;if(C(o))return this.$u?0:C(this.$offset)?w.call(this):this.$offset;if(typeof o=="string"&&(o=function(E){E===void 0&&(E="");var B=E.match(t);if(!B)return null;var a=(""+B[0]).match(i)||["-",0,0],c=a[0],d=60*+a[1]+ +a[2];return d===0?0:c==="+"?d:-d}(o),o===null))return this;var b=Math.abs(o)<=16?60*o:o,u=this;if($)return u.$offset=b,u.$u=o===0,u;if(o!==0){var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(b+T,n)).$offset=b,u.$x.$localOffset=T}else u=this.utc();return u};var k=s.format;s.format=function(o){var $=o||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return k.call(this,$)},s.valueOf=function(){var o=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*o},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var M=s.toDate;s.toDate=function(o){return o==="s"&&this.$offset?V(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():M.call(this)};var g=s.diff;s.diff=function(o,$,C){if(o&&this.$u===o.$u)return g.call(this,o,$,C);var b=this.local(),u=V(o).local();return g.call(b,u,$,C)}}})}(oe)),oe.exports}var $t=Vt();const wt=I($t);var ie={exports:{}},Ct=ie.exports,ze;function Mt(){return ze||(ze=1,function(r,l){(function(n,t){r.exports=t()})(Ct,function(){var n="week",t="year";return function(i,h,m){var V=h.prototype;V.week=function(s){if(s===void 0&&(s=null),s!==null)return this.add(7*(s-this.week()),"day");var f=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var y=m(this).startOf(t).add(1,t).date(f),w=m(this).endOf(n);if(y.isBefore(w))return 1}var k=m(this).startOf(t).date(f).startOf(n).subtract(1,"millisecond"),M=this.diff(k,n,!0);return M<0?m(this).startOf("week").week():Math.ceil(M)},V.weeks=function(s){return s===void 0&&(s=null),this.week(s)}}})}(ie)),ie.exports}var Et=Mt();const St=I(Et);N.extend(wt),N.extend(kt),N.extend(Se),N.extend(St),N.extend(it),N.extend(ht),N.extend(dt);function Le(r){const l=N(r.start),n=r.end?N(r.end):l.add(1,"hour");return{...r,startDate:l,endDate:n,isAllDay:r.allDay||!1}}function he(r){return r.map(Le)}function pe(r,l,n){return r.filter(t=>t.startDate.isBefore(n)&&t.endDate.isAfter(l))}function J(r,l){const n=l.startOf("day"),t=l.endOf("day");return pe(r,n,t)}function ge(r="00:00",l="24:00",n=60){const t=[],[i,h]=r.split(":").map(Number),[m,V]=l.split(":").map(Number);let s=N().hour(i).minute(h).second(0);const f=N().hour(m).minute(V).second(0);for(;s.isBefore(f);)t.push({hour:s.hour(),minute:s.minute(),label:s.format("HH:mm")}),s=s.add(n,"minute");return t}function ye(r,l="monday"){let n=r.startOf("isoWeek").isoWeekday(ke(l));l!=="monday"&&(n=n.subtract(1,"week"));const t=[];for(let i=0;i<7;i++)t.push(n.add(i,"day"));return t}function xe(r,l="monday"){const n=r.startOf("month");let t=n.isoWeekday(ke(l));t.isAfter(n)&&(t=t.subtract(1,"week"));const i=r.endOf("month"),h=[];let m=t;for(;m.isBefore(i)||m.isSame(i,"day");){const V=[];for(let s=0;s<7;s++)V.push(m.add(s,"day"));h.push(V),m=m.add(7,"day")}return h}function se(r,l){if(r.isAllDay)return"All day";const n=l||"HH:mm",t=r.startDate.format(n),i=r.endDate.format(n);return`${t} - ${i}`}function Fe(r){return r.endDate.diff(r.startDate,"minute")}function _t(r,l){return r.startDate.isBefore(l.endDate)&&r.endDate.isAfter(l.startDate)}function He(r){return[...r].sort((l,n)=>l.startDate.valueOf()-n.startDate.valueOf())}function W(r){if(r.color)return r.color;if(r.backgroundColor)return r.backgroundColor;switch(r.status){case"completed":return"#4caf50";case"cancelled":return"#f44336";case"overdue":return"#ff5722";case"planned":return"#2196f3";case"open":default:return"#9e9e9e"}}function le(r){if(r.textColor)return r.textColor;const n=W(r).replace("#",""),t=parseInt(n.substr(0,2),16),i=parseInt(n.substr(2,2),16),h=parseInt(n.substr(4,2),16);return(t*299+i*587+h*114)/1e3>128?"#000000":"#ffffff"}function U(r){return r.isSame(N(),"day")}function G(r){const l=r.isoWeekday();return l===6||l===7}function ke(r){switch(r){case"monday":return 1;case"tuesday":return 2;case"wednesday":return 3;case"thursday":return 4;case"friday":return 5;case"saturday":return 6;case"sunday":return 7;default:return-1}}function Ie(r){switch(r){case"sunday":return 0;case"monday":return 1;case"tuesday":return 2;case"wednesday":return 3;case"thursday":return 4;case"friday":return 5;case"saturday":return 6;default:return-1}}function We(r,l){let n=[...r];if(l.search){const t=l.search.toLowerCase();n=n.filter(i=>i.title.toLowerCase().indexOf(t)!==-1||i.subtitle&&i.subtitle.toLowerCase().indexOf(t)!==-1||i.description&&i.description.toLowerCase().indexOf(t)!==-1)}if(l.statuses&&l.statuses.length>0&&(n=n.filter(t=>l.statuses.indexOf(t.status||"open")!==-1)),l.dateRange){const{start:t,end:i}=l.dateRange;n=n.filter(h=>h.startDate.isBefore(i)&&h.endDate.isAfter(t))}return l.customFilter&&(n=n.filter(l.customFilter)),n}function Ae(r,l){let n=null;return(...t)=>{n&&clearTimeout(n),n=setTimeout(()=>r(...t),l)}}function Bt(r,l){let n;return(...t)=>{n||(r(...t),n=!0,setTimeout(()=>n=!1,l))}}function bt(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function De(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(Array.isArray(r))return r.map(De);const l={};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(l[n]=De(r[n]));return l}const Tt={class:"agenda-view"},vt={class:"agenda-header"},Nt={class:"text-h6"},Yt={class:"agenda-content"},Ot={key:0,class:"no-events"},zt={class:"text-body-1 text-grey"},Lt={key:1,class:"events-list"},xt={class:"event-header d-flex align-center mb-2"},Ft={class:"event-title text-h6 flex-grow-1"},Ht={key:0,class:"event-subtitle text-subtitle-1 mb-2"},It={class:"event-time d-flex align-center mb-2"},Wt={class:"text-body-2"},At={key:0,class:"ml-2 text-caption text-grey"},qt={key:1,class:"event-location d-flex align-center mb-2"},Pt={class:"text-body-2"},Jt={key:2,class:"event-description"},Ut={class:"text-body-2 mb-0"},Gt={key:3,class:"event-metadata mt-3"},Rt={class:"d-flex flex-wrap gap-2"},Zt=e.defineComponent({components:{VIcon:P.VIcon,VCard:D.VCard,VCardActions:D.VCardActions,VChip:D.VChip,VSpacer:D.VSpacer,VBtn:D.VBtn},__name:"AgendaView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["event-click","event-update"],setup(r,{emit:l}){const n=q(),t=r,i=l,h=e.computed(()=>J(t.events,t.currentDate)),m=e.computed(()=>He(h.value)),V=e.computed(()=>n.localizedDayjs.value(t.currentDate).format(n.current.value.formats.day)),s=o=>{switch(o){case"completed":return"success";case"cancelled":return"error";case"overdue":return"warning";case"planned":return"info";case"open":default:return"default"}},f=o=>{switch(o){case"completed":return n.current.value.status.completed;case"cancelled":return n.current.value.status.cancelled;case"overdue":return n.current.value.status.overdue;case"planned":return n.current.value.status.planned;case"open":default:return n.current.value.status.open}},y=o=>{const $=Fe(o),C=Math.floor($/(24*60)),b=Math.floor($/60),u=$%60;return n.current.value.formats.duration(C,b,u)},w=o=>o.endDate.isBefore(N())&&o.status!=="completed"&&o.status!=="cancelled",k=o=>{i("event-click",o)},M=o=>{i("event-update",o.id,{status:"completed"})},g=o=>{i("event-update",o.id,{status:"cancelled"})};return(o,$)=>{const C=e.resolveComponent("v-divider"),b=e.resolveComponent("v-card-text");return e.openBlock(),e.createElementBlock("div",Tt,[e.createElementVNode("div",vt,[e.createElementVNode("h3",Nt,e.toDisplayString(V.value),1),h.value.length>0?(e.openBlock(),e.createBlock(e.unref(D.VChip),{key:0,color:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value.length)+" event"+e.toDisplayString(h.value.length>1?"s":""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Yt,[h.value.length===0?(e.openBlock(),e.createElementBlock("div",Ot,[e.renderSlot(o.$slots,"no-events",{date:o.currentDate},()=>[e.createVNode(e.unref(P.VIcon),{icon:"mdi-calendar-blank",size:"64",color:"grey-lighten-2",class:"mb-4"}),e.createElementVNode("p",zt,e.toDisplayString(e.unref(n).current.value.views.agenda.noEvents),1)],!0)])):(e.openBlock(),e.createElementBlock("div",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id},[e.renderSlot(o.$slots,"event-content",{event:u,date:o.currentDate,handleEventClick:k},()=>[e.createVNode(e.unref(D.VCard),{class:e.normalizeClass(["agenda-event mb-4",{"event-completed":u.status==="completed","event-cancelled":u.status==="cancelled","event-overdue":w(u)}]),style:e.normalizeStyle({borderLeft:`4px solid ${e.unref(W)(u)}`}),elevation:"2",onClick:T=>k({event:u,nativeEvent:T})},{default:e.withCtx(()=>[e.createVNode(b,{class:"pa-4"},{default:e.withCtx(()=>[e.createElementVNode("div",xt,[u.icon?(e.openBlock(),e.createBlock(e.unref(P.VIcon),{key:0,icon:u.icon,color:e.unref(W)(u),class:"mr-2"},null,8,["icon","color"])):e.createCommentVNode("",!0),e.createElementVNode("h4",Ft,e.toDisplayString(u.title),1),e.createVNode(e.unref(D.VChip),{color:s(u.status||"open"),size:"small",variant:"outlined"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f(u.status||"open")),1)]),_:2},1032,["color"])]),u.subtitle?(e.openBlock(),e.createElementBlock("div",Ht,e.toDisplayString(u.subtitle),1)):e.createCommentVNode("",!0),e.createElementVNode("div",It,[e.createVNode(e.unref(P.VIcon),{icon:"mdi-clock-outline",size:"small",class:"mr-2"}),e.createElementVNode("span",Wt,e.toDisplayString(e.unref(se)(u)),1),u.isAllDay?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",At," ("+e.toDisplayString(y(u))+") ",1))]),u.location?(e.openBlock(),e.createElementBlock("div",qt,[e.createVNode(e.unref(P.VIcon),{icon:"mdi-map-marker",size:"small",class:"mr-2"}),e.createElementVNode("span",Pt,e.toDisplayString(u.location),1)])):e.createCommentVNode("",!0),u.description?(e.openBlock(),e.createElementBlock("div",Jt,[e.createElementVNode("p",Ut,e.toDisplayString(u.description),1)])):e.createCommentVNode("",!0),u.data&&Object.keys(u.data).length>0?(e.openBlock(),e.createElementBlock("div",Gt,[e.createVNode(C,{class:"mb-2"}),e.createElementVNode("div",Rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.data,(T,E)=>(e.openBlock(),e.createBlock(e.unref(D.VChip),{key:E,size:"x-small",variant:"outlined"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E)+": "+e.toDisplayString(T),1)]),_:2},1024))),128))])])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(e.unref(D.VCardActions),{class:"pa-4 pt-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(D.VSpacer)),u.status!=="completed"&&u.status!=="cancelled"?(e.openBlock(),e.createBlock(e.unref(D.VBtn),{key:0,disabled:o.readOnly,variant:"text",size:"small",color:"success",onClick:e.withModifiers(T=>M(u),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.views.agenda.buttons.markEventCompleted),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0),u.status!=="cancelled"?(e.openBlock(),e.createBlock(e.unref(D.VBtn),{key:1,disabled:o.readOnly,variant:"text",size:"small",color:"error",onClick:e.withModifiers(T=>g(u),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).current.value.views.agenda.buttons.cancelEvent),1)]),_:2},1032,["disabled","onClick"])):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1032,["style","class","onClick"])],!0)]))),128))]))])])}}}),ce=F(Zt,[["__scopeId","data-v-fde84cc6"]]);function de(r){const l=e.ref(null),n=e.ref(null),t=e.ref(!1),i=e.ref(null),h=(y,w)=>{l.value=y,n.value=w,t.value=!0,w.style.opacity="0.5",w.style.cursor="grabbing"},m=()=>{n.value&&(n.value.style.opacity="1",n.value.style.cursor="grab"),l.value=null,n.value=null,t.value=!1,i.value=null},V=async(y,w)=>{if(!l.value)return;const k=l.value,M=k.startDate,g=k.endDate,o=w||y.add(g.diff(M,"minute"),"minute"),$={event:k,newStart:y.toDate(),newEnd:o.toDate(),oldStart:M.toDate(),oldEnd:g.toDate()};try{r&&await r($)}catch(C){console.error("Failed to drop event:",C)}finally{m()}},s=y=>{i.value=y,y.style.backgroundColor="rgba(25, 118, 210, 0.1)"},f=y=>{i.value===y&&(y.style.backgroundColor="",i.value=null)};return{draggedEvent:e.computed(()=>l.value),isDragging:e.computed(()=>t.value),handleDragStart:h,handleDragEnd:m,handleDrop:V,handleDragOver:s,handleDragLeave:f}}function ue(r){return e.computed(()=>{const[n,t]=r.value.split(":").map(Number);return n*60+t})}function Ve(r,l,n,t,i=60){return e.computed(()=>{const m=ue(l),V=ue(n),s=e.computed(()=>{const w=V.value-m.value;return Math.ceil(w/t.value)}),f=r.value-i;return{height:e.computed(()=>f<=0?30:Math.max(30,Math.floor(f/s.value))).value,numberOfSlots:s.value,minTime:m.value,maxTime:V.value}})}function Kt(){const{mobile:r,width:l,sm:n,md:t,lg:i,xl:h,xxl:m}=Ue.useDisplay(),V=e.computed(()=>n.value||t.value),s=e.computed(()=>i.value||h.value||m.value),f=e.computed(()=>r.value?"agenda":V.value?"week":"month"),y=e.computed(()=>r.value?"compact":V.value?"normal":"detailed"),w=e.computed(()=>s.value),k=e.computed(()=>r.value?40:V.value?50:l.value>1920?80:60),M=e.computed(()=>l.value>1920);return{mobile:r,tablet:V,desktop:s,isWideScreen:M,recommendedView:f,eventDisplayMode:y,showSidebar:w,timeSlotHeight:k}}const Qt=["draggable"],Xt={class:"event-content"},jt={class:"event-header"},en={class:"event-title"},tn={key:0,class:"event-subtitle"},nn={class:"event-time"},rn={key:1,class:"event-location"},an={key:2,class:"event-description"},qe=F(e.defineComponent({__name:"DayEventView",props:{event:{},day:{},dynamicTimeSlots:{},handleEventClick:{type:Function},handleDragStart:{type:Function},config:{},readOnly:{type:Boolean}},setup(r){e.defineComponent({components:{VIcon:D.VIcon}});const l=r,n=t=>{const[i,h]=(l.config.minTime||"00:00").split(":").map(Number),[m,V]=(l.config.maxTime||"24:00").split(":").map(Number),s=l.day.hour(i).minute(h).second(0),f=l.day.hour(m).minute(V).second(0),y=t.startDate.isBefore(s)?s:t.startDate,w=t.endDate.isAfter(f)?f:t.endDate;if(t.endDate.isBefore(s)||t.startDate.isAfter(f))return{display:"none"};const k=y.diff(s,"minute"),M=w.diff(y,"minute"),g=l.config.timeSlotDuration||60,o=l.dynamicTimeSlots.height,$=Math.max(0,k/g*o),C=Math.max(M/g*o,20);return{position:"absolute",top:`${$}px`,height:`${C}px`,left:"8px",right:"8px",backgroundColor:W(t),color:le(t),zIndex:10}};return(t,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["day-event",{"event-completed":t.event.status==="completed"}]),style:e.normalizeStyle(n(t.event)),draggable:!t.readOnly,onClick:i[0]||(i[0]=e.withModifiers(h=>t.handleEventClick({event:t.event,nativeEvent:h}),["stop"])),onDragstart:i[1]||(i[1]=h=>t.handleDragStart(t.event,h.target))},[e.createElementVNode("div",Xt,[e.createElementVNode("div",jt,[t.event.icon?(e.openBlock(),e.createBlock(e.unref(D.VIcon),{key:0,icon:t.event.icon,size:"small",class:"mr-2"},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",en,e.toDisplayString(t.event.title),1)]),t.event.subtitle?(e.openBlock(),e.createElementBlock("div",tn,e.toDisplayString(t.event.subtitle),1)):e.createCommentVNode("",!0),e.createElementVNode("div",nn,e.toDisplayString(e.unref(se)(t.event)),1),t.event.location?(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(e.unref(D.VIcon),{icon:"mdi-map-marker",size:"x-small",class:"mr-1"}),e.createTextVNode(" "+e.toDisplayString(t.event.location),1)])):e.createCommentVNode("",!0),t.event.description?(e.openBlock(),e.createElementBlock("div",an,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0)])],46,Qt))}}),[["__scopeId","data-v-69ba6863"]]),on={class:"day-view"},sn={key:0,class:"time-column-header"},ln={class:"day-name"},cn={key:0,class:"time-column"},dn={class:"time-label"},un=["onClick","onDrop"],mn={key:0},fn={key:1},me=F(e.defineComponent({__name:"DayView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["time-slot-click","event-click","event-drop","date-click"],setup(r,{emit:l}){e.defineComponent({components:{VMenu:D.VMenu}});const n=r,t=l,i=e.computed(()=>!n.readOnly),h=e.computed(()=>n.containerHeight||500),m=e.computed(()=>n.config.timeSlotDuration??60),V=e.computed(()=>n.config.minTime||"00:00"),s=e.computed(()=>n.config.maxTime||"24:00"),f=Ve(h,V,s,m,60),{handleDragStart:y,handleDrop:w}=de(async a=>{t("event-drop",{event:a.event,date:a.date,newEnd:a.newEnd,newStart:a.newStart,oldEnd:a.oldEnd,oldStart:a.oldStart})}),k=e.computed(()=>ge(n.config.minTime,n.config.maxTime,n.config.timeSlotDuration)),M=e.computed(()=>J(n.events,n.currentDate)),g=a=>{t("event-click",a)},o=a=>{t("date-click",a)},$=a=>{const c=n.currentDate.hour(a.hour).minute(a.minute);t("time-slot-click",{date:c,slot:a})},C=(a,c)=>{i.value&&c instanceof HTMLElement&&(c.style.opacity="0.5",c.style.transform="rotate(3deg)",y(a,c))},b=a=>{i.value&&(document.querySelectorAll(".drag-highlight").forEach(c=>{c.classList.remove("drag-highlight")}),document.querySelectorAll('[style*="opacity: 0.5"]').forEach(c=>{const d=c;d.style.opacity="",d.style.transform=""}),w(a))},u=a=>{if(a.preventDefault(),!i.value)return;a.currentTarget.classList.add("drag-highlight")},T=a=>{a.currentTarget.classList.remove("drag-highlight")},E=a=>{if(a.preventDefault(),!i.value)return;a.currentTarget.classList.add("drag-highlight-slot")},B=a=>{a.currentTarget.classList.remove("drag-highlight-slot")};return(a,c)=>(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("div",{class:e.normalizeClass(["day-header",{"show-time-grid":a.config.showTimeGrid,"hide-time-grid":!a.config.showTimeGrid}])},[a.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",sn)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["day-header-content",{today:e.unref(U)(a.currentDate),weekend:e.unref(G)(a.currentDate)}]),onClick:c[0]||(c[0]=d=>o({date:a.currentDate,nativeEvent:d}))},[e.createElementVNode("div",ln,e.toDisplayString(a.currentDate.format("dddd")),1)],2)],2),e.createElementVNode("div",{class:e.normalizeClass(["day-body",{"show-time-grid":a.config.showTimeGrid,"hide-time-grid":!a.config.showTimeGrid}]),onDrop:c[1]||(c[1]=d=>b(a.currentDate.startOf("day")))},[a.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,d=>(e.openBlock(),e.createElementBlock("div",{key:`${d.hour}-${d.minute}`,class:"time-slot",style:e.normalizeStyle({height:`${e.unref(f).height}px`})},[e.createElementVNode("span",dn,e.toDisplayString(d.label),1)],4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"day-content",onDragover:e.withModifiers(u,["prevent"]),onDragleave:T},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,d=>(e.openBlock(),e.createElementBlock("div",{key:`${a.currentDate.format("YYYY-MM-DD")}-${d.hour}-${d.minute}`,class:e.normalizeClass(["time-slot",{"time-grid":a.config.showTimeGrid}]),style:e.normalizeStyle({height:`${e.unref(f).height}px`}),onClick:_=>$(d),onDrop:_=>b(a.currentDate.startOf("day").add(d.hour,"hour").add(d.minute,"minute")),onDragover:e.withModifiers(E,["prevent"]),onDragleave:B},null,46,un))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id},[a.$slots.eventMenu?(e.openBlock(),e.createElementBlock("div",mn,[e.createVNode(e.unref(D.VMenu),null,{activator:e.withCtx(({props:_})=>[e.createVNode(qe,e.mergeProps({ref_for:!0},_,{config:a.config,"read-only":a.readOnly,event:d,day:a.currentDate,"dynamic-time-slots":e.unref(f),"handle-drag-start":C,"handle-event-click":g}),null,16,["config","read-only","event","day","dynamic-time-slots"])]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"eventMenu",{event:d},void 0,!0)]),_:2},1024)])):(e.openBlock(),e.createElementBlock("div",fn,[e.createVNode(qe,{config:a.config,"read-only":a.readOnly,event:d,day:a.currentDate,"dynamic-time-slots":e.unref(f),"handle-drag-start":C,"handle-event-click":g},null,8,["config","read-only","event","day","dynamic-time-slots"])]))]))),128))],32)],34)]))}}),[["__scopeId","data-v-217d3814"]]),hn=["draggable"],pn={class:"event-title"},$e=F(e.defineComponent({__name:"MonthEventView",props:{event:{},day:{},handleEventClick:{type:Function},handleDragStart:{type:Function},config:{},readOnly:{type:Boolean}},setup(r){return e.defineComponent({components:{VIcon:D.VIcon}}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["month-event",{"event-completed":l.event.status==="completed"}]),style:e.normalizeStyle({backgroundColor:e.unref(W)(l.event),color:e.unref(le)(l.event)}),draggable:!l.readOnly,onClick:n[0]||(n[0]=e.withModifiers(t=>l.handleEventClick({event:l.event,nativeEvent:t}),["stop"])),onDragstart:n[1]||(n[1]=t=>l.handleDragStart(l.event,t.target))},[l.event.icon?(e.openBlock(),e.createBlock(e.unref(D.VIcon),{key:0,icon:l.event.icon,size:"x-small",class:"mr-1"},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("span",pn,e.toDisplayString(l.event.title),1)],46,hn))}}),[["__scopeId","data-v-73ce43ec"]]),gn={class:"month-view"},yn={class:"month-header"},kn={class:"month-grid"},Dn=["onClick","onDrop"],Vn={class:"day-number"},$n={class:"day-events"},wn={key:0},Cn={key:1},R=F(e.defineComponent({__name:"MonthView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["event-click","event-drop","date-click"],setup(r,{emit:l}){e.defineComponent({components:{MonthEventView:$e,VMenu:D.VMenu}});const n=e.computed(()=>i.config.minTime||"00:00"),t=ue(n),i=r,h=l,m=e.computed(()=>!i.readOnly),{createLocalizedDayjs:V}=q(),{handleDragStart:s,handleDrop:f}=de(async u=>{h("event-drop",{event:u.event,date:u.date,newEnd:u.newEnd,newStart:u.newStart,oldEnd:u.oldEnd,oldStart:u.oldStart})}),y=e.computed(()=>ye(i.currentDate,i.config.firstDayOfWeek)),w=e.computed(()=>xe(i.currentDate,i.config.firstDayOfWeek)),k=u=>J(i.events,u).slice(0,3),M=u=>{h("event-click",u)},g=u=>{h("date-click",u)},o=(u,T)=>{m.value&&T instanceof HTMLElement&&(T.style.opacity="0.5",T.style.transform="rotate(3deg)",s(u,T))},$=u=>{m.value&&(document.querySelectorAll(".drag-highlight").forEach(T=>{T.classList.remove("drag-highlight")}),document.querySelectorAll('[style*="opacity: 0.5"]').forEach(T=>{const E=T;E.style.opacity="",E.style.transform=""}),f(u.startOf("day").add(t.value,"minute")))},C=u=>{if(u.preventDefault(),!m.value)return;u.currentTarget.classList.add("drag-highlight")},b=u=>{if(!m.value)return;u.currentTarget.classList.remove("drag-highlight")};return(u,T)=>(e.openBlock(),e.createElementBlock("div",gn,[e.createElementVNode("div",yn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,E=>(e.openBlock(),e.createElementBlock("div",{key:`days-col-header-${E.format("YYYY-MM-DD")}`,class:"month-header-day"},e.toDisplayString(e.unref(V)(E).format("ddd")),1))),128))]),e.createElementVNode("div",kn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(E,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"month-week"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E,a=>(e.openBlock(),e.createElementBlock("div",{key:a.format("YYYY-MM-DD"),class:e.normalizeClass(["month-day",{"current-month":a.month()===u.currentDate.month(),"other-month":a.month()!==u.currentDate.month(),today:e.unref(U)(a),weekend:e.unref(G)(a)}]),onClick:c=>g({date:a,nativeEvent:c}),onDragover:e.withModifiers(C,["prevent"]),onDragleave:b,onDrop:c=>$(a)},[e.createElementVNode("div",Vn,e.toDisplayString(a.date()),1),e.createElementVNode("div",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(a),c=>(e.openBlock(),e.createElementBlock("div",{key:c.id},[u.$slots.eventMenu?(e.openBlock(),e.createElementBlock("div",wn,[e.createVNode(e.unref(D.VMenu),null,{activator:e.withCtx(({props:d})=>[e.createVNode($e,e.mergeProps({ref_for:!0},d,{config:u.config,"read-only":u.readOnly,event:c,day:a,"handle-event-click":M,"handle-drag-start":o}),null,16,["config","read-only","event","day"])]),default:e.withCtx(()=>[e.renderSlot(u.$slots,"eventMenu",{event:c},void 0,!0)]),_:2},1024)])):(e.openBlock(),e.createElementBlock("div",Cn,[e.createVNode($e,{config:u.config,"read-only":u.readOnly,event:c,day:a,"handle-event-click":M,"handle-drag-start":o},null,8,["config","read-only","event","day"])]))]))),128))])],42,Dn))),128))]))),128))])]))}}),[["__scopeId","data-v-a30ad79d"]]),Mn=["draggable"],En={class:"event-content"},Sn={class:"event-text"},_n={key:0},Bn={class:"event-title"},bn={key:1,class:"event-subtitle"},Tn={class:"event-time"},we=F(e.defineComponent({__name:"WeekEventView",props:{event:{},day:{},dynamicTimeSlots:{},handleEventClick:{type:Function},handleDragStart:{type:Function},config:{},readOnly:{type:Boolean}},setup(r){e.defineComponent({components:{VIcon:D.VIcon}});const l=r,n=(t,i)=>{const[h,m]=(l.config.minTime||"00:00").split(":").map(Number),[V,s]=(l.config.maxTime||"24:00").split(":").map(Number),f=i.hour(h).minute(m).second(0),y=i.hour(V).minute(s).second(0),w=t.startDate.isBefore(f)?f:t.startDate,k=t.endDate.isAfter(y)?y:t.endDate;if(t.endDate.isBefore(f)||t.startDate.isAfter(y))return{display:"none"};const M=w.diff(f,"minute"),g=k.diff(w,"minute"),o=l.config.timeSlotDuration||60,$=l.dynamicTimeSlots.height,C=Math.max(0,M/o*$),b=Math.max(g/o*$,20);return{position:"absolute",top:`${C}px`,height:`${b}px`,left:"4px",right:"4px",backgroundColor:W(t),color:le(t),zIndex:10}};return(t,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["week-event",{"event-completed":t.event.status==="completed"}]),style:e.normalizeStyle(n(t.event,t.day)),draggable:!t.readOnly,onClick:i[0]||(i[0]=e.withModifiers(h=>t.handleEventClick({event:t.event,nativeEvent:h}),["stop"])),onDragstart:i[1]||(i[1]=h=>t.handleDragStart(t.event,h.target))},[e.createElementVNode("div",En,[e.createElementVNode("div",Sn,[t.event.icon?(e.openBlock(),e.createElementBlock("span",_n,[e.createVNode(e.unref(D.VIcon),{icon:t.event.icon,size:"small",class:"mr-1"},null,8,["icon"])])):e.createCommentVNode("",!0),e.createElementVNode("span",Bn,e.toDisplayString(t.event.title),1),t.event.subtitle?(e.openBlock(),e.createElementBlock("div",bn,e.toDisplayString(t.event.subtitle),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Tn,e.toDisplayString(e.unref(se)(t.event)),1)])])],46,Mn))}}),[["__scopeId","data-v-13ca397d"]]),vn={class:"week-view"},Nn={key:0,class:"time-column-header"},Yn=["onClick"],On={class:"day-name"},zn={class:"day-number"},Ln={key:0,class:"time-column"},xn={key:0,class:"time-label"},Fn={class:"days-container"},Hn=["onClick"],In=["onDrop"],Wn={key:0},An={key:1},fe=F(e.defineComponent({__name:"WeekView",props:{events:{},currentDate:{},containerHeight:{},config:{},readOnly:{type:Boolean}},emits:["event-click","event-drop","date-click"],setup(r,{emit:l}){e.defineComponent({components:{WeekEventView:we,VMenu:D.VMenu}});const n=r,t=l,i=e.computed(()=>!n.readOnly),{handleDragStart:h,handleDrop:m}=de(async d=>{t("event-drop",{event:d.event,date:d.date,newEnd:d.newEnd,newStart:d.newStart,oldEnd:d.oldEnd,oldStart:d.oldStart})}),{createLocalizedDayjs:V}=q(),s=e.computed(()=>ye(n.currentDate,n.config.firstDayOfWeek)),f=e.computed(()=>ge(n.config.minTime,n.config.maxTime,n.config.timeSlotDuration)),y=e.computed(()=>{const d=new Map;return s.value.forEach(_=>{const S=_.format("YYYY-MM-DD");d.set(S,J(n.events,_))}),d}),w=e.computed(()=>n.containerHeight||500),k=e.computed(()=>n.config.timeSlotDuration??60),M=e.computed(()=>n.config.minTime||"00:00"),g=e.computed(()=>n.config.maxTime||"24:00"),o=Ve(w,M,g,k,60),$=d=>{const _=d.format("YYYY-MM-DD");return y.value.get(_)||[]},C=d=>{t("event-click",d)},b=d=>{t("date-click",d)},u=(d,_)=>{i.value&&_ instanceof HTMLElement&&(_.style.opacity="0.5",_.style.transform="rotate(3deg)",h(d,_))},T=d=>{document.querySelectorAll(".drag-highlight, .drag-highlight-slot").forEach(_=>{_.classList.remove("drag-highlight","drag-highlight-slot")}),document.querySelectorAll('[style*="opacity: 0.5"]').forEach(_=>{const S=_;S.style.opacity="",S.style.transform=""}),i.value&&m(d)},E=d=>{if(d.preventDefault(),!i.value)return;d.currentTarget.classList.add("drag-highlight")},B=d=>{d.currentTarget.classList.remove("drag-highlight")},a=d=>{if(d.preventDefault(),!i.value)return;d.currentTarget.classList.add("drag-highlight-slot")},c=d=>{d.currentTarget.classList.remove("drag-highlight-slot")};return(d,_)=>(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",{class:e.normalizeClass(["week-header",{"show-time-grid":d.config.showTimeGrid,"hide-time-grid":!d.config.showTimeGrid}])},[d.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",Nn)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,S=>(e.openBlock(),e.createElementBlock("div",{key:S.format("YYYY-MM-DD"),class:e.normalizeClass(["day-header",{today:e.unref(U)(S),weekend:e.unref(G)(S)}]),onClick:Y=>b({date:S,nativeEvent:Y})},[e.createElementVNode("div",On,e.toDisplayString(e.unref(V)(S).format("ddd")),1),e.createElementVNode("div",zn,e.toDisplayString(e.unref(V)(S).format("D")),1)],10,Yn))),128))],2),e.createElementVNode("div",{class:e.normalizeClass(["week-body",{"show-time-grid":d.config.showTimeGrid,"hide-time-grid":!d.config.showTimeGrid}])},[d.config.showTimeGrid?(e.openBlock(),e.createElementBlock("div",Ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,S=>(e.openBlock(),e.createElementBlock("div",{key:`${S.hour}-${S.minute}`,class:"time-slot",style:e.normalizeStyle({height:`${e.unref(o).height}px`,width:d.config.showTimeGrid?"100%":"1px"})},[d.config.showTimeGrid?(e.openBlock(),e.createElementBlock("span",xn,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)],4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Fn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,S=>(e.openBlock(),e.createElementBlock("div",{key:S.format("YYYY-MM-DD"),class:e.normalizeClass(["day-column",{today:e.unref(U)(S),weekend:e.unref(G)(S)}]),onClick:Y=>b({date:S,nativeEvent:Y}),onDragover:e.withModifiers(E,["prevent"]),onDragleave:B},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,Y=>(e.openBlock(),e.createElementBlock("div",{key:`${S.format("YYYY-MM-DD")}-${Y.hour}-${Y.minute}`,class:e.normalizeClass(["time-slot",{"time-grid":d.config.showTimeGrid}]),style:e.normalizeStyle({height:`${e.unref(o).height}px`}),onDrop:z=>T(S.startOf("day").add(Y.hour,"hour").add(Y.minute,"minute")),onDragover:e.withModifiers(a,["prevent"]),onDragleave:c},null,46,In))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($(S),Y=>(e.openBlock(),e.createElementBlock("div",{key:Y.id},[d.$slots.eventMenu?(e.openBlock(),e.createElementBlock("div",Wn,[e.createVNode(e.unref(D.VMenu),null,{activator:e.withCtx(({props:z})=>[e.createVNode(we,e.mergeProps({ref_for:!0},z,{config:d.config,"read-only":d.readOnly,event:Y,day:S,"dynamic-time-slots":e.unref(o),"handle-event-click":C,"handle-drag-start":u}),null,16,["config","read-only","event","day","dynamic-time-slots"])]),default:e.withCtx(()=>[e.renderSlot(d.$slots,"eventMenu",{event:Y},void 0,!0)]),_:2},1024)])):(e.openBlock(),e.createElementBlock("div",An,[e.createVNode(we,{config:d.config,"read-only":d.readOnly,event:Y,day:S,"dynamic-time-slots":e.unref(o),"handle-event-click":C,"handle-drag-start":u},null,8,["config","read-only","event","day","dynamic-time-slots"])]))]))),128))],42,Hn))),128))])],2)]))}}),[["__scopeId","data-v-81f49a20"]]),qn={class:"calendar-component"},Pe=F(e.defineComponent({__name:"CalendarComponent",props:e.mergeModels({events:{},view:{},currentDate:{},filters:{},lazyLoad:{type:Function},confi