@sbh321/qcalendar
Version:
A forked version of Jeff Galbraith's fork of Quasar UI QCalendar
6 lines • 43.1 kB
JavaScript
/*!
* @subhambhandari/qcalendar v4.0.0-beta.19
* (c) 2024 Subham Bhandari <bhandarimaiya65@gmail.com>
* Released under the MIT License.
*/
(function(e,t){"object"===typeof exports&&"undefined"!==typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):(e="undefined"!==typeof globalThis?globalThis:e||self,e.QCalendarDay=t(e.Vue))})(this,function(ze){"use strict";const a=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?(.(\d{1,3}))?$/,t=/^(\d{4})-(\d{1,2})(-(\d{1,2}))/,b=/(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/,D=[0,31,28,31,30,31,30,31,31,30,31,30,31],_=[0,31,29,31,30,31,30,31,31,30,31,30,31],T=28,C=31,l=12,n=1,h=1,o=7,r=60,u=24,F=0,q=6e4,A=36e5,M=864e5,x=6048e5,E={date:"",time:"",year:0,month:0,day:0,weekday:0,hour:0,minute:0,doy:0,workweek:0,hasDay:!1,hasTime:!1,past:!1,current:!1,future:!1,disabled:!1,currentWeekday:!1},N={hour:0,minute:0};function Pe(){const e=new Date,t=""+(e.getMonth()+1),a=""+e.getDate(),n=e.getFullYear();return[n,s(t,2),s(a,2)].join("-")}function z(e,t,a){let n=X(e);if(1===n.day||0===n.weekday)while(!t.includes(n.weekday))n=w(n);return n=y(n,t[0],g),n=p(n),a&&(n=$(n,a,n.hasTime)),n}function P(e,t,a){let n=X(e);const r=d(n.year,n.month);if(r===n.day||6===n.weekday)while(!t.includes(n.weekday))n=g(n);return n=y(n,t[t.length-1],w),n=p(n),a&&(n=$(n,a,n.hasTime)),n}function S(e){const t=X(e);return t.day=h,p(t),t}function I(e){const t=X(e);return t.day=d(t.year,t.month),p(t),t}function Q(e){const t=Object.prototype.toString.call(e);switch(t){case"[object Number]":return e;case"[object String]":{const a=b.exec(e);return a?60*parseInt(a[1],10)+parseInt(a[3]||0,10):!1}case"[object Object]":return"number"!==typeof e.hour||"number"!==typeof e.minute?!1:60*e.hour+e.minute}return!1}function W(e){return!!a.exec(e)}function O(e,t){return JSON.stringify(e)===JSON.stringify(t)}function H(e,t){return c(e)===c(t)}function L(e,t){return v(e)===v(t)}function R(e,t){return Qe(e)===Qe(t)}function $e(e){const t=a.exec(e);return t?{date:e,time:s(parseInt(t[6],10)||0,2)+":"+s(parseInt(t[8],10)||0,2),year:parseInt(t[1],10),month:parseInt(t[2],10),day:parseInt(t[4],10)||1,hour:isNaN(parseInt(t[6],10))?0:parseInt(t[6],10),minute:isNaN(parseInt(t[8],10))?0:parseInt(t[8],10),weekday:0,doy:0,workweek:0,hasDay:!!t[4],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1}:null}function Xe(e,t){let a=$e(e);return null===a?null:(a=p(a),t&&$(a,t,a.hasTime),a)}function B(e,t=!1){const a=t?"UTC":"";return p({date:s(e[`get${a}FullYear`](),4)+"-"+s(e[`get${a}Month`]()+1,2)+"-"+s(e[`get${a}Date`](),2),time:s(e[`get${a}Hours`]()||0,2)+":"+s(e[`get${a}Minutes`]()||0,2),year:e[`get${a}FullYear`](),month:e[`get${a}Month`]()+1,day:e[`get${a}Date`](),hour:e[`get${a}Hours`](),minute:e[`get${a}Minutes`](),weekday:0,doy:0,workweek:0,hasDay:!0,hasTime:!0,past:!1,current:!1,future:!1,disabled:!1})}function je(e){return 1e8*e.year+1e6*e.month+1e4*e.day}function i(e){return 100*e.hour+e.minute}function Ke(e){return je(e)+i(e)}function U(e,t,a){const n=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute),r=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute);return!0===a&&r<n?0:r-n}function $(e,t,a=!1){let n=je(t),r=je(e),o=n===r;return e.hasTime&&a&&o&&(n=i(t),r=i(e),o=n===r),e.past=r<n,e.current=o,e.future=r>n,e.currentWeekday=e.weekday===t.weekday,e}function V(e,t,a){return e.hasTime=!0,e.hour=Math.floor(t/r),e.minute=t%r,e.time=v(e),a&&$(e,a,!0),e}function Y(e){return e.weekday=ae(e),e}function Z(e){return e.doy=ee(e),e}function J(e){return e.workweek=te(e),e}function G(e,t,a,n,r){const o=je(e);if(void 0!==t){const u=je($e(t));o<=u&&(e.disabled=!0)}if(!0!==e.disabled&&void 0!==a){const l=je($e(a));o>=l&&(e.disabled=!0)}if(!0!==e.disabled&&Array.isArray(n)&&n.length>0)for(const i in n)if(n[i]===e.weekday){e.disabled=!0;break}if(!0!==e.disabled&&Array.isArray(r)&&r.length>0)for(const d in r)if(Array.isArray(r[d])&&2===r[d].length){const s=$e(r[d][0]),c=$e(r[d][1]);if(ve(e,s,c)){e.disabled=!0;break}}else{const v=je(Xe(r[d]+" 00:00"));if(v===o){e.disabled=!0;break}}return e}function p(e){return e.hasTime=!0,e.time=v(e),e.date=c(e),e.weekday=ae(e),e.doy=ee(e),e.workweek=te(e),e}function ee(e){if(0!==e.year)return(Date.UTC(e.year,e.month-1,e.day)-Date.UTC(e.year,0,0))/24/60/60/1e3}function te(e){0===e.year&&(e=Xe(Pe()));const t=ie(e);if(isNaN(t))return 0;const a=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=(a.setDate(a.getDate()-(a.getDay()+6)%7+3),new Date(a.getFullYear(),0,4)),r=(n.setDate(n.getDate()-(n.getDay()+6)%7+3),a.getTimezoneOffset()-n.getTimezoneOffset()),o=(a.setHours(a.getHours()-r),(a-n)/x);return 1+Math.floor(o)}function ae(e){let t=e.weekday;if(e.hasDay){const a=Math.floor,n=e.day,r=(e.month+9)%l+1,o=a(e.year/100),u=e.year%100-(e.month<=2?1:0);t=((n+a(2.6*r-.2)-2*o+u+a(u/4)+a(o/4))%7+7)%7}return t}function ne(e){return 1===(e%4===0^e%100===0^e%400===0)}function d(e,t){return(ne(e)?_:D)[t]}function X(e){return{...e}}function s(e,t){let a=String(e);while(a.length<t)a="0"+a;return a}function c(e){let t=s(e.year,4)+"-"+s(e.month,2);return e.hasDay&&(t+="-"+s(e.day,2)),t}function v(e){return e.hasTime?s(e.hour,2)+":"+s(e.minute,2):""}function Qe(e){return c(e)+" "+(e.hasTime?v(e):"00:00")}function w(e){return++e.day,e.weekday=(e.weekday+1)%o,e.day>T&&e.day>d(e.year,e.month)&&(e.day=h,++e.month,e.month>l)&&(e.month=n,++e.year),e}function g(e){return e.day--,e.weekday=(e.weekday+6)%o,e.day<h&&(e.month--,e.month<n&&(e.year--,e.month=l),e.day=d(e.year,e.month)),e}function re(e,t=w,a=1,n=[0,1,2,3,4,5,6]){return k(e,t,a,n)}function k(e,t=w,a=1,n=[0,1,2,3,4,5,6]){n.includes(e.weekday)||0!==e.weekday||t!==w||++a;while(--a>=0)e=t(e),n.length<7&&!n.includes(e.weekday)&&++a;return e}function y(e,t,a=w,n=6){while(e.weekday!==t&&--n>=0)e=a(e);return e}function oe(t){const e=[1,1,1,1,1,1,1],n=[0,0,0,0,0,0,0];for(let e=0;e<t.length;++e)n[t[e]]=1;for(let a=0;a<o;++a){let t=1;for(let e=1;e<o;++e){const r=(a+e)%o;if(n[r])break;++t}e[a]=n[a]*t}return e}function ue(e,t,a,n,r,o,u=[],l=[],i=42,d=0){const s=je(t),c=[];let v=X(e),y=0,m=y===s;if(!(s<je(e)))while((!m||c.length<d)&&c.length<i){if(y=je(v),m=m||y>s&&c.length>=d,m)break;if(0===n[v.weekday]);else{const f=X(v);p(f),$(f,a),G(f,r,o,u,l),c.push(f)}v=k(v,w)}return c}function le(t,a,n,r,o){const u=[];for(let e=0;e<r;++e){const l=(a+e)*n,i=X(t);u.push(V(i,l,o))}return u}function j(n,r){const o=(e,t)=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?o:(t,e)=>{try{const a=new Intl.DateTimeFormat(n||void 0,r(t,e));return a.format(de(t))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> `+Qe(t)),o}}}function ie(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,0,0)):new Date(e.year,e.month-1,e.day,0,0)}function de(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute)):new Date(e.year,e.month-1,e.day,e.hour,e.minute)}function e(e){return isFinite(parseInt(e,10))}function se(e,t=!1){const a=!0===t?Ke:je;return e.reduce((e,t)=>{return Math.max(a(e),a(t))===a(e)?e:t})}function ce(e,t=!1){const a=!0===t?Ke:je;return e.reduce((e,t)=>{return Math.min(a(e),a(t))===a(e)?e:t})}function ve(e,t,a,n){const r=je(e)+(!0===n?i(e):0),o=je(t)+(!0===n?i(t):0),u=je(a)+(!0===n?i(a):0);return r>=o&&r<=u}function ye(e,t,a,n){const r=je(e),o=je(t),u=je(a),l=je(n);return r>=u&&r<=l||o>=u&&o<=l||u>=r&&o>=l}function K(e,t){const n=X(e);let r;return fe(t,(e,t)=>{if(void 0!==n[t]){n[t]+=parseInt(e,10);const a=me.indexOf(t);-1!==a&&(r=void 0===r?a:Math.min(a,r))}}),void 0!==r&&ge(n,me[r]),p(n),n}const me=["minute","hour","day","month"];function fe(t,a){Object.keys(t).forEach(e=>a(t[e],e))}function he(e){if(e.minute>=r||e.minute<0){const t=Math.floor(e.minute/r);e.minute-=t*r,e.hour+=t,pe(e)}return e}function pe(e){if(e.hour>=u||e.hour<0){const t=Math.floor(e.hour/u);e.hour-=t*u,e.day+=t,we(e)}return e}function we(t){m(t);let a=d(t.year,t.month);if(t.day>a){++t.month,t.month>l&&m(t);let e=t.day-a;a=d(t.year,t.month);do{e>a&&(++t.month,t.month>l&&m(t),e-=a,a=d(t.year,t.month))}while(e>a);t.day=e}else if(t.day<=0){let e=-1*t.day;--t.month,t.month<=0&&m(t),a=d(t.year,t.month);do{e>a&&(e-=a,--t.month,t.month<=0&&m(t),a=d(t.year,t.month))}while(e>a);t.day=a-e}return t}function m(e){if(e.month>l){const t=Math.floor(e.month/l);e.month=e.month%l,e.year+=t}else e.month<n&&(e.month+=l,--e.year);return e}function ge(e,t){switch(t){case"minute":return he(e);case"hour":return pe(e);case"day":return we(e);case"month":return m(e)}}function ke(e,t){const a=U(e,t,!0);return Math.floor(a/M)}function be(e,t){let a=X(e),n=X(t);return a=y(a,0),n=y(n,6),Math.ceil(ke(a,n)/o)}const De={Sun:new Date("2020-01-05T00:00:00.000Z"),Mon:new Date("2020-01-06T00:00:00.000Z"),Tue:new Date("2020-01-07T00:00:00.000Z"),Wed:new Date("2020-01-08T00:00:00.000Z"),Thu:new Date("2020-01-09T00:00:00.000Z"),Fri:new Date("2020-01-10T00:00:00.000Z"),Sat:new Date("2020-01-11T00:00:00.000Z")};function _e(){const r=(e,t)=>"",o={long:{timeZone:"UTC",weekday:"long"},short:{timeZone:"UTC",weekday:"short"},narrow:{timeZone:"UTC",weekday:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?r:e;function e(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,o[e]||o["long"]);return n.format(De[t])}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+t),r}}}function Te(t,a){const e=Object.keys(De),n=_e();return e.map(e=>n(e,t,a))}function Se(){const o=(e,t)=>"",u={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?o:e;function e(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,u[e]||u["long"]),r=new Date;return r.setDate(1),r.setMonth(t),n.format(r)}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> month: `+t),o}}}function Ie(t,a){const n=Se();return[...Array(12).keys()].map(e=>n(e,t,a))}function Je(e,t="px"){if(null!=e&&""!==e)return isNaN(e)?String(e):"auto"===e?e:""+Number(e)+t}function Ce(t,a){for(let e=0;e<t.length;e++)if(!0===a(t[e],e))return e;return-1}function Ge(e,t){return 0===t?e:e.slice(0,t)}var et={name:"ResizeObserver",mounted(e,{value:t}){if(t){const a={};a.callback=t,a.size={width:0,height:0},a.observer=new ResizeObserver(e=>{const t=e[0].contentRect;t.width===a.size.width&&t.height===a.size.height||(a.size.width=t.width,a.size.height=t.height,a.callback(a.size))}),a.observer.observe(e),e.__onResizeObserver=a}},beforeUnmount(e){if(e.__onResizeObserver){const t=e.__onResizeObserver["observer"];t.unobserve(e),delete e.__onResizeObserver}}};function tt(t,a,{scrollArea:e,pane:n}){if(!a){const s="[error: renderCalendar] no renderFunc has been supplied to useCalendar";throw console.error(s),new Error(s)}const r=ze.reactive({width:0,height:0}),o=ze.ref(null);function u({width:e,height:t}){r.width=e,r.height=t}const l=ze.computed(()=>{return!0!==t.noScroll&&e.value&&n.value&&r.height?e.value.offsetWidth-n.value.offsetWidth:0});function i(){}function d(){const e={ref:o,role:"complementary",lang:t.locale,class:`q-calendar ${t.dark?"q-calendar--dark":""} `+(t.bordered?"q-calendar__bordered":"")};return ze.withDirectives(ze.h("div",{...e},[a()]),[[et,u]])}return{rootRef:o,scrollWidth:l,__initCalendar:i,__renderCalendar:d}}const Fe={modelValue:{type:String,default:Pe(),validator:e=>""===e||W(e)},weekdays:{type:Array,default:()=>[0,1,2,3,4,5,6]},dateType:{type:String,default:"round",validator:e=>["round","rounded","square"].includes(e)},weekdayAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},dateAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},bordered:Boolean,dark:Boolean,noAria:Boolean,noActiveDate:Boolean,noHeader:Boolean,noScroll:Boolean,shortWeekdayLabel:Boolean,noDefaultHeaderText:Boolean,noDefaultHeaderBtn:Boolean,minWeekdayLabel:{type:[Number,String],default:1},weekdayBreakpoints:{type:Array,default:()=>[75,35],validator:e=>2===e.length},locale:{type:String,default:"en-US"},animated:Boolean,transitionPrev:{type:String,default:"slide-right"},transitionNext:{type:String,default:"slide-left"},disabledDays:Array,disabledBefore:String,disabledAfter:String,disabledWeekdays:{type:Array,default:()=>[]},dragEnterFunc:{type:Function},dragOverFunc:{type:Function},dragLeaveFunc:{type:Function},dropFunc:{type:Function},selectedDates:{type:Array,default:()=>[]},selectedStartEndDates:{type:Array,default:()=>[]},hoverable:Boolean,focusable:Boolean,focusType:{type:Array,default:["date"],validator:e=>{let t=!0;e.forEach(e=>{!0!==["day","date","weekday","interval","time","resource","task"].includes(e)&&(t=!1)});return t}}};function at(r,{startDate:e,endDate:t,times:a}){const n=ze.computed(()=>oe(r.weekdays)),o=ze.computed(()=>Xe(e.value)),u=ze.computed(()=>{if("0000-00-00"===t.value)return m(o.value);return Xe(t.value)}),l=ze.computed(()=>{const a={timeZone:"UTC",day:"numeric"};return j(r.locale,(e,t)=>a)}),i=ze.computed(()=>{const a={timeZone:"UTC",weekday:"long"};const n={timeZone:"UTC",weekday:"short"};return j(r.locale,(e,t)=>t?n:a)}),d=ze.computed(()=>{const t={timeZone:"UTC",dateStyle:"full"};return j(r.locale,e=>t)});function s(e,t){return e&&e.length>0&&e.includes(t.date)}function c(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(e&&2===e.length){const n=je(t),r=je($e(e[0])),o=je($e(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function v(e,t=!1,a=[],n=[],r=!1){const o=s(a,e),{firstDay:u,lastDay:l,betweenDays:i}=c(n,e);return{"q-past-day":!0!==u&&!0!==i&&!0!==l&&!0!==o&&!0!==t&&e.past,"q-future-day":!0!==u&&!0!==i&&!0!==l&&!0!==o&&!0!==t&&e.future,"q-outside":t,"q-current-day":e.current,"q-selected":o,"q-range-first":!0===u,"q-range":!0===i,"q-range-last":!0===l,"q-range-hover":!0===r&&(!0===u||!0===l||!0===i),"q-disabled-day disabled":!0===e.disabled}}function y(e){return z(e,r.weekdays,a.today)}function m(e){return P(e,r.weekdays,a.today)}function f(e){}return{weekdaySkips:n,parsedStart:o,parsedEnd:u,dayFormatter:l,weekdayFormatter:i,ariaDateFormatter:d,arrayHasDate:s,checkDays:c,getRelativeClasses:v,startOfWeek:y,endOfWeek:m,dayStyleDefault:f}}function qe(e,t){e===window?window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,t):e.scrollTop=t}function Ae(e,t){e===window?window.scrollTo(t,window.pageYOffset||window.scrollY||document.body.scrollTop||0):e.scrollLeft=t}function Me(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function xe(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}function Ee(n,r,o=0){const u=void 0===arguments[3]?performance.now():arguments[3],l=Me(n);o<=0?l!==r&&qe(n,r):requestAnimationFrame(e=>{const t=e-u;const a=l+(r-l)/Math.max(t,o)*t;qe(n,a);a!==r&&Ee(n,r,o-t,e)})}function Ne(n,r,o=0){const u=void 0===arguments[3]?performance.now():arguments[3],l=xe(n);o<=0?l!==r&&Ae(n,r):requestAnimationFrame(e=>{const t=e-u;const a=l+(r-l)/Math.max(t,o)*t;setHorizontalScroll(n,a);a!==r&&Ne(n,r,o-t,e)})}const We={view:{type:String,validator:e=>["day","week","month","month-interval"].includes(e),default:"day"},shortIntervalLabel:Boolean,intervalHeight:{type:[Number,String],default:40,validator:e},intervalMinutes:{type:[Number,String],default:60,validator:e},intervalStart:{type:[Number,String],default:0,validator:e},intervalCount:{type:[Number,String],default:24,validator:e},intervalStyle:{type:Function,default:null},intervalClass:{type:Function,default:null},weekdayStyle:{type:Function,default:null},weekdayClass:{type:Function,default:null},showIntervalLabel:{type:Function,default:null},hour24Format:Boolean,timeClicksClamped:Boolean,dateHeader:{type:String,default:"stacked",validator:e=>["stacked","inline","inverted"].includes(e)}};function nt(o,{weekdaySkips:e,times:t,scrollArea:n,parsedStart:a,parsedEnd:r,maxDays:u,size:l,headerColumnRef:i}){const d=ze.computed(()=>parseInt(o.intervalStart,10)),v=ze.computed(()=>parseInt(o.intervalMinutes,10)),s=ze.computed(()=>parseInt(o.intervalCount,10)),y=ze.computed(()=>parseFloat(o.intervalHeight)),m=ze.computed(()=>{let e=0;o.cellWidth?e=o.cellWidth:l.width>0&&i.value&&(e=i.value.offsetWidth/(o.columnCount>1?o.columnCount:u.value));return e}),c=ze.computed(()=>d.value*v.value),f=ze.computed(()=>s.value*y.value),h=ze.computed(()=>s.value*m.value),p=ze.computed(()=>b(a.value)),w=ze.computed(()=>D(r.value)),g=ze.computed(()=>{return ue(a.value,r.value,t.today,e.value,o.disabledBefore,o.disabledAfter,o.disabledWeekdays,o.disabledDays,u.value)}),k=ze.computed(()=>{return g.value.map(e=>le(e,d.value,v.value,s.value,t.now))});function b(e){return z(e,o.weekdays,t.today)}function D(e){return P(e,o.weekdays,t.today)}function _(e,t){return e&&e.length>0&&e.includes(Qe(t))}function T(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(e&&2===e.length){const n=Ke(t),r=Ke($e(e[0])),o=Ke($e(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function S(e,t=[],a=[]){const n=_(t,e),{firstDay:r,lastDay:o,betweenDays:u}=T(a,e);return{"q-selected":n,"q-range-first":!0===r,"q-range":!0===u,"q-range-last":!0===o,"q-disabled-interval disabled":!0===e.disabled}}function I(e,t=0,a){return[]}const C=ze.computed(()=>{const a={timeZone:"UTC",hour12:!o.hour24Format,hour:"2-digit",minute:"2-digit"};const n={timeZone:"UTC",hour12:!o.hour24Format,hour:"numeric",minute:"2-digit"};const r={timeZone:"UTC",hour12:!o.hour24Format,hour:"numeric"};return j(o.locale,(e,t)=>t?0===e.minute?r:n:a)}),F=ze.computed(()=>{const t={timeZone:"UTC",dateStyle:"full",timeStyle:"short"};return j(o.locale,e=>t)});function q(e){const t=k.value[0][0],a=t.hour===e.hour&&t.minute===e.minute;return!a&&0===e.minute}function A(e){}function M(e){}function O(e,t,a=!1,n=void 0){let r=X(t);const o=e.currentTarget.getBoundingClientRect(),u=e,l=e,i=u.changedTouches||u.touches,d=(i&&i[0]?i[0]:l).clientY,s=(d-o.top)/y.value,c=Math.floor((a?Math.floor(s):s)*v.value);return 0!==c&&(r=K(r,{minute:c})),n&&$(r,n,!0),r}function H(e,t,a=!1,n=void 0){let r=X(t);const o=e.currentTarget.getBoundingClientRect(),u=e,l=e,i=u.changedTouches||u.touches,d=(i&&i[0]?i[0]:l).clientY,s=(d-o.top)/y.value,c=Math.floor((a?Math.floor(s):s)*v.value);return 0!==c&&(r=K(r,{minute:c})),n&&$(r,n,!0),r}function L(e,t,a=!1,n=void 0){let r=X(t);const o=e.currentTarget.getBoundingClientRect(),u=e,l=e,i=u.changedTouches||u.touches,d=(i&&i[0]?i[0]:l).clientX,s=(d-o.left)/m.value,c=Math.floor((a?Math.floor(s):s)*v.value);return 0!==c&&(r=K(r,{minute:c})),n&&$(r,n,!0),r}function R(e,t){const a={timestamp:e};return a.timeStartPos=N,a.timeDurationHeight=x,void 0!==t&&(a.columnIndex=t),a}function B(e,t){const a={timestamp:X(e)};return a.timeStartPosX=W,a.timeDurationWidth=E,void 0!==t&&(a.index=t),a}function U(e,t=0){const a=N(e);return!(!1===a||!n.value)&&(Ee(n.value,a,t),!0)}function V(e,t=0){const a=W(e);return!(!1===a||!n.value)&&(Ne(n.value,a,t),!0)}function x(e){return e/v.value*y.value}function E(e){return e/v.value*m.value}function Y(e){return parseInt(e,10)*v.value/y.value}function Z(e){return parseInt(e,10)*v.value/m.value}function N(e,t=!0){const a=Q(e);if(!1===a)return!1;const n=c.value,r=s.value*v.value,o=(a-n)/r;let u=o*f.value;return t&&(u<0&&(u=0),u>f.value)&&(u=f.value),u}function W(e,t=!0){const a=Q(e);if(!1===a)return!1;const n=c.value,r=s.value*v.value,o=(a-n)/r;let u=o*h.value;return t&&(u<0&&(u=0),u>h.value)&&(u=h.value),u}return{parsedIntervalStart:d,parsedIntervalMinutes:v,parsedIntervalCount:s,parsedIntervalHeight:y,parsedCellWidth:m,parsedStartMinute:c,bodyHeight:f,bodyWidth:h,parsedWeekStart:p,parsedWeekEnd:w,days:g,intervals:k,intervalFormatter:C,ariaDateTimeFormatter:F,arrayHasDateTime:_,checkIntervals:T,getIntervalClasses:S,getResourceClasses:I,showIntervalLabelDefault:q,showResourceLabelDefault:A,styleDefault:M,getTimestampAtEventInterval:O,getTimestampAtEvent:H,getTimestampAtEventX:L,getScopeForSlot:R,getScopeForSlotX:B,scrollToTime:U,scrollToTimeX:V,timeDurationHeight:x,timeDurationWidth:E,heightToMinutes:Y,widthToMinutes:Z,timeStartPos:N,timeStartPosX:W}}const Oe={columnCount:{type:[Number,String],default:0,validator:e},columnIndexStart:{type:[Number,String],default:0,validator:e}},He={maxDays:{type:Number,default:1}},Le={now:{type:String,validator:e=>""===e||W(e),default:""}};function rt(e){const t=ze.reactive({now:Xe("0000-00-00 00:00"),today:Xe("0000-00-00")}),a=ze.computed(()=>e.now?Xe(e.now):o());function n(){t.now.current=t.today.current=!0,t.now.past=t.today.past=!1,t.now.future=t.today.future=!1}function r(){const e=a.value||o();u(e,t.now),l(e,t.now),u(e,t.today)}function o(){return B(new Date)}function u(e,t){e.date!==t.date&&(t.year=e.year,t.month=e.month,t.day=e.day,t.weekday=e.weekday,t.date=e.date)}function l(e,t){e.time!==t.time&&(t.hour=e.hour,t.minute=e.minute,t.time=e.time)}return ze.watch(()=>a,e=>r()),{times:t,parsedNow:a,setCurrent:n,updateCurrent:r,getNow:o,updateDay:u,updateTime:l}}function ot(r,{parsedView:o,parsedValue:u,times:l}){const e=ze.computed(()=>{const e=u.value;let t=r.maxDays;let a=e;let n=e;switch(o.value){case"month":a=S(e),n=I(e),t=d(a.year,a.month);break;case"week":case"week-agenda":case"week-scheduler":a=z(e,r.weekdays,l.today),n=P(a,r.weekdays,l.today),t=r.weekdays.length;break;case"day":case"scheduler":case"agenda":n=re(X(n),w,t>1?t-1:t,r.weekdays),p(n);break;case"month-interval":case"month-scheduler":case"month-agenda":a=S(e),n=I(e),p(n),t=d(a.year,a.month);break;case"resource":t=1,n=re(X(n),w,t,r.weekdays),p(n);break}return{start:a,end:n,maxDays:t}});return{renderValues:e}}const Re=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());let Be,Ue;function Ve(e,a){const t={};for(const n in e){const r=e[n],o=Re("on-"+n);if(void 0===Be)return void console.warn("$listeners has not been set up");if(void 0!==Be.value[o]){const u="on"+r.event.charAt(0).toUpperCase()+r.event.slice(1),l=e=>{const t=e;(void 0===r.button||t.buttons>0&&t.button===r.button)&&(r.prevent&&t.preventDefault(),r.stop&&t.stopPropagation(),Ue(n,a(t,n)));return r.result};u in t?Array.isArray(t[u])?t[u].push(l):t[u]=[t[u],l]:t[u]=l}}return t}function Ye(e,t){return Ve(Ze(e),t)}function Ze(e){return{["click"+e]:{event:"click"},["contextmenu"+e]:{event:"contextmenu",prevent:!0,result:!1},["mousedown"+e]:{event:"mousedown"},["mousemove"+e]:{event:"mousemove"},["mouseup"+e]:{event:"mouseup"},["mouseenter"+e]:{event:"mouseenter"},["mouseleave"+e]:{event:"mouseleave"},["touchstart"+e]:{event:"touchstart"},["touchmove"+e]:{event:"touchmove"},["touchend"+e]:{event:"touchend"}}}function f(e){return Object.keys(Ze(e))}function ut(e,t){return Ue=e,Be=t,{getMouseEventHandlers:Ve,getDefaultMouseEventHandlers:Ye,getMouseEventName:Ze,getRawMouseEvents:f}}const lt=["moved"];function it(l,{parsedView:i,parsedValue:d,weekdaySkips:s,direction:c,maxDays:v,times:y,emittedValue:m,emit:f}){function e(a=1){if(0===a)m.value=Pe();else{let e=X(d.value);const n=a>0,r=n?w:g,o=n?C:h;let t=n?a:-a;c.value=n?"next":"prev";const u=s.value.filter(e=>0!==e).length;while(--t>=0)switch(i.value){case"month":e.day=o,r(e),Y(e);while(0===s.value[e.weekday])e=K(e,{day:!0===n?1:-1});break;case"week":case"week-agenda":case"week-scheduler":k(e,r,u,l.weekdays);break;case"day":case"scheduler":case"agenda":k(e,r,v.value,l.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=o,r(e);break;case"resource":k(e,r,v.value,l.weekdays);break}Y(e),p(e),Z(e),$(e,y.now),m.value=e.date,f("moved",e)}}return{move:e}}const dt=/^on[A-Z]/;function st(e=ze.getCurrentInstance()){return{emitListeners:ze.computed(()=>{const t={};e.vnode&&e.vnode.props&&Object.keys(e.vnode.props).forEach(e=>{dt.test(e)&&(t[e]=!0)});return t})}}function ct(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[ze.h("span",e)]}function vt({focusable:e,focusType:t},a,n){const r=e&&t.includes("date");return ze.h("button",{...a,tabindex:r?0:-1},[n,r&&ct()])}const yt={cellWidth:[Number,String]};function mt(e){const t=ze.computed(()=>void 0!==e.cellWidth);return{isSticky:t}}const ft=["change"];function ht(a,{days:n,lastStart:r,lastEnd:o}){function e(){if(n.value&&n.value.length>0){const e=n.value[0].date,t=n.value[n.value.length-1].date;if(null===r.value||null===o.value||e!==r.value||t!==o.value)return r.value=e,o.value=t,a("change",{start:e,end:t,days:n.value}),!0}return!1}return{checkChange:e}}function pt(){function e(t,{bubbles:a=!1,cancelable:n=!1}={}){try{return new CustomEvent(t,{bubbles:a,cancelable:n})}catch(e){const r=document.createEvent("Event");return r.initEvent(t,a,n),r}}function t(e,t){return[].concat(t).includes(e.keyCode)}return{createEvent:e,isKeyCode:t}}const wt=pt()["isKeyCode"],gt={useNavigation:Boolean};function kt(a,{rootRef:n,focusRef:r,focusValue:o,datesRef:u,parsedView:l,emittedValue:i,weekdaySkips:d,direction:s,times:c}){let e=!1;function t(){!0!==e&&document&&(e=!0,document.addEventListener("keyup",h),document.addEventListener("keydown",f))}function v(){document&&(document.removeEventListener("keyup",h),document.removeEventListener("keydown",f),e=!1)}function y(e){if(void 0!==e&&document){const t=document.activeElement;if(t!==document.body&&!0===n.value.contains(t))return!0}return!1}function m(){let e=0;const t=setInterval(()=>{u.value[r.value]&&(u.value[r.value].focus(),50!==++e)&&document.activeElement!==u.value[r.value]||clearInterval(t)},250)}function f(e){y(e)&&wt(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function h(e){if(y(e)&&wt(e,[33,34,35,36,37,38,39,40]))switch(e.keyCode){case 33:b();break;case 34:D();break;case 35:T();break;case 36:_();break;case 37:g();break;case 38:p();break;case 39:k();break;case 40:w();break}}function p(e){let t=X(o.value);if("month"===l.value){if(t=K(t,{day:-7}),o.value.month!==t.month)return s.value="prev",void(i.value=t.date)}else"day"!==l.value&&"week"!==l.value&&"month-interval"!==l.value||(t=K(t,{minute:parseInt(a.intervalMinutes)}));s.value="prev",r.value=t.date}function w(e){let t=X(o.value);if("month"===l.value){if(t=K(t,{day:7}),o.value.month!==t.month)return s.value="next",void(i.value=t.date)}else"day"!==l.value&&"week"!==l.value&&"month-interval"!==l.value||(t=K(t,{minute:parseInt(a.intervalMinutes)}));s.value="next",r.value=t.date}function g(e){let t=X(o.value);s.value="prev";do{t=K(t,{day:-1})}while(0===d.value[t.weekday]);if("month"===l.value||"month-interval"===l.value){if(o.value.month!==t.month)return void(i.value=t.date)}else if("week"===l.value){if(t.weekday>o.value.weekday)return void(i.value=t.date)}else if("day"===l.value)return void(i.value=t.date);r.value=t.date}function k(e){let t=X(o.value);s.value="next";do{t=K(t,{day:1})}while(0===d.value[t.weekday]);if("month"===l.value||"month-interval"===l.value){if(o.value.month!==t.month)return void(i.value=t.date)}else if("week"===l.value){if(t.weekday<o.value.weekday)return void(i.value=t.date)}else if("day"===l.value)return void(i.value=t.date);r.value=t.date}function b(e){let t=X(o.value);if("month"===l.value||"month-interval"===l.value){t=K(t,{month:-1});const a=t.day<=15?1:-1;while(0===d.value[t.weekday])t=K(t,{day:a})}else"day"===l.value?t=K(t,{day:-1}):"week"===l.value&&(t=K(t,{day:-7}));s.value="prev",r.value=t.date}function D(e){let t=X(o.value);if("month"===l.value||"month-interval"===l.value){t=K(t,{month:1});const a=t.day<=15?1:-1;while(0===d.value[t.weekday])t=K(t,{day:a})}else"day"===l.value?t=K(t,{day:1}):"week"===l.value&&(t=K(t,{day:7}));s.value="next",r.value=t.date}function _(e){let t=X(o.value);"month"===l.value||"month-interval"===l.value?t=S(t):"week"===l.value&&(t=z(t,a.weekdays,c.today));while(0===d.value[t.weekday])t=K(t,{day:-1});r.value=t.date}function T(e){let t=X(o.value);"month"===l.value||"month-interval"===l.value?t=I(t):"week"===l.value&&(t=P(t,a.weekdays,c.today));while(0===d.value[t.weekday])t=K(t,{day:-1});r.value=t.date}return ze.onBeforeUnmount(()=>{v()}),ze.watch(()=>a.useNavigation,e=>{(!0===e?t:v)()}),!0===a.useNavigation&&t(),{startNavigation:t,endNavigation:v,tryFocus:m}}var bt=ze.defineComponent({name:"QCalendarDay",directives:[et],props:{...Fe,...We,...Oe,...He,...Le,...yt,...gt},emits:["update:model-value",...ft,...lt,...f("-date"),...f("-interval"),...f("-head-intervals"),...f("-head-day"),...f("-time")],setup(y,{slots:m,emit:c,expose:O}){const e=ze.ref(null),H=ze.ref(null),L=ze.ref(null),f=ze.ref(null),t=ze.ref(null),h=ze.ref({}),a=ze.ref({}),n=ze.ref({}),u=ze.ref("next"),l=ze.ref(y.modelValue||Pe()),i=ze.ref("0000-00-00"),d=ze.ref(0),p=ze.ref(y.modelValue),s=ze.reactive({width:0,height:0}),w=ze.ref(!1),v=ze.ref(!1),R=ze.ref(null),B=ze.ref(null),r=(ze.watch(()=>y.view,()=>{d.value=0}),ze.computed(()=>{if("month"===y.view)return"month-interval";return y.view})),U=ze.getCurrentInstance();if(null===U)throw new Error("current instance is null");const g=st(U)["emitListeners"],k=mt(y)["isSticky"],{times:b,setCurrent:V,updateCurrent:Y}=rt(y),{weekdaySkips:o,parsedStart:D,parsedEnd:Z,dayFormatter:z,weekdayFormatter:P,ariaDateFormatter:$,dayStyleDefault:X,getRelativeClasses:_}=(Y(),V(),at(y,{startDate:l,endDate:i,times:b})),T=ze.computed(()=>{return Xe(y.modelValue,b.now)||D.value||b.today}),j=(t.value=T.value,f.value=T.value.date,ot(y,{parsedView:r,parsedValue:T,times:b}))["renderValues"],{rootRef:S,scrollWidth:K,__initCalendar:Q,__renderCalendar:J}=tt(y,Ze,{scrollArea:e,pane:H}),{days:I,intervals:G,intervalFormatter:ee,ariaDateTimeFormatter:te,parsedCellWidth:C,getIntervalClasses:ae,showIntervalLabelDefault:ne,styleDefault:re,getTimestampAtEventInterval:oe,getTimestampAtEvent:ue,getScopeForSlot:F,scrollToTime:le,heightToMinutes:ie,timeDurationHeight:de,timeStartPos:se}=nt(y,{weekdaySkips:o,times:b,scrollArea:e,parsedStart:D,parsedEnd:Z,maxDays:d,size:s,headerColumnRef:L}),q=it(y,{parsedView:r,parsedValue:T,weekdaySkips:o,direction:u,maxDays:d,times:b,emittedValue:p,emit:c})["move"],A=ut(c,g)["getDefaultMouseEventHandlers"],ce=ht(c,{days:I,lastStart:R,lastEnd:B})["checkChange"],M=pt()["isKeyCode"],ve=kt(y,{rootRef:S,focusRef:f,focusValue:t,datesRef:h,days:I,parsedView:r,parsedValue:T,emittedValue:p,weekdaySkips:o,direction:u,times:b})["tryFocus"],x=ze.computed(()=>{{if("day"===r.value&&parseInt(y.columnCount,10)>1)return parseInt(y.columnCount,10);if("day"===r.value&&y.maxDays&&y.maxDays>1)return y.maxDays}return I.value.length}),ye=ze.computed(()=>{if(S.value)return parseInt(getComputedStyle(S.value).getPropertyValue("--calendar-intervals-width"),10);return 0}),E=ze.computed(()=>{if(S.value){const e=s.width||S.value.getBoundingClientRect().width;if(e&&ye.value&&x.value)return(e-K.value-ye.value)/x.value+"px"}return 100/x.value+"%"});function me(){p.value=Pe()}function fe(e=1){q(e)}function he(e=1){q(-e)}function pe({width:e,height:t}){s.width=e,s.height=t}function N(e){return e.date===p.value}function we(){return ze.h("div",{roll:"presentation",class:{"q-calendar-day__head":!0,"q-calendar__sticky":!0===k.value},style:{marginRight:K.value+"px"}},[ge(),ke()])}function ge(){const e=m["head-intervals"],t={timestamps:I.value,days:I.value,date:y.modelValue};return ze.h("div",{class:{"q-calendar-day__head--intervals":!0,"q-calendar__sticky":!0===k.value},...A("-head-intervals",e=>{return{scope:t,event:e}})},[e&&e({scope:t})])}function ke(){return ze.h("div",{ref:L,class:{"q-calendar-day__head--days__column":!0}},[be(),De()])}function be(){return ze.h("div",{class:{"q-calendar-day__head--days__weekdays":!0}},[..._e()])}function De(){const e=m["head-days-events"];return ze.nextTick(()=>{if(n.value&&0===parseInt(y.columnCount,10)&&window)try{const e=window.getComputedStyle(n.value);a.value.parentElement.style.height=e.height,a.value.style.height=e.height}catch(e){}}),ze.h("div",{class:{"q-calendar-day__head--days__event":!0}},[e&&ze.h("div",{ref:a,style:{position:"absolute",left:0,top:0,right:0,overflow:"hidden",zIndex:1}},[e({scope:{days:I.value,ref:n}})]),...Te()])}function _e(){return 1===I.value.length&&parseInt(y.columnCount,10)>0?Array.apply(null,new Array(parseInt(y.columnCount,10))).map((e,t)=>t+parseInt(y.columnIndexStart,10)).map(e=>Se(I.value[0],e)):I.value.map(e=>Se(e))}function Te(){return 1===I.value.length&&parseInt(y.columnCount,10)>0?Array.apply(null,new Array(parseInt(y.columnCount,10))).map((e,t)=>t+parseInt(y.columnIndexStart,10)).map(e=>Ce(I.value[0],e)):I.value.map(e=>Ce(e))}function Se(t,e){const a=m["head-day"],n=m["head-date"],r=!0!==y.noActiveDate&&N(t),o=F(t,e),u=(o.activeDate=r,o.droppable=w.value===t.date,o.disabled=!!y.disabledWeekdays&&y.disabledWeekdays.includes(t.weekday),!0===k.value?y.cellWidth:E.value),l=y.weekdayStyle||X,i={width:u,maxWidth:u,minWidth:u,...l({scope:o})},d=(!0===k.value&&(i.minWidth=u),"function"===typeof y.weekdayClass?y.weekdayClass({scope:o}):{}),s=!0===y.focusable&&y.focusType.includes("weekday"),c=t.date+(void 0!==e?"-"+e:""),v={key:c,ref:e=>{h.value[c]=e},tabindex:!0===s?0:-1,class:{"q-calendar-day__head--day":!0,...d,..._(t),"q-active-date":r,"q-calendar__hoverable":!0===y.hoverable,"q-calendar__focusable":!0===s},style:i,onFocus:e=>{!0===s&&(f.value=c)},onKeydown:e=>{!0!==t.disabled&&M(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==t.disabled&&M(e,[13,32])&&(p.value=t.date)},...A("-head-day",e=>{return{scope:o,event:e}}),onDragenter:e=>{void 0!==y.dragEnterFunc&&"function"===typeof y.dragEnterFunc&&(!0===y.dragEnterFunc(e,"head-day",o)?w.value=t.date:w.value="")},onDragover:e=>{void 0!==y.dragOverFunc&&"function"===typeof y.dragOverFunc&&(!0===y.dragOverFunc(e,"head-day",o)?w.value=t.date:w.value="")},onDragleave:e=>{void 0!==y.dragLeaveFunc&&"function"===typeof y.dragLeaveFunc&&(!0===y.dragLeaveFunc(e,"head-day",o)?w.value=t.date:w.value="")},onDrop:e=>{void 0!==y.dropFunc&&"function"===typeof y.dropFunc&&(!0===y.dropFunc(e,"head-day",o)?w.value=t.date:w.value="")}};return ze.h("div",v,[void 0!==a&&a({scope:o}),void 0===a&&Me(t,e),void 0===a&&Ie(t),void 0===a&&n&&n({scope:o}),void 0===a&&xe(t,e),ct()])}function Ie(e){return"stacked"===y.dateHeader?[!0!==y.noDefaultHeaderText&&W(e),!0!==y.noDefaultHeaderBtn&&qe(e)]:"inline"===y.dateHeader?("left"===y.weekdayAlign&&"right"===y.dateAlign||"right"===y.weekdayAlign&&y.dateAlign,ze.h("div",{class:"q-calendar__header--inline"},[!0!==y.noDefaultHeaderText&&W(e),!0!==y.noDefaultHeaderBtn&&qe(e)])):"inverted"===y.dateHeader?("left"===y.weekdayAlign&&"right"===y.dateAlign||"right"===y.weekdayAlign&&y.dateAlign,ze.h("div",{class:"q-calendar__header--inline"},[!0!==y.noDefaultHeaderBtn&&qe(e),!0!==y.noDefaultHeaderText&&W(e)])):void 0}function Ce(e,t){const a=m["head-day-event"],n=!0!==y.noActiveDate&&N(e),r=F(e,t),o=(r.activeDate=n,r.disabled=!!y.disabledWeekdays&&y.disabledWeekdays.includes(e.weekday),!0===k.value?Je(C.value):E.value),u={width:o,maxWidth:o,minWidth:o};return!0===k.value&&(u.minWidth=o),ze.h("div",{key:"event-"+e.date+(void 0!==t?"-"+t:""),class:{"q-calendar-day__head--day__event":!0,..._(e),"q-active-date":n},style:u},[a&&a({scope:r})])}function W(e){const t=m["head-weekday-label"],a=!0===y.shortWeekdayLabel,n=F(e),r=(n.shortWeekdayLabel=y.shortWeekdayLabel,n.disabled=!!y.disabledWeekdays&&y.disabledWeekdays.includes(e.weekday),{class:{"q-calendar-day__head--weekday":!0,["q-calendar__"+y.weekdayAlign]:!0,"q-calendar__ellipsis":!0}});return ze.h("div",r,t&&t({scope:n})||Fe(e,a))}function Fe(e,t){const a=P.value(e,t||y.weekdayBreakpoints[0]>0&&C.value<=y.weekdayBreakpoints[0]);return ze.h("span",{class:"q-calendar-day__head--weekday-label q-calendar__ellipsis"},y.weekdayBreakpoints[1]>0&&C.value<=y.weekdayBreakpoints[1]?Ge(a,y.minWeekdayLabel):a)}function qe(e){const t={class:{"q-calendar-day__head--date":!0,["q-calendar__"+y.dateAlign]:!0}};return ze.h("div",t,Ae(e))}function Ae(a){const e=!0!==y.noActiveDate&&N(a),t=z.value(a,!1),n=m["head-day-label"],r=m["head-day-button"],o={dayLabel:t,timestamp:a,activeDate:e,disabled:!!y.disabledWeekdays&&y.disabledWeekdays.includes(a.weekday)},u={class:{"q-calendar-day__head--day__label":!0,"q-calendar__button":!0,"q-calendar__button--round":"round"===y.dateType,"q-calendar__button--rounded":"rounded"===y.dateType,"q-calendar__button--bordered":!0===a.current,"q-calendar__focusable":!0},disabled:a.disabled,onKeydown:e=>{!0!==a.disabled&&M(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==a.disabled&&M(e,[13,32])&&(p.value=a.date,void 0!==g.value.onClickDate)&&c("click-date",{scope:o})},...A("-date",(e,t)=>{"click-date"!==t&&"contextmenu-date"!==t||(p.value=a.date,"click-date"===t&&e.preventDefault());return{scope:o,event:e}})};return!0!==y.noAria&&(u.ariaLabel=$.value(a)),r?r({scope:o}):vt(y,u,n?n({scope:o}):t)}function Me(e,t){const a=m["column-header-before"];if(a){const n={timestamp:e,columnIndex:t};return ze.h("div",{class:"q-calendar-day__column-header--before"},[a({scope:n})])}}function xe(e,t){const a=m["column-header-after"];if(a){const n={timestamp:e,columnIndex:t};return ze.h("div",{class:"q-calendar-day__column-header--after"},[a({scope:n})])}}function Ee(){return ze.h("div",{class:"q-calendar-day__body"},[Ne()])}function Ne(){return!0===k.value?ze.h("div",{ref:e,class:{"q-calendar-day__scroll-area":!0,"q-calendar__scroll":!0}},[!0!==k.value&&Ue(),Oe()]):!0===y.noScroll?We():ze.h("div",{ref:e,class:{"q-calendar-day__scroll-area":!0,"q-calendar__scroll":!0}},[We()])}function We(){return ze.h("div",{ref:H,class:"q-calendar-day__pane"},[Ue(),Oe()])}function Oe(){const e=m["day-container"];return ze.h("div",{class:"q-calendar-day__day-container"},[!0===k.value&&!0!==y.noHeader&&we(),ze.h("div",{style:{display:"flex",flexDirection:"row"}},[!0===k.value&&Ue(),...He()]),e&&e({scope:{days:I.value}})])}function He(){return 1===I.value.length&&parseInt(y.columnCount,10)>0?Array.apply(null,new Array(parseInt(y.columnCount,10))).map((e,t)=>t+parseInt(y.columnIndexStart,10)).map(e=>Le(I.value[0],0,e)):I.value.map((e,t)=>Le(e,t))}function Le(e,t,a){const n=m["day-body"],r=F(e,a),o=!0===k.value?y.cellWidth:E.value,u={width:o,maxWidth:o,minWidth:o};return!0===k.value&&(u.minWidth=o),ze.h("div",{key:e.date+(void 0!==a?":"+a:""),class:{"q-calendar-day__day":!0,..._(e)},style:u},[...Re(t,a),n&&n({scope:r})])}function Re(e,t){return G.value[e].map(e=>Be(e,t))}function Be(a,n){const e=Je(y.intervalHeight),t=y.intervalStyle||re,r=m["day-interval"],o=F(a,n),u=(o.droppable=v.value===Ke(a),"function"===typeof y.intervalClass?y.intervalClass({scope:o}):{}),l=!0===y.focusable&&y.focusType.includes("interval"),i=Qe(a),d={key:i,tabindex:!0===l?0:-1,class:{"q-calendar-day__day-interval":0===a.minute,"q-calendar-day__day-interval--section":0!==a.minute,...u,...ae(a,y.selectedDates,y.selectedStartEndDates),"q-calendar__hoverable":!0===y.hoverable,"q-calendar__focusable":!0===l},style:{height:e,...t({scope:o})},onDragenter:e=>{void 0!==y.dragEnterFunc&&"function"===typeof y.dragEnterFunc&&(!0===y.dragEnterFunc(e,"interval",o)?v.value=Ke(a):v.value="")},onDragover:e=>{void 0!==y.dragOverFunc&&"function"===typeof y.dragOverFunc&&(!0===y.dragOverFunc(e,"interval",o)?v.value=Ke(a):v.value="")},onDragleave:e=>{void 0!==y.dragLeaveFunc&&"function"===typeof y.dragLeaveFunc&&(!0===y.dragLeaveFunc(e,"interval",o)?v.value=Ke(a):v.value="")},onDrop:e=>{void 0!==y.dropFunc&&"function"===typeof y.dropFunc&&(!0===y.dropFunc(e,"interval",o)?v.value=Ke(a):v.value="")},onKeydown:e=>{M(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{if(M(e,[13,32])){const t=F(a,n);p.value=t.timestamp.date,void 0!==g.value.onClickTime&&c("click-time",{scope:t,event:e})}},...A("-time",e=>{const t=F(oe(e,a,y.timeClicksClamped,b.now),n);return{scope:t,event:e}})},s=(!0!==y.noAria&&(d.ariaLabel=te.value(a)),r?r({scope:o}):void 0);return ze.h("div",d,[s,ct()])}function Ue(){const e={ariaHidden:"true",class:{"q-calendar-day__intervals-column":!0,"q-calendar__ellipsis":!0,"q-calendar__sticky":!0===k.value},...A("-interval",e=>{const t=ue(e,D.value,y.timeClicksClamped,b.now);return{scope:{timestamp:t},event:e}})};return ze.h("div",e,Ve())}function Ve(){return G.value[0].map(e=>Ye(e))}function Ye(e){const t=m["interval-label"],a=Je(y.intervalHeight),n=y.shortIntervalLabel,r=y.showIntervalLabel||ne,o=r(e),u=o?ee.value(e,n):void 0;return ze.h("div",{key:e.time,class:{"q-calendar-day__interval":0===e.minute,"q-calendar-day__interval--section":0!==e.minute},style:{height:a}},[ze.h("div",{class:"q-calendar-day__interval--text q-calendar__overflow-wrap"},[t?t({scope:{timestamp:e,label:u}}):u])])}function Ze(){const{start:e,end:t,maxDays:a}=j.value,n=(l.value===e.date&&i.value===t.date&&d.value===a||(l.value=e.date,i.value=t.date,d.value=a),s.width>0),r=ze.withDirectives(ze.h("div",{key:l.value,class:"q-calendar-day"},[!0===n&&!0!==k.value&&!0!==y.noHeader&&we(),n&&Ee()]),[[et,pe]]);if(!0!==y.animated)return r;{const o="q-calendar--"+("prev"===u.value?y.transitionPrev:y.transitionNext);return ze.h(ze.Transition,{name:o,appear:!0},()=>r)}}return ze.watch([I],ce,{deep:!0,immediate:!0}),ze.watch(()=>y.modelValue,(e,t)=>{if(p.value!==y.modelValue){if(!0===y.animated){const a=je($e(e)),n=je($e(t));u.value=a>=n?"next":"prev"}p.value=e}f.value=e}),ze.watch(p,(e,t)=>{if(p.value!==y.modelValue){if(!0===y.animated){const a=je($e(e)),n=je($e(t));u.value=a>=n?"next":"prev"}c("update:model-value",e)}}),ze.watch(f,e=>{e&&(t.value=Xe(e))}),ze.watch(t,e=>{h.value[f.value]?h.value[f.value].focus():ve()}),ze.watch(()=>y.maxDays,e=>{d.value=e}),ze.onBeforeUpdate(()=>{h.value={};a.value={};n.value={}}),ze.onMounted(()=>{Q()}),O({prev:he,next:fe,move:q,moveToToday:me,updateCurrent:Y,timeStartPos:se,timeDurationHeight:de,heightToMinutes:ie,scrollToTime:le}),()=>J()}});const Dt="4.0.0-beta.19";var _t={version:Dt,QCalendarDay:bt,PARSE_REGEX:a,PARSE_DATE:t,PARSE_TIME:b,DAYS_IN_MONTH:D,DAYS_IN_MONTH_LEAP:_,DAYS_IN_MONTH_MIN:T,DAYS_IN_MONTH_MAX:C,MONTH_MAX:l,MONTH_MIN:n,DAY_MIN:h,DAYS_IN_WEEK:o,MINUTES_IN_HOUR:r,HOURS_IN_DAY:u,FIRST_HOUR:F,MILLISECONDS_IN_MINUTE:q,MILLISECONDS_IN_HOUR:A,MILLISECONDS_IN_DAY:M,MILLISECONDS_IN_WEEK:x,Timestamp:E,TimeObject:N,today:Pe,getStartOfWeek:z,getEndOfWeek:P,getStartOfMonth:S,getEndOfMonth:I,parseTime:Q,validateTimestamp:W,parsed:$e,parseTimestamp:Xe,parseDate:B,getDayIdentifier:je,getTimeIdentifier:i,getDayTimeIdentifier:Ke,diffTimestamp:U,updateRelative:$,updateMinutes:V,updateWeekday:Y,updateDayOfYear:Z,updateWorkWeek:J,updateDisabled:G,updateFormatted:p,getDayOfYear:ee,getWorkWeek:te,getWeekday:ae,isLeapYear:ne,daysInMonth:d,copyTimestamp:X,padNumber:s,getDate:c,getTime:v,getDateTime:Qe,nextDay:w,prevDay:g,moveRelativeDays:re,relativeDays:k,findWeekday:y,getWeekdaySkips:oe,createDayList:ue,createIntervalList:le,createNativeLocaleFormatter:j,makeDate:ie,makeDateTime:de,validateNumber:e,maxTimestamp:se,minTimestamp:ce,isBetweenDates:ve,isOverlappingDates:ye,daysBetween:ke,weeksBetween:be,addToDate:K,compareTimestamps:O,compareDate:H,compareTime:L,compareDateTime:R,getWeekdayFormatter:_e,getWeekdayNames:Te,getMonthFormatter:Se,getMonthNames:Ie,convertToUnit:Je,indexOf:Ce,install(e){e.component(bt.name,bt)}};return _t});