@quasar/quasar-ui-qcalendar
Version:
QCalendar - Day/Month/Week Calendars, Popups, Date Pickers, Schedules, Agendas, Planners and Tasks for your Vue Apps
6 lines • 42.5 kB
JavaScript
/*!
* @quasar/quasar-ui-qcalendar v4.1.2
* (c) 2025 Jeff Galbraith <jeff@quasar.dev>
* 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(Ve){const i=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?(.(\d{1,3}))?$/,y=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?/,f=/(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/,k=[0,31,28,31,30,31,30,31,31,30,31,30,31],b=[0,31,29,31,30,31,30,31,31,30,31,30,31],r={MILLISECONDS_IN:{SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5,WEEK:6048e5},SECONDS_IN:{MINUTE:60,HOUR:3600,DAY:86400,WEEK:604800},MINUTES_IN:{MINUTE:1,HOUR:60,DAY:1440,WEEK:10080},HOURS_IN:{DAY:24,WEEK:168},DAYS_IN:{WEEK:7}},T=28,I=31,N=12,C=1,A=1,F=0;function t(e){return"string"===typeof e&&i.test(e)}function Pe(e){if("string"!==typeof e)return null;const t=i.exec(e);if(!t||!t[1]||!t[2])return null;const a=parseInt(t[1],10),n=parseInt(t[2],10),r=parseInt(t[4]||"1",10),o=parseInt(t[6]||"0",10),u=parseInt(t[8]||"0",10);return{date:e,time:o.toString().padStart(2,"0")+":"+u.toString().padStart(2,"0"),year:a,month:n,day:r,hour:o,minute:u,hasDay:!!t[4],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1,weekday:0,doy:0,workweek:0}}function M(e,t=!1){if(!(e instanceof Date))return null;const a=t?"UTC":"";return w({date:o(e[`get${a}FullYear`](),4)+"-"+o(e[`get${a}Month`]()+1,2)+"-"+o(e[`get${a}Date`](),2),time:o(e[`get${a}Hours`]()||0,2)+":"+o(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 o(e,t){let a=String(e);while(a.length<t)a="0"+a;return a}function E(e){return e%4===0&&e%100!==0||e%400===0}function l(e,t){return(E(e)?b:k)[t]}function h(e){const t=new Date(e.year,e.month-1,e.day+1);return w(oe({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function p(e){const t=new Date(e.year,e.month-1,e.day-1);return w(oe({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function Ze(){const e=new Date,t=e.getMonth()+1,a=e.getDate(),n=e.getFullYear();return[n,o(t,2),o(a,2)].join("-")}function W(e){return e===Ze()}function P(e,t,a){let n=K(e);if(t){if(1===n.day||0===n.weekday)while(!t.includes(Number(n.weekday)))n=h(n);n=v(n,t[0],p),n=w(n),a&&(n=$(n,a,n.hasTime))}return n}function Z(e,t,a){let n=K(e);if(t&&Array.isArray(t)){const r=l(n.year,n.month);if(r===n.day||n.weekday===t[t.length-1])while(!t.includes(Number(n.weekday)))n=p(n);n=v(n,t[t.length-1],h),n=w(n),a&&(n=$(n,a,n.hasTime))}return n}function _(e){let t=K(e);return t.day=A,t=w(t),t}function S(e){let t=K(e);return t.day=l(t.year,t.month),t=w(t),t}function z(e){const t=Object.prototype.toString.call(e);switch(t){case"[object Number]":return e;case"[object String]":{const a=f.exec(e);return a?60*parseInt(a[1],10)+parseInt(a[3]||"0",10):!1}case"[object Object]":return"object"!==typeof e||"number"!==typeof e.hour||"number"!==typeof e.minute?!1:"object"===typeof e&&"hour"in e&&"minute"in e&&60*e.hour+e.minute}return!1}function q(e,t){return!(!e||!t)&&e.year===t.year&&e.month===t.month&&e.day===t.day&&e.hour===t.hour&&e.minute===t.minute}function O(e,t){return s(e)===s(t)}function x(e,t){return c(e)===c(t)}function H(e,t){return je(e)===je(t)}function ze(e,t=null){let a=Pe(e);return a?(a=w(a),t&&(a=$(a,t,a.hasTime)),a):null}function $e(e){return 1e8*(e.year??0)+1e6*(e.month??0)+1e4*(e.day??0)}function d(e){return 100*(e.hour??0)+(e.minute??0)}function Ke(e){return $e(e)+d(e)}function U(e,t,a=!1){const n=Date.UTC(e.year??0,(e.month??1)-1,e.day??1,e.hour??0,e.minute??0),r=Date.UTC(t.year??0,(t.month??1)-1,t.day??1,t.hour??0,t.minute??0);return!0===a&&r<n?0:r-n}function $(e,t,a=!1){let n=K(e),r=$e(t),o=$e(n),u=r===o;return n.hasTime&&a&&u&&(r=d(t),o=d(n),u=r===o),n.past=o<r,n.current=u,n.future=o>r,n.currentWeekday=n.weekday===t.weekday,n}function R(e,t,a=null){let n=K(e);return n.hasTime=!0,n.hour=Math.floor(t/r.MINUTES_IN.HOUR),n.minute=t%r.MINUTES_IN.HOUR,n.time=c(n),a&&(n=$(n,a,!0)),n}function g(e){let t=K(e);return t.weekday=u(t),t}function L(e){let t=K(e);return t.doy=a(t)||0,t}function B(e){let t=K(e);return t.workweek=n(t),t}function Y(e,t,a,n,r){let o=K(e);const u=$e(o);if(void 0!==t){const s=Pe(t);if(s){const c=$e(s);u<=c&&(o.disabled=!0)}}if(!0!==o.disabled&&void 0!==a){const v=Pe(a);if(v){const m=$e(v);u>=m&&(o.disabled=!0)}}if(!0!==o.disabled&&Array.isArray(n)&&n.length>0)for(var i in n)if(n[i]===o.weekday){o.disabled=!0;break}if(!0!==o.disabled&&Array.isArray(r)&&r.length>0)for(var l in r)if(Array.isArray(r[l])&&2===r[l].length&&r[l][0]&&r[l][1]){const y=Pe(r[l][0]),f=Pe(r[l][1]);if(y&&f&&ne(o,y,f)){o.disabled=!0;break}}else{const h=r[l];if(Array.isArray(h))for(var d of h){const p=ze(d);if(p){const g=$e(p);if(g===u){o.disabled=!0;break}}}else if(h){const w=ze(h);if(w){const D=$e(w);D===u&&(o.disabled=!0)}}}return o}function w(e){let t=K(e);return t.hasTime=!0,t.time=c(t),t.date=s(t),t.weekday=u(t),t.doy=a(t)||0,t.workweek=n(t),t}function a(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 n(e){let t=K(e);if(0===t.year){const r=ze(Ze());r&&(t=r)}const a=new Date(Date.UTC(t.year,t.month-1,t.day)),n=4;a.setUTCDate(a.getUTCDate()-(a.getUTCDay()+6)%7+n),a.setUTCDate(a.getUTCDate()+n-(a.getUTCDay()||7));e=new Date(Date.UTC(a.getUTCFullYear(),0,1)),e=Math.ceil(((a.valueOf()-e.valueOf())/864e5+1)/7);return e}function u(e){let t=e.weekday;if(e.hasDay){const a=Math.floor,n=e.day,r=(e.month+9)%N+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??0}function K(e){return{...e}}function s(e){let t=o(e.year,4)+"-"+o(e.month,2);return e.hasDay&&(t+="-"+o(e.day,2)),t}function c(e){return e.hasTime?o(e.hour,2)+":"+o(e.minute,2):""}function je(e){return s(e)+" "+(e.hasTime?c(e):"00:00")}function V(e,t=h,a=1,n=[0,1,2,3,4,5,6]){const r=K(e);return D(r,t,a,n)}function D(e,t=h,a=1,n=[0,1,2,3,4,5,6]){let r=K(e);n.includes(Number(r.weekday))||0!==r.weekday||t!==h||++a;while(--a>=0)r=t(r),n.length<7&&!n.includes(Number(r.weekday))&&++a;return r}function v(e,t,a=h,n=6){let r=K(e);while(r.weekday!==t&&--n>=0)r=a(r);return r}function Q(e,t,a,n=[0,1,2,3,4,5,6],r=void 0,o=void 0,u=[],i=[],l=42,d=0){const s=$e(e),c=$e(t),v=[];let m=K(e),y=0,f=y===c;if(!(c<s))while((!f||v.length<d)&&v.length<l){if(y=$e(m),f=f||y>c&&v.length>=d,f)break;if(n.includes(Number(m.weekday))){let e=K(m);e=w(e),e=$(e,a),e=Y(e,r,o,u,i),v.push(e)}m=D(m,h)}return v}function G(t,a,n,r,o){const u=[];for(let e=0;e<r;++e){const i=(a+e)*n,l=K(t);u.push(R(l,i,o))}return u}function j(n,r){const e=()=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:(t,e)=>{try{const a=new Intl.DateTimeFormat(n||void 0,r(t,e));return a.format(ee(t))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> `+je(t)),""}}}function J(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 ee(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(Number(e))}function te(e,t=!1){const a=!0===t?Ke:$e;return e.reduce((e,t)=>{return Math.max(a(e),a(t))===a(e)?e:t})}function ae(e,t=!1){const a=!0===t?Ke:$e;return e.reduce((e,t)=>{return Math.min(a(e),a(t))===a(e)?e:t})}function ne(e,t,a,n=!1){const r=$e(e)+(!0===n?d(e):0),o=$e(t)+(!0===n?d(t):0),u=$e(a)+(!0===n?d(a):0);return r>=o&&r<=u}function re(e,t,a,n){const r=$e(e),o=$e(t),u=$e(a),i=$e(n);return r>=u&&r<=i||o>=u&&o<=i||u>=r&&o>=i}function X(e,t){const a=K(e);return t.year&&(a.year+=t.year),t.month&&(a.month+=t.month),t.day&&(a.day+=t.day),t.hour&&(a.hour+=t.hour),t.minute&&(a.minute+=t.minute),w(oe(a))}function oe(e){const t=new Date(e.year,e.month-1,e.day,e.hour,e.minute);return{...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes()}}function ue(e,t){const a=U(e,t,!0);return Math.floor(a/r.MILLISECONDS_IN.DAY)}function ie(e,t){let a=K(e),n=K(t);return a=v(a,0),n=v(n,6),Math.ceil(ue(a,n)/r.DAYS_IN.WEEK)}const le={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 de(){const e=()=>"",r={long:{timeZone:"UTC",weekday:"long"},short:{timeZone:"UTC",weekday:"short"},narrow:{timeZone:"UTC",weekday:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,r[e]||r["long"]);return n.format(le[t])}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+t),""}}}function se(t,a){const e=Object.keys(le),n=de();return e.map(e=>String(n(e,t,a)))}function ce(){const e=()=>"",o={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,o[e]||o["long"]),r=new Date;return r.setDate(1),r.setMonth(t),n.format(r)}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> month: `+t),""}}}function ve(t,a){const n=ce();return[...Array(12).keys()].map(e=>n(e,t,a))}var me={PARSE_DATETIME:i,PARSE_DATE:y,PARSE_TIME:f,DAYS_IN_MONTH:k,DAYS_IN_MONTH_LEAP:b,DAYS_IN_MONTH_MIN:T,DAYS_IN_MONTH_MAX:I,MONTH_MAX:N,MONTH_MIN:C,DAY_MIN:A,TIME_CONSTANTS:r,FIRST_HOUR:F,today:Ze,getStartOfWeek:P,getEndOfWeek:Z,getStartOfMonth:_,getEndOfMonth:S,parseTime:z,validateTimestamp:t,parsed:Pe,parseTimestamp:ze,parseDate:M,getDayIdentifier:$e,getTimeIdentifier:d,getDayTimeIdentifier:Ke,diffTimestamp:U,updateRelative:$,updateMinutes:R,updateWeekday:g,updateDayOfYear:L,updateWorkWeek:B,updateDisabled:Y,updateFormatted:w,getDayOfYear:a,getWorkWeek:n,getWeekday:u,isLeapYear:E,daysInMonth:l,copyTimestamp:K,padNumber:o,getDate:s,getTime:c,getDateTime:je,nextDay:h,prevDay:p,relativeDays:D,findWeekday:v,createDayList:Q,createIntervalList:G,createNativeLocaleFormatter:j,makeDate:J,makeDateTime:ee,validateNumber:e,isBetweenDates:ne,isOverlappingDates:re,daysBetween:ue,weeksBetween:ie,addToDate:X,compareTimestamps:q,compareDate:O,compareTime:x,compareDateTime:H,getWeekdayFormatter:de,getWeekdayNames:se,getMonthFormatter:ce,getMonthNames:ve},me=Object.freeze({__proto__:null,DAYS_IN_MONTH:k,DAYS_IN_MONTH_LEAP:b,DAYS_IN_MONTH_MAX:I,DAYS_IN_MONTH_MIN:T,DAY_MIN:A,FIRST_HOUR:F,MONTH_MAX:N,MONTH_MIN:C,PARSE_DATE:y,PARSE_DATETIME:i,PARSE_TIME:f,TIME_CONSTANTS:r,addToDate:X,compareDate:O,compareDateTime:H,compareTime:x,compareTimestamps:q,copyTimestamp:K,createDayList:Q,createIntervalList:G,createNativeLocaleFormatter:j,daysBetween:ue,daysInMonth:l,default:me,diffTimestamp:U,findWeekday:v,getDate:s,getDateTime:je,getDayIdentifier:$e,getDayOfYear:a,getDayTimeIdentifier:Ke,getEndOfMonth:S,getEndOfWeek:Z,getMonthFormatter:ce,getMonthNames:ve,getStartOfMonth:_,getStartOfWeek:P,getTime:c,getTimeIdentifier:d,getWeekday:u,getWeekdayFormatter:de,getWeekdayNames:se,getWorkWeek:n,isBetweenDates:ne,isLeapYear:E,isOverlappingDates:re,isToday:W,makeDate:J,makeDateTime:ee,maxTimestamp:te,minTimestamp:ae,moveRelativeDays:V,nextDay:h,padNumber:o,parseDate:M,parseTime:z,parseTimestamp:ze,parsed:Pe,prevDay:p,relativeDays:D,today:Ze,updateDayOfYear:L,updateDisabled:Y,updateFormatted:w,updateMinutes:R,updateRelative:$,updateWeekday:g,updateWorkWeek:B,validateNumber:e,validateTimestamp:t,weeksBetween:ie});function Xe(e,t="px"){if(e)return isNaN(e)?String(e):"auto"===e?e:""+Number(e)+t}function ye(t,a){for(let e=0;e<t.length;e++)if(!0===a(t[e],e))return e;return-1}function Qe(e,t){return 0===t?e:e.slice(0,t)}var fe={convertToUnit:Xe,indexOf:ye,minCharWidth:Qe},fe=Object.freeze({__proto__:null,convertToUnit:Xe,default:fe,indexOf:ye,minCharWidth:Qe});const Ge={mounted(e,t){if("function"===typeof t.value){const a=t.value,n={callback:a,size:{width:0,height:0},observer:new ResizeObserver(e=>{const t=e[0].contentRect;t.width===n.size.width&&t.height===n.size.height||(n.size.width=t.width,n.size.height=t.height,n.debounceTimeout&&clearTimeout(n.debounceTimeout),n.debounceTimeout=setTimeout(()=>{n.callback(n.size),n.debounceTimeout=void 0},100))})};n.observer.observe(e),e.__onResizeObserver=n}},beforeUnmount(e){if(e.__onResizeObserver){const{observer:t,debounceTimeout:a}=e.__onResizeObserver;a&&clearTimeout(a),t.unobserve(e),delete e.__onResizeObserver}}};function Je(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=Ve.reactive({width:0,height:0}),o=Ve.ref(null);function u({width:e,height:t}){r.width=e,r.height=t}const i=Ve.computed(()=>{return!0!==t.noScroll&&e.value&&n.value&&r.height?e.value.offsetWidth-n.value.offsetWidth:0});function l(){}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 Ve.withDirectives(Ve.h("div",{...e},[a()]),[[Ge,u]])}return{rootRef:o,scrollWidth:i,__initCalendar:l,__renderCalendar:d}}const he=e=>e.every(e=>["day","date","weekday","interval","time","resource","task"].includes(e)),pe={modelValue:{type:String,default:Ze(),validator:e=>""===e||t(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:Function,dragOverFunc:Function,dragLeaveFunc:Function,dropFunc:Function,selectedDates:{type:[Array,Set],default:()=>[]},selectedStartEndDates:{type:Array,default:()=>[]},hoverable:Boolean,focusable:Boolean,focusType:{type:Array,default:()=>["date"],validator:he}};function et(t,{startDate:e,endDate:a,times:n}){const r=Ve.computed(()=>ze(e.value)),o=Ve.computed(()=>{return"0000-00-00"===a.value?Z(r.value,t.weekdays,n.today):ze(a.value)||r.value}),u=Ve.computed(()=>j(t.locale,()=>({timeZone:"UTC",day:"numeric"}))),i=Ve.computed(()=>j(t.locale,(e,t)=>({timeZone:"UTC",weekday:t?"short":"long"}))),l=Ve.computed(()=>j(t.locale,()=>({timeZone:"UTC",dateStyle:"full"})));function d(e,t){return e&&e.length>0&&e.includes(t.date)}function s(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(2===e.length){const n=$e(t),r=$e(Pe(e[0])),o=$e(Pe(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function c(e,t=!1,a=[],n=[],r=!1){const o=d(a,e),{firstDay:u,lastDay:i,betweenDays:l}=s(n,e);return{"q-past-day":!u&&!l&&!i&&!o&&!t&&!!e.past,"q-future-day":!u&&!l&&!i&&!o&&!t&&!!e.future,"q-outside":t,"q-current-day":!!e.current,"q-selected":o,"q-range-first":u,"q-range":l,"q-range-last":i,"q-range-hover":r&&(u||i||l),"q-disabled-day disabled":!0===e.disabled}}function v(e){return P(e,t.weekdays,n.today)}function m(e){return Z(e,t.weekdays,n.today)}function y(){return{}}return{parsedStart:r,parsedEnd:o,dayFormatter:u,weekdayFormatter:i,ariaDateFormatter:l,arrayHasDate:d,checkDays:s,getRelativeClasses:c,startOfWeek:v,endOfWeek:m,dayStyleDefault:y}}function ge(e,t){e instanceof Window?e.scrollTo({top:t,behavior:"instant"}):e.scrollTop=t}function we(e){return e instanceof Window?e.scrollY:e.scrollTop}function De(o,u,i=500,l=performance.now(),d=we(o)){i<=0||d===u?ge(o,u):requestAnimationFrame(e=>{const t=e-l,a=Math.min(t/i,1),n=e=>e<.5?2*e*e:(4-2*e)*e-1,r=d+(u-d)*n(a);ge(o,r),a<1&&De(o,u,i,l,d)})}function ke(r,e,o=500){const u=r.scrollLeft,i=e-u;let l=null;function d(e){null===l&&(l=e);const t=e-l,a=Math.min(t/o,1),n=e=>e<.5?2*e*e:(4-2*e)*e-1;r.scrollLeft=u+i*n(a),t<o&&requestAnimationFrame(d)}requestAnimationFrame(d)}const be={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 tt(o,{times:t,scrollArea:n,parsedStart:e,parsedEnd:a,maxDays:r,size:u,headerColumnRef:i}){const l=Ve.computed(()=>parseInt(String(o.intervalStart),10)),v=Ve.computed(()=>parseInt(String(o.intervalMinutes),10)),d=Ve.computed(()=>parseInt(String(o.intervalCount),10)),m=Ve.computed(()=>parseFloat(String(o.intervalHeight))),y=Ve.computed(()=>{let e=0;const t=Number(o.columnCount);return o.cellWidth?e=Number(o.cellWidth):u.width>0&&i.value&&(e=i.value.offsetWidth/(t>1?t:r.value)),e}),s=Ve.computed(()=>l.value*v.value),c=Ve.computed(()=>d.value*m.value),f=Ve.computed(()=>d.value*y.value),h=Ve.computed(()=>D(e.value)),p=Ve.computed(()=>k(a.value)),g=Ve.computed(()=>{return Q(e.value,a.value,t.today,o.weekdays,o.disabledBefore,o.disabledAfter,o.disabledWeekdays,o.disabledDays,r.value)}),w=Ve.computed(()=>{return g.value.map(e=>G(e,l.value,v.value,d.value,t.now))});function D(e){return P(e,o.weekdays,t.today)}function k(e){return Z(e,o.weekdays,t.today)}function b(e,t){return e&&e.length>0&&e.includes(je(t))}function T(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(e&&2===e.length){const n=Ke(t),r=Ke(Pe(e[0])),o=Ke(Pe(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function _(e,t=[],a=[]){const n=b(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 S(e,t,a){return[]}const I=Ve.computed(()=>{const a={timeZone:"UTC",hour12:!o.hour24Format,hour:"2-digit",minute:"2-digit"},n={timeZone:"UTC",hour12:!o.hour24Format,hour:"numeric",minute:"2-digit"},r={timeZone:"UTC",hour12:!o.hour24Format,hour:"numeric"};return j(o.locale,(e,t)=>t?0===e.minute?r:n:a)}),N=Ve.computed(()=>{const e={timeZone:"UTC",dateStyle:"full",timeStyle:"short"};return j(o.locale,()=>e)});function C(e){const t=w.value[0][0],a=t.hour===e.hour&&t.minute===e.minute;return!a&&0===e.minute}function A(e){}function F(e){return{}}function M(e,t,a=!1,n){let r=K(t);if(e.currentTarget){const o=e.currentTarget.getBoundingClientRect(),u=e,i=e,l=u.changedTouches||u.touches,d=(l&&l[0]?l[0]:i).clientY,s=(d-o.top)/m.value,c=Math.floor((a?Math.floor(s):s)*v.value);0!==c&&(r=X(r,{minute:c})),n&&(r=$(r,n,!0))}return r}function x(e,t,a=!1,n){let r=K(t);const o=e.currentTarget.getBoundingClientRect(),u=e,i=e,l=u.changedTouches||u.touches,d=(l&&l[0]?l[0]:i).clientY,s=(d-o.top)/m.value,c=Math.floor((a?Math.floor(s):s)*v.value);return 0!==c&&(r=X(r,{minute:c})),n&&(r=$(r,n,!0)),r}function H(e,t,a=!1,n){let r=K(t);if(e.currentTarget){const o=e.currentTarget.getBoundingClientRect(),u=e,i=e,l=u.changedTouches||u.touches,d=(l&&l[0]?l[0]:i).clientX,s=(d-o.left)/y.value,c=Math.floor((a?Math.floor(s):s)*v.value);0!==c&&(r=X(r,{minute:c})),n&&(r=$(r,n,!0))}return r}function U(e,t){const a={timestamp:e,timeStartPos:q,timeDurationHeight:E};return void 0!==t&&(a.columnIndex=t),a}function R(e,t){const a={timestamp:K(e),timeStartPosX:O,timeDurationWidth:W};return void 0!==t&&(a.index=t),a}function L(e,t=0){const a=q(e);return!(!1===a||!n.value)&&(De(n.value,a,t),!0)}function B(e,t=0){const a=O(e);return!(!1===a||!n.value)&&(ke(n.value,a,t),!0)}function E(e){return e/v.value*m.value}function W(e){return e/v.value*y.value}function Y(e){return e*v.value/m.value}function V(e){return e*v.value/y.value}function q(e,t=!0){const a=z(e);if(!1===a)return!1;const n=s.value,r=d.value*v.value,o=(a-n)/r;let u=o*c.value;return t&&(u<0&&(u=0),u>c.value)&&(u=c.value),u}function O(e,t=!0){const a=z(e);if(!1===a)return!1;const n=s.value,r=d.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}return{parsedIntervalStart:l,parsedIntervalMinutes:v,parsedIntervalCount:d,parsedIntervalHeight:m,parsedCellWidth:y,parsedStartMinute:s,bodyHeight:c,bodyWidth:f,parsedWeekStart:h,parsedWeekEnd:p,days:g,intervals:w,intervalFormatter:I,ariaDateTimeFormatter:N,arrayHasDateTime:b,checkIntervals:T,getIntervalClasses:_,getResourceClasses:S,showIntervalLabelDefault:C,showResourceLabelDefault:A,styleDefault:F,getTimestampAtEventInterval:M,getTimestampAtEvent:x,getTimestampAtEventX:H,getScopeForSlot:U,getScopeForSlotX:R,scrollToTime:L,scrollToTimeX:B,timeDurationHeight:E,timeDurationWidth:W,heightToMinutes:Y,widthToMinutes:V,timeStartPos:q,timeStartPosX:O}}const Te={columnCount:{type:[Number,String],default:0,validator:e},columnIndexStart:{type:[Number,String],default:0,validator:e}},_e={maxDays:{type:Number,default:1}},Se={now:{type:String,validator:e=>""===e||t(e),default:""}};function at(e){const t=Ve.reactive({now:ze("0000-00-00 00:00"),today:ze("0000-00-00")}),a=Ve.computed(()=>e.now?ze(e.now):o());function n(){t.now&&t.today&&(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),i(e,t.now),u(e,t.today)}function o(){return M(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 i(e,t){e.time!==t.time&&(t.hour=e.hour,t.minute=e.minute,t.time=e.time)}return Ve.watch(a,()=>r()),{times:t,parsedNow:a,setCurrent:n,updateCurrent:r,getNow:o,updateDay:u,updateTime:i}}function nt(r,{parsedView:o,parsedValue:u,times:i}){const e=Ve.computed(()=>{const e=u.value;let t=r.maxDays,a=e,n=e;switch(o.value){case"month":a=_(e),n=S(e),t=l(a.year,a.month);break;case"week":case"week-agenda":case"week-scheduler":a=P(e,r.weekdays,i.today),n=Z(a,r.weekdays,i.today),t=r.weekdays.length;break;case"day":case"scheduler":case"agenda":n=V(K(n),h,t>1?t-1:t,r.weekdays),n=w(n);break;case"month-interval":case"month-scheduler":case"month-agenda":a=_(e),n=S(e),n=w(n),t=l(a.year,a.month);break;case"resource":t=1,n=V(K(n),h,t,r.weekdays),n=w(n);break}return{start:a,end:n,maxDays:t}});return{renderValues:e}}const Ie=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());function Ne(t,e,a,n){const r={};for(const o in a){const u=a[o],i=Ie("on-"+o);if(!e.value)return console.warn("$listeners has not been set up"),{};if(void 0!==e.value[i]){const l="on"+u.event.charAt(0).toUpperCase()+u.event.slice(1),d=e=>{return(void 0===u.button||"buttons"in e&&e.buttons>0&&e.button===u.button)&&(u.prevent&&e.preventDefault(),u.stop&&e.stopPropagation(),t(o,n(e,o))),u.result};l in r?Array.isArray(r[l])?r[l].push(d):r[l]=[r[l],d]:r[l]=d}}return r}function Ce(e,t,a,n){return Ne(e,t,Ae(a),n)}function Ae(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 m(e){return Object.keys(Ae(e))}function rt(a,n){return{getMouseEventHandlers:(e,t)=>Ne(a,n,e,t),getDefaultMouseEventHandlers:(e,t)=>Ce(a,n,e,t),getMouseEventName:Ae,getRawMouseEvents:m}}const Fe=["moved"];function ot(l,{parsedView:d,parsedValue:s,direction:c,maxDays:v,times:m,emittedValue:y,emit:f}){function e(a=1){if(0===a)y.value=Ze();else{let e=K(s.value);const n=S(e),r=a>0,o=r?h:p,u=r?n.day:1;let t=r?a:-a;c.value=r?"next":"prev";const i=l.weekdays.length;while(--t>=0)switch(d.value){case"month":e.day=u,e=o(e),e=g(e);while(!l.weekdays.includes(Number(e.weekday)))e=X(e,{day:r?1:-1});break;case"week":case"week-agenda":case"week-scheduler":e=D(e,o,i,l.weekdays);break;case"day":case"scheduler":case"agenda":e=D(e,o,v.value,l.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=u,e=o(e);break;case"resource":e=D(e,o,v.value,l.weekdays);break}e=g(e),e=w(e),e=L(e),e=$(e,m.now),y.value=e.date,f("moved",e)}}return{move:e}}const Me=/^on[A-Z]/;function ut(e=Ve.getCurrentInstance()){return{emitListeners:Ve.computed(()=>{const t={};return e?.vnode?.props&&Object.keys(e.vnode.props).forEach(e=>{Me.test(e)&&(t[e]=!0)}),t})}}function it(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[Ve.h("span",e)]}function Ee(){function e({focusable:e,focusType:t},a,n){const r=e&&t.includes("date");return Ve.h("button",{...a,tabindex:r?0:-1},[n,r&&it()])}return{renderButton:e}}const We={cellWidth:[Number,String]};function lt(e){const t=Ve.computed(()=>void 0!==e.cellWidth);return{isSticky:t}}const qe=["change"];function dt(n,{days:r,lastStart:o,lastEnd:u}){function e(){const e=r.value;if(0===e.length)return!1;const t=e[0].date,a=e[e.length-1].date;return(!o.value||!u.value||t!==o.value||a!==u.value)&&(o.value=t,u.value=a,n("change",{start:t,end:a,days:e}),!0)}return{checkChange:e}}function st(){function e(e,t){return(Array.isArray(t)?t:[t]).includes(e.keyCode)}return{isKeyCode:e}}const Oe=st().isKeyCode,xe={useNavigation:Boolean};function ct(t,{rootRef:a,focusRef:n,focusValue:r,datesRef:o,parsedView:u,emittedValue:i,direction:l,times:d}){let e=!1;function s(){e||document&&(e=!0,document.addEventListener("keyup",f),document.addEventListener("keydown",y))}function c(){document&&(document.removeEventListener("keyup",f),document.removeEventListener("keydown",y),e=!1)}function v(e){if(e&&document){const t=document.activeElement;if(t!==document.body&&a.value?.contains(t))return!0}return!1}function m(){let t=0;const a=window.setInterval(()=>{const e=o.value[n.value];e&&(e.focus(),50!==++t)&&document.activeElement!==e||window.clearInterval(a)},250)}function y(e){v(e)&&Oe(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function f(e){if(v(e)&&Oe(e,[33,34,35,36,37,38,39,40])){const t={33:D,34:k,35:T,36:b,37:g,38:h,39:w,40:p};t[e.keyCode]?.()}}function h(){let e=K(r.value);if("month"===u.value){if(e=X(e,{day:-7}),r.value.month!==e.month)return l.value="prev",void(i.value=e.date)}else e=X(e,{minute:Number(t.intervalMinutes)});l.value="prev",n.value=e.date}function p(){let e=K(r.value);if("month"===u.value){if(e=X(e,{day:7}),r.value.month!==e.month)return l.value="next",void(i.value=e.date)}else e=X(e,{minute:Number(t.intervalMinutes)});l.value="next",n.value=e.date}function g(){let e=K(r.value);l.value="prev";do{e=X(e,{day:-1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function w(){let e=K(r.value);l.value="next";do{e=X(e,{day:1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function D(){let e=K(r.value);e="month"===u.value?X(e,{month:-1}):X(e,{day:-7}),l.value="prev",n.value=e.date}function k(){let e=K(r.value);e="month"===u.value?X(e,{month:1}):X(e,{day:7}),l.value="next",n.value=e.date}function b(){let e=K(r.value);e="month"===u.value?_(e):P(e,t.weekdays||[],d.today);while(!t.weekdays.includes(Number(e.weekday)))e=X(e,{day:-1});n.value=e.date}function T(){let e=K(r.value);e="month"===u.value?S(e):Z(e,t.weekdays||[],d.today);while(!t.weekdays.includes(Number(e.weekday)))e=X(e,{day:-1});n.value=e.date}return Ve.onBeforeUnmount(()=>{c()}),Ve.watch(()=>t.useNavigation,e=>{(!0===e?s:c)()}),!0===t.useNavigation&&s(),{startNavigation:s,endNavigation:c,tryFocus:m}}const vt=Ee().renderButton;var He=Ve.defineComponent({name:"QCalendarDay",directives:{ResizeObserver:Ge},props:{...pe,...be,...Te,..._e,...Se,...We,...xe},emits:["update:model-value",...qe,...Fe,...m("-date"),...m("-interval"),...m("-head-intervals"),...m("-head-day"),...m("-time")],setup(m,{slots:y,emit:v,expose:x}){const e=Ve.ref(null),H=Ve.ref(null),U=Ve.ref(null),f=Ve.ref(m.modelValue||Ze()),t=Ve.ref(Pe(m.modelValue||Ze())),h=Ve.ref({}),a=Ve.ref(),n=Ve.ref(),u=Ve.ref("next"),i=Ve.ref(m.modelValue||Ze()),l=Ve.ref("0000-00-00"),d=Ve.ref(0),p=Ve.ref(m.modelValue||Ze()),s=Ve.reactive({width:0,height:0}),g=Ve.ref(""),w=Ve.ref(0),R=Ve.ref(null),L=Ve.ref(null),r=(Ve.watch(()=>m.view,()=>{d.value=0}),Ve.computed(()=>{return"month"===m.view?"month-interval":m.view})),B=Ve.getCurrentInstance();if(null===B)throw new Error("current instance is null");const D=ut(B).emitListeners,k=lt(m).isSticky,{times:b,setCurrent:Y,updateCurrent:V}=at(m),{parsedStart:o,parsedEnd:P,dayFormatter:Z,weekdayFormatter:z,ariaDateFormatter:$,dayStyleDefault:K,getRelativeClasses:T}=(V(),Y(),et(m,{startDate:i,endDate:l,times:b})),c=Ve.computed(()=>{return ze(m.modelValue,b.now)||o.value||b.today}),j=(t.value=c.value,f.value=c.value.date,nt(m,{parsedView:r,parsedValue:c,times:b})).renderValues,{rootRef:_,scrollWidth:X,__renderCalendar:Q}=Je(m,Ye,{scrollArea:e,pane:H}),{days:S,intervals:G,intervalFormatter:J,ariaDateTimeFormatter:ee,parsedCellWidth:I,getIntervalClasses:te,showIntervalLabelDefault:ae,styleDefault:ne,getTimestampAtEventInterval:re,getTimestampAtEvent:oe,getScopeForSlot:N,scrollToTime:ue,heightToMinutes:ie,timeDurationHeight:le,timeStartPos:de}=tt(m,{times:b,scrollArea:e,parsedStart:o,parsedEnd:P,maxDays:d,size:s,headerColumnRef:U}),C=ot(m,{parsedView:r,parsedValue:c,direction:u,maxDays:d,times:b,emittedValue:p,emit:v}).move,A=rt(v,D).getDefaultMouseEventHandlers,se=dt(v,{days:S,lastStart:R,lastEnd:L}).checkChange,F=st().isKeyCode,ce=ct(m,{rootRef:_,focusRef:f,focusValue:t,datesRef:h,parsedView:r,emittedValue:p,direction:u,times:b}).tryFocus,M=Ve.computed(()=>{const e=parseInt(String(m.columnCount),10);return"day"===r.value&&e>1?e:"day"===r.value&&m.maxDays&&m.maxDays>1?m.maxDays:S.value.length}),ve=Ve.computed(()=>{return _.value?parseInt(window.getComputedStyle(_.value).getPropertyValue("--calendar-intervals-width"),10):0}),E=Ve.computed(()=>{if(_.value){const e=s.width||_.value.getBoundingClientRect().width;if(e&&ve.value&&M.value)return(e-X.value-ve.value)/M.value+"px"}return 100/M.value+"%"});function me(){p.value=Ze()}function ye(e=1){C(e)}function fe(e=1){C(-e)}function he({width:e,height:t}){s.width=e,s.height=t}function W(e){return e.date===p.value}function pe(){return Ve.h("div",{roll:"presentation",class:{"q-calendar-day__head":!0,"q-calendar__sticky":!0===k.value},style:{marginRight:X.value+"px"}},[ge(),we()])}function ge(){const e=y["head-intervals"],t={timestamps:S.value,days:S.value,date:m.modelValue};return Ve.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 we(){return Ve.h("div",{ref:U,class:{"q-calendar-day__head--days__column":!0}},[De(),ke()])}function De(){return Ve.h("div",{class:{"q-calendar-day__head--days__weekdays":!0}},[...be()])}function ke(){const e=y["head-days-events"],t=parseInt(String(m.columnCount),10);return Ve.nextTick(()=>{if(n.value&&0===t&&window)try{const e=window.getComputedStyle(n.value);a.value&&a.value.parentElement&&(a.value.parentElement.style.height=e.height,a.value.style.height=e.height)}catch{}}),Ve.h("div",{class:{"q-calendar-day__head--days__event":!0}},[e&&Ve.h("div",{ref:a,style:{position:"absolute",left:0,top:0,right:0,overflow:"hidden",zIndex:1}},[e({scope:{days:S.value,ref:n}})]),...Te()])}function be(){const e=parseInt(String(m.columnCount),10),a=parseInt(String(m.columnIndexStart),10);return 1===S.value.length&&e>0?Array.apply(null,new Array(e)).map((e,t)=>t+a).map(e=>_e(S.value[0],e)):S.value.map(e=>_e(e,0))}function Te(){const e=parseInt(String(m.columnCount),10),a=parseInt(String(m.columnIndexStart),10);return 1===S.value.length&&e>0?Array.apply(null,new Array(e)).map((e,t)=>t+a).map(e=>Ie(S.value[0],e)).filter(e=>void 0!==e):S.value.map(e=>Ie(e,0)).filter(e=>void 0!==e)}function _e(t,e){const a=y["head-day"],n=y["head-date"],r=!0!==m.noActiveDate&&W(t),o=N(t,e),u=(o.activeDate=r,o.droppable=g.value===t.date,o.disabled=!!m.disabledWeekdays&&m.disabledWeekdays.includes(Number(t.weekday)),!0===k.value?m.cellWidth:E.value),i=m.weekdayStyle||K,l={width:u,maxWidth:u,minWidth:u,...i({scope:o})},d=(!0===k.value&&(l.minWidth=u),"function"===typeof m.weekdayClass?m.weekdayClass({scope:o}):{}),s=!0===m.focusable&&m.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(t),"q-active-date":r,"q-calendar__hoverable":!0===m.hoverable,"q-calendar__focusable":!0===s},style:l,onFocus:()=>{!0===s&&(f.value=c)},onKeydown:e=>{!0!==t.disabled&&F(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==t.disabled&&F(e,[13,32])&&(p.value=t.date)},...A("-head-day",e=>{return{scope:o,event:e}}),onDragenter:e=>{void 0!==m.dragEnterFunc&&"function"===typeof m.dragEnterFunc&&(!0===m.dragEnterFunc(e,"head-day",{scope:o})?g.value=t.date:g.value="")},onDragover:e=>{void 0!==m.dragOverFunc&&"function"===typeof m.dragOverFunc&&(!0===m.dragOverFunc(e,"head-day",{scope:o})?g.value=t.date:g.value="")},onDragleave:e=>{void 0!==m.dragLeaveFunc&&"function"===typeof m.dragLeaveFunc&&(!0===m.dragLeaveFunc(e,"head-day",{scope:o})?g.value=t.date:g.value="")},onDrop:e=>{void 0!==m.dropFunc&&"function"===typeof m.dropFunc&&(!0===m.dropFunc(e,"head-day",{scope:o})?g.value=t.date:g.value="")}};return Ve.h("div",v,[void 0!==a&&a({scope:o}),void 0===a&&Ae(t,e),void 0===a&&Se(t),void 0===a&&n&&n({scope:o}),void 0===a&&Fe(t,e),it()])}function Se(e){return"stacked"===m.dateHeader?[!0!==m.noDefaultHeaderText?q(e):[],!0!==m.noDefaultHeaderBtn?O(e):[]].filter(e=>void 0!==e):"inline"===m.dateHeader?("left"===m.weekdayAlign&&"right"===m.dateAlign||"right"===m.weekdayAlign&&m.dateAlign,Ve.h("div",{class:"q-calendar__header--inline"},[!0!==m.noDefaultHeaderText&&q(e),!0!==m.noDefaultHeaderBtn&&O(e)])):"inverted"===m.dateHeader?("left"===m.weekdayAlign&&"right"===m.dateAlign||"right"===m.weekdayAlign&&m.dateAlign,Ve.h("div",{class:"q-calendar__header--inline"},[!0!==m.noDefaultHeaderBtn&&O(e),!0!==m.noDefaultHeaderText&&q(e)])):void 0}function Ie(e,t){const a=y["head-day-event"],n=!0!==m.noActiveDate&&W(e),r=N(e,t),o=(r.activeDate=n,r.disabled=!!m.disabledWeekdays&&m.disabledWeekdays.includes(Number(e.weekday)),!0===k.value?Xe(I.value):E.value),u={width:o,maxWidth:o,minWidth:o};return!0===k.value&&(u.minWidth=o),Ve.h("div",{key:"event-"+e.date+(void 0!==t?"-"+t:""),class:{"q-calendar-day__head--day__event":!0,...T(e),"q-active-date":n},style:u},[a&&a({scope:r})])}function q(e){const t=y["head-weekday-label"],a=!0===m.shortWeekdayLabel,n=N(e,0),r=(n.shortWeekdayLabel=m.shortWeekdayLabel,n.disabled=!!m.disabledWeekdays&&m.disabledWeekdays.includes(Number(e.weekday)),{class:{"q-calendar-day__head--weekday":!0,["q-calendar__"+m.weekdayAlign]:!0,"q-calendar__ellipsis":!0}});return Ve.h("div",r,t&&t({scope:n})||Ne(e,a))}function Ne(e,t){const a=z.value(e,t||m.weekdayBreakpoints[0]>0&&I.value<=m.weekdayBreakpoints[0]);return Ve.h("span",{class:"q-calendar-day__head--weekday-label q-calendar__ellipsis"},m.weekdayBreakpoints[1]>0&&I.value<=m.weekdayBreakpoints[1]?Qe(a,Number(m.minWeekdayLabel)):a)}function O(e){const t={class:{"q-calendar-day__head--date":!0,["q-calendar__"+m.dateAlign]:!0}};return Ve.h("div",t,Ce(e))}function Ce(a){const e=!0!==m.noActiveDate&&W(a),t=Z.value(a,!1),n=y["head-day-label"],r=y["head-day-button"],o={dayLabel:t,timestamp:a,activeDate:e,disabled:!!m.disabledWeekdays&&m.disabledWeekdays.includes(Number(a.weekday))},u={class:{"q-calendar-day__head--day__label":!0,"q-calendar__button":!0,"q-calendar__button--round":"round"===m.dateType,"q-calendar__button--rounded":"rounded"===m.dateType,"q-calendar__button--bordered":!0===a.current,"q-calendar__focusable":!0},disabled:a.disabled,onKeydown:e=>{!0!==a.disabled&&F(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==a.disabled&&F(e,[13,32])&&(p.value=a.date,void 0!==D.value.onClickDate)&&v("click-date",{scope:o})},...A("-date",(e,t)=>{return"click-date"!==t&&"contextmenu-date"!==t||(p.value=a.date,"click-date"===t&&e.preventDefault()),{scope:o,event:e}})};return!0!==m.noAria&&(u.ariaLabel=$.value(a,!1)),r?r({scope:o}):vt(m,u,n?n({scope:o}):t)}function Ae(e,t){const a=y["column-header-before"];if(a){const n={timestamp:e,columnIndex:t};return Ve.h("div",{class:"q-calendar-day__column-header--before"},[a({scope:n})])}}function Fe(e,t){const a=y["column-header-after"];if(a){const n={timestamp:e,columnIndex:t};return Ve.h("div",{class:"q-calendar-day__column-header--after"},[a({scope:n})])}}function Me(){return Ve.h("div",{class:"q-calendar-day__body"},[Ee()])}function Ee(){return!0===k.value?Ve.h("div",{ref:e,class:{"q-calendar-day__scroll-area":!0,"q-calendar__scroll":!0}},[!0!==k.value&&Re(),qe()]):!0===m.noScroll?We():Ve.h("div",{ref:e,class:{"q-calendar-day__scroll-area":!0,"q-calendar__scroll":!0}},[We()])}function We(){return Ve.h("div",{ref:H,class:"q-calendar-day__pane"},[Re(),qe()])}function qe(){const e=y["day-container"];return Ve.h("div",{class:"q-calendar-day__day-container"},[!0===k.value&&!0!==m.noHeader&&pe(),Ve.h("div",{style:{display:"flex",flexDirection:"row"}},[!0===k.value&&Re(),...Oe()]),e&&e({scope:{days:S.value}})])}function Oe(){const e=parseInt(String(m.columnCount),10),a=parseInt(String(m.columnIndexStart),10);return 1===S.value.length&&e>0?Array.apply(null,new Array(e)).map((e,t)=>t+a).map(e=>xe(S.value[0],0,e)):S.value.map((e,t)=>xe(e,t,0))}function xe(e,t,a){const n=y["day-body"],r=N(e,a),o=!0===k.value?m.cellWidth:E.value,u={width:o,maxWidth:o,minWidth:o};return!0===k.value&&(u.minWidth=o),Ve.h("div",{key:e.date+(void 0!==a?":"+a:""),class:{"q-calendar-day__day":!0,...T(e)},style:u},[...He(t,a),n&&n({scope:r})])}function He(e,t){return G.value[e].map(e=>Ue(e,t))}function Ue(a,n){const e=Xe(m.intervalHeight),t=m.intervalStyle||ne,r=y["day-interval"],o=N(a,n),u=(o.droppable=w.value===Ke(a),"function"===typeof m.intervalClass?m.intervalClass({scope:o}):{}),i=!0===m.focusable&&m.focusType.includes("interval"),l=je(a),d={height:e,...t({scope:o})},s={key:l,tabindex:!0===i?0:-1,class:{"q-calendar-day__day-interval":0===a.minute,"q-calendar-day__day-interval--section":0!==a.minute,...u,...te(a,Array.from(m.selectedDates),m.selectedStartEndDates),"q-calendar__hoverable":!0===m.hoverable,"q-calendar__focusable":!0===i},style:d,onDragenter:e=>{void 0!==m.dragEnterFunc&&"function"===typeof m.dragEnterFunc&&(!0===m.dragEnterFunc(e,"interval",{scope:o})?w.value=Ke(a):w.value=0)},onDragover:e=>{void 0!==m.dragOverFunc&&"function"===typeof m.dragOverFunc&&(!0===m.dragOverFunc(e,"interval",{scope:o})?w.value=Ke(a):w.value=0)},onDragleave:e=>{void 0!==m.dragLeaveFunc&&"function"===typeof m.dragLeaveFunc&&(!0===m.dragLeaveFunc(e,"interval",{scope:o})?w.value=Ke(a):w.value=0)},onDrop:e=>{void 0!==m.dropFunc&&"function"===typeof m.dropFunc&&(!0===m.dropFunc(e,"interval",{scope:o})?w.value=Ke(a):w.value=0)},onKeydown:e=>{F(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{if(F(e,[13,32])){const t=N(a,n);p.value=t.timestamp.date,void 0!==D.value.onClickTime&&v("click-time",{scope:t,event:e})}},...A("-time",e=>{const t=N(re(e,a,m.timeClicksClamped,b.now),n);return{scope:t,event:e}})},c=(!0!==m.noAria&&(s.ariaLabel=ee.value(a,!1)),r?r({scope:o}):void 0);return Ve.h("div",s,[c,it()])}function Re(){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=oe(e,o.value,m.timeClicksClamped,b.now);return{scope:{timestamp:t},event:e}})};return Ve.h("div",e,Le())}function Le(){return G.value[0].map(e=>Be(e))}function Be(e){const t=y["interval-label"],a=Xe(m.intervalHeight),n=m.shortIntervalLabel??!1,r=m.showIntervalLabel||ae,o=r(e),u=o?J.value(e,n):void 0;return Ve.h("div",{key:e.time,class:{"q-calendar-day__interval":0===e.minute,"q-calendar-day__interval--section":0!==e.minute},style:{height:a}},[Ve.h("div",{class:"q-calendar-day__interval--text q-calendar__overflow-wrap"},[t?t({scope:{timestamp:e,label:u}}):u])])}function Ye(){const{start:e,end:t,maxDays:a}=j.value,n=(i.value===e.date&&l.value===t.date&&d.value===a||(i.value=e.date,l.value=t.date,d.value=a),s.width>0),r=Ve.withDirectives(Ve.h("div",{key:i.value,class:"q-calendar-day"},[!0===n&&!0!==k.value&&!0!==m.noHeader&&pe(),n&&Me()]),[[Ge,he]]);if(!0!==m.animated)return r;{const o="q-calendar--"+("prev"===u.value?m.transitionPrev:m.transitionNext);return Ve.h(Ve.Transition,{name:o,appear:!0},()=>r)}}return Ve.watch([S],se,{deep:!0,immediate:!0}),Ve.watch(()=>m.modelValue,(e,t)=>{if(p.value!==m.modelValue){if(!0===m.animated){const a=$e(Pe(e)),n=$e(Pe(t));u.value=a>=n?"next":"prev"}p.value=e}f.value=e}),Ve.watch(p,(e,t)=>{if(p.value!==m.modelValue){if(!0===m.animated){const a=$e(Pe(e)),n=$e(Pe(t));u.value=a>=n?"next":"prev"}v("update:model-value",e)}}),Ve.watch(f,e=>{e&&(t.value=ze(e))}),Ve.watch(t,()=>{f.value&&h.value[f.value]?h.value[f.value].focus():ce()}),Ve.watch(()=>m.maxDays,e=>{d.value=e}),Ve.onBeforeUpdate(()=>{h.value={},a.value=void 0,n.value=void 0}),Ve.onMounted(()=>{}),x({prev:fe,next:ye,move:C,moveToToday:me,updateCurrent:V,timeStartPos:de,timeDurationHeight:le,heightToMinutes:ie,scrollToTime:ue}),()=>Q()}});const Ue="4.1.2";me={version:Ue,QCalendarDay:He,...me,...fe,install(e){e.component(String(He.name),He)}};return me});