vue-cal 5.0.1-rc.20 → 5.0.1-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { computed as M, reactive as $e, watch as fe, toRefs as wt, ref as ue, onBeforeUnmount as Xe, inject as Ne, createElementBlock as O, openBlock as C, renderSlot as P, createCommentVNode as q, unref as V, Fragment as oe, renderList as ke, normalizeClass as ye, createElementVNode as ve, createVNode as Oe, Transition as Ge, withCtx as J, createBlock as Se, resolveDynamicComponent as Qe, mergeProps as de, toHandlers as Be, normalizeProps as te, toDisplayString as ie, normalizeStyle as _e, onMounted as qe, withModifiers as xe, nextTick as Ue, createTextVNode as et, TransitionGroup as tt, createSlots as je, useTemplateRef as _t, useId as kt, useAttrs as bt, provide as $t, guardReactiveProps as ae } from "vue";
1
+ import { computed as Y, reactive as Te, watch as me, toRefs as bt, ref as ie, onBeforeUnmount as Be, inject as He, createElementBlock as L, openBlock as C, renderSlot as j, createCommentVNode as U, unref as b, Fragment as ue, renderList as pe, normalizeClass as ye, createElementVNode as ve, createVNode as je, Transition as Ge, withCtx as B, createBlock as Se, resolveDynamicComponent as xe, mergeProps as le, toHandlers as Re, normalizeProps as te, onMounted as Ze, toDisplayString as ce, withModifiers as et, nextTick as Je, normalizeStyle as _e, createTextVNode as Ue, TransitionGroup as tt, createSlots as Ce, useTemplateRef as Tt, useId as Mt, useAttrs as Yt, provide as at, guardReactiveProps as ne } from "vue";
2
2
  /**
3
- * vue-cal v5.0.1-rc.20
3
+ * vue-cal v5.0.1-rc.21
4
4
  * (c) 2024-2025 Antoni Andre <antoniandre.web@gmail.com>
5
5
  * @license MIT
6
6
  */
@@ -33,370 +33,373 @@ const ge = {
33
33
  years: { cols: 5, rows: 5 }
34
34
  // Arbitrary range of quarters of century (25y).
35
35
  }
36
- }, Tt = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Re = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], Mt = Re.reduce((y, s, r) => (y[s] = r || 7, y), {}), Yt = (y, s, r) => {
37
- const { dateUtils: d } = y, w = !1, b = M(() => {
38
- if (A.value[s.view]) return s.view;
39
- const l = s.datePicker ? "month" : "week", p = s.view || l;
40
- return A.value[p] ? p : (console.warn(
41
- `Vue Cal: the provided or default view \`${p}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(A.value)[0]}\`.`
42
- ), Object.keys(A.value)[0]);
43
- }), H = M(() => s.sm && !s.xs), f = M(() => s.xs || s.datePicker), F = M(() => s.clickToNavigate || s.datePicker && s.clickToNavigate !== !1), u = M(() => {
44
- const l = {
36
+ }, Et = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], Xe = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"], St = Xe.reduce((p, t, u) => (p[t] = u || 7, p), {}), Ct = (p, t, u) => {
37
+ const { dateUtils: o } = p, w = !1, _ = Y(() => {
38
+ if (F.value[t.view]) return t.view;
39
+ const f = t.datePicker ? "month" : "week", T = t.view || f;
40
+ return F.value[T] ? T : (console.warn(
41
+ `Vue Cal: the provided or default view \`${T}\` is either invalid or not in the list of available views. The first available view will be chosen: \`${Object.keys(F.value)[0]}\`.`
42
+ ), Object.keys(F.value)[0]);
43
+ }), N = Y(() => t.sm && !t.xs), d = Y(() => t.xs || t.datePicker), z = Y(() => t.clickToNavigate || t.datePicker && t.clickToNavigate !== !1), v = Y(() => {
44
+ const f = {
45
45
  cell: {},
46
46
  // All possible event listeners to attach to cells.
47
47
  event: {}
48
48
  // All possible event listeners to attach to calendar events.
49
- }, p = (k) => k.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
50
- for (const [k, a] of Object.entries(r)) {
51
- const [j, R, N] = k.match(/^on(Cell|Event)(.+)$/) || [];
52
- j && (l[R.toLowerCase()][p(N).replace(/^-+|-+$/g, "")] = a);
49
+ }, T = (E) => E.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
50
+ for (const [E, l] of Object.entries(u)) {
51
+ const [X, q, ae] = E.match(/^on(Cell|Event)(.+)$/) || [];
52
+ X && (f[q.toLowerCase()][T(ae).replace(/^-+|-+$/g, "")] = l);
53
53
  }
54
- return l;
55
- }), m = M(() => {
56
- var p;
57
- const l = {};
58
- return s.hideWeekends && (l[6] = !0) && (l[7] = !0), (p = s.hideWeekdays) != null && p.length && s.hideWeekdays.forEach((k) => l[Mt[k]] = !0), l;
59
- }), Y = M(() => s.hideWeekends || m.value[6] && m.value[7]), A = M(() => {
60
- const l = s.datePicker;
61
- let p = 0, k = {};
62
- const a = s.views;
63
- return l && !a ? {
54
+ return f;
55
+ }), c = Y(() => {
56
+ var T;
57
+ const f = {};
58
+ return t.hideWeekends && (f[6] = !0) && (f[7] = !0), (T = t.hideWeekdays) != null && T.length && t.hideWeekdays.forEach((E) => f[St[E]] = !0), f;
59
+ }), y = Y(() => t.hideWeekends || c.value[6] && c.value[7]), F = Y(() => {
60
+ const f = t.datePicker;
61
+ let T = 0, E = {};
62
+ const l = t.views;
63
+ return f && !l ? {
64
64
  month: { ...ge.availableViews.month },
65
65
  year: { ...ge.availableViews.year },
66
66
  years: { ...ge.availableViews.years }
67
- } : (a ? (Array.isArray(a) ? k = a.reduce((j, R) => (typeof R == "string" && ge.availableViews[R] ? j[R] = ge.availableViews[R] : p++, j), {}) : typeof a == "object" && (k = Object.entries(a).reduce((j, [R, N]) => {
68
- const { cols: ne, rows: x } = ge.availableViews[R];
69
- return j[R] = { cols: N.cols || ne, rows: N.rows || x }, j;
70
- }, {})), p && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(k).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), k = { ...ge.availableViews })) : k = { ...ge.availableViews }, k);
71
- }), Z = M(() => s.datePicker ? "month" : A.value.week ? "week" : Object.keys(A.value)[0]), t = M(() => {
72
- if (typeof s.selectedDate == "string") return d.stringToDate(s.selectedDate);
73
- if (s.selectedDate instanceof Date) return s.selectedDate;
74
- s.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", s.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
75
- }), o = M(() => {
76
- if (!s.disableDays) return [];
77
- const l = [];
78
- if (Array.isArray(s.disableDays))
79
- for (let p of s.disableDays) {
80
- let k = p;
81
- typeof p == "string" ? k = d.stringToDate(p) : p instanceof Date && (p = d.formatDate(p, "YYYY-MM-DD")), k instanceof Date && !isNaN(k.getTime()) ? l.push(p) : console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", p);
67
+ } : (l ? (Array.isArray(l) ? E = l.reduce((X, q) => (typeof q == "string" && ge.availableViews[q] ? X[q] = ge.availableViews[q] : T++, X), {}) : typeof l == "object" && (E = Object.entries(l).reduce((X, [q, ae]) => {
68
+ const { cols: se, rows: de } = ge.availableViews[q];
69
+ return X[q] = { cols: ae.cols || se, rows: ae.rows || de }, X;
70
+ }, {})), T && console.warn("Vue Cal: the provided `views` prop contains invalid views that will be ignored."), Object.keys(E).length || (console.warn("Vue Cal: No valid view in the provided `views` prop. Falling back to default views."), E = { ...ge.availableViews })) : E = { ...ge.availableViews }, E);
71
+ }), W = Y(() => t.datePicker ? "month" : F.value.week ? "week" : Object.keys(F.value)[0]), a = Y(() => {
72
+ if (typeof t.selectedDate == "string") return o.stringToDate(t.selectedDate);
73
+ if (t.selectedDate instanceof Date) return t.selectedDate;
74
+ t.selectedDate ? console.warn("Vue Cal: The provided selected date is invalid:", t.selectedDate) : console.log("Vue Cal: Info - The provided selected date is undefined.");
75
+ }), s = Y(() => {
76
+ if (!t.disableDays) return [];
77
+ const f = [];
78
+ if (Array.isArray(t.disableDays))
79
+ for (let T of t.disableDays) {
80
+ let E = T;
81
+ typeof T == "string" ? E = o.stringToDate(T) : T instanceof Date && (T = o.formatDate(T, "YYYY-MM-DD")), E instanceof Date && !isNaN(E.getTime()) ? f.push(T) : console.warn("Vue Cal: The provided `disableDays` prop contains an invalid date:", T);
82
82
  }
83
- else console.warn("Vue Cal: The provided `disableDays` prop is invalid:", s.disableDays);
84
- return l;
85
- }), e = M(() => {
86
- let l = null;
87
- return s.minDate && typeof s.minDate == "string" ? l = d.stringToDate(s.minDate) : s.minDate && s.minDate instanceof Date && (l = s.minDate), (l == null ? void 0 : l.getTime()) || null;
88
- }), h = M(() => {
89
- let l = null;
90
- return s.maxDate && typeof s.maxDate == "string" ? l = d.stringToDate(s.maxDate) : s.maxDate && s.maxDate instanceof Date && (l = s.maxDate), (l == null ? void 0 : l.getTime()) || null;
91
- }), c = M(() => {
92
- var k;
93
- const { view: l } = y;
94
- return s.schedules.length && (l.isDay || l.isDays || l.isWeek) && ((k = s.schedules) == null ? void 0 : k.map((a, j) => ({ ...a, id: a.id ?? j + 1 }))) || void 0;
95
- }), E = M(() => {
96
- const l = {
83
+ else console.warn("Vue Cal: The provided `disableDays` prop is invalid:", t.disableDays);
84
+ return f;
85
+ }), e = Y(() => {
86
+ let f = null;
87
+ return t.minDate && typeof t.minDate == "string" ? f = o.stringToDate(t.minDate) : t.minDate && t.minDate instanceof Date && (f = t.minDate), (f == null ? void 0 : f.getTime()) || null;
88
+ }), k = Y(() => {
89
+ let f = null;
90
+ return t.maxDate && typeof t.maxDate == "string" ? f = o.stringToDate(t.maxDate) : t.maxDate && t.maxDate instanceof Date && (f = t.maxDate), (f == null ? void 0 : f.getTime()) || null;
91
+ }), i = Y(() => {
92
+ var E;
93
+ const { view: f } = p;
94
+ return t.schedules.length && (f.isDay || f.isDays || f.isWeek) && ((E = t.schedules) == null ? void 0 : E.map((l, X) => ({ ...l, id: l.id ?? X + 1 }))) || void 0;
95
+ }), V = Y(() => {
96
+ const f = {
97
97
  drag: !0,
98
98
  resize: !0,
99
99
  delete: !0,
100
100
  create: !0
101
101
  };
102
- return s.editableEvents === !0 ? l : s.editableEvents === !1 ? Object.keys(l).map((p) => l[p] = !1) : { ...l, ...s.editableEvents };
103
- }), L = M(() => {
104
- const { view: l } = y, { eventCount: p } = s;
105
- return (Array.isArray(p) ? p.includes(l.id) : p) && (l.isMonth && !s.eventsOnMonthView || l.isYear);
106
- }), z = async (l) => {
107
- var k;
108
- let p = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((a) => a.default), "../i18n/bg.json": () => import("./i18n/bg.js").then((a) => a.default), "../i18n/bn.json": () => import("./i18n/bn.js").then((a) => a.default), "../i18n/bs.json": () => import("./i18n/bs.js").then((a) => a.default), "../i18n/ca.json": () => import("./i18n/ca.js").then((a) => a.default), "../i18n/cs.json": () => import("./i18n/cs.js").then((a) => a.default), "../i18n/da.json": () => import("./i18n/da.js").then((a) => a.default), "../i18n/de.json": () => import("./i18n/de.js").then((a) => a.default), "../i18n/el.json": () => import("./i18n/el.js").then((a) => a.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.js").then((a) => a.default), "../i18n/en-us.json": () => Promise.resolve().then(() => Vt).then((a) => a.default), "../i18n/es.json": () => import("./i18n/es.js").then((a) => a.default), "../i18n/et.json": () => import("./i18n/et.js").then((a) => a.default), "../i18n/fa.json": () => import("./i18n/fa.js").then((a) => a.default), "../i18n/fi.json": () => import("./i18n/fi.js").then((a) => a.default), "../i18n/fr.json": () => import("./i18n/fr.js").then((a) => a.default), "../i18n/he.json": () => import("./i18n/he.js").then((a) => a.default), "../i18n/hr.json": () => import("./i18n/hr.js").then((a) => a.default), "../i18n/hu.json": () => import("./i18n/hu.js").then((a) => a.default), "../i18n/id.json": () => import("./i18n/id.js").then((a) => a.default), "../i18n/is.json": () => import("./i18n/is.js").then((a) => a.default), "../i18n/it.json": () => import("./i18n/it.js").then((a) => a.default), "../i18n/ja.json": () => import("./i18n/ja.js").then((a) => a.default), "../i18n/ka.json": () => import("./i18n/ka.js").then((a) => a.default), "../i18n/ko.json": () => import("./i18n/ko.js").then((a) => a.default), "../i18n/lt.json": () => import("./i18n/lt.js").then((a) => a.default), "../i18n/mn.json": () => import("./i18n/mn.js").then((a) => a.default), "../i18n/nl.json": () => import("./i18n/nl.js").then((a) => a.default), "../i18n/no.json": () => import("./i18n/no.js").then((a) => a.default), "../i18n/pl.json": () => import("./i18n/pl.js").then((a) => a.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.js").then((a) => a.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.js").then((a) => a.default), "../i18n/ro.json": () => import("./i18n/ro.js").then((a) => a.default), "../i18n/ru.json": () => import("./i18n/ru.js").then((a) => a.default), "../i18n/sk.json": () => import("./i18n/sk.js").then((a) => a.default), "../i18n/sl.json": () => import("./i18n/sl.js").then((a) => a.default), "../i18n/sq.json": () => import("./i18n/sq.js").then((a) => a.default), "../i18n/sr.json": () => import("./i18n/sr.js").then((a) => a.default), "../i18n/sv.json": () => import("./i18n/sv.js").then((a) => a.default), "../i18n/tr.json": () => import("./i18n/tr.js").then((a) => a.default), "../i18n/uk.json": () => import("./i18n/uk.js").then((a) => a.default), "../i18n/vi.json": () => import("./i18n/vi.js").then((a) => a.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.js").then((a) => a.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.js").then((a) => a.default) });
102
+ return t.editableEvents === !0 ? f : t.editableEvents === !1 ? Object.keys(f).map((T) => f[T] = !1) : { ...f, ...t.editableEvents };
103
+ }), P = Y(() => {
104
+ const { view: f } = p, { eventCount: T } = t;
105
+ return (Array.isArray(T) ? T.includes(f.id) : T) && (f.isMonth && !t.eventsOnMonthView || f.isYear);
106
+ }), A = Y(() => t.allDayEvents && t.time !== !1 && !_.isMonth), m = Y(() => t.timeAtCursor && t.time !== !1), h = async (f) => {
107
+ var E;
108
+ let T = /* @__PURE__ */ Object.assign({ "../i18n/ar.json": () => import("./i18n/ar.js").then((l) => l.default), "../i18n/bg.json": () => import("./i18n/bg.js").then((l) => l.default), "../i18n/bn.json": () => import("./i18n/bn.js").then((l) => l.default), "../i18n/bs.json": () => import("./i18n/bs.js").then((l) => l.default), "../i18n/ca.json": () => import("./i18n/ca.js").then((l) => l.default), "../i18n/cs.json": () => import("./i18n/cs.js").then((l) => l.default), "../i18n/da.json": () => import("./i18n/da.js").then((l) => l.default), "../i18n/de.json": () => import("./i18n/de.js").then((l) => l.default), "../i18n/el.json": () => import("./i18n/el.js").then((l) => l.default), "../i18n/en-gb.json": () => import("./i18n/en-gb.js").then((l) => l.default), "../i18n/en-us.json": () => Promise.resolve().then(() => Lt).then((l) => l.default), "../i18n/es.json": () => import("./i18n/es.js").then((l) => l.default), "../i18n/et.json": () => import("./i18n/et.js").then((l) => l.default), "../i18n/fa.json": () => import("./i18n/fa.js").then((l) => l.default), "../i18n/fi.json": () => import("./i18n/fi.js").then((l) => l.default), "../i18n/fr.json": () => import("./i18n/fr.js").then((l) => l.default), "../i18n/he.json": () => import("./i18n/he.js").then((l) => l.default), "../i18n/hr.json": () => import("./i18n/hr.js").then((l) => l.default), "../i18n/hu.json": () => import("./i18n/hu.js").then((l) => l.default), "../i18n/id.json": () => import("./i18n/id.js").then((l) => l.default), "../i18n/is.json": () => import("./i18n/is.js").then((l) => l.default), "../i18n/it.json": () => import("./i18n/it.js").then((l) => l.default), "../i18n/ja.json": () => import("./i18n/ja.js").then((l) => l.default), "../i18n/ka.json": () => import("./i18n/ka.js").then((l) => l.default), "../i18n/ko.json": () => import("./i18n/ko.js").then((l) => l.default), "../i18n/lt.json": () => import("./i18n/lt.js").then((l) => l.default), "../i18n/mn.json": () => import("./i18n/mn.js").then((l) => l.default), "../i18n/nl.json": () => import("./i18n/nl.js").then((l) => l.default), "../i18n/no.json": () => import("./i18n/no.js").then((l) => l.default), "../i18n/pl.json": () => import("./i18n/pl.js").then((l) => l.default), "../i18n/pt-br.json": () => import("./i18n/pt-br.js").then((l) => l.default), "../i18n/pt-pt.json": () => import("./i18n/pt-pt.js").then((l) => l.default), "../i18n/ro.json": () => import("./i18n/ro.js").then((l) => l.default), "../i18n/ru.json": () => import("./i18n/ru.js").then((l) => l.default), "../i18n/sk.json": () => import("./i18n/sk.js").then((l) => l.default), "../i18n/sl.json": () => import("./i18n/sl.js").then((l) => l.default), "../i18n/sq.json": () => import("./i18n/sq.js").then((l) => l.default), "../i18n/sr.json": () => import("./i18n/sr.js").then((l) => l.default), "../i18n/sv.json": () => import("./i18n/sv.js").then((l) => l.default), "../i18n/tr.json": () => import("./i18n/tr.js").then((l) => l.default), "../i18n/uk.json": () => import("./i18n/uk.js").then((l) => l.default), "../i18n/vi.json": () => import("./i18n/vi.js").then((l) => l.default), "../i18n/zh-cn.json": () => import("./i18n/zh-cn.js").then((l) => l.default), "../i18n/zh-hk.json": () => import("./i18n/zh-hk.js").then((l) => l.default) });
109
109
  {
110
- if (!p[`../i18n/${l}.json`]) {
111
- console.warn(`Vue Cal: the locale \`${l}\` does not exist. Falling back to \`en-us\`.`), l = "en-us";
110
+ if (!T[`../i18n/${f}.json`]) {
111
+ console.warn(`Vue Cal: the locale \`${f}\` does not exist. Falling back to \`en-us\`.`), f = "en-us";
112
112
  return;
113
113
  }
114
- p = await ((k = p[`../i18n/${l}.json`]) == null ? void 0 : k.call(p));
114
+ T = await ((E = T[`../i18n/${f}.json`]) == null ? void 0 : E.call(T));
115
115
  }
116
- y.texts = Object.assign(y.texts, Object.assign({ ...ge.texts }, p)), d.updateTexts(y.texts);
117
- }, D = $e(s.events || []);
118
- return fe(() => s.events, (l) => D.splice(0, D.length, ...l)), fe(() => s.locale, (l) => z(l || "en-us")), (s.locale || !y.texts.today) && z(s.locale || "en-us"), {
119
- ...wt(s),
120
- events: D,
116
+ p.texts = Object.assign(p.texts, Object.assign({ ...ge.texts }, T)), o.updateTexts(p.texts);
117
+ }, H = Te(t.events || []);
118
+ return me(() => t.events, (f) => H.splice(0, H.length, ...f)), me(() => t.locale, (f) => h(f || "en-us")), (t.locale || !p.texts.today) && h(t.locale || "en-us"), {
119
+ ...bt(t),
120
+ events: H,
121
121
  // All the events listeners for cells and events that the end user may have attached to vue-cal.
122
- eventListeners: u,
123
- defaultView: Z,
124
- availableViews: A,
125
- disableDays: o,
122
+ eventListeners: v,
123
+ defaultView: W,
124
+ availableViews: F,
125
+ disableDays: s,
126
126
  ready: w,
127
- sm: H,
128
- xs: f,
129
- clickToNavigate: F,
130
- hideWeekdays: m,
131
- hideWeekends: Y,
127
+ sm: N,
128
+ xs: d,
129
+ clickToNavigate: z,
130
+ hideWeekdays: c,
131
+ hideWeekends: y,
132
132
  minTimestamp: e,
133
- maxTimestamp: h,
134
- schedules: c,
135
- selectedDate: t,
136
- editableEvents: E,
137
- showCellEventCount: L,
138
- view: b,
133
+ maxTimestamp: k,
134
+ schedules: i,
135
+ selectedDate: a,
136
+ editableEvents: V,
137
+ showCellEventCount: P,
138
+ allDayEvents: A,
139
+ timeAtCursor: m,
140
+ view: _,
139
141
  // Getters.
140
142
  get hasHiddenDays() {
141
- return Object.keys(m.value).length;
143
+ return Object.keys(c.value).length;
142
144
  },
143
145
  get size() {
144
- return f.value ? "xs" : H.value ? "sm" : "lg";
146
+ return d.value ? "xs" : N.value ? "sm" : "lg";
145
147
  },
146
- loadTexts: z
148
+ loadTexts: h
147
149
  };
148
- }, Ve = (y, s) => {
149
- const r = s.timeTo - s.timeFrom;
150
- return (y - s.timeFrom) * 100 / r;
151
- }, Fe = (y, s) => {
152
- const r = s.timeTo - s.timeFrom;
153
- return ~~(y * r / 100 + s.timeFrom);
154
- }, Ze = (y, s) => {
155
- const r = s.clientHeight;
156
- return y * 100 / r;
157
- }, Ie = $e({ id: null, date: null });
158
- let at = !1, Je = !0;
159
- const pe = $e({ el: null, cell: null, timeout: null }), we = $e({
150
+ }, Oe = (p, t) => {
151
+ const u = t.timeTo - t.timeFrom;
152
+ return (p - t.timeFrom) * 100 / u;
153
+ }, Le = (p, t) => {
154
+ const u = t.timeTo - t.timeFrom;
155
+ return ~~(p * u / 100 + t.timeFrom);
156
+ }, Ke = (p, t) => {
157
+ const u = t.clientHeight;
158
+ return p * 100 / u;
159
+ }, Ie = Te({ id: null, date: null });
160
+ let nt = !1, qe = !0;
161
+ const ke = Te({ el: null, cell: null, timeout: null }), $e = Te({
160
162
  eventId: null,
161
163
  fromVueCal: null,
162
164
  toVueCal: null
163
165
  });
164
- function Et(y) {
165
- const { config: s, view: r, eventsManager: d, emit: w, uid: b, dateUtils: H } = y, f = (e) => {
166
- var l;
167
- const { timeStep: h, timeCellHeight: c, timeFrom: E } = s, L = (((l = e.touches) == null ? void 0 : l[0]) || e).clientY, { top: z } = e.currentTarget.getBoundingClientRect(), D = L - z - ~~e.dataTransfer.getData("cursor-grab-at");
168
- return Fe(Ze(D, e.currentTarget), s);
169
- }, F = (e, h, c) => {
170
- const E = h.duration || u(h.start, h.end) || s.timeStep;
171
- let L = Math.max(f(e), 0);
172
- if (s.snapToInterval) {
173
- const p = L + s.snapToInterval / 2;
174
- L = p - p % s.snapToInterval;
166
+ function Vt(p) {
167
+ const { config: t, view: u, eventsManager: o, emit: w, uid: _, dateUtils: N } = p, d = (e) => {
168
+ var h;
169
+ const { timeStep: k, timeCellHeight: i, timeFrom: V } = t, P = (((h = e.touches) == null ? void 0 : h[0]) || e).clientY, { top: A } = e.currentTarget.getBoundingClientRect(), m = P - A - ~~e.dataTransfer.getData("cursor-grab-at");
170
+ return Le(Ke(m, e.currentTarget), t);
171
+ }, z = (e, k, i) => {
172
+ const V = k.duration || v(k.start, k.end) || t.timeStep;
173
+ let P = Math.max(d(e), 0);
174
+ if (t.snapToInterval) {
175
+ const H = P + t.snapToInterval / 2;
176
+ P = H - H % t.snapToInterval;
175
177
  }
176
- const z = new Date(new Date(c).setMinutes(L)), D = Math.min(L + E, 24 * 60), l = new Date(new Date(c).setMinutes(D));
177
- return { start: z, end: l };
178
- }, u = (e, h) => Math.round((h - e) / 6e4);
178
+ const A = new Date(new Date(i).setMinutes(P)), m = Math.min(P + V, 24 * 60), h = new Date(new Date(i).setMinutes(m));
179
+ return { start: A, end: h };
180
+ }, v = (e, k) => Math.round((k - e) / 6e4);
179
181
  return {
180
- eventDragStart: (e, h) => {
181
- if (e.target.nodeType === 3 || y.touch.isResizingEvent) return e.preventDefault();
182
+ eventDragStart: (e, k) => {
183
+ if (e.target.nodeType === 3 || p.touch.isResizingEvent) return e.preventDefault();
182
184
  e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move";
183
- const c = { ...h, _: { id: h._.id, duration: u(h.start, h.end) } };
185
+ const i = { ...k, _: { id: k._.id, duration: v(k.start, k.end) } };
184
186
  try {
185
- e.dataTransfer.setData("text/plain", ""), e.dataTransfer.setData("event", JSON.stringify(c)), e.dataTransfer.setData("cursor-grab-at", e.offsetY);
186
- } catch (L) {
187
- return console.warn("Vue Cal: Failed to set drag data:", L), e.preventDefault();
187
+ e.dataTransfer.setData("text/plain", ""), e.dataTransfer.setData("event", JSON.stringify(i)), e.dataTransfer.setData("cursor-grab-at", e.offsetY);
188
+ } catch (P) {
189
+ return console.warn("Vue Cal: Failed to set drag data:", P), e.preventDefault();
188
190
  }
189
- we.eventId = h._.id, we.fromVueCal = b, w("event-drag-start", {
191
+ $e.eventId = k._.id, $e.fromVueCal = _, w("event-drag-start", {
190
192
  e,
191
- event: h
193
+ event: k
192
194
  });
193
- const E = e.target.closest(".vuecal__event");
194
- E.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
195
- E.classList.add("vuecal__event--dragging-original"), E.classList.remove("vuecal__event--dragging-ghost");
196
- }, 0), at = !1, Object.assign(Ie, { id: r.id, date: r.firstCellDate }), Je = !0, y.touch.isDraggingEvent = !0;
195
+ const V = e.target.closest(".vuecal__event");
196
+ V.classList.add("vuecal__event--dragging-ghost"), setTimeout(() => {
197
+ V.classList.add("vuecal__event--dragging-original"), V.classList.remove("vuecal__event--dragging-ghost");
198
+ }, 0), nt = !1, Object.assign(Ie, { id: u.id, date: u.firstCellDate }), qe = !0, p.touch.isDraggingEvent = !0;
197
199
  },
198
- eventDragEnd: (e, h) => {
199
- we.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
200
- const { fromVueCal: c, toVueCal: E } = we;
201
- E && c !== E && d.deleteEvent(h._.id, 3), at && Je && Ie.id && r.switchView(Ie.id, Ie.date, !0), w("event-drag-end", {
200
+ eventDragEnd: (e, k) => {
201
+ $e.eventId = null, e.target.closest(".vuecal__event").classList.remove("vuecal__event--dragging-original");
202
+ const { fromVueCal: i, toVueCal: V } = $e;
203
+ V && i !== V && o.deleteEvent(k._.id, 3), nt && qe && Ie.id && u.switchView(Ie.id, Ie.date, !0), w("event-drag-end", {
202
204
  e,
203
- event: h,
204
- external: we.fromVueCal !== b
205
- }), we.fromVueCal = null, we.toVueCal = null, y.touch.isDraggingEvent = !1;
205
+ event: k,
206
+ external: $e.fromVueCal !== _
207
+ }), $e.fromVueCal = null, $e.toVueCal = null, p.touch.isDraggingEvent = !1;
206
208
  },
207
- cellDragEnter: (e, h) => {
208
- const { start: c } = h, E = e.currentTarget;
209
+ cellDragEnter: (e, k) => {
210
+ const { start: i } = k, V = e.currentTarget;
209
211
  if (!e.currentTarget.contains(e.relatedTarget)) {
210
- if (E === pe.el || !E.className.includes("vuecal__cell-content")) return !1;
211
- pe.el && (pe.cell.highlighted = !1), Object.assign(pe, { el: E, cell: h, timeout: clearTimeout(pe.timeout) }), h.highlighted = !0, ["years", "year", "month"].includes(r.id) && (pe.timeout = setTimeout(() => y.switchToNarrowerView(c), 2e3));
212
+ if (V === ke.el || !V.className.includes("vuecal__cell-content")) return !1;
213
+ ke.el && (ke.cell.highlighted = !1), Object.assign(ke, { el: V, cell: k, timeout: clearTimeout(ke.timeout) }), k.highlighted = !0, ["years", "year", "month"].includes(u.id) && (ke.timeout = setTimeout(() => p.switchToNarrowerView(i), 2e3));
212
214
  }
213
215
  },
214
- cellDragOver: (e, h) => {
215
- const { start: c, schedule: E } = h;
216
- e.preventDefault(), h.highlighted = !0, (E || E === 0) && (h.highlightedSchedule = E);
216
+ cellDragOver: (e, k) => {
217
+ const { start: i, schedule: V } = k;
218
+ e.preventDefault(), k.highlighted = !0, (V || V === 0) && (k.highlightedSchedule = V);
217
219
  },
218
- cellDragLeave: (e, h) => {
219
- e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (h.highlightedSchedule = !1, pe.cell === h && (clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null }), h.highlighted = !1));
220
+ cellDragLeave: (e, k) => {
221
+ e.preventDefault(), !e.currentTarget.contains(e.relatedTarget) && (k.highlightedSchedule = !1, ke.cell === k && (clearTimeout(ke.timeout), Object.assign(ke, { el: null, cell: null, timeout: null }), k.highlighted = !1));
220
222
  },
221
- cellDragDrop: async (e, h) => {
222
- var a, j, R;
223
- e.preventDefault(), clearTimeout(pe.timeout), Object.assign(pe, { el: null, cell: null, timeout: null });
224
- const c = JSON.parse(e.dataTransfer.getData("event") || "{}");
225
- c.start && (c.start = new Date(c.start)), c.end && (c.end = new Date(c.end));
226
- let E;
227
- const { start: L, end: z } = F(e, c, h.start), { schedule: D } = ((a = e.target.closest("[data-schedule]")) == null ? void 0 : a.dataset) || {};
228
- let l = () => {
223
+ cellDragDrop: async (e, k, i = !1) => {
224
+ var E, l, X;
225
+ e.preventDefault(), clearTimeout(ke.timeout), Object.assign(ke, { el: null, cell: null, timeout: null });
226
+ const V = JSON.parse(e.dataTransfer.getData("event") || "{}");
227
+ V.start && (V.start = new Date(V.start)), V.end && (V.end = new Date(V.end));
228
+ let P, A, m;
229
+ i ? (A = new Date(k.start), m = new Date(k.end)) : { start: A, end: m } = z(e, V, k.start);
230
+ const { schedule: h } = ((E = e.target.closest("[data-schedule]")) == null ? void 0 : E.dataset) || {};
231
+ let H = () => {
229
232
  };
230
- we.fromVueCal === b ? (E = d.getEvent(c._.id), E && (E._.dragging = !1, l = (N) => {
231
- if (E.start = L, E.end = z, D !== void 0 && (E.schedule = ~~D), N && typeof N == "object") {
232
- const { _: ne, ...x } = N;
233
- Object.assign(E, x);
233
+ $e.fromVueCal === _ ? (P = o.getEvent(V._.id), P && (P._.dragging = !1, H = (q) => {
234
+ if (P.start = A, P.end = m, P.allDay = i, h !== void 0 && (P.schedule = ~~h), q && typeof q == "object") {
235
+ const { _: ae, ...se } = q;
236
+ Object.assign(P, se);
234
237
  }
235
- })) : (E = {
236
- ...c,
237
- start: L,
238
- end: z,
239
- ...D !== void 0 && { schedule: ~~D },
240
- _: { id: ((j = c._) == null ? void 0 : j.id) || c.id, duration: u(L, z) },
241
- getOverlappingEvents: () => d.getEventsInRange(L, z, { schedule: ~~D })
242
- }, l = (N) => {
243
- if (E = d.createEvent(E), N && typeof N == "object") {
244
- const { _: ne, ...x } = N;
245
- Object.assign(E, x);
238
+ })) : (P = {
239
+ ...V,
240
+ start: A,
241
+ end: m,
242
+ ...h !== void 0 && { schedule: ~~h },
243
+ _: { id: ((l = V._) == null ? void 0 : l.id) || V.id, duration: v(A, m) },
244
+ getOverlappingEvents: () => o.getEventsInRange(A, m, { schedule: ~~h })
245
+ }, H = (q) => {
246
+ if (P = o.createEvent(P), q && typeof q == "object") {
247
+ const { _: ae, ...se } = q;
248
+ Object.assign(P, se);
246
249
  }
247
250
  });
248
- let p = !0;
249
- const { drop: k } = (R = s.eventListeners) == null ? void 0 : R.event;
250
- k && (p = await k({
251
+ let f = !0;
252
+ const { drop: T } = (X = t.eventListeners) == null ? void 0 : X.event;
253
+ T && (f = await T({
251
254
  e,
252
- event: { ...E, start: L, end: z, schedule: ~~D },
253
- overlaps: E.getOverlappingEvents({ start: L, end: z, schedule: ~~D }),
254
- cell: h,
255
- external: we.fromVueCal !== b
256
- })), p !== !1 && l(p), h.highlighted = !1, h.highlightedSchedule = null, Je = !1, we.toVueCal = b, w("event-dropped", {
255
+ event: { ...P, start: A, end: m, schedule: ~~h },
256
+ overlaps: P.getOverlappingEvents({ start: A, end: m, schedule: ~~h }),
257
+ cell: k,
258
+ external: $e.fromVueCal !== _
259
+ })), f !== !1 && H(f), k.highlighted = !1, k.highlightedSchedule = null, qe = !1, $e.toVueCal = _, w("event-dropped", {
257
260
  e,
258
- cell: h,
259
- event: E,
260
- originalEvent: c,
261
- external: we.fromVueCal !== b
261
+ cell: k,
262
+ event: P,
263
+ originalEvent: V,
264
+ external: $e.fromVueCal !== _
262
265
  });
263
266
  }
264
267
  };
265
268
  }
266
- const st = (y, s) => {
267
- let r, d, w, b = {}, H = {};
268
- const f = ue(y), F = () => {
269
- f.value.today || (f.value = s), Date.prototype.addDays = function(n) {
270
- return A(this, n || 0);
269
+ const lt = (p, t) => {
270
+ let u, o, w, _ = {}, N = {};
271
+ const d = ie(p), z = () => {
272
+ d.value.today || (d.value = t), Date.prototype.addDays = function(n) {
273
+ return F(this, n || 0);
271
274
  }, Date.prototype.subtractDays = function(n) {
272
- return Z(this, n || 0);
275
+ return W(this, n || 0);
273
276
  }, Date.prototype.addHours = function(n) {
274
- return t(this, n || 0);
277
+ return a(this, n || 0);
275
278
  }, Date.prototype.subtractHours = function(n) {
276
- return o(this, n || 0);
279
+ return s(this, n || 0);
277
280
  }, Date.prototype.addMinutes = function(n) {
278
281
  return e(this, n || 0);
279
282
  }, Date.prototype.subtractMinutes = function(n) {
280
- return h(this, n || 0);
283
+ return k(this, n || 0);
281
284
  }, Date.prototype.getWeek = function() {
282
- return E(this);
285
+ return V(this);
283
286
  }, Date.prototype.isToday = function() {
284
- return L(this);
287
+ return P(this);
285
288
  }, Date.prototype.isLeapYear = function() {
286
- return l(this);
289
+ return h(this);
287
290
  }, Date.prototype.format = function(n = "YYYY-MM-DD") {
288
- return ne(this, n);
291
+ return q(this, n);
289
292
  }, Date.prototype.formatTime = function(n = "HH:mm") {
290
- return le(this, n);
293
+ return se(this, n);
291
294
  };
292
- }, u = () => {
295
+ }, v = () => {
293
296
  delete Date.prototype.addDays, delete Date.prototype.subtractDays, delete Date.prototype.addHours, delete Date.prototype.subtractHours, delete Date.prototype.addMinutes, delete Date.prototype.subtractMinutes, delete Date.prototype.getWeek, delete Date.prototype.isToday, delete Date.prototype.isLeapYear, delete Date.prototype.format, delete Date.prototype.formatTime;
294
- }, m = (n) => {
295
- f.value = n, Date.prototype.subtractDays && F();
296
- }, Y = () => (d !== (/* @__PURE__ */ new Date()).getDate() && (r = /* @__PURE__ */ new Date(), d = r.getDate(), w = `${r.getFullYear()}-${r.getMonth()}-${r.getDate()}`), w), A = (n, _) => {
297
- const g = new Date(n.valueOf());
298
- return g.setDate(g.getDate() + _), g;
299
- }, Z = (n, _) => {
300
- const g = new Date(n.valueOf());
301
- return g.setDate(g.getDate() - _), g;
302
- }, t = (n, _) => {
303
- const g = new Date(n.valueOf());
304
- return g.setHours(g.getHours() + _), g;
305
- }, o = (n, _) => {
306
- const g = new Date(n.valueOf());
307
- return g.setHours(g.getHours() - _), g;
308
- }, e = (n, _) => {
309
- const g = new Date(n.valueOf());
310
- return g.setMinutes(g.getMinutes() + _), g;
311
- }, h = (n, _) => {
312
- const g = new Date(n.valueOf());
313
- return g.setMinutes(g.getMinutes() - _), g;
314
- }, c = (n, _) => {
315
- const g = (I) => {
316
- const ee = I % _;
317
- return ee !== 0 && (I += ee >= _ / 2 ? _ - ee : -ee), I;
297
+ }, c = (n) => {
298
+ d.value = n, Date.prototype.subtractDays && z();
299
+ }, y = () => (o !== (/* @__PURE__ */ new Date()).getDate() && (u = /* @__PURE__ */ new Date(), o = u.getDate(), w = `${u.getFullYear()}-${u.getMonth()}-${u.getDate()}`), w), F = (n, $) => {
300
+ const D = new Date(n.valueOf());
301
+ return D.setDate(D.getDate() + $), D;
302
+ }, W = (n, $) => {
303
+ const D = new Date(n.valueOf());
304
+ return D.setDate(D.getDate() - $), D;
305
+ }, a = (n, $) => {
306
+ const D = new Date(n.valueOf());
307
+ return D.setHours(D.getHours() + $), D;
308
+ }, s = (n, $) => {
309
+ const D = new Date(n.valueOf());
310
+ return D.setHours(D.getHours() - $), D;
311
+ }, e = (n, $) => {
312
+ const D = new Date(n.valueOf());
313
+ return D.setMinutes(D.getMinutes() + $), D;
314
+ }, k = (n, $) => {
315
+ const D = new Date(n.valueOf());
316
+ return D.setMinutes(D.getMinutes() - $), D;
317
+ }, i = (n, $) => {
318
+ const D = (G) => {
319
+ const K = G % $;
320
+ return K !== 0 && (G += K >= $ / 2 ? $ - K : -K), G;
318
321
  };
319
- if (typeof n == "number") return g(n);
322
+ if (typeof n == "number") return D(n);
320
323
  if (n instanceof Date) {
321
- let I = g(n.getMinutes());
322
- I >= 60 && (n.setHours(n.getHours() + 1), I = 0), n.setMinutes(I, 0, 0);
324
+ let G = D(n.getMinutes());
325
+ G >= 60 && (n.setHours(n.getHours() + 1), G = 0), n.setMinutes(G, 0, 0);
323
326
  }
324
- }, E = (n, _ = !1) => {
325
- const g = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate())), I = g.getUTCDay() || 7;
326
- g.setUTCDate(g.getUTCDate() + 4 - I);
327
- const ee = new Date(Date.UTC(g.getUTCFullYear(), 0, 1));
328
- return Math.ceil(((g - ee) / 864e5 + 1) / 7) + (_ ? 1 : 0);
329
- }, L = (n) => `${n.getFullYear()}-${n.getMonth()}-${n.getDate()}` === Y(), z = (n, _) => {
330
- if (!n || !_) return console.warn(`Vue Cal: missing date${n ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
331
- if (N(n)) {
332
- if (!N(_)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${_}\`.`);
327
+ }, V = (n, $ = !1) => {
328
+ const D = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate())), G = D.getUTCDay() || 7;
329
+ D.setUTCDate(D.getUTCDate() + 4 - G);
330
+ const K = new Date(Date.UTC(D.getUTCFullYear(), 0, 1));
331
+ return Math.ceil(((D - K) / 864e5 + 1) / 7) + ($ ? 1 : 0);
332
+ }, P = (n) => `${n.getFullYear()}-${n.getMonth()}-${n.getDate()}` === y(), A = (n, $) => {
333
+ if (!n || !$) return console.warn(`Vue Cal: missing date${n ? "2" : "1"} parameter for comparison with \`isSameDate(date1, date2)\`.`);
334
+ if (X(n)) {
335
+ if (!X($)) return console.warn(`Vue Cal: invalid date2 provided for comparison with \`isSameDate(date1, date2)\`: \`${$}\`.`);
333
336
  } else return console.warn(`Vue Cal: invalid date1 provided for comparison with \`isSameDate(date1, date2)\`: \`${n}\`.`);
334
- return n.getFullYear() === _.getFullYear() && n.getMonth() === _.getMonth() && n.getDate() === _.getDate();
335
- }, D = (n, _, g) => N(n) ? n.getTime() >= _ && n.getTime() <= g : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${n}\`.`), l = (n) => {
336
- const _ = n.getFullYear();
337
- return !(_ % 400) || _ % 100 && !(_ % 4);
338
- }, p = (n = null, _) => {
339
- const g = n && new Date(n.valueOf()) || /* @__PURE__ */ new Date(), I = _ ? 7 : 6;
340
- return g.setDate(g.getDate() - (g.getDay() + I) % 7), g;
341
- }, k = (n) => n instanceof Date ? n : (n.length === 10 && (n += " 00:00"), new Date(n.replace(/-/g, "/"))), a = (n) => n.getHours() * 60 + n.getMinutes(), j = (n, _) => {
342
- typeof n == "string" && (n = n.replace(/-/g, "/")), typeof _ == "string" && (_ = _.replace(/-/g, "/")), n = new Date(n).setHours(0, 0, 0, 0), _ = new Date(_).setHours(0, 0, 1, 0);
343
- const g = (new Date(_).getTimezoneOffset() - new Date(n).getTimezoneOffset()) * 60 * 1e3;
344
- return Math.ceil((_ - n - g) / (24 * 3600 * 1e3));
345
- }, R = (n, _, g) => Math.abs(n.getTime() - _.getTime()) <= g * 60 * 1e3, N = (n) => n && n instanceof Date && !isNaN(n), ne = (n, _ = "YYYY-MM-DD", g = null) => {
346
- if (g || (g = f.value), _ || (_ = "YYYY-MM-DD"), _ === "YYYY-MM-DD") return x(n);
347
- b = {}, H = {};
348
- const I = {
349
- YYYY: () => Q(n, g).YYYY,
350
- YY: () => Q(n, g).YY(),
351
- M: () => Q(n, g).M,
352
- MM: () => Q(n, g).MM(),
353
- MMM: () => Q(n, g).MMM(),
354
- MMMM: () => Q(n, g).MMMM(),
355
- MMMMG: () => Q(n, g).MMMMG(),
356
- D: () => Q(n, g).D,
357
- DD: () => Q(n, g).DD(),
358
- S: () => Q(n, g).S(),
359
- d: () => Q(n, g).d,
360
- dd: () => Q(n, g).dd(),
361
- ddd: () => Q(n, g).ddd(),
362
- dddd: () => Q(n, g).dddd(),
363
- HH: () => re(n, g).HH,
364
- H: () => re(n, g).H,
365
- hh: () => re(n, g).hh,
366
- h: () => re(n, g).h,
367
- am: () => re(n, g).am,
368
- AM: () => re(n, g).AM,
369
- mm: () => re(n, g).mm,
370
- m: () => re(n, g).m,
371
- s: () => re(n, g).s
337
+ return n.getFullYear() === $.getFullYear() && n.getMonth() === $.getMonth() && n.getDate() === $.getDate();
338
+ }, m = (n, $, D) => X(n) ? n.getTime() >= $ && n.getTime() <= D : console.warn(`Vue Cal: invalid date provided to \`isInRange(date, rangeStart, rangeEnd)\`: \`${n}\`.`), h = (n) => {
339
+ const $ = n.getFullYear();
340
+ return !($ % 400) || $ % 100 && !($ % 4);
341
+ }, H = (n = null, $) => {
342
+ const D = n && new Date(n.valueOf()) || /* @__PURE__ */ new Date(), G = $ ? 7 : 6;
343
+ return D.setDate(D.getDate() - (D.getDay() + G) % 7), D;
344
+ }, f = (n) => n instanceof Date ? n : (n.length === 10 && (n += " 00:00"), new Date(n.replace(/-/g, "/"))), T = (n) => n.getHours() * 60 + n.getMinutes(), E = (n, $) => {
345
+ typeof n == "string" && (n = n.replace(/-/g, "/")), typeof $ == "string" && ($ = $.replace(/-/g, "/")), n = new Date(n).setHours(0, 0, 0, 0), $ = new Date($).setHours(0, 0, 1, 0);
346
+ const D = (new Date($).getTimezoneOffset() - new Date(n).getTimezoneOffset()) * 60 * 1e3;
347
+ return Math.ceil(($ - n - D) / (24 * 3600 * 1e3));
348
+ }, l = (n, $, D) => Math.abs(n.getTime() - $.getTime()) <= D * 60 * 1e3, X = (n) => n && n instanceof Date && !isNaN(n), q = (n, $ = "YYYY-MM-DD", D = null) => {
349
+ if (D || (D = d.value), $ || ($ = "YYYY-MM-DD"), $ === "YYYY-MM-DD") return ae(n);
350
+ _ = {}, N = {};
351
+ const G = {
352
+ YYYY: () => ee(n, D).YYYY,
353
+ YY: () => ee(n, D).YY(),
354
+ M: () => ee(n, D).M,
355
+ MM: () => ee(n, D).MM(),
356
+ MMM: () => ee(n, D).MMM(),
357
+ MMMM: () => ee(n, D).MMMM(),
358
+ MMMMG: () => ee(n, D).MMMMG(),
359
+ D: () => ee(n, D).D,
360
+ DD: () => ee(n, D).DD(),
361
+ S: () => ee(n, D).S(),
362
+ d: () => ee(n, D).d,
363
+ dd: () => ee(n, D).dd(),
364
+ ddd: () => ee(n, D).ddd(),
365
+ dddd: () => ee(n, D).dddd(),
366
+ HH: () => re(n, D).HH,
367
+ H: () => re(n, D).H,
368
+ hh: () => re(n, D).hh,
369
+ h: () => re(n, D).h,
370
+ am: () => re(n, D).am,
371
+ AM: () => re(n, D).AM,
372
+ mm: () => re(n, D).mm,
373
+ m: () => re(n, D).m,
374
+ s: () => re(n, D).s
372
375
  };
373
- return _.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (ee, he) => {
374
- const i = I[he.replace(/\{|\}/g, "")];
375
- return i !== void 0 ? i() : he;
376
+ return $.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (K, De) => {
377
+ const r = G[De.replace(/\{|\}/g, "")];
378
+ return r !== void 0 ? r() : De;
376
379
  });
377
- }, x = (n) => {
378
- const _ = n.getMonth() + 1, g = n.getDate();
379
- return `${n.getFullYear()}-${_ < 10 ? "0" : ""}${_}-${g < 10 ? "0" : ""}${g}`;
380
- }, le = (n, _ = "HH:mm", g = null, I = !1) => {
381
- let ee = !1;
382
- if (I) {
383
- const [T, S, $] = [n.getHours(), n.getMinutes(), n.getSeconds()];
384
- T + S + $ === 141 && (ee = !0);
380
+ }, ae = (n) => {
381
+ const $ = n.getMonth() + 1, D = n.getDate();
382
+ return `${n.getFullYear()}-${$ < 10 ? "0" : ""}${$}-${D < 10 ? "0" : ""}${D}`;
383
+ }, se = (n, $ = "HH:mm", D = null, G = !1) => {
384
+ let K = !1;
385
+ if (G) {
386
+ const [S, O, M] = [n.getHours(), n.getMinutes(), n.getSeconds()];
387
+ S + O + M === 141 && (K = !0);
385
388
  }
386
- if (n instanceof Date && _ === "HH:mm") return ee ? "24:00" : ce(n);
387
- H = {}, g || (g = f.value);
388
- const he = re(n, g), i = _.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (T, S) => {
389
- const $ = he[S.replace(/\{|\}/g, "")];
390
- return $ !== void 0 ? $ : S;
389
+ if (n instanceof Date && $ === "HH:mm") return K ? "24:00" : de(n);
390
+ N = {}, D || (D = d.value);
391
+ const De = re(n, D), r = $.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g, (S, O) => {
392
+ const M = De[O.replace(/\{|\}/g, "")];
393
+ return M !== void 0 ? M : O;
391
394
  });
392
- return ee ? i.replace("23:59", "24:00") : i;
393
- }, ce = (n) => {
394
- const _ = n.getHours(), g = n.getMinutes();
395
- return `${(_ < 10 ? "0" : "") + _}:${(g < 10 ? "0" : "") + g}`;
396
- }, X = (n) => {
397
- const _ = Math.floor(n / 60).toString().padStart(2, 0), g = (n % 60).toString().padStart(2, 0);
398
- return `${_}:${g}`;
399
- }, Ee = (n) => {
395
+ return K ? r.replace("23:59", "24:00") : r;
396
+ }, de = (n) => {
397
+ const $ = n.getHours(), D = n.getMinutes();
398
+ return `${($ < 10 ? "0" : "") + $}:${(D < 10 ? "0" : "") + D}`;
399
+ }, Z = (n) => {
400
+ const $ = Math.floor(n / 60).toString().padStart(2, 0), D = (n % 60).toString().padStart(2, 0);
401
+ return `${$}:${D}`;
402
+ }, he = (n) => {
400
403
  if (n > 3 && n < 21) return "th";
401
404
  switch (n % 10) {
402
405
  case 1:
@@ -408,94 +411,94 @@ const st = (y, s) => {
408
411
  default:
409
412
  return "th";
410
413
  }
411
- }, Q = (n, _) => {
412
- if (b.D) return b;
413
- const g = n.getFullYear(), I = n.getMonth() + 1, ee = n.getDate(), i = (n.getDay() - 1 + 7) % 7;
414
- return b = {
414
+ }, ee = (n, $) => {
415
+ if (_.D) return _;
416
+ const D = n.getFullYear(), G = n.getMonth() + 1, K = n.getDate(), r = (n.getDay() - 1 + 7) % 7;
417
+ return _ = {
415
418
  // Year.
416
- YYYY: g,
419
+ YYYY: D,
417
420
  // 2024.
418
- YY: () => g.toString().substring(2),
421
+ YY: () => D.toString().substring(2),
419
422
  // 24.
420
423
  // Month.
421
- M: I,
424
+ M: G,
422
425
  // 1 to 12.
423
- MM: () => I.toString().padStart(2, 0),
426
+ MM: () => G.toString().padStart(2, 0),
424
427
  // 01 to 12.
425
- MMM: () => _.months[I - 1].substring(0, 3),
428
+ MMM: () => $.months[G - 1].substring(0, 3),
426
429
  // Jan to Dec.
427
- MMMM: () => _.months[I - 1],
430
+ MMMM: () => $.months[G - 1],
428
431
  // January to December.
429
- MMMMG: () => (_.monthsGenitive || _.months)[I - 1],
432
+ MMMMG: () => ($.monthsGenitive || $.months)[G - 1],
430
433
  // January to December in genitive form (Greek...)
431
434
  // Day.
432
- D: ee,
435
+ D: K,
433
436
  // 1 to 31.
434
- DD: () => ee.toString().padStart(2, 0),
437
+ DD: () => K.toString().padStart(2, 0),
435
438
  // 01 to 31.
436
- S: () => Ee(ee),
439
+ S: () => he(K),
437
440
  // st, nd, rd, th.
438
441
  // Day of the week.
439
- d: i + 1,
442
+ d: r + 1,
440
443
  // 1 to 7 with 7 = Sunday.
441
444
  // Some locales have same start for all the days, so they have specific abbrev in weekDaysShort.
442
- dd: () => _.weekDaysShort.length ? _.weekDaysShort[i] : _.weekDays[i][0],
445
+ dd: () => $.weekDaysShort.length ? $.weekDaysShort[r] : $.weekDays[r][0],
443
446
  // M to S.
444
- ddd: () => _.weekDaysShort.length ? _.weekDaysShort[i] : _.weekDays[i].substr(0, 3),
447
+ ddd: () => $.weekDaysShort.length ? $.weekDaysShort[r] : $.weekDays[r].substr(0, 3),
445
448
  // Mon to Sun.
446
- dddd: () => _.weekDays[i]
449
+ dddd: () => $.weekDays[r]
447
450
  // Monday to Sunday.
448
- }, b;
449
- }, re = (n, _) => {
450
- if (H.am) return H;
451
- let g, I, ee;
452
- n instanceof Date ? (g = n.getHours(), I = n.getMinutes(), ee = n.getSeconds()) : (g = Math.floor(n / 60), I = Math.floor(n % 60));
453
- const he = g % 12 ? g % 12 : 12, i = (_ || { am: "am", pm: "pm" })[g === 24 || g < 12 ? "am" : "pm"];
454
- return H = {
455
- H: g,
456
- h: he,
457
- HH: g.toString().padStart(2, 0),
458
- hh: he.toString().padStart(2, 0),
459
- am: i,
460
- AM: i.toUpperCase(),
461
- m: I,
462
- mm: I.toString().padStart(2, 0),
463
- s: ee
464
- }, H;
451
+ }, _;
452
+ }, re = (n, $) => {
453
+ if (N.am) return N;
454
+ let D, G, K;
455
+ n instanceof Date ? (D = n.getHours(), G = n.getMinutes(), K = n.getSeconds()) : (D = Math.floor(n / 60), G = Math.floor(n % 60));
456
+ const De = D % 12 ? D % 12 : 12, r = ($ || { am: "am", pm: "pm" })[D === 24 || D < 12 ? "am" : "pm"];
457
+ return N = {
458
+ H: D,
459
+ h: De,
460
+ HH: D.toString().padStart(2, 0),
461
+ hh: De.toString().padStart(2, 0),
462
+ am: r,
463
+ AM: r.toUpperCase(),
464
+ m: G,
465
+ mm: G.toString().padStart(2, 0),
466
+ s: K
467
+ }, N;
465
468
  };
466
469
  return {
467
- addDatePrototypes: F,
468
- removeDatePrototypes: u,
469
- updateTexts: m,
470
- addDays: A,
471
- subtractDays: Z,
472
- addHours: t,
473
- subtractHours: o,
470
+ addDatePrototypes: z,
471
+ removeDatePrototypes: v,
472
+ updateTexts: c,
473
+ addDays: F,
474
+ subtractDays: W,
475
+ addHours: a,
476
+ subtractHours: s,
474
477
  addMinutes: e,
475
- subtractMinutes: h,
476
- snapToInterval: c,
477
- getWeek: E,
478
- isToday: L,
479
- isSameDate: z,
480
- isInRange: D,
481
- isLeapYear: l,
482
- getPreviousFirstDayOfWeek: p,
483
- stringToDate: k,
484
- dateToMinutes: a,
485
- countDays: j,
486
- datesInSameTimeStep: R,
487
- isValid: N,
488
- formatDate: ne,
489
- formatDateLite: x,
490
- formatTime: le,
491
- formatTimeLite: ce,
492
- formatMinutes: X
478
+ subtractMinutes: k,
479
+ snapToInterval: i,
480
+ getWeek: V,
481
+ isToday: P,
482
+ isSameDate: A,
483
+ isInRange: m,
484
+ isLeapYear: h,
485
+ getPreviousFirstDayOfWeek: H,
486
+ stringToDate: f,
487
+ dateToMinutes: T,
488
+ countDays: E,
489
+ datesInSameTimeStep: l,
490
+ isValid: X,
491
+ formatDate: q,
492
+ formatDateLite: ae,
493
+ formatTime: se,
494
+ formatTimeLite: de,
495
+ formatMinutes: Z
493
496
  };
494
- }, St = (y) => {
495
- const { dateUtils: s, config: r } = y;
496
- let d = 0;
497
- const w = M(() => {
498
- const t = {
497
+ }, Ot = (p) => {
498
+ const { dateUtils: t, config: u } = p;
499
+ let o = 0;
500
+ const w = Y(() => {
501
+ const a = {
499
502
  // A map of events indexed by { YYYY: { MM: { DD: [] } } }.
500
503
  // Each year contains a map of 12 months starting from 1, each containing a map of days starting from 1, each containing an array of event IDs.
501
504
  byYear: {},
@@ -507,503 +510,507 @@ const st = (y, s) => {
507
510
  // An array of events IDs that are multiday.
508
511
  byId: {}
509
512
  // A map of all the events indexed by ID for fast lookup. Each event is the original full event object.
510
- }, o = r.events.sort((e, h) => e.start - h.start < 0 ? -1 : 1);
511
- for (const e of o)
512
- if (b(e), H(e), t.byId[e._.id] = e, e.recurring)
513
- t.recurring.push(e._.id);
513
+ }, s = u.events.sort((e, k) => e.start - k.start < 0 ? -1 : 1);
514
+ for (const e of s)
515
+ if (_(e), N(e), a.byId[e._.id] = e, e.recurring)
516
+ a.recurring.push(e._.id);
514
517
  else if (e._.multiday)
515
- t.multiday.push(e._.id), t.byDate[e._.startFormatted] || (t.byDate[e._.startFormatted] = []), t.byDate[e._.startFormatted].push(e._.id);
518
+ a.multiday.push(e._.id), a.byDate[e._.startFormatted] || (a.byDate[e._.startFormatted] = []), a.byDate[e._.startFormatted].push(e._.id);
516
519
  else {
517
- t.byDate[e._.startFormatted] || (t.byDate[e._.startFormatted] = []), t.byDate[e._.startFormatted].push(e._.id);
518
- const h = e._.startFormatted.substring(0, 4), c = e._.startFormatted.substring(5, 7), E = e._.startFormatted.substring(8, 10);
519
- t.byYear[h] || (t.byYear[h] = {}), t.byYear[h][c] || (t.byYear[h][c] = {}), t.byYear[h][c][E] || (t.byYear[h][c][E] = []), t.byYear[h][c][E].push(e._.id);
520
+ a.byDate[e._.startFormatted] || (a.byDate[e._.startFormatted] = []), a.byDate[e._.startFormatted].push(e._.id);
521
+ const k = e._.startFormatted.substring(0, 4), i = e._.startFormatted.substring(5, 7), V = e._.startFormatted.substring(8, 10);
522
+ a.byYear[k] || (a.byYear[k] = {}), a.byYear[k][i] || (a.byYear[k][i] = {}), a.byYear[k][i][V] || (a.byYear[k][i][V] = []), a.byYear[k][i][V].push(e._.id);
520
523
  }
521
- return t;
522
- }), b = (t) => {
523
- if (typeof t.start == "string" && (t.start = s.stringToDate(t.start)), typeof t.end == "string" && (t.end = s.stringToDate(t.end)), t.start.setSeconds(0, 0), t.end.getSeconds() >= 59 ? t.end.setMinutes(60, 0, 0) : t.end.setSeconds(0, 0), isNaN(t.start) || isNaN(t.end) || t.end.getTime() < t.start.getTime()) {
524
- isNaN(t.start) ? console.error(`Vue Cal: invalid start date for event "${t.title}".`, t.start) : isNaN(t.end) ? console.error(`Vue Cal: invalid end date for event "${t.title}".`, t.end) : console.error(`Vue Cal: invalid event dates for event "${t.title}". The event ends before it starts.`, t.start, t.end);
524
+ return a;
525
+ }), _ = (a) => {
526
+ if (typeof a.start == "string" && (a.start = t.stringToDate(a.start)), typeof a.end == "string" && (a.end = t.stringToDate(a.end)), a.start.setSeconds(0, 0), a.end.getSeconds() >= 59 ? a.end.setMinutes(60, 0, 0) : a.end.setSeconds(0, 0), isNaN(a.start) || isNaN(a.end) || a.end.getTime() < a.start.getTime()) {
527
+ isNaN(a.start) ? console.error(`Vue Cal: invalid start date for event "${a.title}".`, a.start) : isNaN(a.end) ? console.error(`Vue Cal: invalid end date for event "${a.title}".`, a.end) : console.error(`Vue Cal: invalid event dates for event "${a.title}". The event ends before it starts.`, a.start, a.end);
525
528
  return;
526
529
  }
527
- t._ || (t._ = {}), t._.multiday = !s.isSameDate(t.start, new Date(t.end.getTime() - 1)), t._.startFormatted = s.formatDate(t.start), t._.startMinutes = ~~s.dateToMinutes(t.start), t._.endMinutes = ~~s.dateToMinutes(t.end);
528
- const o = t.start.getHours(), e = t.start.getMinutes().toString().padStart(2, 0), h = t.end.getHours(), c = t.end.getMinutes().toString().padStart(2, 0);
529
- t._.startTimeFormatted24 = `${o.toString().padStart(2, 0)}:${e}`, t._.startTimeFormatted12 = `${o % 12 || 12}${e ? `:${e}` : ""} ${o < 12 ? "AM" : "PM"}`, t._.endTimeFormatted24 = `${h.toString().padStart(2, 0)}:${c}`, t._.endTimeFormatted12 = `${h % 12 || 12}${c ? `:${c}` : ""} ${h < 12 ? "AM" : "PM"}`, t._.duration = Math.abs(~~((t.end - t.start) / 6e4));
530
- }, H = (t) => {
531
- t._ || (t._ = {}), t._.id = t._.id || ++d, t.delete || (t.delete = (o) => m(t._.id, o)), t._.deleting = !1, t._.deleted = !1, t.isOverlapping = (o = null) => t.getOverlappingEvents(o).length, t.getOverlappingEvents = (o = null) => {
530
+ a._ || (a._ = {}), a._.multiday = !t.isSameDate(a.start, new Date(a.end.getTime() - 1)), a._.startFormatted = t.formatDate(a.start), a._.startMinutes = ~~t.dateToMinutes(a.start), a._.endMinutes = ~~t.dateToMinutes(a.end);
531
+ const s = a.start.getHours(), e = a.start.getMinutes().toString().padStart(2, 0), k = a.end.getHours(), i = a.end.getMinutes().toString().padStart(2, 0);
532
+ a._.startTimeFormatted24 = `${s.toString().padStart(2, 0)}:${e}`, a._.startTimeFormatted12 = `${s % 12 || 12}${e ? `:${e}` : ""} ${s < 12 ? "AM" : "PM"}`, a._.endTimeFormatted24 = `${k.toString().padStart(2, 0)}:${i}`, a._.endTimeFormatted12 = `${k % 12 || 12}${i ? `:${i}` : ""} ${k < 12 ? "AM" : "PM"}`, a._.duration = Math.abs(~~((a.end - a.start) / 6e4));
533
+ }, N = (a) => {
534
+ a._ || (a._ = {}), a._.id = a._.id || ++o, a.delete || (a.delete = (s) => c(a._.id, s)), a._.deleting = !1, a._.deleted = !1, a.isOverlapping = (s = null) => a.getOverlappingEvents(s).length, a.getOverlappingEvents = (s = null) => {
532
535
  var e;
533
- return A(
534
- (o == null ? void 0 : o.start) || t.start,
535
- (o == null ? void 0 : o.end) || t.end,
536
- { excludeIds: [t._.id], schedule: (e = r.schedules) != null && e.length ? ~~((o == null ? void 0 : o.schedule) || t.schedule) : null }
536
+ return F(
537
+ (s == null ? void 0 : s.start) || a.start,
538
+ (s == null ? void 0 : s.end) || a.end,
539
+ { excludeIds: [a._.id], schedule: (e = u.schedules) != null && e.length ? ~~((s == null ? void 0 : s.schedule) || a.schedule) : null }
537
540
  );
538
- }, t._.register = (o) => {
539
- t._.$el = o, t._.fireCreated && (y.emit("event-created", t), delete t._.fireCreated);
540
- }, t._.unregister = () => {
541
- t._.$el = null, t._.register = null, t.isOverlapping = null, t.getOverlappingEvents = null, t.delete = null;
541
+ }, a._.register = (s) => {
542
+ a._.$el = s, a._.fireCreated && (p.emit("event-created", a), delete a._.fireCreated);
543
+ }, a._.unregister = () => {
544
+ a._.$el = null, a._.register = null, a.isOverlapping = null, a.getOverlappingEvents = null, a.delete = null;
542
545
  };
543
- }, f = (t) => w.value.byId[t], F = (t) => {
544
- const o = [];
545
- for (const { start: e, end: h } of t) {
546
- const c = A(e, h);
547
- c.length && o.push(...c);
546
+ }, d = (a) => w.value.byId[a], z = (a) => {
547
+ const s = [];
548
+ for (const { start: e, end: k } of a) {
549
+ const i = F(e, k);
550
+ i.length && s.push(...i);
548
551
  }
549
- return o;
550
- }, u = (t) => {
551
- if (!t.start || !t.end) {
552
+ return s;
553
+ }, v = (a) => {
554
+ if (!a.start || !a.end) {
552
555
  console.error("Vue Cal: Cannot create an event without valid start and end dates.");
553
556
  return;
554
557
  }
555
- return r.snapToInterval && (s.snapToInterval(t.start, r.snapToInterval), s.snapToInterval(t.end, r.snapToInterval)), t = { ...t }, t._ || (t._ = {}), t._.id = ++d, t._.fireCreated = !0, r.events.push(t), t;
556
- }, m = async (t, o = 0) => {
557
- var L, z;
558
- if (!t) return console.warn("Vue Cal: Cannot delete event without its ID or criteria.");
559
- let e = typeof t == "string" || !isNaN(t) ? t : null;
560
- const h = typeof t == "object" ? Object.entries(t) : null;
561
- if (h) {
562
- const [D, l] = h[0];
563
- e = (L = r.events.find((p) => p[D] === l)) == null ? void 0 : L._.id;
558
+ return u.snapToInterval && (t.snapToInterval(a.start, u.snapToInterval), t.snapToInterval(a.end, u.snapToInterval)), a = { ...a }, a._ || (a._ = {}), a._.id = ++o, a._.fireCreated = !0, u.events.push(a), a;
559
+ }, c = async (a, s = 0) => {
560
+ var P, A;
561
+ if (!a) return console.warn("Vue Cal: Cannot delete event without its ID or criteria.");
562
+ let e = typeof a == "string" || !isNaN(a) ? a : null;
563
+ const k = typeof a == "object" ? Object.entries(a) : null;
564
+ if (k) {
565
+ const [m, h] = k[0];
566
+ e = (P = u.events.find((H) => H[m] === h)) == null ? void 0 : P._.id;
564
567
  }
565
- if (!r.editableEvents.delete)
568
+ if (!u.editableEvents.delete)
566
569
  return console.info("Vue Cal: Event deletion is disabled. Enable it with the `editable-events` props.");
567
570
  if (!e) return console.warn("Vue Cal: Cannot delete event without its ID.");
568
- const c = r.events.findIndex((D) => D._.id === e);
569
- if (c === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${e}\`.`);
570
- const E = r.events[c];
571
- if (E.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${e}\` since it was explicitely set to \`delete: false\`.`);
572
- switch (o) {
571
+ const i = u.events.findIndex((m) => m._.id === e);
572
+ if (i === -1) return console.warn(`Vue Cal: Cannot delete unknown event \`${e}\`.`);
573
+ const V = u.events[i];
574
+ if (V.deletable === !1) return console.warn(`Vue Cal: Can't delete event \`${e}\` since it was explicitely set to \`delete: false\`.`);
575
+ switch (s) {
573
576
  case 0:
574
- E._.deleting ? r.events.splice(c, 1) : E._.deleting = !0;
577
+ V._.deleting ? u.events.splice(i, 1) : V._.deleting = !0;
575
578
  break;
576
579
  // Display the delete button.
577
580
  case 1:
578
- E._.deleting = !0;
581
+ V._.deleting = !0;
579
582
  break;
580
583
  // Visual deletion + external DOM event firing.
581
584
  // When explicitly using this stage, the event will be visually deleted but still present in the
582
585
  // source of truth until the cell is unmounted (by navigating away).
583
586
  case 2:
584
- E._.deleted = !0, r.events[c]._.deleted = !0, (z = E._.$el) == null || z.dispatchEvent(new CustomEvent("event-deleted", { detail: E._.id }));
587
+ V._.deleted = !0, u.events[i]._.deleted = !0, (A = V._.$el) == null || A.dispatchEvent(new CustomEvent("event-deleted", { detail: V._.id }));
585
588
  break;
586
589
  // Effective deletion from the source of truth (by default, when unmounting the cell).
587
590
  case 3:
588
- r.events.splice(c, 1), y.emit("update:events", r.events), y.emit("event-delete", E);
591
+ u.events.splice(i, 1), p.emit("update:events", u.events), p.emit("event-delete", V);
589
592
  break;
590
593
  }
591
594
  return !0;
592
- }, Y = (t, o) => {
593
- const e = A(t, o);
594
- if (!e.length) return { cellOverlaps: {}, longestStreak: 0 };
595
- const h = {};
596
- let c = [], E = 0;
597
- e.sort((L, z) => L.start - z.start || L.end - L.start - (z.end - z.start));
598
- for (const L of e) {
599
- const z = L._.id;
600
- h[z] || (h[z] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), c = c.filter((a) => a.end > L.start);
601
- const D = c.filter((a) => {
602
- var R;
603
- return (!((R = r.schedules) != null && R.length) || L.schedule === a.schedule) && a.start < L.end;
604
- }), l = new Set(D.map((a) => {
605
- var j;
606
- return ((j = h[a._.id]) == null ? void 0 : j.position) ?? 0;
595
+ }, y = (a, s) => {
596
+ const e = u.allDayEvents ? { allDay: !0 } : {}, k = F(a, s, { background: !1, ...e });
597
+ if (!k.length) return { cellOverlaps: {}, longestStreak: 0 };
598
+ const i = {};
599
+ let V = [], P = 0;
600
+ k.sort((A, m) => A.start - m.start || A.end - A.start - (m.end - m.start));
601
+ for (const A of k) {
602
+ const m = A._.id;
603
+ i[m] || (i[m] = { overlaps: /* @__PURE__ */ new Set(), maxConcurrent: 1, position: 0 }), V = V.filter((E) => E.end > A.start);
604
+ const h = V.filter((E) => {
605
+ var X;
606
+ return (!((X = u.schedules) != null && X.length) || A.schedule === E.schedule) && E.start < A.end;
607
+ }), H = new Set(h.map((E) => {
608
+ var l;
609
+ return ((l = i[E._.id]) == null ? void 0 : l.position) ?? 0;
607
610
  }));
608
- let p = 0;
609
- for (; l.has(p); ) p++;
610
- h[z].position = p, c.push(L);
611
- const k = Math.max(1, ...D.map((a) => {
612
- var j;
613
- return ((j = h[a._.id]) == null ? void 0 : j.maxConcurrent) ?? 1;
611
+ let f = 0;
612
+ for (; H.has(f); ) f++;
613
+ i[m].position = f, V.push(A);
614
+ const T = Math.max(1, ...h.map((E) => {
615
+ var l;
616
+ return ((l = i[E._.id]) == null ? void 0 : l.maxConcurrent) ?? 1;
614
617
  }));
615
- h[z].maxConcurrent = Math.max(D.length + 1, k);
616
- for (const a of D)
617
- h[a._.id].overlaps.add(z), h[z].overlaps.add(a._.id), h[a._.id].maxConcurrent = h[z].maxConcurrent;
618
- E = Math.max(E, h[z].maxConcurrent);
618
+ i[m].maxConcurrent = Math.max(h.length + 1, T);
619
+ for (const E of h)
620
+ i[E._.id].overlaps.add(m), i[m].overlaps.add(E._.id), i[E._.id].maxConcurrent = i[m].maxConcurrent;
621
+ P = Math.max(P, i[m].maxConcurrent);
619
622
  }
620
- for (const L in h) h[L].overlaps = [...h[L].overlaps];
621
- return { cellOverlaps: h, longestStreak: E };
622
- }, A = (t, o, { excludeIds: e = [], schedule: h = null, background: c = !0 } = {}) => {
623
- const E = t.getFullYear(), L = o.getFullYear(), z = t.getMonth() + 1, D = o.getMonth() + 1, l = t.getDate(), p = o.getDate(), k = t.getTime(), a = o.getTime(), j = [], R = new Set(e);
624
- for (let N = E; N <= L; N++) {
625
- const ne = `${N}`, x = w.value.byYear[ne];
626
- if (!x) continue;
627
- const le = N === E ? z : 1, ce = N === L ? D : 12;
628
- for (let X = le; X <= ce; X++) {
629
- const Ee = String(X).padStart(2, "0"), Q = x[Ee];
630
- if (Q)
631
- for (const re in Q) {
632
- const n = +re;
633
- if (N === E && X === z && n < l || N === L && X === D && n > p) continue;
634
- const _ = Q[re];
635
- for (let g = 0; g < _.length; g++) {
636
- const I = w.value.byId[_[g]];
637
- !I || R.has(I._.id) || h !== null && h !== I.schedule || c === !1 && I.background || I.end.getTime() > k && I.start.getTime() < a && j.push(I);
623
+ for (const A in i) i[A].overlaps = [...i[A].overlaps];
624
+ return { cellOverlaps: i, longestStreak: P };
625
+ }, F = (a, s, { excludeIds: e = [], schedule: k = null, background: i = !0, allDay: V = !1 } = {}) => {
626
+ const P = a.getFullYear(), A = s.getFullYear(), m = a.getMonth() + 1, h = s.getMonth() + 1, H = a.getDate(), f = s.getDate(), T = a.getTime(), E = s.getTime(), l = [], X = new Set(e);
627
+ for (let q = P; q <= A; q++) {
628
+ const ae = `${q}`, se = w.value.byYear[ae];
629
+ if (!se) continue;
630
+ const de = q === P ? m : 1, Z = q === A ? h : 12;
631
+ for (let he = de; he <= Z; he++) {
632
+ const ee = String(he).padStart(2, "0"), re = se[ee];
633
+ if (re)
634
+ for (const n in re) {
635
+ const $ = +n;
636
+ if (q === P && he === m && $ < H || q === A && he === h && $ > f) continue;
637
+ const D = re[n];
638
+ for (let G = 0; G < D.length; G++) {
639
+ const K = w.value.byId[D[G]];
640
+ !K || X.has(K._.id) || k !== null && k !== K.schedule || i === !1 && K.background || u.allDayEvents && (V && !K.allDay || !V && K.allDay) || K.end.getTime() > T && K.start.getTime() < E && l.push(K);
638
641
  }
639
642
  }
640
643
  }
641
644
  }
642
- return j;
645
+ return l;
643
646
  };
644
647
  return {
645
648
  events: w,
646
- getEvent: f,
647
- getViewEvents: F,
648
- getCellOverlappingEvents: Y,
649
- getEventsInRange: A,
650
- createEvent: u,
651
- deleteEvent: m,
652
- isEventInRange: (t, o, e) => {
653
- const h = t.allDay || !r.time, c = h ? new Date(t.start).setHours(0, 0, 0, 0) : t.start.getTime(), E = h ? new Date(t.end).setHours(23, 59, 59, 999) : t.end.getTime(), L = h ? new Date(o).setHours(0, 0, 0, 0) : o.getTime(), z = h ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
654
- return E > L && c < z;
649
+ getEvent: d,
650
+ getViewEvents: z,
651
+ getCellOverlappingEvents: y,
652
+ getEventsInRange: F,
653
+ createEvent: v,
654
+ deleteEvent: c,
655
+ isEventInRange: (a, s, e) => {
656
+ const k = a.allDay || !u.time, i = k ? new Date(a.start).setHours(0, 0, 0, 0) : a.start.getTime(), V = k ? new Date(a.end).setHours(23, 59, 59, 999) : a.end.getTime(), P = k ? new Date(s).setHours(0, 0, 0, 0) : s.getTime(), A = k ? new Date(e).setHours(23, 59, 59, 999) : e.getTime();
657
+ return V > P && i < A;
655
658
  }
656
659
  };
657
- }, Ct = ({ config: y, dateUtils: s, emit: r, texts: d, eventsManager: w }, b) => {
658
- const { availableViews: H } = y, f = ue(y.view && H[y.view] ? y.view : y.defaultView), F = ue(y.selectedDate || null), u = ue(/* @__PURE__ */ new Date()), m = ue(new Date(y.viewDate || u.value));
659
- m.value.setHours(0, 0, 0, 0);
660
- const Y = ue(new Date(m));
661
- let A = null;
662
- const Z = M(() => f.value === "month" ? Y.value : l.value), t = M(() => f.value === "month" ? new Date(Y.value.getFullYear(), Y.value.getMonth() + 1, 0, 23, 59, 59, 999) : k.value), o = M(() => f.value === "week" ? s.getPreviousFirstDayOfWeek(l.value, y.startWeekOnSunday) : f.value === "month" ? l.value : Z.value), e = M(() => {
663
- if (f.value === "week") {
664
- const v = s.addDays(o.value, 7);
665
- return v.setMilliseconds(-1), v;
660
+ }, jt = ({ config: p, dateUtils: t, emit: u, texts: o, eventsManager: w }, _) => {
661
+ const { availableViews: N } = p, d = ie(p.view && N[p.view] ? p.view : p.defaultView), z = ie(p.selectedDate || null), v = ie(/* @__PURE__ */ new Date()), c = ie(new Date(p.viewDate || v.value));
662
+ c.value.setHours(0, 0, 0, 0);
663
+ const y = ie(new Date(c));
664
+ let F = null;
665
+ const W = Y(() => d.value === "month" ? y.value : h.value), a = Y(() => d.value === "month" ? new Date(y.value.getFullYear(), y.value.getMonth() + 1, 0, 23, 59, 59, 999) : f.value), s = Y(() => d.value === "week" ? t.getPreviousFirstDayOfWeek(h.value, p.startWeekOnSunday) : d.value === "month" ? h.value : W.value), e = Y(() => {
666
+ if (d.value === "week") {
667
+ const g = t.addDays(s.value, 7);
668
+ return g.setMilliseconds(-1), g;
666
669
  }
667
- return f.value === "month" ? k.value : t.value;
668
- }), h = M(() => {
669
- const v = u.value.getTime();
670
- if (f.value === "week")
671
- return o.value.getTime() <= v && v <= e.value.getTime();
672
- const W = l.value.getTime(), K = k.value.getTime();
673
- return W <= v && v <= K;
670
+ return d.value === "month" ? f.value : a.value;
671
+ }), k = Y(() => {
672
+ const g = v.value.getTime();
673
+ if (d.value === "week")
674
+ return s.value.getTime() <= g && g <= e.value.getTime();
675
+ const R = h.value.getTime(), x = f.value.getTime();
676
+ return R <= g && g <= x;
674
677
  });
675
- function c() {
676
- u.value = /* @__PURE__ */ new Date(), A = setTimeout(c, 60 * 1e3);
678
+ function i() {
679
+ v.value = /* @__PURE__ */ new Date(), F = setTimeout(i, 60 * 1e3);
677
680
  }
678
- function E() {
679
- A = setTimeout(c, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), c();
681
+ function V() {
682
+ F = setTimeout(i, (60 - (/* @__PURE__ */ new Date()).getSeconds()) * 1e3), i();
680
683
  }
681
- const L = M(() => {
682
- if (!y.availableViews[f.value]) return 1;
683
- let v = y.availableViews[f.value].cols;
684
- return y.hasHiddenDays && ["week", "month"].includes(f.value) && (v -= y.hasHiddenDays), v;
685
- }), z = M(() => {
686
- var v;
687
- return ((v = y.availableViews[f.value]) == null ? void 0 : v.rows) || 1;
688
- }), D = M(() => L.value * z.value), l = M(() => {
689
- if (f.value === "month") {
690
- let v = Y.value.getDay() || 7;
691
- return y.startWeekOnSunday && !y.hideWeekdays[7] && (v += 1), y.viewDayOffset && (v -= y.viewDayOffset), s.subtractDays(Y.value, v - 1);
684
+ const P = Y(() => {
685
+ if (!p.availableViews[d.value]) return 1;
686
+ let g = p.availableViews[d.value].cols;
687
+ return p.hasHiddenDays && ["week", "month"].includes(d.value) && (g -= p.hasHiddenDays), g;
688
+ }), A = Y(() => {
689
+ var g;
690
+ return ((g = p.availableViews[d.value]) == null ? void 0 : g.rows) || 1;
691
+ }), m = Y(() => P.value * A.value), h = Y(() => {
692
+ if (d.value === "month") {
693
+ let g = y.value.getDay() || 7;
694
+ return p.startWeekOnSunday && !p.hideWeekdays[7] && (g += 1), p.viewDayOffset && (g -= p.viewDayOffset), t.subtractDays(y.value, g - 1);
692
695
  }
693
- if (f.value === "week") {
694
- const v = "1234567".split("").filter((K) => !Object.keys(y.hideWeekdays).includes(K));
695
- let W = Math.min(...v);
696
- return y.startWeekOnSunday && !y.hideWeekdays[7] && (W = 1), y.viewDayOffset && (W += y.viewDayOffset), s.addDays(Y.value, W - 1);
696
+ if (d.value === "week") {
697
+ const g = "1234567".split("").filter((x) => !Object.keys(p.hideWeekdays).includes(x));
698
+ let R = Math.min(...g);
699
+ return p.startWeekOnSunday && !p.hideWeekdays[7] && (R = 1), p.viewDayOffset && (R += p.viewDayOffset), t.addDays(y.value, R - 1);
697
700
  }
698
- return Y.value;
699
- }), p = M(() => {
700
- const v = [], W = ["days", "week", "month"].includes(f.value);
701
- let K = 0;
702
- for (let U = 0; U < D.value + K; U++)
703
- switch (f.value) {
701
+ return y.value;
702
+ }), H = Y(() => {
703
+ const g = [], R = ["days", "week", "month"].includes(d.value);
704
+ let x = 0;
705
+ for (let Q = 0; Q < m.value + x; Q++)
706
+ switch (d.value) {
704
707
  case "day":
705
708
  case "days":
706
709
  case "week":
707
710
  case "month": {
708
- const me = s.addDays(l.value, U), We = me.getDay() || 7;
709
- if (W && y.hasHiddenDays && y.hideWeekdays[We]) {
710
- K++;
711
+ const fe = t.addDays(h.value, Q), Ae = fe.getDay() || 7;
712
+ if (R && p.hasHiddenDays && p.hideWeekdays[Ae]) {
713
+ x++;
711
714
  continue;
712
715
  }
713
- const Ce = new Date(me);
714
- Ce.setHours(23, 59, 59, 999), v.push({ start: me, startFormatted: s.formatDate(me), end: Ce });
716
+ const Ve = new Date(fe);
717
+ Ve.setHours(23, 59, 59, 999), g.push({ start: fe, startFormatted: t.formatDate(fe), end: Ve });
715
718
  break;
716
719
  }
717
720
  case "year":
718
- v.push({
719
- start: new Date(l.value.getFullYear(), U, 1, 0, 0, 0, 0),
720
- end: new Date(l.value.getFullYear(), U + 1, 0, 23, 59, 59, 999)
721
+ g.push({
722
+ start: new Date(h.value.getFullYear(), Q, 1, 0, 0, 0, 0),
723
+ end: new Date(h.value.getFullYear(), Q + 1, 0, 23, 59, 59, 999)
721
724
  });
722
725
  break;
723
726
  case "years":
724
- v.push({
725
- start: new Date(l.value.getFullYear() + U, 0, 1, 0, 0, 0, 0),
726
- end: new Date(l.value.getFullYear() + U + 1, 0, 0, 23, 59, 59, 999)
727
+ g.push({
728
+ start: new Date(h.value.getFullYear() + Q, 0, 1, 0, 0, 0, 0),
729
+ end: new Date(h.value.getFullYear() + Q + 1, 0, 0, 23, 59, 59, 999)
727
730
  });
728
731
  break;
729
732
  }
730
- return v;
731
- }), k = M(() => p.value[p.value.length - 1].end), a = ue("right"), j = M(() => {
732
- const v = Object.keys(y.availableViews);
733
- return v[v.indexOf(f.value) + 1];
734
- }), R = M(() => {
735
- const v = Object.keys(y.availableViews);
736
- return v[v.indexOf(f.value) - 1];
733
+ return g;
734
+ }), f = Y(() => H.value[H.value.length - 1].end), T = ie("right"), E = Y(() => {
735
+ const g = Object.keys(p.availableViews);
736
+ return g[g.indexOf(d.value) + 1];
737
+ }), l = Y(() => {
738
+ const g = Object.keys(p.availableViews);
739
+ return g[g.indexOf(d.value) - 1];
737
740
  });
738
- function N(v, W, K = !1) {
739
- if (!W || !W[v]) return v + 1;
740
- const U = W[v];
741
- return K && typeof U == "string" ? U.substring(0, 3) : U;
741
+ function X(g, R, x = !1) {
742
+ if (!R || !R[g]) return g + 1;
743
+ const Q = R[g];
744
+ return x && typeof Q == "string" ? Q.substring(0, 3) : Q;
742
745
  }
743
- function ne(v, W, K) {
744
- const { monthsArray: U, monthBeforeDay: me, canTruncate: We, xs: Ce } = K, Te = v.getMonth(), Me = v.getFullYear(), Ye = W.getMonth(), Pe = W.getFullYear(), Ae = Te !== Ye, pt = Me !== Pe, be = We && (Ce || Ae), Le = v.getDate(), He = W.getDate();
745
- return pt ? me ? `${N(Te, U, be)} ${Le}, ${Me} - ${N(Ye, U, be)} ${He}, ${Pe}` : `${Le} ${N(Te, U, be)} ${Me} - ${He} ${N(Ye, U, be)} ${Pe}` : Ae ? me ? `${N(Te, U, be)} ${Le} - ${N(Ye, U, be)} ${He}, ${Me}` : `${Le} ${N(Te, U, be)} - ${He} ${N(Ye, U, be)} ${Me}` : me ? `${N(Te, U, be)} ${Le}-${He}, ${Me}` : `${Le}-${He} ${N(Te, U, be)} ${Me}`;
746
+ function q(g, R, x) {
747
+ const { monthsArray: Q, monthBeforeDay: fe, canTruncate: Ae, xs: Ve } = x, Me = g.getMonth(), Ye = g.getFullYear(), Ee = R.getMonth(), ze = R.getFullYear(), We = Me !== Ee, _t = Ye !== ze, be = Ae && (Ve || We), Fe = g.getDate(), Pe = R.getDate();
748
+ return _t ? fe ? `${X(Me, Q, be)} ${Fe}, ${Ye} - ${X(Ee, Q, be)} ${Pe}, ${ze}` : `${Fe} ${X(Me, Q, be)} ${Ye} - ${Pe} ${X(Ee, Q, be)} ${ze}` : We ? fe ? `${X(Me, Q, be)} ${Fe} - ${X(Ee, Q, be)} ${Pe}, ${Ye}` : `${Fe} ${X(Me, Q, be)} - ${Pe} ${X(Ee, Q, be)} ${Ye}` : fe ? `${X(Me, Q, be)} ${Fe}-${Pe}, ${Ye}` : `${Fe}-${Pe} ${X(Me, Q, be)} ${Ye}`;
746
749
  }
747
- const x = M(() => {
748
- const { dateFormat: v, months: W, monthsGenitive: K, week: U, truncations: me } = d, We = y.locale, Ce = me !== !1, Te = v.indexOf("M") < v.indexOf("D"), Me = K && We === "el" ? K : W;
749
- switch (f.value) {
750
+ const ae = Y(() => {
751
+ const { dateFormat: g, months: R, monthsGenitive: x, week: Q, truncations: fe } = o, Ae = p.locale, Ve = fe !== !1, Me = g.indexOf("M") < g.indexOf("D"), Ye = x && Ae === "el" ? x : R;
752
+ switch (d.value) {
750
753
  case "day":
751
- return s.formatDate(l.value, v);
754
+ return t.formatDate(h.value, g);
752
755
  case "days":
753
756
  case "week": {
754
- const Ye = {
755
- monthsArray: Me,
756
- monthBeforeDay: Te,
757
- canTruncate: Ce,
758
- xs: y.xs
757
+ const Ee = {
758
+ monthsArray: Ye,
759
+ monthBeforeDay: Me,
760
+ canTruncate: Ve,
761
+ xs: p.xs
759
762
  };
760
- let Pe = ne(l.value, k.value, Ye);
761
- if (f.value === "week") {
762
- const Ae = s.getWeek(
763
- l.value,
764
- y.startWeekOnSunday && !y.hideWeekdays[7]
763
+ let ze = q(h.value, f.value, Ee);
764
+ if (d.value === "week") {
765
+ const We = t.getWeek(
766
+ h.value,
767
+ p.startWeekOnSunday && !p.hideWeekdays[7]
765
768
  );
766
- Pe += ` <small>${U} ${Ae}</small>`;
769
+ ze += ` <small>${Q} ${We}</small>`;
767
770
  }
768
- return Pe;
771
+ return ze;
769
772
  }
770
773
  case "month": {
771
- const Ye = `${y.xs && Ce ? "MMM" : "MMMM"} YYYY`;
772
- return s.formatDate(Z.value, Ye);
774
+ const Ee = `${p.xs && Ve ? "MMM" : "MMMM"} YYYY`;
775
+ return t.formatDate(W.value, Ee);
773
776
  }
774
777
  case "year":
775
- return l.value.getFullYear();
778
+ return h.value.getFullYear();
776
779
  case "years":
777
- return `${l.value.getFullYear()} - ${t.value.getFullYear()}`;
780
+ return `${h.value.getFullYear()} - ${a.value.getFullYear()}`;
778
781
  }
779
782
  });
780
- function le() {
781
- switch (Y.value = new Date(m.value || u.value), Y.value.setHours(0, 0, 0, 0), f.value) {
783
+ function se() {
784
+ switch (y.value = new Date(c.value || v.value), y.value.setHours(0, 0, 0, 0), d.value) {
782
785
  case "day":
783
786
  break;
784
787
  case "days":
785
788
  break;
786
789
  case "week":
787
- Y.value = s.getPreviousFirstDayOfWeek(Y.value, y.startWeekOnSunday && !y.hideWeekdays[7]);
790
+ y.value = t.getPreviousFirstDayOfWeek(y.value, p.startWeekOnSunday && !p.hideWeekdays[7]);
788
791
  break;
789
792
  case "month":
790
- Y.value = new Date(Y.value.getFullYear(), Y.value.getMonth(), 1, 0, 0, 0, 0);
793
+ y.value = new Date(y.value.getFullYear(), y.value.getMonth(), 1, 0, 0, 0, 0);
791
794
  break;
792
795
  case "year":
793
- Y.value = new Date(Y.value.getFullYear(), 0, 1, 0, 0, 0, 0);
796
+ y.value = new Date(y.value.getFullYear(), 0, 1, 0, 0, 0, 0);
794
797
  break;
795
798
  case "years":
796
- Y.value = new Date(Y.value.getFullYear() - Y.value.getFullYear() % D.value, 0, 1, 0, 0, 0, 0);
799
+ y.value = new Date(y.value.getFullYear() - y.value.getFullYear() % m.value, 0, 1, 0, 0, 0, 0);
797
800
  break;
798
801
  }
799
- y.ready && r("view-change", {
800
- id: f.value,
801
- title: x.value,
802
- start: Z.value,
803
- end: t.value,
804
- extendedStart: o.value,
802
+ p.ready && u("view-change", {
803
+ id: d.value,
804
+ title: ae.value,
805
+ start: W.value,
806
+ end: a.value,
807
+ extendedStart: s.value,
805
808
  extendedEnd: e.value,
806
- cellDates: p.value,
807
- containsToday: h.value,
808
- events: G.value
809
- }), u.value = /* @__PURE__ */ new Date();
809
+ cellDates: H.value,
810
+ containsToday: k.value,
811
+ events: J.value
812
+ }), v.value = /* @__PURE__ */ new Date();
810
813
  }
811
- function ce(v) {
812
- const W = f.value, K = y.availableViews[W];
813
- v[W] && JSON.stringify(v[W]) === JSON.stringify(K) || le();
814
+ function de(g) {
815
+ const R = d.value, x = p.availableViews[R];
816
+ g[R] && JSON.stringify(g[R]) === JSON.stringify(x) || se();
814
817
  }
815
- function X(v, W = !0) {
816
- const K = Object.keys(y.availableViews);
817
- f.value !== v && (K.includes(v) ? (a.value = K.indexOf(v) < K.indexOf(f.value) ? "left" : "right", f.value = v, r("update:view", v), le()) : console.warn(`Vue Cal: the \`${v}\` view is not available.`));
818
+ function Z(g, R = !0) {
819
+ const x = Object.keys(p.availableViews);
820
+ d.value !== g && (x.includes(g) ? (T.value = x.indexOf(g) < x.indexOf(d.value) ? "left" : "right", d.value = g, u("update:view", g), se()) : console.warn(`Vue Cal: the \`${g}\` view is not available.`));
818
821
  }
819
- function Ee() {
820
- j.value ? X(j.value) : console.warn("Vue Cal: no broader view is available.");
822
+ function he() {
823
+ E.value ? Z(E.value) : console.warn("Vue Cal: no broader view is available.");
821
824
  }
822
- function Q() {
823
- R.value ? X(R.value) : console.warn("Vue Cal: no narrower view is available.");
825
+ function ee() {
826
+ l.value ? Z(l.value) : console.warn("Vue Cal: no narrower view is available.");
824
827
  }
825
828
  function re() {
826
- _(!1);
829
+ $(!1);
827
830
  }
828
831
  function n() {
829
- _(!0);
832
+ $(!0);
830
833
  }
831
- function _(v = !0) {
832
- let W = new Date(m.value);
833
- switch (f.value) {
834
+ function $(g = !0) {
835
+ let R = new Date(c.value);
836
+ switch (d.value) {
834
837
  case "day":
835
838
  case "days":
836
- v ? W = s.addDays(k.value, 1) : W = s.subtractDays(l.value, D.value);
839
+ g ? R = t.addDays(f.value, 1) : R = t.subtractDays(h.value, m.value);
837
840
  break;
838
841
  case "week": {
839
- v ? (W = s.addDays(e.value, 1), W.setHours(0, 0, 0, 0)) : W = s.subtractDays(o.value, D.value);
842
+ g ? (R = t.addDays(e.value, 1), R.setHours(0, 0, 0, 0)) : R = t.subtractDays(s.value, m.value);
840
843
  break;
841
844
  }
842
845
  case "month": {
843
- const K = v ? 1 : -1;
844
- W = new Date(W.getFullYear(), W.getMonth() + K, 1, 0, 0, 0, 0);
846
+ const x = g ? 1 : -1;
847
+ R = new Date(R.getFullYear(), R.getMonth() + x, 1, 0, 0, 0, 0);
845
848
  break;
846
849
  }
847
850
  case "year": {
848
- const K = v ? 1 : -1;
849
- W = new Date(W.getFullYear() + K, 1, 1, 0, 0, 0, 0);
851
+ const x = g ? 1 : -1;
852
+ R = new Date(R.getFullYear() + x, 1, 1, 0, 0, 0, 0);
850
853
  break;
851
854
  }
852
855
  case "years": {
853
- const K = v ? D.value : -D.value;
854
- W = new Date(W.getFullYear() + K, 1, 1, 0, 0, 0, 0);
856
+ const x = g ? m.value : -m.value;
857
+ R = new Date(R.getFullYear() + x, 1, 1, 0, 0, 0, 0);
855
858
  break;
856
859
  }
857
860
  }
858
- I(W);
861
+ G(R);
859
862
  }
860
- function g() {
861
- const v = /* @__PURE__ */ new Date();
862
- v.setHours(0, 0, 0, 0), I(v);
863
+ function D() {
864
+ const g = /* @__PURE__ */ new Date();
865
+ g.setHours(0, 0, 0, 0), G(g);
863
866
  }
864
- function I(v, W = !0, K = !1) {
865
- if (!s.isValid(v)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
866
- let [U, me] = [l.value, k.value];
867
- f.value === "month" && ([U, me] = [Z.value, t.value]), (!s.isInRange(v, U, me) || K) && (v.setHours(0, 0, 0, 0), a.value = v.getTime() < U.getTime() ? "left" : "right", m.value = v, W && r("update:viewDate", v), le());
867
+ function G(g, R = !0, x = !1) {
868
+ if (!t.isValid(g)) return console.warn("Vue Cal: can't navigate to the given date: invalid date provided to `updateViewDate(date)`.");
869
+ let [Q, fe] = [h.value, f.value];
870
+ d.value === "month" && ([Q, fe] = [W.value, a.value]), (!t.isInRange(g, Q, fe) || x) && (g.setHours(0, 0, 0, 0), T.value = g.getTime() < Q.getTime() ? "left" : "right", c.value = g, R && u("update:viewDate", g), se());
868
871
  }
869
- function ee(v, W = !0) {
870
- if (!s.isValid(v)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
871
- const { isValid: K, isSameDate: U } = s;
872
- (!F.value || !K(F.value) || !U(v, F.value)) && (v.setHours(0, 0, 0, 0), F.value = v, W && r("update:selectedDate", v));
872
+ function K(g, R = !0) {
873
+ if (!t.isValid(g)) return console.warn("Vue Cal: can't update the selected date: invalid date provided to `updateSelectedDate(date)`.");
874
+ const { isValid: x, isSameDate: Q } = t;
875
+ (!z.value || !x(z.value) || !Q(g, z.value)) && (g.setHours(0, 0, 0, 0), z.value = g, R && u("update:selectedDate", g));
873
876
  }
874
- function he(v) {
875
- !v && !Y.value.getDay() ? I(s.addDays(Y.value, 1), !0, !0) : (a.value = "left", le());
877
+ function De(g) {
878
+ !g && !y.value.getDay() ? G(t.addDays(y.value, 1), !0, !0) : (T.value = "left", se());
876
879
  }
877
- function i(v) {
878
- v && y.startWeekOnSunday && !Y.value.getDay() ? I(s.addDays(Y.value, 1), !0, !0) : !v && y.startWeekOnSunday && Y.value.getDay() === 1 && I(s.subtractDays(Y.value, 1), !0, !0);
880
+ function r(g) {
881
+ g && p.startWeekOnSunday && !y.value.getDay() ? G(t.addDays(y.value, 1), !0, !0) : !g && p.startWeekOnSunday && y.value.getDay() === 1 && G(t.subtractDays(y.value, 1), !0, !0);
879
882
  }
880
- function T() {
881
- console.log("toggling weekdays", y.hideWeekdays);
883
+ function S() {
884
+ console.log("toggling weekdays", p.hideWeekdays);
882
885
  }
883
- function S(v) {
884
- var U;
885
- const W = (U = b.value) == null ? void 0 : U.querySelector(".vuecal__scrollable"), K = v ? v * y.timeCellHeight / y.timeStep : 0;
886
- W == null || W.scrollTo({ top: K, behavior: "smooth" });
886
+ function O(g) {
887
+ var Q;
888
+ const R = (Q = _.value) == null ? void 0 : Q.querySelector(".vuecal__scrollable"), x = g ? g * p.timeCellHeight / p.timeStep : 0;
889
+ R == null || R.scrollTo({ top: x, behavior: "smooth" });
887
890
  }
888
- function $() {
889
- const v = /* @__PURE__ */ new Date();
890
- S(v.getHours() * 60 + v.getMinutes());
891
+ function M() {
892
+ const g = /* @__PURE__ */ new Date();
893
+ O(g.getHours() * 60 + g.getMinutes());
891
894
  }
892
- function B() {
893
- S(0);
895
+ function I() {
896
+ O(0);
894
897
  }
895
- const G = M(() => w.getViewEvents(p.value)), se = w.createEvent, De = w.deleteEvent;
896
- return fe(() => y.view, (v) => X(v, !1)), fe(() => y.availableViews, ce), fe(() => y.datePicker, () => X("month", !1)), fe(() => y.viewDate, (v) => I(v, !1)), fe(() => y.selectedDate, (v) => ee(v, !1)), fe(() => y.startWeekOnSunday, (v) => he(v)), fe(() => y.hideWeekends, (v) => i(v)), fe(() => y.hideWeekdays, T), fe(() => D.value, () => {
897
- D.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
898
- }), fe(() => y.watchRealTime, (v) => {
899
- v && y.time ? E() : A = clearTimeout(A);
900
- }), le(), y.time && y.watchRealTime && E(), Xe(() => A = clearTimeout(A)), {
901
- now: u,
902
- id: f,
903
- broaderView: j,
904
- narrowerView: R,
905
- title: x,
906
- viewDate: m,
907
- start: Z,
908
- end: t,
909
- extendedStart: o,
898
+ const J = Y(() => w.getViewEvents(H.value)), oe = w.createEvent, we = w.deleteEvent;
899
+ return me(() => p.view, (g) => Z(g, !1)), me(() => p.availableViews, de), me(() => p.datePicker, () => Z("month", !1)), me(() => p.viewDate, (g) => G(g, !1)), me(() => p.selectedDate, (g) => K(g, !1)), me(() => p.startWeekOnSunday, (g) => De(g)), me(() => p.hideWeekends, (g) => r(g)), me(() => p.hideWeekdays, S), me(() => m.value, () => {
900
+ m.value > 90 && console.warn("Vue Cal: high cell count detected. Performance may degrade when interactions are enabled.");
901
+ }), me(() => p.watchRealTime, (g) => {
902
+ g && p.time ? V() : F = clearTimeout(F);
903
+ }), se(), p.time && p.watchRealTime && V(), Be(() => F = clearTimeout(F)), {
904
+ now: v,
905
+ id: d,
906
+ broaderView: E,
907
+ narrowerView: l,
908
+ title: ae,
909
+ viewDate: c,
910
+ start: W,
911
+ end: a,
912
+ extendedStart: s,
910
913
  // Full range, including out of scope month days, and hidden leading/trailing days.
911
914
  extendedEnd: e,
912
915
  // Full range, including out of scope month days, and hidden leading/trailing days.
913
- firstCellDate: l,
914
- lastCellDate: k,
915
- containsToday: h,
916
- selectedDate: F,
917
- cellDates: p,
918
- cols: L,
919
- rows: z,
916
+ firstCellDate: h,
917
+ lastCellDate: f,
918
+ containsToday: k,
919
+ selectedDate: z,
920
+ cellDates: H,
921
+ cols: P,
922
+ rows: A,
920
923
  // All the events are stored and indexed in the events object of the eventsManager.
921
924
  // The following events array is only a subset of visible ones, plus any potential recurring
922
925
  // and multi-day events.
923
- events: G,
924
- transitionDirection: a,
925
- switch: X,
926
- broader: Ee,
927
- narrower: Q,
926
+ events: J,
927
+ transitionDirection: T,
928
+ switch: Z,
929
+ broader: he,
930
+ narrower: ee,
928
931
  previous: re,
929
932
  next: n,
930
- navigate: _,
931
- goToToday: g,
932
- updateViewDate: I,
933
- updateSelectedDate: ee,
934
- scrollToCurrentTime: $,
935
- scrollToTime: S,
936
- scrollTop: B,
937
- createEvent: se,
938
- deleteEvent: De,
933
+ navigate: $,
934
+ goToToday: D,
935
+ updateViewDate: G,
936
+ updateSelectedDate: K,
937
+ scrollToCurrentTime: M,
938
+ scrollToTime: O,
939
+ scrollTop: I,
940
+ createEvent: oe,
941
+ deleteEvent: we,
939
942
  // Getters.
940
943
  get isDay() {
941
- return f.value === "day";
944
+ return d.value === "day";
942
945
  },
943
946
  get isDays() {
944
- return f.value === "days";
947
+ return d.value === "days";
945
948
  },
946
949
  get isWeek() {
947
- return f.value === "week";
950
+ return d.value === "week";
948
951
  },
949
952
  get isMonth() {
950
- return f.value === "month";
953
+ return d.value === "month";
951
954
  },
952
955
  get isYear() {
953
- return f.value === "year";
956
+ return d.value === "year";
954
957
  },
955
958
  get isYears() {
956
- return f.value === "years";
959
+ return d.value === "years";
957
960
  }
958
961
  };
959
- }, lt = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], rt = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ot = "Years", it = "Year", ut = "Month", ct = "Week", dt = "Days", vt = "Day", mt = "Today", ft = "No Event", gt = "All day", ht = "Delete", yt = "Create an event", Dt = "dddd, MMMM D, YYYY", Ke = {
960
- weekDays: lt,
961
- months: rt,
962
- years: ot,
963
- year: it,
964
- month: ut,
965
- week: ct,
966
- days: dt,
967
- day: vt,
962
+ }, rt = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], ot = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], it = "Years", ut = "Year", ct = "Month", dt = "Week", vt = "Days", ft = "Day", mt = "Today", gt = "No Event", yt = "All-day", ht = "Delete", Dt = "Create an event", pt = "dddd, MMMM D, YYYY", wt = "am", kt = "pm", Qe = {
963
+ weekDays: rt,
964
+ months: ot,
965
+ years: it,
966
+ year: ut,
967
+ month: ct,
968
+ week: dt,
969
+ days: vt,
970
+ day: ft,
968
971
  today: mt,
969
- noEvent: ft,
970
- allDay: gt,
972
+ noEvent: gt,
973
+ allDay: yt,
971
974
  deleteEvent: ht,
972
- createEvent: yt,
973
- dateFormat: Dt
974
- }, Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
975
+ createEvent: Dt,
976
+ dateFormat: pt,
977
+ am: wt,
978
+ pm: kt
979
+ }, Lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
975
980
  __proto__: null,
976
- allDay: gt,
977
- createEvent: yt,
978
- dateFormat: Dt,
979
- day: vt,
980
- days: dt,
981
- default: Ke,
981
+ allDay: yt,
982
+ am: wt,
983
+ createEvent: Dt,
984
+ dateFormat: pt,
985
+ day: ft,
986
+ days: vt,
987
+ default: Qe,
982
988
  deleteEvent: ht,
983
- month: ut,
984
- months: rt,
985
- noEvent: ft,
989
+ month: ct,
990
+ months: ot,
991
+ noEvent: gt,
992
+ pm: kt,
986
993
  today: mt,
987
- week: ct,
988
- weekDays: lt,
989
- year: it,
990
- years: ot
991
- }, Symbol.toStringTag, { value: "Module" })), ze = $e({
994
+ week: dt,
995
+ weekDays: rt,
996
+ year: ut,
997
+ years: it
998
+ }, Symbol.toStringTag, { value: "Module" })), Ne = Te({
992
999
  texts: { ...ge.texts },
993
1000
  // Make texts reactive before a locale is loaded.
994
- dateUtils: st(ge.texts, Ke)
1001
+ dateUtils: lt(ge.texts, Qe)
995
1002
  // Some Date utils functions need localized texts.
996
- }), Ot = ({ props: y, emit: s, attrs: r, vuecalEl: d, uid: w }) => {
997
- const b = $e({
1003
+ }), Ht = ({ props: p, emit: t, attrs: u, vuecalEl: o, uid: w }) => {
1004
+ const _ = Te({
998
1005
  uid: w,
999
1006
  // The Vuecal instance unique ID, used for dnd source-target identification.
1000
- emit: s,
1001
- texts: { ...ze.texts },
1007
+ emit: t,
1008
+ texts: { ...Ne.texts },
1002
1009
  // Make texts reactive before a locale is loaded.
1003
1010
  // The date utils composable.
1004
1011
  // A class/composable is needed in order to access the user locale in all the methods, and
1005
1012
  // independently of other potential Vue Cal instances on the same page.
1006
- dateUtils: { ...ze.dateUtils },
1013
+ dateUtils: { ...Ne.dateUtils },
1007
1014
  now: /* @__PURE__ */ new Date(),
1008
1015
  config: {},
1009
1016
  eventsManager: {},
@@ -1018,10 +1025,10 @@ const st = (y, s) => {
1018
1025
  isResizingEvent: !1
1019
1026
  }
1020
1027
  });
1021
- return b.dateUtils = st(Object.assign(ge.texts, b.texts), Ke), b.config = Yt(b, y, r), b.eventsManager = St(b), b.view = Ct(b, d), b.dnd = Et(b), b;
1022
- }, jt = 24 * 60, Ft = {
1023
- allDayEvents: { type: [Boolean, String], default: !1 },
1024
- // Coming soon.
1028
+ return _.dateUtils = lt(Object.assign(ge.texts, _.texts), Qe), _.config = Ct(_, p, u), _.eventsManager = Ot(_), _.view = jt(_, o), _.dnd = Vt(_), _;
1029
+ }, zt = 24 * 60, Ft = {
1030
+ allDayEvents: { type: Boolean, default: !1 },
1031
+ // Display all-day events in a fixed top bar on the day, days & week views.
1025
1032
  stackEvents: { type: Boolean, default: !1 },
1026
1033
  clickToNavigate: { type: Boolean, default: void 0 },
1027
1034
  // Setting to false will force it off on date-picker.
@@ -1084,7 +1091,7 @@ const st = (y, s) => {
1084
1091
  // Start time of the time column, in minutes.
1085
1092
  timeStep: { type: Number, default: 60 },
1086
1093
  // Step amount for the time in the time column, in minutes.
1087
- timeTo: { type: Number, default: jt },
1094
+ timeTo: { type: Number, default: zt },
1088
1095
  // End time of the time column, in minutes.
1089
1096
  titleBar: { type: Boolean, default: !0 },
1090
1097
  // Show or hide the header title bar.
@@ -1116,215 +1123,111 @@ const st = (y, s) => {
1116
1123
  // minScheduleWidth: { type: Number, default: 0 },
1117
1124
  // overlapsPerTimeStep: { type: Boolean, default: false },
1118
1125
  // resizeX: { type: Boolean, default: false },
1119
- }, Pt = { class: "vuecal__header" }, Lt = {
1126
+ }, Pt = { class: "vuecal__header" }, Nt = {
1120
1127
  key: 0,
1121
1128
  class: "vuecal__views-bar"
1122
- }, Ht = ["onClick", "innerHTML"], zt = {
1129
+ }, At = ["onClick", "innerHTML"], Bt = {
1123
1130
  key: 1,
1124
1131
  class: "vuecal__title-bar"
1125
- }, Nt = { class: "vuecal__transition-wrap" }, Wt = ["disabled", "innerHTML"], At = {
1132
+ }, Wt = { class: "vuecal__transition-wrap" }, It = ["disabled", "innerHTML"], Rt = {
1126
1133
  __name: "header",
1127
- setup(y) {
1128
- const s = Ne("vuecal"), { view: r, config: d } = s, w = () => {
1129
- d.clickToNavigate && r.broader();
1130
- }, b = M(() => d.clickToNavigate ? { click: w } : {});
1131
- return (H, f) => (C(), O("div", Pt, [
1132
- P(H.$slots, "header", {
1133
- view: V(r),
1134
- availableViews: V(d).availableViews,
1135
- vuecal: V(s)
1134
+ setup(p) {
1135
+ const t = He("vuecal"), { view: u, config: o } = t, w = () => {
1136
+ o.clickToNavigate && u.broader();
1137
+ }, _ = Y(() => o.clickToNavigate ? { click: w } : {});
1138
+ return (N, d) => (C(), L("div", Pt, [
1139
+ j(N.$slots, "header", {
1140
+ view: b(u),
1141
+ availableViews: b(o).availableViews,
1142
+ vuecal: b(t)
1136
1143
  }),
1137
- H.$slots.header ? q("", !0) : (C(), O(oe, { key: 0 }, [
1138
- V(d).viewsBar ? (C(), O("div", Lt, [
1139
- (C(!0), O(oe, null, ke(V(d).availableViews, (F, u) => (C(), O("button", {
1140
- class: ye(["vuecal__view-button", { "vuecal__view-button--active": V(r).id === u }]),
1141
- onClick: (m) => V(r).switch(u),
1142
- innerHTML: V(s).texts[u],
1144
+ N.$slots.header ? U("", !0) : (C(), L(ue, { key: 0 }, [
1145
+ b(o).viewsBar ? (C(), L("div", Nt, [
1146
+ (C(!0), L(ue, null, pe(b(o).availableViews, (z, v) => (C(), L("button", {
1147
+ class: ye(["vuecal__view-button", { "vuecal__view-button--active": b(u).id === v }]),
1148
+ onClick: (c) => b(u).switch(v),
1149
+ innerHTML: b(t).texts[v],
1143
1150
  type: "button"
1144
- }, null, 10, Ht))), 256))
1145
- ])) : q("", !0),
1146
- V(d).titleBar ? (C(), O("nav", zt, [
1151
+ }, null, 10, At))), 256))
1152
+ ])) : U("", !0),
1153
+ b(o).titleBar ? (C(), L("nav", Bt, [
1147
1154
  ve("button", {
1148
- class: ye(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !H.$slots["previous-button"] }]),
1149
- onClick: f[0] || (f[0] = (...F) => V(r).previous && V(r).previous(...F)),
1155
+ class: ye(["vuecal__nav vuecal__nav--prev", { "vuecal__nav--default": !N.$slots["previous-button"] }]),
1156
+ onClick: d[0] || (d[0] = (...z) => b(u).previous && b(u).previous(...z)),
1150
1157
  type: "button"
1151
1158
  }, [
1152
- P(H.$slots, "previous-button")
1159
+ j(N.$slots, "previous-button")
1153
1160
  ], 2),
1154
- ve("div", Nt, [
1155
- Oe(Ge, {
1156
- name: `vuecal-slide-fade--${V(r).transitionDirection}`
1161
+ ve("div", Wt, [
1162
+ je(Ge, {
1163
+ name: `vuecal-slide-fade--${b(u).transitionDirection}`
1157
1164
  }, {
1158
- default: J(() => [
1159
- (C(), O("div", {
1160
- key: V(r).id + V(r).start.getTime()
1165
+ default: B(() => [
1166
+ (C(), L("div", {
1167
+ key: b(u).id + b(u).start.getTime()
1161
1168
  }, [
1162
- H.$slots.title || H.$slots[`title.${V(r).id}`] ? (C(), Se(Qe(V(d).clickToNavigate && V(r).broaderView ? "button" : "div"), de({
1169
+ N.$slots.title || N.$slots[`title.${b(u).id}`] ? (C(), Se(xe(b(o).clickToNavigate && b(u).broaderView ? "button" : "div"), le({
1163
1170
  key: 0,
1164
1171
  class: "vuecal__title"
1165
- }, Be(b.value)), {
1166
- default: J(() => [
1167
- H.$slots[`title.${V(r).id}`] ? P(H.$slots, `title.${V(r).id}`, te(de({ key: 0 }, V(r)))) : P(H.$slots, "title", te(de({ key: 1 }, V(r))))
1172
+ }, Re(_.value)), {
1173
+ default: B(() => [
1174
+ N.$slots[`title.${b(u).id}`] ? j(N.$slots, `title.${b(u).id}`, te(le({ key: 0 }, b(u)))) : j(N.$slots, "title", te(le({ key: 1 }, b(u))))
1168
1175
  ]),
1169
1176
  _: 3
1170
- }, 16)) : (C(), Se(Qe(V(d).clickToNavigate && V(r).broaderView ? "button" : "div"), de({
1177
+ }, 16)) : (C(), Se(xe(b(o).clickToNavigate && b(u).broaderView ? "button" : "div"), le({
1171
1178
  key: 1,
1172
1179
  class: "vuecal__title"
1173
- }, Be(b.value), {
1174
- innerHTML: V(r).title
1180
+ }, Re(_.value), {
1181
+ innerHTML: b(u).title
1175
1182
  }), null, 16, ["innerHTML"]))
1176
1183
  ]))
1177
1184
  ]),
1178
1185
  _: 3
1179
1186
  }, 8, ["name"])
1180
1187
  ]),
1181
- V(d).todayButton ? (C(), O(oe, { key: 0 }, [
1182
- H.$slots["today-button"] ? P(H.$slots, "today-button", {
1188
+ b(o).todayButton ? (C(), L(ue, { key: 0 }, [
1189
+ N.$slots["today-button"] ? j(N.$slots, "today-button", {
1183
1190
  key: 0,
1184
- navigate: () => !V(r).containsToday && V(r).goToToday(),
1185
- active: V(r).containsToday
1186
- }) : (C(), O("button", {
1191
+ navigate: () => !b(u).containsToday && b(u).goToToday(),
1192
+ active: b(u).containsToday
1193
+ }) : (C(), L("button", {
1187
1194
  key: 1,
1188
- class: ye(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": V(r).containsToday }]),
1189
- onClick: f[1] || (f[1] = (F) => !V(r).containsToday && V(r).goToToday()),
1190
- disabled: !!V(r).containsToday,
1195
+ class: ye(["vuecal__nav vuecal__nav--today vuecal__nav--default", { "vuecal__nav--active": b(u).containsToday }]),
1196
+ onClick: d[1] || (d[1] = (z) => !b(u).containsToday && b(u).goToToday()),
1197
+ disabled: !!b(u).containsToday,
1191
1198
  type: "button",
1192
- innerHTML: V(s).texts.today
1193
- }, null, 10, Wt))
1194
- ], 64)) : q("", !0),
1199
+ innerHTML: b(t).texts.today
1200
+ }, null, 10, It))
1201
+ ], 64)) : U("", !0),
1195
1202
  ve("button", {
1196
- class: ye(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !H.$slots["next-button"] }]),
1197
- onClick: f[2] || (f[2] = (...F) => V(r).next && V(r).next(...F)),
1203
+ class: ye(["vuecal__nav vuecal__nav--next", { "vuecal__nav--default": !N.$slots["next-button"] }]),
1204
+ onClick: d[2] || (d[2] = (...z) => b(u).next && b(u).next(...z)),
1198
1205
  type: "button"
1199
1206
  }, [
1200
- P(H.$slots, "next-button")
1207
+ j(N.$slots, "next-button")
1201
1208
  ], 2)
1202
- ])) : q("", !0)
1209
+ ])) : U("", !0)
1203
1210
  ], 64))
1204
1211
  ]));
1205
1212
  }
1206
- }, It = {
1207
- key: 0,
1208
- class: "vuecal__headings"
1209
- }, Bt = {
1210
- key: 0,
1211
- class: "vuecal__weekdays-headings"
1212
- }, Rt = ["onClick"], Xt = { class: "vuecal__weekday-day" }, Gt = {
1213
- key: 0,
1214
- class: "vuecal__weekday-date"
1215
- }, Jt = {
1216
- key: 1,
1217
- class: "vuecal__schedules-headings w-flex grow"
1218
- }, Ut = ["innerHTML"], qt = {
1219
- __name: "headings-bar",
1220
- setup(y) {
1221
- const s = Ne("vuecal"), { view: r, config: d, dateUtils: w } = s, b = M(() => d.xs ? "day-xs" : d.sm || r.isDays || r.isMonth ? "day-sm" : "day"), H = M(() => (r.isDay || r.isDays || r.isWeek || r.isMonth) && !(r.isDay && !d.schedules)), f = M(() => r.cellDates.slice(0, r.cols).map(({ start: u }) => ({
1222
- id: Re[u.getDay()],
1223
- date: u,
1224
- dateNumber: u.getDate(),
1225
- day: w.formatDate(u, "dddd"),
1226
- "day-sm": w.formatDate(u, "ddd"),
1227
- "day-xs": w.formatDate(u, "dd"),
1228
- isToday: w.isToday(u)
1229
- }))), F = {
1230
- click: (u) => {
1231
- (r.isDays || r.isWeek) && r.updateSelectedDate(u);
1232
- }
1233
- };
1234
- return (u, m) => H.value ? (C(), O("div", It, [
1235
- V(r).isDay ? q("", !0) : (C(), O("div", Bt, [
1236
- (C(!0), O(oe, null, ke(f.value, (Y, A) => (C(), O("div", {
1237
- class: ye(["vuecal__weekday", { "vuecal__weekday--today": Y.isToday }]),
1238
- key: A,
1239
- onClick: (Z) => F.click(Y.date)
1240
- }, [
1241
- P(u.$slots, "weekday-heading", {
1242
- label: Y[b.value],
1243
- id: Y.id,
1244
- date: Y.date
1245
- }, () => [
1246
- ve("span", Xt, ie(Y[b.value]), 1),
1247
- V(r).isMonth ? q("", !0) : (C(), O("strong", Gt, ie(Y.dateNumber), 1))
1248
- ])
1249
- ], 10, Rt))), 128))
1250
- ])),
1251
- V(d).schedules ? (C(), O("div", Jt, [
1252
- (C(!0), O(oe, null, ke(f.value, (Y, A) => (C(), O(oe, { key: A }, [
1253
- (C(!0), O(oe, null, ke(V(d).schedules, (Z, t) => (C(), O(oe, { key: t }, [
1254
- u.$slots["schedule-heading"] ? (C(), O("div", {
1255
- key: 0,
1256
- class: ye(["vuecal__schedule vuecal__schedule--heading", Z.class])
1257
- }, [
1258
- P(u.$slots, "schedule-heading", {
1259
- schedule: Z,
1260
- view: V(r)
1261
- })
1262
- ], 2)) : (C(), O("div", {
1263
- key: 1,
1264
- class: ye(["vuecal__schedule vuecal__schedule--heading", Z.class]),
1265
- innerHTML: Z.label
1266
- }, null, 10, Ut))
1267
- ], 64))), 128))
1268
- ], 64))), 128))
1269
- ])) : q("", !0)
1270
- ])) : q("", !0);
1271
- }
1272
- }, Zt = { class: "vuecal__time-column" }, Kt = {
1273
- __name: "time-column",
1274
- setup(y) {
1275
- const s = Ne("vuecal"), { config: r, texts: d } = s, w = M(() => {
1276
- const b = [];
1277
- for (let f = r.timeFrom; f < r.timeTo; f += r.timeStep) {
1278
- const F = f + r.timeStep > r.timeTo, u = ~~(f / 60), m = f % 60, Y = d[f < 720 ? "am" : "pm"];
1279
- let A = null;
1280
- F && (A = `calc(var(--vuecal-time-cell-height) * ${(r.timeTo - f) / r.timeStep})`), b.push({
1281
- minutesSum: f,
1282
- // The sum of hours + minutes in minutes.
1283
- hours: u,
1284
- minutes: m,
1285
- formatted12: `${u % 12 ? u % 12 : 12}${m ? `:${m.toString().padStart(2, 0)}` : ""}${Y}`,
1286
- formatted24: `${u.toString().padStart(2, 0)}:${m.toString().padStart(2, 0)}`,
1287
- height: A
1288
- });
1289
- }
1290
- return b;
1291
- });
1292
- return (b, H) => (C(), O("div", Zt, [
1293
- (C(!0), O(oe, null, ke(w.value, (f, F) => (C(), O("div", {
1294
- class: "vuecal__time-cell",
1295
- key: F,
1296
- style: _e({ height: f.height || null })
1297
- }, [
1298
- P(b.$slots, "time-cell", {
1299
- index: F,
1300
- minutes: f.minutes,
1301
- hours: f.hours,
1302
- minutesSum: f.minutesSum,
1303
- format12: f.formatted12,
1304
- format24: f.formatted24
1305
- }, () => [
1306
- ve("label", null, ie(V(r).twelveHour ? f.formatted12 : f.formatted24), 1)
1307
- ])
1308
- ], 4))), 128))
1309
- ]));
1310
- }
1311
- }, Qt = ["draggable"], xt = { class: "vuecal__event-details" }, ea = { class: "vuecal__event-title" }, ta = {
1213
+ }, Xt = ["draggable"], Gt = { class: "vuecal__event-details" }, qt = { class: "vuecal__event-title" }, Jt = {
1312
1214
  key: 0,
1313
1215
  class: "vuecal__event-time"
1314
- }, aa = {
1216
+ }, Ut = {
1315
1217
  key: 0,
1316
1218
  class: "vuecal__event-comma"
1317
- }, na = { class: "vuecal__event-start" }, sa = {
1219
+ }, Zt = { class: "vuecal__event-start" }, Kt = {
1318
1220
  key: 1,
1319
1221
  class: "vuecal__event-end"
1320
- }, la = ["innerHTML"], nt = {
1222
+ }, Qt = ["innerHTML"], st = {
1321
1223
  __name: "event",
1322
1224
  props: {
1323
- event: { type: Object, required: !0 }
1225
+ event: { type: Object, required: !0 },
1226
+ inAllDayBar: { type: Boolean, default: !1 }
1324
1227
  },
1325
1228
  emits: ["event-drag-start", "event-drag-end", "event-resize-start", "event-resize-end"],
1326
- setup(y, { emit: s }) {
1327
- const { config: r, view: d, dnd: w, touch: b, dateUtils: H } = Ne("vuecal"), f = y, F = ue(null), u = $e(f.event), m = $e({
1229
+ setup(p, { emit: t }) {
1230
+ const { config: u, view: o, dnd: w, touch: _, dateUtils: N } = He("vuecal"), d = p, z = ie(null), v = Te(d.event), c = Te({
1328
1231
  dragging: !1,
1329
1232
  resizing: !1,
1330
1233
  fromResizer: !1,
@@ -1358,200 +1261,211 @@ const st = (y, s) => {
1358
1261
  cellEl: null,
1359
1262
  // Store the cell DOM node for a more efficient resizing calc in mousemove/touchmove.
1360
1263
  schedule: null
1361
- }), Y = M(() => r.editableEvents.drag && u.draggable !== !1 && !u.background), A = M(() => d.isMonth || d.isYear || d.isYears ? !1 : r.time && r.editableEvents.resize && u.resizable !== !1 && !u.background);
1362
- M(() => r.editableEvents.delete && u.deletable !== !1 && !u.background);
1363
- const Z = M(() => {
1364
- var D, l, p;
1264
+ }), y = Y(() => u.editableEvents.drag && v.draggable !== !1 && !v.background), F = Y(() => o.isMonth || o.isYear || o.isYears || d.inAllDayBar ? !1 : u.time && u.editableEvents.resize && v.resizable !== !1 && !v.background);
1265
+ Y(() => u.editableEvents.delete && v.deletable !== !1 && !v.background);
1266
+ const W = Y(() => {
1267
+ var m, h, H, f, T;
1365
1268
  return {
1366
- [`vuecal__event--${u._.id}`]: !0,
1367
- [u.class]: !!u.class,
1368
- "vuecal__event--recurring": !!u.recurring,
1369
- "vuecal__event--background": !!u.background,
1370
- "vuecal__event--multiday": !!((D = u._) != null && D.multiday),
1371
- "vuecal__event--cut-top": ((l = u._) == null ? void 0 : l.startMinutes) < r.timeFrom,
1372
- "vuecal__event--cut-bottom": ((p = u._) == null ? void 0 : p.endMinutes) > r.timeTo || u._.multiday,
1269
+ [`vuecal__event--${v._.id}`]: !0,
1270
+ [v.class]: !!v.class,
1271
+ "vuecal__event--recurring": !!v.recurring,
1272
+ "vuecal__event--background": !!v.background,
1273
+ "vuecal__event--all-day": v.allDay || ((m = v._) == null ? void 0 : m.startMinutes) === 0 && ((h = v._) == null ? void 0 : h.duration) === 24 * 60,
1274
+ "vuecal__event--multiday": !!((H = v._) != null && H.multiday),
1275
+ "vuecal__event--cut-top": !d.inAllDayBar && ((f = v._) == null ? void 0 : f.startMinutes) < u.timeFrom,
1276
+ "vuecal__event--cut-bottom": !d.inAllDayBar && ((T = v._) == null ? void 0 : T.endMinutes) > u.timeTo || v._.multiday,
1373
1277
  // Only apply the dragging class on the event copy that is being dragged.
1374
- "vuecal__event--dragging": !u._.draggingGhost && u._.dragging,
1278
+ "vuecal__event--dragging": !v._.draggingGhost && v._.dragging,
1375
1279
  // Only apply the dragging-ghost class on the event original that remains fixed while a copy is being
1376
1280
  // dragged. Sometimes when dragging fast the dragging-ghost class would get stuck and events stays
1377
1281
  // invisible, so if dragging is false, disable the dragging-ghost class as well.
1378
1282
  // On event drop, if the new position of the event is approved, only remove the dragging-ghost class
1379
1283
  // after event deletion (event._.dragging is already false) so the event ghost does not flash in before
1380
1284
  // deletion.
1381
- "vuecal__event--dragging-ghost": u._.draggingGhost,
1382
- "vuecal__event--resizing": m.resizing
1285
+ "vuecal__event--dragging-ghost": v._.draggingGhost,
1286
+ "vuecal__event--resizing": c.resizing
1383
1287
  };
1384
- }), t = M(() => {
1385
- const D = (d.isDay || d.isDays || d.isWeek) && r.time;
1386
- if (!D && !u.backgroundColor && !u.color) return !1;
1387
- const l = {
1388
- backgroundColor: u.backgroundColor || null,
1389
- color: u.color || null
1288
+ }), a = Y(() => {
1289
+ const m = (o.isDay || o.isDays || o.isWeek) && u.time && !d.inAllDayBar;
1290
+ if (!m && !v.backgroundColor && !v.color) return !1;
1291
+ const h = {
1292
+ backgroundColor: v.backgroundColor || null,
1293
+ color: v.color || null
1390
1294
  };
1391
- if (D) {
1392
- const p = Math.max(r.timeFrom, u._.startMinutes), k = Math.min(r.timeTo, u._.endMinutes) + (u._.duration && !u._.endMinutes ? 24 * 60 : 0), a = Ve(p, r), j = Ve(k, r) - a;
1393
- l.top = `${a}%`, l.height = `${j}%`;
1295
+ if (m) {
1296
+ const H = Math.max(u.timeFrom, v._.startMinutes), f = Math.min(u.timeTo, v._.endMinutes) + (v._.duration && !v._.endMinutes ? 24 * 60 : 0), T = Oe(H, u), E = Oe(f, u) - T;
1297
+ h.top = `${T}%`, h.height = `${E}%`;
1394
1298
  }
1395
- return l;
1396
- }), o = M(() => {
1397
- const D = { ...r.eventListeners.event };
1398
- for (const [k, a] of Object.entries(D))
1399
- ["resize-end"].includes(k) || (D[k] = (j) => {
1400
- j.type !== "drop" && a(j.type ? { e: j, event: u } : j);
1299
+ return h;
1300
+ }), s = Y(() => {
1301
+ const m = { ...u.eventListeners.event };
1302
+ for (const [f, T] of Object.entries(m))
1303
+ ["resize-end"].includes(f) || (m[f] = (E) => {
1304
+ E.type !== "drop" && T(E.type ? { e: E, event: v } : E);
1401
1305
  });
1402
- const l = { ...D };
1403
- D.touchstart = (k) => {
1404
- var a;
1405
- k.stopPropagation(), e(k), (a = l.touchstart) == null || a.call(l, { e: k, event: u });
1406
- }, D.mousedown = (k) => {
1407
- var a;
1408
- k.stopPropagation(), e(k), (a = l.mousedown) == null || a.call(l, { e: k, event: u });
1306
+ const h = { ...m };
1307
+ m.touchstart = (f) => {
1308
+ var T;
1309
+ f.stopPropagation(), e(f), (T = h.touchstart) == null || T.call(h, { e: f, event: v });
1310
+ }, m.mousedown = (f) => {
1311
+ var T;
1312
+ f.stopPropagation(), e(f), (T = h.mousedown) == null || T.call(h, { e: f, event: v });
1409
1313
  };
1410
- let p = null;
1411
- return D.click = (k) => {
1412
- var a;
1413
- (a = l.click) == null || a.call(l, { e: k, event: u }), p ? p = clearTimeout(p) : p = setTimeout(() => {
1414
- var j;
1415
- p = null, (j = l["delayed-click"]) == null || j.call(l, { e: k, event: u });
1314
+ let H = null;
1315
+ return m.click = (f) => {
1316
+ var T;
1317
+ (T = h.click) == null || T.call(h, { e: f, event: v }), H ? H = clearTimeout(H) : H = setTimeout(() => {
1318
+ var E;
1319
+ H = null, (E = h["delayed-click"]) == null || E.call(h, { e: f, event: v });
1416
1320
  }, 400);
1417
- }, D.dblclick = (k) => {
1418
- l.dblclick ? l.dblclick({ e: k, event: u }) : u.delete(1);
1419
- }, D;
1420
- }), e = (D) => {
1421
- var k, a, j;
1422
- const l = ((k = D.touches) == null ? void 0 : k[0]) || D;
1423
- m.fromResizer = l.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1424
- const p = F.value.getBoundingClientRect();
1425
- m.startX = (((a = D.touches) == null ? void 0 : a[0]) || D).clientX - p.left, m.startY = (((j = D.touches) == null ? void 0 : j[0]) || D).clientY - p.top, m.startPercentageX = m.startX * 100 / p.width, m.startPercentageY = m.startY * 100 / p.height, m.cellEl = F.value.closest(".vuecal__cell"), m.resizeStartDate = u.start, z(D.type === "touchstart" ? "touchmove" : "mousemove", h), z(D.type === "touchstart" ? "touchend" : "mouseup", c, { once: !0 }), m.holdTimer = setTimeout(() => {
1426
- var R, N;
1427
- m.holding = !0, (N = (R = o.value).hold) == null || N.call(R, { e: D, event: u });
1321
+ }, m.dblclick = (f) => {
1322
+ h.dblclick ? h.dblclick({ e: f, event: v }) : v.delete(1);
1323
+ }, m;
1324
+ }), e = (m) => {
1325
+ var f, T, E;
1326
+ const h = ((f = m.touches) == null ? void 0 : f[0]) || m;
1327
+ c.fromResizer = h.target.matches(".vuecal__event-resizer, .vuecal__event-resizer *");
1328
+ const H = z.value.getBoundingClientRect();
1329
+ c.startX = (((T = m.touches) == null ? void 0 : T[0]) || m).clientX - H.left, c.startY = (((E = m.touches) == null ? void 0 : E[0]) || m).clientY - H.top, c.startPercentageX = c.startX * 100 / H.width, c.startPercentageY = c.startY * 100 / H.height, c.cellEl = z.value.closest(".vuecal__cell"), c.resizeStartDate = v.start, A(m.type === "touchstart" ? "touchmove" : "mousemove", k), A(m.type === "touchstart" ? "touchend" : "mouseup", i, { once: !0 }), c.holdTimer = setTimeout(() => {
1330
+ var l, X;
1331
+ c.holding = !0, (X = (l = s.value).hold) == null || X.call(l, { e: m, event: v });
1428
1332
  }, 1e3);
1429
- }, h = async (D) => {
1430
- var p, k, a, j;
1431
- const l = ((p = D.touches) == null ? void 0 : p[0]) || D;
1432
- if (m.fromResizer && !m.resizing && (m.resizing = !0, m.resizingOriginalEvent = { ...u, _: { ...u._ } }, b.isResizingEvent = !0, (a = (k = o.value).resizeStart) == null || a.call(k, { e: D, event: u })), m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.cellEl) {
1433
- const { top: R, left: N, width: ne, height: x } = m.cellEl.getBoundingClientRect();
1434
- m.moveX = l.clientX - N, m.moveY = l.clientY - R, m.movePercentageX = m.moveX * 100 / ne, m.movePercentageY = m.moveY * 100 / x;
1333
+ }, k = async (m) => {
1334
+ var H, f, T, E;
1335
+ const h = ((H = m.touches) == null ? void 0 : H[0]) || m;
1336
+ if (c.fromResizer && !c.resizing && (c.resizing = !0, c.resizingOriginalEvent = { ...v, _: { ...v._ } }, _.isResizingEvent = !0, (T = (f = s.value).resizeStart) == null || T.call(f, { e: m, event: v })), c.holdTimer = clearTimeout(c.holdTimer), c.holding = !1, c.cellEl) {
1337
+ const { top: l, left: X, width: q, height: ae } = c.cellEl.getBoundingClientRect();
1338
+ c.moveX = h.clientX - X, c.moveY = h.clientY - l, c.movePercentageX = c.moveX * 100 / q, c.movePercentageY = c.moveY * 100 / ae;
1435
1339
  }
1436
- if (m.fromResizer) {
1437
- const { newStart: R, newEnd: N } = E(u);
1438
- let ne = !0;
1439
- const { resize: x } = (j = r.eventListeners) == null ? void 0 : j.event;
1440
- x && (ne = await x({
1441
- e: D,
1442
- event: { ...u, start: R, end: N },
1443
- overlaps: u.getOverlappingEvents({ start: R, end: N })
1444
- })), ne !== !1 ? (u.start = R, u.end = N, m.resizingLastAcceptedEvent && (m.resizingLastAcceptedEvent = null)) : x && (m.resizingLastAcceptedEvent = { ...u, _: { ...u._ } });
1340
+ if (c.fromResizer) {
1341
+ const { newStart: l, newEnd: X } = V(v);
1342
+ let q = !0;
1343
+ const { resize: ae } = (E = u.eventListeners) == null ? void 0 : E.event;
1344
+ ae && (q = await ae({
1345
+ e: m,
1346
+ event: { ...v, start: l, end: X },
1347
+ overlaps: v.getOverlappingEvents({ start: l, end: X })
1348
+ })), q !== !1 ? (v.start = l, v.end = X, c.resizingLastAcceptedEvent && (c.resizingLastAcceptedEvent = null)) : ae && (c.resizingLastAcceptedEvent = { ...v, _: { ...v._ } });
1445
1349
  }
1446
- }, c = async (D) => {
1447
- var l, p;
1448
- if (m.holdTimer = clearTimeout(m.holdTimer), m.holding = !1, m.resizing) {
1449
- const { newStart: k, newEnd: a } = E(u);
1450
- let j = !0;
1451
- const R = o.value["resize-end"];
1452
- R && (j = await R({
1453
- e: D,
1454
- event: u,
1455
- original: m.resizingOriginalEvent,
1350
+ }, i = async (m) => {
1351
+ var h, H;
1352
+ if (c.holdTimer = clearTimeout(c.holdTimer), c.holding = !1, c.resizing) {
1353
+ const { newStart: f, newEnd: T } = V(v);
1354
+ let E = !0;
1355
+ const l = s.value["resize-end"];
1356
+ l && (E = await l({
1357
+ e: m,
1358
+ event: v,
1359
+ original: c.resizingOriginalEvent,
1456
1360
  // Original event details before resizing.
1457
- overlaps: u.getOverlappingEvents({ start: k, end: a })
1458
- })), u.start = j === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).start : ((l = m.resizingLastAcceptedEvent) == null ? void 0 : l.start) || k, u.end = j === !1 ? (m.resizingLastAcceptedEvent || m.resizingOriginalEvent).end : ((p = m.resizingLastAcceptedEvent) == null ? void 0 : p.end) || a, u._.duration < 1 && (u.start = m.resizingOriginalEvent.start, u.end = m.resizingOriginalEvent.end), b.isResizingEvent = !1;
1361
+ overlaps: v.getOverlappingEvents({ start: f, end: T })
1362
+ })), v.start = E === !1 ? (c.resizingLastAcceptedEvent || c.resizingOriginalEvent).start : ((h = c.resizingLastAcceptedEvent) == null ? void 0 : h.start) || f, v.end = E === !1 ? (c.resizingLastAcceptedEvent || c.resizingOriginalEvent).end : ((H = c.resizingLastAcceptedEvent) == null ? void 0 : H.end) || T, v._.duration < 1 && (v.start = c.resizingOriginalEvent.start, v.end = c.resizingOriginalEvent.end), _.isResizingEvent = !1;
1459
1363
  }
1460
- document.removeEventListener(D.type === "touchend" ? "touchmove" : "mousemove", h), m.resizing = !1, m.fromResizer = !1, m.dragging = !1, m.startX = 0, m.startY = 0, m.moveX = 0, m.moveY = 0, m.startPercentageX = 0, m.startPercentageY = 0, m.movePercentageX = 0, m.movePercentageY = 0, m.cellEl = null, m.resizeStartDate = null, m.resizingOriginalEvent = null, m.resizingLastAcceptedEvent = null, m.schedule = null;
1461
- }, E = (D) => {
1462
- const l = new Date(D.start.getFullYear(), D.start.getMonth(), D.start.getDate());
1463
- new Date(l).setDate(l.getDate() + 1);
1464
- let k = Fe(m.movePercentageY, r);
1465
- if (k = Math.max(0, Math.min(k, 24 * 60)), r.snapToInterval) {
1466
- const R = k + r.snapToInterval / 2;
1467
- k = R - R % r.snapToInterval;
1364
+ document.removeEventListener(m.type === "touchend" ? "touchmove" : "mousemove", k), c.resizing = !1, c.fromResizer = !1, c.dragging = !1, c.startX = 0, c.startY = 0, c.moveX = 0, c.moveY = 0, c.startPercentageX = 0, c.startPercentageY = 0, c.movePercentageX = 0, c.movePercentageY = 0, c.cellEl = null, c.resizeStartDate = null, c.resizingOriginalEvent = null, c.resizingLastAcceptedEvent = null, c.schedule = null;
1365
+ }, V = (m) => {
1366
+ const h = new Date(m.start.getFullYear(), m.start.getMonth(), m.start.getDate());
1367
+ new Date(h).setDate(h.getDate() + 1);
1368
+ let f = Le(c.movePercentageY, u);
1369
+ if (f = Math.max(0, Math.min(f, 24 * 60)), u.snapToInterval) {
1370
+ const l = f + u.snapToInterval / 2;
1371
+ f = l - l % u.snapToInterval;
1468
1372
  }
1469
- let a = D.start, j = new Date(l.getTime() + k * 6e4);
1470
- return j < m.resizeStartDate && (a = j, j = m.resizeStartDate), { newStart: a, newEnd: j };
1373
+ let T = m.start, E = new Date(h.getTime() + f * 6e4);
1374
+ return E < c.resizeStartDate && (T = E, E = c.resizeStartDate), { newStart: T, newEnd: E };
1375
+ }, P = [], A = (m, h, H) => {
1376
+ document.addEventListener(m, h, H), P.push({ event: m, handler: h, options: H });
1471
1377
  };
1472
- qe(() => u._.register(F.value));
1473
- const L = [], z = (D, l, p) => {
1474
- document.addEventListener(D, l, p), L.push({ event: D, handler: l, options: p });
1475
- };
1476
- return Xe(() => {
1477
- u._.unregister();
1478
- for (const { event: D, handler: l, options: p } of L)
1479
- document.removeEventListener(D, l, p);
1480
- }), (D, l) => (C(), O("div", de({ class: "vuecal__event" }, Be(o.value, !0), {
1378
+ return Ze(() => v._.register(z.value)), Be(() => {
1379
+ v._.unregister();
1380
+ for (const { event: m, handler: h, options: H } of P)
1381
+ document.removeEventListener(m, h, H);
1382
+ }), (m, h) => (C(), L("div", le({ class: "vuecal__event" }, Re(s.value, !0), {
1481
1383
  ref_key: "eventEl",
1482
- ref: F,
1483
- class: Z.value,
1484
- style: t.value,
1485
- draggable: Y.value ? "true" : void 0,
1486
- onDragstart: l[2] || (l[2] = (p) => Y.value && V(w).eventDragStart(p, u)),
1487
- onDragend: l[3] || (l[3] = (p) => Y.value && V(w).eventDragEnd(p, u))
1384
+ ref: z,
1385
+ class: W.value,
1386
+ style: a.value,
1387
+ draggable: y.value ? "true" : void 0,
1388
+ onDragstart: h[2] || (h[2] = (H) => y.value && b(w).eventDragStart(H, v)),
1389
+ onDragend: h[3] || (h[3] = (H) => y.value && b(w).eventDragEnd(H, v))
1488
1390
  }), [
1489
- ve("div", xt, [
1490
- P(D.$slots, "event", { event: u }, () => [
1491
- ve("div", ea, ie(u.title), 1),
1492
- V(r).time && !(V(r).allDayEvents && u.allDay) ? (C(), O("div", ta, [
1493
- V(d).isMonth ? (C(), O("span", aa, ",")) : q("", !0),
1494
- ve("span", na, ie(u._[`startTimeFormatted${V(r).twelveHour ? 12 : 24}`]), 1),
1495
- V(d).isMonth ? q("", !0) : (C(), O("span", sa, "- " + ie(u._[`endTimeFormatted${V(r).twelveHour ? 12 : 24}`]), 1))
1496
- ])) : q("", !0),
1497
- ve("div", {
1391
+ ve("div", Gt, [
1392
+ m.$slots["event.all-day"] ? j(m.$slots, "event.all-day", {
1393
+ key: 0,
1394
+ event: v
1395
+ }) : m.$slots[`event.${b(o).id}`] ? j(m.$slots, `event.${b(o).id}`, {
1396
+ key: 1,
1397
+ event: v
1398
+ }) : j(m.$slots, "event", {
1399
+ key: 2,
1400
+ event: v
1401
+ }, () => [
1402
+ ve("div", qt, ce(v.title), 1),
1403
+ b(u).time && !p.inAllDayBar ? (C(), L("div", Jt, [
1404
+ b(o).isMonth ? (C(), L("span", Ut, ",")) : U("", !0),
1405
+ ve("span", Zt, ce(v._[`startTimeFormatted${b(u).twelveHour ? 12 : 24}`]), 1),
1406
+ b(o).isMonth ? U("", !0) : (C(), L("span", Kt, " - " + ce(v._[`endTimeFormatted${b(u).twelveHour ? 12 : 24}`]), 1))
1407
+ ])) : U("", !0),
1408
+ p.inAllDayBar ? U("", !0) : (C(), L("div", {
1409
+ key: 1,
1498
1410
  class: "vuecal__event-content",
1499
- innerHTML: u.content
1500
- }, null, 8, la)
1411
+ innerHTML: v.content
1412
+ }, null, 8, Qt))
1501
1413
  ])
1502
1414
  ]),
1503
- A.value ? (C(), O("div", {
1415
+ F.value ? (C(), L("div", {
1504
1416
  key: 0,
1505
1417
  class: "vuecal__event-resizer",
1506
- onDragstart: l[0] || (l[0] = xe(() => {
1418
+ onDragstart: h[0] || (h[0] = et(() => {
1507
1419
  }, ["prevent", "stop"]))
1508
- }, null, 32)) : q("", !0),
1509
- Oe(Ge, { name: "vuecal-delete-btn" }, {
1510
- default: J(() => [
1511
- u._.deleting ? (C(), O("div", {
1420
+ }, null, 32)) : U("", !0),
1421
+ je(Ge, { name: "vuecal-delete-btn" }, {
1422
+ default: B(() => [
1423
+ v._.deleting ? (C(), L("div", {
1512
1424
  key: 0,
1513
1425
  class: "vuecal__event-delete",
1514
- onClick: l[1] || (l[1] = xe((p) => u.delete(3), ["stop"]))
1515
- }, "Delete")) : q("", !0)
1426
+ onClick: h[1] || (h[1] = et((H) => v.delete(3), ["stop"]))
1427
+ }, "Delete")) : U("", !0)
1516
1428
  ]),
1517
1429
  _: 1
1518
1430
  })
1519
- ], 16, Qt));
1431
+ ], 16, Xt));
1520
1432
  }
1521
- }, ra = ["innerHTML"], oa = ["data-schedule"], ia = {
1433
+ }, xt = ["innerHTML"], ea = ["data-schedule"], ta = {
1522
1434
  key: 1,
1523
1435
  class: "vuecal__cell-date"
1524
- }, ua = {
1436
+ }, aa = {
1525
1437
  key: 2,
1526
1438
  class: "vuecal__cell-content"
1527
- }, ca = {
1439
+ }, na = {
1528
1440
  key: 3,
1529
1441
  class: "vuecal__cell-events"
1530
- }, da = {
1442
+ }, sa = {
1531
1443
  key: 1,
1532
1444
  class: "vuecal__cell-date"
1533
- }, va = {
1445
+ }, la = {
1534
1446
  key: 2,
1535
1447
  class: "vuecal__cell-content"
1536
- }, ma = {
1448
+ }, ra = {
1537
1449
  key: 3,
1538
1450
  class: "vuecal__cell-events"
1539
- }, fa = {
1451
+ }, oa = {
1540
1452
  key: 5,
1541
1453
  class: "vuecal__cell-events-count"
1542
- }, ga = ["title"], ha = {
1454
+ }, ia = ["title"], $t = {
1543
1455
  __name: "cell",
1544
1456
  props: {
1545
1457
  // Even with time=false, the date of the cell will still be provided in order to attach
1546
1458
  // events to a specific date.
1547
1459
  start: { type: Date, required: !0 },
1548
1460
  end: { type: Date, required: !0 },
1549
- index: { type: Number, required: !0 }
1461
+ index: { type: Number, required: !0 },
1462
+ allDay: { type: Boolean, default: !1 }
1463
+ // True when the cell is an all-day cell.
1550
1464
  },
1551
- setup(y) {
1552
- const s = y, r = Ne("vuecal"), { view: d, config: w, dateUtils: b, eventsManager: H, dnd: f, touch: F } = r, u = M(() => b.isToday(s.start)), m = ue(null), Y = ue([]), A = ue(!1), Z = (i) => {
1553
- Y.value.push(i.detail), A.value = !0;
1554
- }, t = () => setTimeout(() => A.value = !1, 300), o = $e({
1465
+ setup(p) {
1466
+ const t = p, u = He("vuecal"), { view: o, config: w, dateUtils: _, eventsManager: N, dnd: d, touch: z } = u, v = Y(() => _.isToday(t.start)), c = ie(null), y = ie([]), F = ie(!1), W = (r) => {
1467
+ y.value.push(r.detail), F.value = !0;
1468
+ }, a = () => setTimeout(() => F.value = !1, 300), s = Te({
1555
1469
  dragging: !1,
1556
1470
  holding: !1,
1557
1471
  // When the cell is clicked and hold for a certain amount of time.
@@ -1572,424 +1486,660 @@ const st = (y, s) => {
1572
1486
  movePercentageX: 0,
1573
1487
  movePercentageY: 0,
1574
1488
  schedule: null
1575
- }), e = ue(!1), h = ue({ cellOverlaps: {}, longestStreak: 0 }), c = M(() => {
1576
- let i = Math.min(o.startPercentageY, o.movePercentageY), T = Math.max(o.startPercentageY, o.movePercentageY), S = Fe(i, w), $ = Fe(T, w);
1577
- return w.snapToInterval && (S = b.snapToInterval(S, w.snapToInterval), $ = b.snapToInterval($, w.snapToInterval), i = Ve(S, w), T = Ve($, w)), {
1489
+ }), e = ie(!1), k = ie({ cellOverlaps: {}, longestStreak: 0 }), i = Y(() => {
1490
+ let r = Math.min(s.startPercentageY, s.movePercentageY), S = Math.max(s.startPercentageY, s.movePercentageY), O = Le(r, w), M = Le(S, w);
1491
+ return w.snapToInterval && (O = _.snapToInterval(O, w.snapToInterval), M = _.snapToInterval(M, w.snapToInterval), r = Oe(O, w), S = Oe(M, w)), {
1578
1492
  style: {
1579
- top: `${i}%`,
1580
- height: `${Math.abs(T - i)}%`
1493
+ top: `${r}%`,
1494
+ height: `${Math.abs(S - r)}%`
1581
1495
  },
1582
- startMinutes: S,
1583
- endMinutes: $,
1584
- start: b.formatMinutes(S),
1585
- end: b.formatMinutes($),
1586
- ...o.schedule ? { schedule: o.schedule } : {}
1496
+ startMinutes: O,
1497
+ endMinutes: M,
1498
+ start: _.formatMinutes(O),
1499
+ end: _.formatMinutes(M),
1500
+ ...s.schedule ? { schedule: s.schedule } : {}
1587
1501
  };
1588
- }), E = M(() => {
1589
- const i = w.editableEvents.create && (o.dragging || e.value), T = w.eventCreateMinDrag && o.thresholdPassed || !w.eventCreateMinDrag;
1590
- return i && T;
1591
- }), L = M(() => {
1592
- var se;
1593
- const i = /* @__PURE__ */ new Date(), T = d.start.getFullYear(), S = d.start.getMonth(), $ = s.start.getFullYear(), B = s.start.getMonth();
1502
+ }), V = Y(() => {
1503
+ const r = w.editableEvents.create && (s.dragging || e.value), S = w.eventCreateMinDrag && s.thresholdPassed || !w.eventCreateMinDrag;
1504
+ return r && S;
1505
+ }), P = Y(() => {
1506
+ var oe;
1507
+ const r = /* @__PURE__ */ new Date(), S = o.start.getFullYear(), O = o.start.getMonth(), M = t.start.getFullYear(), I = t.start.getMonth();
1594
1508
  return {
1595
- [`vuecal__cell--${Re[s.start.getDay()]}`]: d.isDay || d.isDays || d.isWeek || d.isMonth,
1596
- [`vuecal__cell--${Tt[B]}`]: d.isYear,
1597
- [`vuecal__cell--${$}`]: d.isYears,
1598
- "vuecal__cell--today": u.value,
1599
- "vuecal__cell--current-month": d.isYear && $ === i.getFullYear() && B === i.getMonth(),
1600
- "vuecal__cell--current-year": d.isYears && $ === i.getFullYear(),
1601
- "vuecal__cell--out-of-range": d.isMonth && ($ !== T || B !== S),
1602
- "vuecal__cell--before-min": x.value && N.value,
1603
- "vuecal__cell--after-max": x.value && ne.value,
1604
- "vuecal__cell--disabled": x.value,
1605
- "vuecal__cell--selected": d.selectedDate && d.selectedDate.getTime() >= s.start.getTime() && d.selectedDate.getTime() <= s.end.getTime(),
1606
- "vuecal__cell--has-schedules": (se = w.schedules) == null ? void 0 : se.length,
1607
- "vuecal__cell--dragging": o.dragging,
1608
- "vuecal__cell--has-events": D.value.length
1509
+ [`vuecal__cell--${Xe[t.start.getDay()]}`]: o.isDay || o.isDays || o.isWeek || o.isMonth,
1510
+ [`vuecal__cell--${Et[I]}`]: o.isYear,
1511
+ [`vuecal__cell--${M}`]: o.isYears,
1512
+ "vuecal__cell--today": v.value,
1513
+ "vuecal__cell--current-month": o.isYear && M === r.getFullYear() && I === r.getMonth(),
1514
+ "vuecal__cell--current-year": o.isYears && M === r.getFullYear(),
1515
+ "vuecal__cell--out-of-range": o.isMonth && (M !== S || I !== O),
1516
+ "vuecal__cell--before-min": ae.value && X.value,
1517
+ "vuecal__cell--after-max": ae.value && q.value,
1518
+ "vuecal__cell--disabled": ae.value,
1519
+ "vuecal__cell--selected": o.selectedDate && o.selectedDate.getTime() >= t.start.getTime() && o.selectedDate.getTime() <= t.end.getTime(),
1520
+ "vuecal__cell--has-schedules": (oe = w.schedules) == null ? void 0 : oe.length,
1521
+ "vuecal__cell--dragging": s.dragging,
1522
+ "vuecal__cell--has-events": m.value.length
1609
1523
  };
1610
1524
  });
1611
- M(() => b.formatDate(s.start));
1612
- const z = M(() => {
1613
- switch (d.id) {
1525
+ Y(() => _.formatDate(t.start));
1526
+ const A = Y(() => {
1527
+ switch (o.id) {
1614
1528
  case "day":
1615
1529
  return "";
1616
1530
  case "days":
1617
- return w.availableViews.days.rows > 1 && b.formatDate(s.start, "D"), "";
1531
+ return w.availableViews.days.rows > 1 && _.formatDate(t.start, "D"), "";
1618
1532
  case "week":
1619
1533
  return "";
1620
1534
  case "month":
1621
- return b.formatDate(s.start, "D");
1535
+ return _.formatDate(t.start, "D");
1622
1536
  case "year":
1623
- return b.formatDate(s.start, w.xs ? "MMM" : "MMMM");
1537
+ return _.formatDate(t.start, w.xs ? "MMM" : "MMMM");
1624
1538
  case "years":
1625
- return b.formatDate(s.start, "YYYY");
1539
+ return _.formatDate(t.start, "YYYY");
1626
1540
  }
1627
- }), D = M(() => w.datePicker ? [] : H.getEventsInRange(s.start, s.end, { excludeIds: Y.value })), l = M(() => D.value.filter((i) => !i.background)), p = M(() => {
1628
- var i;
1629
- return (i = w.schedules) == null ? void 0 : i.reduce((T, S) => (T[S.id] = D.value.filter(($) => $.schedule === S.id), T), {});
1630
- }), k = M(() => {
1631
- if (d.isMonth || d.isYear || d.isYears) return {};
1632
- const i = {};
1633
- for (const T of D.value) {
1634
- const S = T._.id, { maxConcurrent: $ = 1, position: B = 0 } = h.value.cellOverlaps[S] || {};
1635
- i[S] = { left: `${100 / $ * B}%` }, w.stackEvents ? i[S].width = `${100 / $ + (B === $ - 1 ? 0 : 15)}%` : i[S].width = `${100 / $}%`;
1541
+ }), m = Y(() => w.datePicker ? [] : N.getEventsInRange(
1542
+ t.start,
1543
+ t.end,
1544
+ { excludeIds: y.value, ...w.allDayEvents ? { allDay: t.allDay } : {} }
1545
+ )), h = Y(() => m.value.filter((r) => !r.background)), H = Y(() => {
1546
+ var r;
1547
+ return (r = w.schedules) == null ? void 0 : r.reduce((S, O) => (S[O.id] = m.value.filter((M) => M.schedule === O.id), S), {});
1548
+ }), f = Y(() => {
1549
+ if (o.isMonth || o.isYear || o.isYears || t.allDay) return {};
1550
+ const r = {};
1551
+ for (const S of m.value) {
1552
+ const O = S._.id, { maxConcurrent: M = 1, position: I = 0 } = k.value.cellOverlaps[O] || {};
1553
+ r[O] = { left: `${100 / M * I}%` }, w.stackEvents ? r[O].width = `${100 / M + (I === M - 1 ? 0 : 15)}%` : r[O].width = `${100 / M}%`;
1636
1554
  }
1637
- return i;
1638
- }), a = M(() => {
1639
- const i = {};
1640
- for (const T of D.value) {
1641
- const S = T._.id, { maxConcurrent: $ = 1, position: B = 0 } = h.value.cellOverlaps[S] || {};
1642
- i[S] = `vuecal__event--stack-${B + 1}-${$}`;
1555
+ return r;
1556
+ }), T = Y(() => {
1557
+ const r = {};
1558
+ for (const S of m.value) {
1559
+ const O = S._.id, { maxConcurrent: M = 1, position: I = 0 } = k.value.cellOverlaps[O] || {};
1560
+ r[O] = `vuecal__event--stack-${I + 1}-${M}`;
1643
1561
  }
1644
- return i;
1645
- }), j = M(() => w.showCellEventCount && l.value.length), R = M(() => {
1646
- var S;
1647
- if (!w.specialHours || d.isMonth || d.isYear || d.isYears) return;
1648
- const i = Re[s.start.getDay()];
1649
- let T = (S = w.specialHours) == null ? void 0 : S[i];
1650
- if (T)
1651
- return Array.isArray(T) || (T = [T]), T.map(($) => {
1652
- let { from: B, to: G, class: se, label: De } = $;
1653
- if (isNaN(B) || isNaN(G) || w.timeFrom >= G || w.timeTo <= B) return;
1654
- B = Math.max(w.timeFrom, B), G = Math.min(w.timeTo, G);
1655
- const v = Ve(B, w), W = Ve(G, w) - v;
1562
+ return r;
1563
+ }), E = Y(() => w.showCellEventCount && h.value.length), l = Y(() => {
1564
+ var O;
1565
+ if (!w.specialHours || o.isMonth || o.isYear || o.isYears || t.allDay) return;
1566
+ const r = Xe[t.start.getDay()];
1567
+ let S = (O = w.specialHours) == null ? void 0 : O[r];
1568
+ if (S)
1569
+ return Array.isArray(S) || (S = [S]), S.map((M) => {
1570
+ let { from: I, to: J, class: oe, label: we } = M;
1571
+ if (isNaN(I) || isNaN(J) || w.timeFrom >= J || w.timeTo <= I) return;
1572
+ I = Math.max(w.timeFrom, I), J = Math.min(w.timeTo, J);
1573
+ const g = Oe(I, w), R = Oe(J, w) - g;
1656
1574
  return {
1657
- style: { top: `${v}%`, height: `${W}%` },
1658
- label: De,
1659
- class: se
1575
+ style: { top: `${g}%`, height: `${R}%` },
1576
+ label: we,
1577
+ class: oe
1660
1578
  };
1661
- }).filter(($) => !!$);
1662
- }), N = M(() => w.minTimestamp !== null && w.minTimestamp > s.end.getTime()), ne = M(() => w.maxTimestamp && w.maxTimestamp < s.start.getTime()), x = M(() => {
1663
- const { disableDays: i } = w, T = d.isYear || d.isYears;
1664
- return i.length && i.includes(b.formatDate(s.start)) && !T ? !0 : N.value || ne.value;
1665
- }), le = $e({
1666
- show: M(() => {
1667
- if (!(!d.isDay && !d.isDays && !d.isWeek) && !(!u.value || !w.time) && !(w.timeFrom > b.dateToMinutes(d.now)) && !(b.dateToMinutes(d.now) > w.timeTo))
1579
+ }).filter((M) => !!M);
1580
+ }), X = Y(() => w.minTimestamp !== null && w.minTimestamp > t.end.getTime()), q = Y(() => w.maxTimestamp && w.maxTimestamp < t.start.getTime()), ae = Y(() => {
1581
+ const { disableDays: r } = w, S = o.isYear || o.isYears;
1582
+ return r.length && r.includes(_.formatDate(t.start)) && !S ? !0 : X.value || q.value;
1583
+ }), se = Te({
1584
+ show: Y(() => {
1585
+ if (!(!o.isDay && !o.isDays && !o.isWeek) && !(!v.value || !w.time || t.allDay) && !(w.timeFrom > _.dateToMinutes(o.now)) && !(_.dateToMinutes(o.now) > w.timeTo))
1668
1586
  return !0;
1669
1587
  }),
1670
- nowInMinutes: M(() => b.dateToMinutes(d.now)),
1671
- todaysTimePosition: M(() => Ve(le.nowInMinutes, w)),
1672
- style: M(() => `top: ${le.todaysTimePosition}%`),
1673
- currentTime: M(() => b.formatTime(d.now))
1674
- }), ce = M(() => {
1675
- if (x.value) return {};
1676
- const i = { ...w.eventListeners.cell };
1677
- for (const [$, B] of Object.entries(i))
1678
- i[$] = (G) => {
1679
- var se, De, v;
1680
- (v = (De = G.target || ((se = G.e) == null ? void 0 : se.target)).closest) != null && v.call(De, ".vuecal__event") || B(G.type ? { e: G, cell: X.value, cursor: Q.value } : G);
1588
+ nowInMinutes: Y(() => _.dateToMinutes(o.now)),
1589
+ todaysTimePosition: Y(() => Oe(se.nowInMinutes, w)),
1590
+ style: Y(() => `top: ${se.todaysTimePosition}%`),
1591
+ currentTime: Y(() => _.formatTime(o.now))
1592
+ }), de = Y(() => {
1593
+ if (ae.value) return {};
1594
+ const r = { ...w.eventListeners.cell };
1595
+ for (const [M, I] of Object.entries(r))
1596
+ r[M] = (J) => {
1597
+ var oe, we, g;
1598
+ (g = (we = J.target || ((oe = J.e) == null ? void 0 : oe.target)).closest) != null && g.call(we, ".vuecal__event") || I(J.type ? { e: J, cell: Z.value, cursor: ee.value } : J);
1681
1599
  };
1682
- const T = { ...i };
1683
- let S = null;
1684
- return i.click = ($) => {
1685
- var G;
1600
+ const S = { ...r };
1601
+ let O = null;
1602
+ return r.click = (M) => {
1603
+ var J;
1686
1604
  re();
1687
- const B = Ee($);
1688
- (G = T.click) == null || G.call(T, { e: $, cell: X.value, cursor: B }), S ? S = clearTimeout(S) : S = setTimeout(() => {
1689
- var se;
1690
- S = null, (se = T["delayed-click"]) == null || se.call(T, { e: $, cell: X.value, cursor: B });
1605
+ const I = he(M);
1606
+ (J = S.click) == null || J.call(S, { e: M, cell: Z.value, cursor: I }), O ? O = clearTimeout(O) : O = setTimeout(() => {
1607
+ var oe;
1608
+ O = null, (oe = S["delayed-click"]) == null || oe.call(S, { e: M, cell: Z.value, cursor: I });
1691
1609
  }, 400);
1692
- }, (w.time && d.isDay || d.isDays || d.isWeek) && (i.touchstart = ($) => {
1693
- var B;
1694
- n($.e || $), (B = T.touchstart) == null || B.call(T, { e: $, cell: X.value, cursor: Q.value });
1695
- }, i.mousedown = ($) => {
1696
- var B;
1697
- n($.e || $), (B = T.mousedown) == null || B.call(T, { e: $, cell: X.value, cursor: Q.value });
1698
- }), T.dblclick && (i.dblclick = ($) => {
1699
- var B;
1700
- (B = T.dblclick) == null || B.call(T, { e: $, cell: X.value, cursor: Ee($) });
1701
- }), w.editableEvents.drag && (i.dragenter = ($) => f.cellDragEnter($, X.value), i.dragover = ($) => {
1702
- $.preventDefault(), f.cellDragOver($, X.value);
1703
- }, i.dragleave = ($) => f.cellDragLeave($, X.value), i.drop = ($) => f.cellDragDrop($, X.value)), i;
1704
- }), X = M(() => ({
1705
- start: s.start,
1706
- end: s.end,
1707
- events: D,
1708
- ...o.schedule ? { schedule: o.schedule } : {},
1709
- goNarrower: () => d.narrower(),
1710
- goBroader: () => d.broader(),
1711
- broader: d.broaderView,
1712
- narrower: d.narrowerView
1713
- })), Ee = (i) => {
1714
- var G;
1715
- const T = (((G = i.touches) == null ? void 0 : G[0]) || i).clientY, { top: S } = m.value.getBoundingClientRect(), $ = Ze(T - S, m.value), B = new Date(s.start);
1716
- return B.setMinutes(Fe($, w)), { y: $, date: B };
1717
- }, Q = M(() => {
1718
- const i = Fe(o.movePercentageY || o.startPercentageY, w), T = new Date(s.start);
1719
- return T.setMinutes(i), {
1720
- x: o.movePercentageX || o.startPercentageX,
1721
- y: o.movePercentageY || o.startPercentageY,
1722
- date: T
1610
+ }, (w.time && o.isDay || o.isDays || o.isWeek) && (r.touchstart = (M) => {
1611
+ var I;
1612
+ n(M.e || M), (I = S.touchstart) == null || I.call(S, { e: M, cell: Z.value, cursor: ee.value });
1613
+ }, r.mousedown = (M) => {
1614
+ var I;
1615
+ n(M.e || M), (I = S.mousedown) == null || I.call(S, { e: M, cell: Z.value, cursor: ee.value });
1616
+ }), S.dblclick && (r.dblclick = (M) => {
1617
+ var I;
1618
+ (I = S.dblclick) == null || I.call(S, { e: M, cell: Z.value, cursor: he(M) });
1619
+ }), w.editableEvents.drag && (r.dragenter = (M) => d.cellDragEnter(M, Z.value), r.dragover = (M) => {
1620
+ M.preventDefault(), d.cellDragOver(M, Z.value);
1621
+ }, r.dragleave = (M) => d.cellDragLeave(M, Z.value), r.drop = (M) => d.cellDragDrop(M, Z.value, t.allDay)), r;
1622
+ }), Z = Y(() => ({
1623
+ start: t.start,
1624
+ end: t.end,
1625
+ events: m,
1626
+ ...s.schedule ? { schedule: s.schedule } : {},
1627
+ goNarrower: () => o.narrower(),
1628
+ goBroader: () => o.broader(),
1629
+ broader: o.broaderView,
1630
+ narrower: o.narrowerView
1631
+ })), he = (r) => {
1632
+ var J;
1633
+ const S = (((J = r.touches) == null ? void 0 : J[0]) || r).clientY, { top: O } = c.value.getBoundingClientRect(), M = Ke(S - O, c.value), I = new Date(t.start);
1634
+ return I.setMinutes(Le(M, w)), { y: M, date: I };
1635
+ }, ee = Y(() => {
1636
+ const r = Le(s.movePercentageY || s.startPercentageY, w), S = new Date(t.start);
1637
+ return S.setMinutes(r), {
1638
+ x: s.movePercentageX || s.startPercentageX,
1639
+ y: s.movePercentageY || s.startPercentageY,
1640
+ date: S
1723
1641
  };
1724
1642
  }), re = () => {
1725
- d.updateSelectedDate(s.start), w.clickToNavigate && ((d.isMonth || d.isDays || d.isWeek) && w.availableViews.day ? d.switch("day") : d.isYear && w.availableViews.month ? d.switch("month") : d.isYears && w.availableViews.year && d.switch("year")), d.updateViewDate(s.start);
1726
- }, n = (i) => {
1727
- var S, $;
1728
- o.schedule = ~~i.target.dataset.schedule;
1729
- const T = m.value.getBoundingClientRect();
1730
- o.startX = (((S = i.touches) == null ? void 0 : S[0]) || i).clientX - T.left, o.startY = ((($ = i.touches) == null ? void 0 : $[0]) || i).clientY - T.top, o.startPercentageX = o.startX * 100 / T.width, o.startPercentageY = o.startY * 100 / T.height, o.thresholdPassed = !1, document.addEventListener(i.type === "touchstart" ? "touchmove" : "mousemove", _), document.addEventListener(i.type === "touchstart" ? "touchend" : "mouseup", g, { once: !0 }), o.holdTimer = setTimeout(() => {
1731
- var B, G;
1732
- o.holding = !0, (G = (B = ce.value).hold) == null || G.call(B, { e: i, cell: X.value, cursor: Q.value });
1643
+ o.updateSelectedDate(t.start), w.clickToNavigate && ((o.isMonth || o.isDays || o.isWeek) && w.availableViews.day ? o.switch("day") : o.isYear && w.availableViews.month ? o.switch("month") : o.isYears && w.availableViews.year && o.switch("year")), o.updateViewDate(t.start);
1644
+ }, n = (r) => {
1645
+ var O, M;
1646
+ s.schedule = ~~r.target.dataset.schedule;
1647
+ const S = c.value.getBoundingClientRect();
1648
+ s.startX = (((O = r.touches) == null ? void 0 : O[0]) || r).clientX - S.left, s.startY = (((M = r.touches) == null ? void 0 : M[0]) || r).clientY - S.top, s.startPercentageX = s.startX * 100 / S.width, s.startPercentageY = s.startY * 100 / S.height, s.thresholdPassed = !1, document.addEventListener(r.type === "touchstart" ? "touchmove" : "mousemove", $), document.addEventListener(r.type === "touchstart" ? "touchend" : "mouseup", D, { once: !0 }), s.holdTimer = setTimeout(() => {
1649
+ var I, J;
1650
+ s.holding = !0, (J = (I = de.value).hold) == null || J.call(I, { e: r, cell: Z.value, cursor: ee.value });
1733
1651
  }, 1e3);
1734
- }, _ = (i) => {
1735
- var S, $, B, G, se, De;
1736
- o.dragging || (F.isDraggingCell = !0, ($ = (S = ce.value)["drag-start"]) == null || $.call(S, { e: i, cell: X.value, cursor: Q.value })), o.dragging = !0, o.holdTimer = clearTimeout(o.holdTimer), o.holding = !1;
1737
- const T = m.value.getBoundingClientRect();
1738
- o.moveX = (((B = i.touches) == null ? void 0 : B[0]) || i).clientX - T.left, o.moveY = (((G = i.touches) == null ? void 0 : G[0]) || i).clientY - T.top, o.movePercentageX = o.moveX * 100 / T.width, o.movePercentageY = o.moveY * 100 / T.height, w.eventCreateMinDrag && Math.abs(o.startY - o.moveY) > w.eventCreateMinDrag && (o.thresholdPassed = !0), (De = (se = ce.value).drag) == null || De.call(se, { e: i, cell: X.value, cursor: Q.value });
1739
- }, g = async (i) => {
1740
- var T, S;
1741
- document.removeEventListener(i.type === "touchend" ? "touchmove" : "mousemove", _, { passive: !1 }), o.dragging && ((S = (T = ce.value)["drag-end"]) == null || S.call(T, { e: i, cell: X.value, cursor: Q.value }), F.isDraggingCell = !1, w.editableEvents.create && (e.value = !0, await I(i), e.value = !1)), o.holdTimer = clearTimeout(o.holdTimer), o.holding = !1, o.dragging = !1, o.startX = 0, o.startY = 0, o.moveX = 0, o.moveY = 0, o.startPercentageX = 0, o.startPercentageY = 0, o.movePercentageX = 0, o.movePercentageY = 0, o.thresholdPassed = !1, o.schedule = null;
1742
- }, I = async (i) => {
1743
- if (!E.value) return;
1744
- let { start: T, end: S, startMinutes: $, endMinutes: B } = c.value;
1745
- T = new Date(s.start), T.setMinutes($), S = new Date(s.start), S.setMinutes(B);
1746
- let G = { ...c.value, start: T, end: S };
1747
- const { create: se } = w.eventListeners.event;
1748
- if (typeof se == "function") {
1749
- const De = G;
1750
- G = await new Promise((v) => se({ e: i, event: G, cell: X.value, resolve: v, cursor: Q.value })), G && typeof G == "object" && d.createEvent(G), G && typeof G == "boolean" && d.createEvent(De);
1751
- } else d.createEvent(G);
1752
- }, ee = () => {
1753
- var i;
1754
- for (const T of Object.keys(ce.value))
1755
- (i = m.value) == null || i.removeEventListener(T, ce.value[T]);
1756
- }, he = () => {
1757
- h.value = H.getCellOverlappingEvents(s.start, s.end);
1652
+ }, $ = (r) => {
1653
+ var O, M, I, J, oe, we;
1654
+ s.dragging || (z.isDraggingCell = !0, (M = (O = de.value)["drag-start"]) == null || M.call(O, { e: r, cell: Z.value, cursor: ee.value })), s.dragging = !0, s.holdTimer = clearTimeout(s.holdTimer), s.holding = !1;
1655
+ const S = c.value.getBoundingClientRect();
1656
+ s.moveX = (((I = r.touches) == null ? void 0 : I[0]) || r).clientX - S.left, s.moveY = (((J = r.touches) == null ? void 0 : J[0]) || r).clientY - S.top, s.movePercentageX = s.moveX * 100 / S.width, s.movePercentageY = s.moveY * 100 / S.height, w.eventCreateMinDrag && Math.abs(s.startY - s.moveY) > w.eventCreateMinDrag && (s.thresholdPassed = !0), (we = (oe = de.value).drag) == null || we.call(oe, { e: r, cell: Z.value, cursor: ee.value });
1657
+ }, D = async (r) => {
1658
+ var S, O;
1659
+ document.removeEventListener(r.type === "touchend" ? "touchmove" : "mousemove", $, { passive: !1 }), s.dragging && ((O = (S = de.value)["drag-end"]) == null || O.call(S, { e: r, cell: Z.value, cursor: ee.value }), z.isDraggingCell = !1, w.editableEvents.create && (e.value = !0, await G(r), e.value = !1)), s.holdTimer = clearTimeout(s.holdTimer), s.holding = !1, s.dragging = !1, s.startX = 0, s.startY = 0, s.moveX = 0, s.moveY = 0, s.startPercentageX = 0, s.startPercentageY = 0, s.movePercentageX = 0, s.movePercentageY = 0, s.thresholdPassed = !1, s.schedule = null;
1660
+ }, G = async (r) => {
1661
+ if (!V.value) return;
1662
+ let { start: S, end: O, startMinutes: M, endMinutes: I } = i.value;
1663
+ S = new Date(t.start), S.setMinutes(M), O = new Date(t.start), O.setMinutes(I);
1664
+ let J = { ...i.value, start: S, end: O };
1665
+ const { create: oe } = w.eventListeners.event;
1666
+ if (typeof oe == "function") {
1667
+ const we = J;
1668
+ J = await new Promise((g) => oe({ e: r, event: J, cell: Z.value, resolve: g, cursor: ee.value })), J && typeof J == "object" && o.createEvent(J), J && typeof J == "boolean" && o.createEvent(we);
1669
+ } else o.createEvent(J);
1670
+ }, K = () => {
1671
+ var r;
1672
+ for (const S of Object.keys(de.value))
1673
+ (r = c.value) == null || r.removeEventListener(S, de.value[S]);
1674
+ }, De = () => {
1675
+ k.value = N.getCellOverlappingEvents(t.start, t.end);
1758
1676
  };
1759
- return fe(
1677
+ return me(
1760
1678
  // Watch event IDs and start/end dates (only) to detect event resizing/dnd.
1761
- () => !d.isYears && !d.isYear && l.value.map((i) => `${i._.id}${i.start.getTime()}${i.end.getTime()}`).join(),
1679
+ () => !o.isYears && !o.isYear && h.value.map((r) => `${r._.id}${r.start.getTime()}${r.end.getTime()}`).join(),
1762
1680
  async () => {
1763
- await Ue(), he();
1681
+ await Je(), De();
1764
1682
  },
1765
1683
  { immediate: !0, flush: "post" }
1766
1684
  // Use flush: 'post' to prevent infinite updates.
1767
- ), Xe(async () => {
1768
- for (const i of Y.value) H.deleteEvent(i, 3);
1769
- ee(), await Ue();
1770
- }), (i, T) => (C(), O("div", de({
1771
- class: ["vuecal__cell", L.value],
1685
+ ), Be(async () => {
1686
+ for (const r of y.value) N.deleteEvent(r, 3);
1687
+ K(), await Je();
1688
+ }), (r, S) => (C(), L("div", le({
1689
+ class: ["vuecal__cell", P.value],
1772
1690
  ref_key: "cellEl",
1773
- ref: m
1774
- }, Be(ce.value, !0)), [
1775
- i.$slots.cell ? P(i.$slots, "cell", {
1691
+ ref: c
1692
+ }, Re(de.value, !0)), [
1693
+ r.$slots.cell ? j(r.$slots, "cell", {
1776
1694
  key: 0,
1777
- cell: X.value
1778
- }) : q("", !0),
1779
- R.value ? (C(!0), O(oe, { key: 1 }, ke(R.value, (S, $) => (C(), O("div", {
1780
- class: ye(["vuecal__special-hours", S.class]),
1781
- style: _e(S.style),
1782
- innerHTML: S.label || ""
1783
- }, null, 14, ra))), 256)) : q("", !0),
1784
- !i.$slots.cell && V(w).schedules ? (C(!0), O(oe, { key: 2 }, ke(V(w).schedules, (S) => (C(), O("div", {
1785
- class: ye(["vuecal__schedule vuecal__schedule--cell", S.class]),
1786
- key: S.id,
1787
- style: _e(S.style || null),
1788
- "data-schedule": S.id
1695
+ cell: Z.value
1696
+ }) : U("", !0),
1697
+ l.value ? (C(!0), L(ue, { key: 1 }, pe(l.value, (O, M) => (C(), L("div", {
1698
+ class: ye(["vuecal__special-hours", O.class]),
1699
+ style: _e(O.style),
1700
+ innerHTML: O.label || ""
1701
+ }, null, 14, xt))), 256)) : U("", !0),
1702
+ !r.$slots.cell && b(w).schedules ? (C(!0), L(ue, { key: 2 }, pe(b(w).schedules, (O) => (C(), L("div", {
1703
+ class: ye(["vuecal__schedule vuecal__schedule--cell", O.class]),
1704
+ key: O.id,
1705
+ style: _e(O.style || null),
1706
+ "data-schedule": O.id
1789
1707
  }, [
1790
- i.$slots["cell-events"] ? P(i.$slots, "cell-events", {
1708
+ r.$slots["cell-events"] ? j(r.$slots, "cell-events", {
1791
1709
  key: 0,
1792
- cell: X.value
1793
- }) : q("", !0),
1794
- z.value || i.$slots["cell-date"] ? (C(), O("div", ia, [
1795
- P(i.$slots, "cell-date", { cell: X.value }, () => [
1796
- et(ie(z.value), 1)
1710
+ cell: Z.value
1711
+ }) : U("", !0),
1712
+ A.value || r.$slots["cell-date"] ? (C(), L("div", ta, [
1713
+ j(r.$slots, "cell-date", { cell: Z.value }, () => [
1714
+ Ue(ce(A.value), 1)
1797
1715
  ])
1798
- ])) : q("", !0),
1799
- i.$slots["cell-content"] ? (C(), O("div", ua, [
1800
- P(i.$slots, "cell-content", { cell: X.value })
1801
- ])) : q("", !0),
1802
- i.$slots["cell-events"] && D.value.length ? (C(), O("div", ca, [
1803
- P(i.$slots, "cell-events", { cell: X.value })
1804
- ])) : D.value.length || A.value ? (C(), Se(tt, {
1716
+ ])) : U("", !0),
1717
+ r.$slots["cell-content"] ? (C(), L("div", aa, [
1718
+ j(r.$slots, "cell-content", { cell: Z.value })
1719
+ ])) : U("", !0),
1720
+ r.$slots["cell-events"] && m.value.length ? (C(), L("div", na, [
1721
+ j(r.$slots, "cell-events", { cell: Z.value })
1722
+ ])) : m.value.length || F.value ? (C(), Se(tt, {
1805
1723
  key: 4,
1806
1724
  class: "vuecal__cell-events",
1807
1725
  name: "vuecal-event-delete",
1808
- onBeforeLeave: T[0] || (T[0] = ($) => A.value = !0),
1809
- onAfterLeave: t,
1726
+ onBeforeLeave: S[0] || (S[0] = (M) => F.value = !0),
1727
+ onAfterLeave: a,
1810
1728
  tag: "div"
1811
1729
  }, {
1812
- default: J(() => [
1813
- (C(!0), O(oe, null, ke(p.value[S.id], ($) => (C(), Se(nt, {
1814
- key: $._.id,
1815
- event: $,
1816
- onEventDeleted: Z,
1817
- style: _e(k.value[$._.id])
1818
- }, je({ _: 2 }, [
1819
- i.$slots.event ? {
1820
- name: "event",
1821
- fn: J((B) => [
1822
- P(i.$slots, "event", de({ ref_for: !0 }, B))
1730
+ default: B(() => [
1731
+ (C(!0), L(ue, null, pe(H.value[O.id], (M) => (C(), Se(st, {
1732
+ key: M._.id,
1733
+ event: M,
1734
+ onEventDeleted: W,
1735
+ "in-all-day-bar": t.allDay,
1736
+ style: _e(f.value[M._.id])
1737
+ }, Ce({ _: 2 }, [
1738
+ r.$slots["event.all-day"] && t.allDay ? {
1739
+ name: "event.all-day",
1740
+ fn: B((I) => [
1741
+ j(r.$slots, "event.all-day", le({ ref_for: !0 }, I))
1823
1742
  ]),
1824
1743
  key: "0"
1744
+ } : void 0,
1745
+ r.$slots[`event.${b(o).id}`] ? {
1746
+ name: `event.${b(o).id}`,
1747
+ fn: B((I) => [
1748
+ j(r.$slots, `event.${b(o).id}`, le({ ref_for: !0 }, I))
1749
+ ]),
1750
+ key: "1"
1751
+ } : void 0,
1752
+ r.$slots.event ? {
1753
+ name: "event",
1754
+ fn: B((I) => [
1755
+ j(r.$slots, "event", le({ ref_for: !0 }, I))
1756
+ ]),
1757
+ key: "2"
1825
1758
  } : void 0
1826
- ]), 1032, ["event", "style"]))), 128))
1759
+ ]), 1032, ["event", "in-all-day-bar", "style"]))), 128))
1827
1760
  ]),
1828
1761
  _: 2
1829
- }, 1024)) : q("", !0),
1830
- E.value && o.schedule === S.id ? (C(), O("div", {
1762
+ }, 1024)) : U("", !0),
1763
+ V.value && s.schedule === O.id && !t.allDay ? (C(), L("div", {
1831
1764
  key: 5,
1832
1765
  class: "vuecal__event-placeholder",
1833
- style: _e(c.value.style)
1834
- }, ie(c.value.start) + " - " + ie(c.value.end), 5)) : q("", !0)
1835
- ], 14, oa))), 128)) : q("", !0),
1836
- !i.$slots.cell && !V(w).schedules ? (C(), O(oe, { key: 3 }, [
1837
- i.$slots["cell-events"] ? P(i.$slots, "cell-events", {
1766
+ style: _e(i.value.style)
1767
+ }, ce(i.value.start) + " - " + ce(i.value.end), 5)) : U("", !0)
1768
+ ], 14, ea))), 128)) : U("", !0),
1769
+ !r.$slots.cell && !b(w).schedules ? (C(), L(ue, { key: 3 }, [
1770
+ r.$slots["cell-events"] ? j(r.$slots, "cell-events", {
1838
1771
  key: 0,
1839
- cell: X.value
1840
- }) : q("", !0),
1841
- z.value || i.$slots["cell-date"] ? (C(), O("div", da, [
1842
- P(i.$slots, "cell-date", { cell: X.value }, () => [
1843
- et(ie(z.value), 1)
1772
+ cell: Z.value
1773
+ }) : U("", !0),
1774
+ A.value || r.$slots["cell-date"] ? (C(), L("div", sa, [
1775
+ j(r.$slots, "cell-date", { cell: Z.value }, () => [
1776
+ Ue(ce(A.value), 1)
1844
1777
  ])
1845
- ])) : q("", !0),
1846
- i.$slots["cell-content"] ? (C(), O("div", va, [
1847
- P(i.$slots, "cell-content", { cell: X.value })
1848
- ])) : q("", !0),
1849
- i.$slots["cell-events"] && D.value.length ? (C(), O("div", ma, [
1850
- P(i.$slots, "cell-events", { cell: X.value })
1851
- ])) : !(V(d).isMonth && !V(w).eventsOnMonthView) && !V(d).isYear && !V(d).isYears && (D.value.length || A.value) ? (C(), Se(tt, {
1778
+ ])) : U("", !0),
1779
+ r.$slots["cell-content"] ? (C(), L("div", la, [
1780
+ j(r.$slots, "cell-content", { cell: Z.value })
1781
+ ])) : U("", !0),
1782
+ r.$slots["cell-events"] && m.value.length ? (C(), L("div", ra, [
1783
+ j(r.$slots, "cell-events", { cell: Z.value })
1784
+ ])) : !(b(o).isMonth && !b(w).eventsOnMonthView) && !b(o).isYear && !b(o).isYears && (m.value.length || F.value) ? (C(), Se(tt, {
1852
1785
  key: 4,
1853
1786
  class: "vuecal__cell-events",
1854
1787
  name: "vuecal-event-delete",
1855
- onBeforeLeave: T[1] || (T[1] = (S) => A.value = !0),
1856
- onAfterLeave: t,
1788
+ onBeforeLeave: S[1] || (S[1] = (O) => F.value = !0),
1789
+ onAfterLeave: a,
1857
1790
  tag: "div"
1858
1791
  }, {
1859
- default: J(() => [
1860
- (C(!0), O(oe, null, ke(D.value, (S) => (C(), Se(nt, {
1861
- key: S._.id,
1862
- event: S,
1863
- onEventDeleted: Z,
1864
- class: ye(a.value[S._.id]),
1865
- style: _e(k.value[S._.id])
1866
- }, je({ _: 2 }, [
1867
- i.$slots.event ? {
1868
- name: "event",
1869
- fn: J(($) => [
1870
- P(i.$slots, "event", de({ ref_for: !0 }, $))
1792
+ default: B(() => [
1793
+ (C(!0), L(ue, null, pe(m.value, (O) => (C(), Se(st, {
1794
+ key: O._.id,
1795
+ event: O,
1796
+ onEventDeleted: W,
1797
+ "in-all-day-bar": t.allDay,
1798
+ class: ye(T.value[O._.id]),
1799
+ style: _e(f.value[O._.id])
1800
+ }, Ce({ _: 2 }, [
1801
+ r.$slots["event.all-day"] && t.allDay ? {
1802
+ name: "event.all-day",
1803
+ fn: B((M) => [
1804
+ j(r.$slots, "event.all-day", le({ ref_for: !0 }, M))
1871
1805
  ]),
1872
1806
  key: "0"
1807
+ } : void 0,
1808
+ r.$slots[`event.${b(o).id}`] ? {
1809
+ name: `event.${b(o).id}`,
1810
+ fn: B((M) => [
1811
+ j(r.$slots, `event.${b(o).id}`, le({ ref_for: !0 }, M))
1812
+ ]),
1813
+ key: "1"
1814
+ } : void 0,
1815
+ r.$slots.event ? {
1816
+ name: "event",
1817
+ fn: B((M) => [
1818
+ j(r.$slots, "event", le({ ref_for: !0 }, M))
1819
+ ]),
1820
+ key: "2"
1873
1821
  } : void 0
1874
- ]), 1032, ["event", "class", "style"]))), 128))
1822
+ ]), 1032, ["event", "in-all-day-bar", "class", "style"]))), 128))
1875
1823
  ]),
1876
1824
  _: 3
1877
- })) : q("", !0),
1878
- E.value ? (C(), O("div", {
1825
+ })) : U("", !0),
1826
+ V.value ? (C(), L("div", {
1879
1827
  key: 5,
1880
1828
  class: "vuecal__event-placeholder",
1881
- style: _e(c.value.style)
1882
- }, ie(c.value.start) + " - " + ie(c.value.end), 5)) : q("", !0)
1883
- ], 64)) : q("", !0),
1884
- i.$slots["event-count"] ? P(i.$slots, "event-count", {
1829
+ style: _e(i.value.style)
1830
+ }, ce(i.value.start) + " - " + ce(i.value.end), 5)) : U("", !0)
1831
+ ], 64)) : U("", !0),
1832
+ r.$slots["event-count"] ? j(r.$slots, "event-count", {
1885
1833
  key: 4,
1886
- events: l.value
1887
- }) : j.value ? (C(), O("div", fa, ie(l.value.length), 1)) : q("", !0),
1888
- le.show ? (C(), O("div", {
1834
+ events: h.value
1835
+ }) : E.value ? (C(), L("div", oa, ce(h.value.length), 1)) : U("", !0),
1836
+ se.show ? (C(), L("div", {
1889
1837
  key: 6,
1890
1838
  class: "vuecal__now-line",
1891
- style: _e(le.style),
1892
- title: le.currentTime
1839
+ style: _e(se.style),
1840
+ title: se.currentTime
1893
1841
  }, [
1894
- ve("span", null, ie(le.currentTime), 1)
1895
- ], 12, ga)) : q("", !0)
1842
+ ve("span", null, ce(se.currentTime), 1)
1843
+ ], 12, ia)) : U("", !0)
1896
1844
  ], 16));
1897
1845
  }
1898
- }, ya = {
1846
+ }, ua = {
1847
+ key: 0,
1848
+ class: "vuecal__headings"
1849
+ }, ca = {
1850
+ key: 0,
1851
+ class: "vuecal__weekdays-headings"
1852
+ }, da = ["onClick"], va = { class: "vuecal__weekday-day" }, fa = {
1853
+ key: 0,
1854
+ class: "vuecal__weekday-date"
1855
+ }, ma = {
1856
+ key: 1,
1857
+ class: "vuecal__schedules-headings w-flex grow"
1858
+ }, ga = ["innerHTML"], ya = {
1859
+ key: 2,
1860
+ class: "vuecal__all-day w-flex grow"
1861
+ }, ha = {
1862
+ __name: "headings-bar",
1863
+ setup(p) {
1864
+ const t = He("vuecal"), u = He("$vuecalEl"), { view: o, config: w, dateUtils: _ } = t, N = Y(() => w.xs ? "day-xs" : w.sm || o.isDays || o.isMonth ? "day-sm" : "day"), d = Y(() => (o.isDay || o.isDays || o.isWeek || o.isMonth) && !(o.isDay && !w.schedules && !w.allDayEvents)), z = Y(() => o.cellDates.slice(0, o.cols).map(({ start: y }) => ({
1865
+ id: Xe[y.getDay()],
1866
+ date: y,
1867
+ dateNumber: y.getDate(),
1868
+ day: _.formatDate(y, "dddd"),
1869
+ "day-sm": _.formatDate(y, "ddd"),
1870
+ "day-xs": _.formatDate(y, "dd"),
1871
+ isToday: _.isToday(y)
1872
+ }))), v = {
1873
+ click: (y) => {
1874
+ (o.isDays || o.isWeek) && o.updateSelectedDate(y);
1875
+ }
1876
+ }, c = {
1877
+ isResizing: ie(!1),
1878
+ startY: ie(0),
1879
+ initialHeight: ie(0),
1880
+ defaultHeight: 25,
1881
+ // Default height in pixels.
1882
+ // Cleanup event listeners.
1883
+ cleanup() {
1884
+ typeof document < "u" && (document.removeEventListener("mousemove", c.handleMouseMove), document.removeEventListener("mouseup", c.cleanup), document.removeEventListener("touchmove", c.handleTouchMove, { passive: !1 }), document.removeEventListener("touchend", c.cleanup)), c.isResizing.value = !1;
1885
+ },
1886
+ startResize(y) {
1887
+ var W;
1888
+ this.isResizing.value = !0, this.startY.value = y;
1889
+ const F = (W = u.value) == null ? void 0 : W.querySelector(".vuecal__all-day");
1890
+ F && (this.initialHeight.value = F.offsetHeight), document.addEventListener("mousemove", c.handleMouseMove), document.addEventListener("mouseup", c.cleanup), document.addEventListener("touchmove", c.handleTouchMove, { passive: !1 }), document.addEventListener("touchend", c.cleanup);
1891
+ },
1892
+ // Update height based on mouse/touch movement.
1893
+ updateHeight(y) {
1894
+ var a;
1895
+ if (!this.isResizing.value) return;
1896
+ const F = y - this.startY.value, W = Math.max(20, this.initialHeight.value + F);
1897
+ (a = u.value) == null || a.style.setProperty("--vuecal-all-day-bar-height", `${W}px`);
1898
+ },
1899
+ // Mouse event handlers.
1900
+ handleMouseDown(y) {
1901
+ this.startResize(y.clientY);
1902
+ },
1903
+ handleMouseMove(y) {
1904
+ c.updateHeight(y.clientY);
1905
+ },
1906
+ // Touch event handlers.
1907
+ handleTouchStart(y) {
1908
+ var F;
1909
+ (F = y.touches) != null && F[0] && this.startResize(y.touches[0].clientY);
1910
+ },
1911
+ handleTouchMove(y) {
1912
+ var F;
1913
+ (F = y.touches) != null && F[0] && (c.updateHeight(y.touches[0].clientY), y.preventDefault());
1914
+ }
1915
+ };
1916
+ return Be(() => {
1917
+ c.cleanup();
1918
+ }), (y, F) => d.value ? (C(), L("div", ua, [
1919
+ b(o).isDay ? U("", !0) : (C(), L("div", ca, [
1920
+ (C(!0), L(ue, null, pe(z.value, (W, a) => (C(), L("div", {
1921
+ class: ye(["vuecal__weekday", { "vuecal__weekday--today": W.isToday }]),
1922
+ key: a,
1923
+ onClick: (s) => v.click(W.date)
1924
+ }, [
1925
+ j(y.$slots, "weekday-heading", {
1926
+ label: W[N.value],
1927
+ id: W.id,
1928
+ date: W.date
1929
+ }, () => [
1930
+ ve("span", va, ce(W[N.value]), 1),
1931
+ b(o).isMonth ? U("", !0) : (C(), L("strong", fa, ce(W.dateNumber), 1))
1932
+ ])
1933
+ ], 10, da))), 128))
1934
+ ])),
1935
+ b(w).schedules ? (C(), L("div", ma, [
1936
+ (C(!0), L(ue, null, pe(z.value, (W, a) => (C(), L(ue, { key: a }, [
1937
+ (C(!0), L(ue, null, pe(b(w).schedules, (s, e) => (C(), L(ue, { key: e }, [
1938
+ y.$slots["schedule-heading"] ? (C(), L("div", {
1939
+ key: 0,
1940
+ class: ye(["vuecal__schedule vuecal__schedule--heading", s.class])
1941
+ }, [
1942
+ j(y.$slots, "schedule-heading", {
1943
+ schedule: s,
1944
+ view: b(o)
1945
+ })
1946
+ ], 2)) : (C(), L("div", {
1947
+ key: 1,
1948
+ class: ye(["vuecal__schedule vuecal__schedule--heading", s.class]),
1949
+ innerHTML: s.label
1950
+ }, null, 10, ga))
1951
+ ], 64))), 128))
1952
+ ], 64))), 128))
1953
+ ])) : U("", !0),
1954
+ b(w).allDayEvents ? (C(), L("div", ya, [
1955
+ (C(!0), L(ue, null, pe(z.value, (W, a) => (C(), Se($t, {
1956
+ class: ye(["vuecal__all-day-cell", { "vuecal__weekday--today": W.isToday }]),
1957
+ key: a,
1958
+ start: W.date,
1959
+ end: new Date(W.date.getTime() + 24 * 60 * 60 * 1e3 - 1),
1960
+ index: a,
1961
+ "all-day": ""
1962
+ }, Ce({ _: 2 }, [
1963
+ y.$slots["event.all-day"] ? {
1964
+ name: "event.all-day",
1965
+ fn: B((s) => [
1966
+ j(y.$slots, "event.all-day", le({ ref_for: !0 }, s))
1967
+ ]),
1968
+ key: "0"
1969
+ } : {
1970
+ name: "event",
1971
+ fn: B((s) => [
1972
+ j(y.$slots, "event", le({ ref_for: !0 }, s))
1973
+ ]),
1974
+ key: "1"
1975
+ }
1976
+ ]), 1032, ["class", "start", "end", "index"]))), 128)),
1977
+ ve("div", {
1978
+ class: "vuecal__all-day-resizer",
1979
+ onMousedown: F[0] || (F[0] = (...W) => c.handleMouseDown && c.handleMouseDown(...W)),
1980
+ onTouchstart: F[1] || (F[1] = (...W) => c.handleTouchStart && c.handleTouchStart(...W))
1981
+ }, null, 32)
1982
+ ])) : U("", !0)
1983
+ ])) : U("", !0);
1984
+ }
1985
+ }, Da = { class: "vuecal__time-column" }, pa = {
1986
+ key: 0,
1987
+ class: "vuecal__all-day-label"
1988
+ }, wa = {
1989
+ __name: "time-column",
1990
+ setup(p) {
1991
+ const t = He("vuecal"), { config: u, texts: o } = t, w = Y(() => {
1992
+ const _ = [];
1993
+ for (let d = u.timeFrom; d < u.timeTo; d += u.timeStep) {
1994
+ const z = d + u.timeStep > u.timeTo, v = ~~(d / 60), c = d % 60, y = o[d < 720 ? "am" : "pm"];
1995
+ let F = null;
1996
+ z && (F = `calc(var(--vuecal-time-cell-height) * ${(u.timeTo - d) / u.timeStep})`), _.push({
1997
+ minutesSum: d,
1998
+ // The sum of hours + minutes in minutes.
1999
+ hours: v,
2000
+ minutes: c,
2001
+ formatted12: `${v % 12 ? v % 12 : 12}${c ? `:${c.toString().padStart(2, 0)}` : ""}${y}`,
2002
+ formatted24: `${v.toString().padStart(2, 0)}:${c.toString().padStart(2, 0)}`,
2003
+ height: F
2004
+ });
2005
+ }
2006
+ return _;
2007
+ });
2008
+ return (_, N) => (C(), L("div", Da, [
2009
+ b(u).allDayEvents ? (C(), L("div", pa, [
2010
+ j(_.$slots, "all-day-label", {}, () => [
2011
+ Ue(ce(b(t).texts.allDay), 1)
2012
+ ])
2013
+ ])) : U("", !0),
2014
+ (C(!0), L(ue, null, pe(w.value, (d, z) => (C(), L("div", {
2015
+ class: "vuecal__time-cell",
2016
+ key: z,
2017
+ style: _e({ height: d.height || null })
2018
+ }, [
2019
+ j(_.$slots, "time-cell", {
2020
+ index: z,
2021
+ minutes: d.minutes,
2022
+ hours: d.hours,
2023
+ minutesSum: d.minutesSum,
2024
+ format12: d.formatted12,
2025
+ format24: d.formatted24
2026
+ }, () => [
2027
+ ve("label", null, ce(b(u).twelveHour ? d.formatted12 : d.formatted24), 1)
2028
+ ])
2029
+ ], 4))), 128))
2030
+ ]));
2031
+ }
2032
+ }, ka = {
1899
2033
  __name: "body",
1900
- setup(y) {
1901
- const s = Ne("vuecal"), { view: r, config: d, dateUtils: w } = s, b = ue(null), H = ue(null), f = M(() => ({
1902
- "--vuecal-grid-columns": r.cols,
1903
- "--vuecal-grid-rows": r.rows
1904
- })), F = M(() => {
1905
- const Y = w.formatTime(Fe(H.value, d));
2034
+ setup(p) {
2035
+ const t = He("vuecal"), { view: u, config: o, dateUtils: w } = t, _ = ie(null), N = ie(null), d = Y(() => ({
2036
+ "--vuecal-grid-columns": u.cols,
2037
+ "--vuecal-grid-rows": u.rows
2038
+ })), z = Y(() => {
2039
+ const y = w.formatTime(Le(N.value, o));
1906
2040
  return {
1907
- style: { top: `${H.value}%` },
1908
- time: Y
2041
+ style: { top: `${N.value}%` },
2042
+ time: y
1909
2043
  };
1910
- }), u = (Y) => {
1911
- var t;
1912
- if (r.isMonth || r.isYear || r.isYears) return;
1913
- const A = (((t = Y.touches) == null ? void 0 : t[0]) || Y).clientY, { top: Z } = b.value.getBoundingClientRect();
1914
- H.value = Ze(A - Z, b.value);
1915
- }, m = () => {
1916
- H.value = null;
2044
+ }), v = (y) => {
2045
+ var a;
2046
+ if (u.isMonth || u.isYear || u.isYears) return;
2047
+ const F = (((a = y.touches) == null ? void 0 : a[0]) || y).clientY, { top: W } = _.value.getBoundingClientRect();
2048
+ N.value = Ke(F - W, _.value);
2049
+ }, c = () => {
2050
+ N.value = null;
1917
2051
  };
1918
- return qe(() => {
1919
- b.value.addEventListener("mousemove", u), b.value.addEventListener("touchmove", u), b.value.addEventListener("mouseleave", m), b.value.addEventListener("touchend", m);
1920
- }), Xe(() => {
1921
- b.value && (b.value.removeEventListener("mousemove", u), b.value.removeEventListener("touchmove", u), b.value.removeEventListener("mouseleave", m), b.value.removeEventListener("touchend", m));
1922
- }), (Y, A) => (C(), O("div", {
2052
+ return Ze(() => {
2053
+ _.value.addEventListener("mousemove", v), _.value.addEventListener("touchmove", v), _.value.addEventListener("mouseleave", c), _.value.addEventListener("touchend", c);
2054
+ }), Be(() => {
2055
+ _.value && (_.value.removeEventListener("mousemove", v), _.value.removeEventListener("touchmove", v), _.value.removeEventListener("mouseleave", c), _.value.removeEventListener("touchend", c));
2056
+ }), (y, F) => (C(), L("div", {
1923
2057
  class: "vuecal__body",
1924
2058
  ref_key: "bodyEl",
1925
- ref: b,
1926
- style: _e(f.value)
2059
+ ref: _,
2060
+ style: _e(d.value)
1927
2061
  }, [
1928
- Oe(Ge, { name: "vuecal-shrink" }, {
1929
- default: J(() => [
1930
- V(d).timeAtCursor && H.value !== null ? (C(), O("div", {
2062
+ je(Ge, { name: "vuecal-shrink" }, {
2063
+ default: B(() => [
2064
+ b(o).timeAtCursor && N.value !== null ? (C(), L("div", {
1931
2065
  key: 0,
1932
2066
  class: "vuecal__time-at-cursor",
1933
- style: _e(F.value.style)
2067
+ style: _e(z.value.style)
1934
2068
  }, [
1935
- ve("label", null, ie(F.value.time), 1)
1936
- ], 4)) : q("", !0)
2069
+ ve("label", null, ce(z.value.time), 1)
2070
+ ], 4)) : U("", !0)
1937
2071
  ]),
1938
2072
  _: 1
1939
2073
  }),
1940
- (C(!0), O(oe, null, ke(V(r).cellDates, (Z, t) => (C(), Se(ha, {
1941
- key: t,
1942
- start: Z.start,
1943
- end: Z.end,
1944
- index: t
1945
- }, je({ _: 2 }, [
1946
- Y.$slots.cell ? {
2074
+ (C(!0), L(ue, null, pe(b(u).cellDates, (W, a) => (C(), Se($t, {
2075
+ key: a,
2076
+ start: W.start,
2077
+ end: W.end,
2078
+ index: a
2079
+ }, Ce({ _: 2 }, [
2080
+ y.$slots.cell ? {
1947
2081
  name: "cell",
1948
- fn: J((o) => [
1949
- P(Y.$slots, "cell", de({ ref_for: !0 }, o))
2082
+ fn: B((s) => [
2083
+ j(y.$slots, "cell", le({ ref_for: !0 }, s))
1950
2084
  ]),
1951
2085
  key: "0"
1952
2086
  } : void 0,
1953
- Y.$slots["cell-date"] ? {
2087
+ y.$slots["cell-date"] ? {
1954
2088
  name: "cell-date",
1955
- fn: J((o) => [
1956
- P(Y.$slots, "cell-date", de({ ref_for: !0 }, o))
2089
+ fn: B((s) => [
2090
+ j(y.$slots, "cell-date", le({ ref_for: !0 }, s))
1957
2091
  ]),
1958
2092
  key: "1"
1959
2093
  } : void 0,
1960
- Y.$slots["cell-content"] ? {
2094
+ y.$slots["cell-content"] ? {
1961
2095
  name: "cell-content",
1962
- fn: J((o) => [
1963
- P(Y.$slots, "cell-content", de({ ref_for: !0 }, o))
2096
+ fn: B((s) => [
2097
+ j(y.$slots, "cell-content", le({ ref_for: !0 }, s))
1964
2098
  ]),
1965
2099
  key: "2"
1966
2100
  } : void 0,
1967
- Y.$slots["cell-events"] ? {
2101
+ y.$slots["cell-events"] ? {
1968
2102
  name: "cell-events",
1969
- fn: J((o) => [
1970
- P(Y.$slots, "cell-events", de({ ref_for: !0 }, o))
2103
+ fn: B((s) => [
2104
+ j(y.$slots, "cell-events", le({ ref_for: !0 }, s))
1971
2105
  ]),
1972
2106
  key: "3"
1973
- } : Y.$slots.event ? {
1974
- name: "event",
1975
- fn: J((o) => [
1976
- P(Y.$slots, "event", de({ ref_for: !0 }, o))
2107
+ } : void 0,
2108
+ y.$slots[`event.${b(u).id}`] ? {
2109
+ name: `event.${b(u).id}`,
2110
+ fn: B((s) => [
2111
+ j(y.$slots, `event.${b(u).id}`, le({ ref_for: !0 }, s))
1977
2112
  ]),
1978
2113
  key: "4"
1979
- } : Y.$slots["event-count"] ? {
1980
- name: "event-count",
1981
- fn: J((o) => [
1982
- P(Y.$slots, "event-count", de({ ref_for: !0 }, o))
2114
+ } : void 0,
2115
+ y.$slots["event.all-day"] ? {
2116
+ name: "event.all-day",
2117
+ fn: B((s) => [
2118
+ j(y.$slots, "event.all-day", le({ ref_for: !0 }, s))
1983
2119
  ]),
1984
2120
  key: "5"
2121
+ } : void 0,
2122
+ y.$slots.event ? {
2123
+ name: "event",
2124
+ fn: B((s) => [
2125
+ j(y.$slots, "event", le({ ref_for: !0 }, s))
2126
+ ]),
2127
+ key: "6"
2128
+ } : void 0,
2129
+ y.$slots["event-count"] ? {
2130
+ name: "event-count",
2131
+ fn: B((s) => [
2132
+ j(y.$slots, "event-count", le({ ref_for: !0 }, s))
2133
+ ]),
2134
+ key: "7"
1985
2135
  } : void 0
1986
2136
  ]), 1032, ["start", "end", "index"]))), 128))
1987
2137
  ], 4));
1988
2138
  }
1989
- }, Da = ["data-locale"], pa = { class: "vuecal__scrollable-wrap" }, wa = {
2139
+ }, $a = ["data-locale"], _a = { class: "vuecal__scrollable-wrap" }, ba = {
1990
2140
  key: 1,
1991
2141
  class: "vuecal__week-numbers"
1992
- }, _a = { class: "vuecal__week-number" }, ka = { class: "vuecal__body-wrap" }, $a = {
2142
+ }, Ta = { class: "vuecal__week-number" }, Ma = { class: "vuecal__body-wrap" }, Ea = {
1993
2143
  __name: "index",
1994
2144
  props: Ft,
1995
2145
  emits: [
@@ -2005,218 +2155,248 @@ const st = (y, s) => {
2005
2155
  "event-drag-start",
2006
2156
  "event-drag-end"
2007
2157
  ],
2008
- setup(y, { expose: s, emit: r }) {
2009
- const d = y, w = r, b = _t("vuecal-el"), H = Ot({ props: d, emit: w, attrs: bt(), vuecalEl: b, uid: kt() }), { config: f, view: F, dateUtils: u, touch: m } = H, Y = M(() => f.time && (F.isDay || F.isDays || F.isWeek)), A = M(() => Array(F.rows).fill().map((e, h) => u.getWeek(u.addDays(F.firstCellDate, 7 * h)))), Z = M(() => {
2158
+ setup(p, { expose: t, emit: u }) {
2159
+ const o = p, w = u, _ = Tt("vuecal-el"), N = Ht({ props: o, emit: w, attrs: Yt(), vuecalEl: _, uid: Mt() }), { config: d, view: z, dateUtils: v, touch: c } = N, y = Y(() => d.time && (z.isDay || z.isDays || z.isWeek)), F = Y(() => Array(z.rows).fill().map((e, k) => v.getWeek(v.addDays(z.firstCellDate, 7 * k)))), W = Y(() => {
2010
2160
  var e;
2011
2161
  return {
2012
- "vuecal--ready": f.ready,
2013
- [`vuecal--${f.theme}-theme`]: f.theme,
2014
- [`vuecal--${f.size}`]: !0,
2015
- "vuecal--date-picker": f.datePicker,
2016
- "vuecal--dark": f.dark,
2017
- "vuecal--light": !f.dark,
2018
- [`vuecal--${F.id}-view`]: !0,
2019
- "vuecal--view-has-time": Y.value,
2020
- "vuecal--timeless": !f.time,
2021
- "vuecal--dragging-cell": m.isDraggingCell,
2022
- "vuecal--dragging-event": m.isDraggingEvent,
2023
- "vuecal--resizing-event": m.isResizingEvent,
2024
- "vuecal--has-schedules": (e = f.schedules) == null ? void 0 : e.length
2162
+ "vuecal--ready": d.ready,
2163
+ [`vuecal--${d.theme}-theme`]: d.theme,
2164
+ [`vuecal--${d.size}`]: !0,
2165
+ "vuecal--date-picker": d.datePicker,
2166
+ "vuecal--dark": d.dark,
2167
+ "vuecal--light": !d.dark,
2168
+ [`vuecal--${z.id}-view`]: !0,
2169
+ "vuecal--view-has-time": y.value,
2170
+ "vuecal--timeless": !d.time,
2171
+ "vuecal--dragging-cell": c.isDraggingCell,
2172
+ "vuecal--dragging-event": c.isDraggingEvent,
2173
+ "vuecal--resizing-event": c.isResizingEvent,
2174
+ "vuecal--has-schedules": (e = d.schedules) == null ? void 0 : e.length
2025
2175
  };
2026
- }), t = M(() => ({
2027
- "--vuecal-time-cell-height": f.timeCellHeight && `${f.timeCellHeight}px`
2028
- })), o = M(() => {
2029
- var e, h;
2176
+ }), a = Y(() => ({
2177
+ "--vuecal-time-cell-height": d.timeCellHeight && `${d.timeCellHeight}px`
2178
+ })), s = Y(() => {
2179
+ var e, k;
2030
2180
  return {
2031
- "vuecal__scrollable--row": Y.value || f.weekNumbers && F.isMonth,
2181
+ "vuecal__scrollable--row": y.value || d.weekNumbers && z.isMonth,
2032
2182
  // Keep the states inside the Vue transition wrapper for smooth CSS transitions.
2033
- [`vuecal__scrollable--${F.id}-view`]: !0,
2034
- "vuecal__scrollable--has-schedules": (e = f.schedules) == null ? void 0 : e.length,
2035
- "vuecal__scrollable--no-schedules": !((h = f.schedules) != null && h.length)
2183
+ [`vuecal__scrollable--${z.id}-view`]: !0,
2184
+ "vuecal__scrollable--has-schedules": (e = d.schedules) == null ? void 0 : e.length,
2185
+ "vuecal__scrollable--no-schedules": !((k = d.schedules) != null && k.length),
2186
+ "vuecal__scrollable--no-all-day-bar": !d.allDayEvents,
2187
+ "vuecal__scrollable--has-all-day-bar": d.allDayEvents
2036
2188
  };
2037
2189
  });
2038
- return qe(async () => {
2039
- await Ue(), f.ready = !0, w("ready", { config: f, view: F });
2040
- }), $t("vuecal", H), s({ view: H.view }), (e, h) => (C(), O("div", {
2041
- class: ye(["vuecal", Z.value]),
2190
+ return Ze(async () => {
2191
+ await Je(), d.ready = !0, w("ready", { config: d, view: z });
2192
+ }), at("vuecal", N), at("$vuecalEl", _), t({ view: N.view }), (e, k) => (C(), L("div", {
2193
+ class: ye(["vuecal", W.value]),
2042
2194
  ref: "vuecal-el",
2043
2195
  "data-locale": e.locale,
2044
- style: _e(t.value)
2196
+ style: _e(a.value)
2045
2197
  }, [
2046
- e.$slots.diy ? P(e.$slots, "diy", {
2198
+ e.$slots.diy ? j(e.$slots, "diy", {
2047
2199
  key: 0,
2048
- vuecal: V(H)
2049
- }) : (C(), O(oe, { key: 1 }, [
2050
- Oe(At, null, je({ _: 2 }, [
2200
+ vuecal: b(N)
2201
+ }) : (C(), L(ue, { key: 1 }, [
2202
+ je(Rt, null, Ce({ _: 2 }, [
2051
2203
  e.$slots.header ? {
2052
2204
  name: "header",
2053
- fn: J((c) => [
2054
- P(e.$slots, "header", te(ae(c)))
2205
+ fn: B((i) => [
2206
+ j(e.$slots, "header", te(ne(i)))
2055
2207
  ]),
2056
2208
  key: "0"
2057
2209
  } : void 0,
2058
2210
  !e.$slots.header && e.$slots["previous-button"] ? {
2059
2211
  name: "previous-button",
2060
- fn: J((c) => [
2061
- P(e.$slots, "previous-button", te(ae(c)))
2212
+ fn: B((i) => [
2213
+ j(e.$slots, "previous-button", te(ne(i)))
2062
2214
  ]),
2063
2215
  key: "1"
2064
2216
  } : void 0,
2065
2217
  !e.$slots.header && e.$slots["next-button"] ? {
2066
2218
  name: "next-button",
2067
- fn: J((c) => [
2068
- P(e.$slots, "next-button", te(ae(c)))
2219
+ fn: B((i) => [
2220
+ j(e.$slots, "next-button", te(ne(i)))
2069
2221
  ]),
2070
2222
  key: "2"
2071
2223
  } : void 0,
2072
2224
  !e.$slots.header && e.$slots["today-button"] ? {
2073
2225
  name: "today-button",
2074
- fn: J((c) => [
2075
- P(e.$slots, "today-button", te(ae(c)))
2226
+ fn: B((i) => [
2227
+ j(e.$slots, "today-button", te(ne(i)))
2076
2228
  ]),
2077
2229
  key: "3"
2078
2230
  } : void 0,
2079
2231
  !e.$slots.header && e.$slots.title ? {
2080
2232
  name: "title",
2081
- fn: J((c) => [
2082
- P(e.$slots, "title", te(ae(c)))
2233
+ fn: B((i) => [
2234
+ j(e.$slots, "title", te(ne(i)))
2083
2235
  ]),
2084
2236
  key: "4"
2085
2237
  } : void 0,
2086
2238
  !e.$slots.header && e.$slots["title.day"] ? {
2087
2239
  name: "title.day",
2088
- fn: J((c) => [
2089
- P(e.$slots, "title.day", te(ae(c)))
2240
+ fn: B((i) => [
2241
+ j(e.$slots, "title.day", te(ne(i)))
2090
2242
  ]),
2091
2243
  key: "5"
2092
2244
  } : void 0,
2093
2245
  !e.$slots.header && e.$slots["title.days"] ? {
2094
2246
  name: "title.days",
2095
- fn: J((c) => [
2096
- P(e.$slots, "title.days", te(ae(c)))
2247
+ fn: B((i) => [
2248
+ j(e.$slots, "title.days", te(ne(i)))
2097
2249
  ]),
2098
2250
  key: "6"
2099
2251
  } : void 0,
2100
2252
  !e.$slots.header && e.$slots["title.week"] ? {
2101
2253
  name: "title.week",
2102
- fn: J((c) => [
2103
- P(e.$slots, "title.week", te(ae(c)))
2254
+ fn: B((i) => [
2255
+ j(e.$slots, "title.week", te(ne(i)))
2104
2256
  ]),
2105
2257
  key: "7"
2106
2258
  } : void 0,
2107
2259
  !e.$slots.header && e.$slots["title.month"] ? {
2108
2260
  name: "title.month",
2109
- fn: J((c) => [
2110
- P(e.$slots, "title.month", te(ae(c)))
2261
+ fn: B((i) => [
2262
+ j(e.$slots, "title.month", te(ne(i)))
2111
2263
  ]),
2112
2264
  key: "8"
2113
2265
  } : void 0,
2114
2266
  !e.$slots.header && e.$slots["title.year"] ? {
2115
2267
  name: "title.year",
2116
- fn: J((c) => [
2117
- P(e.$slots, "title.year", te(ae(c)))
2268
+ fn: B((i) => [
2269
+ j(e.$slots, "title.year", te(ne(i)))
2118
2270
  ]),
2119
2271
  key: "9"
2120
2272
  } : void 0,
2121
2273
  !e.$slots.header && e.$slots["title.years"] ? {
2122
2274
  name: "title.years",
2123
- fn: J((c) => [
2124
- P(e.$slots, "title.years", te(ae(c)))
2275
+ fn: B((i) => [
2276
+ j(e.$slots, "title.years", te(ne(i)))
2125
2277
  ]),
2126
2278
  key: "10"
2127
2279
  } : void 0,
2128
2280
  !e.$slots.header && e.$slots["schedule-heading"] ? {
2129
2281
  name: "schedule-heading",
2130
- fn: J((c) => [
2131
- P(e.$slots, "schedule-heading", te(ae(c)))
2282
+ fn: B((i) => [
2283
+ j(e.$slots, "schedule-heading", te(ne(i)))
2132
2284
  ]),
2133
2285
  key: "11"
2134
2286
  } : void 0
2135
2287
  ]), 1024),
2136
- ve("div", pa, [
2137
- Oe(Ge, {
2138
- name: `vuecal-slide-fade--${V(F).transitionDirection}`
2288
+ ve("div", _a, [
2289
+ je(Ge, {
2290
+ name: `vuecal-slide-fade--${b(z).transitionDirection}`
2139
2291
  }, {
2140
- default: J(() => [
2141
- (C(), O("div", {
2142
- class: ye(["vuecal__scrollable", o.value]),
2143
- key: V(F).id + V(F).start.getTime()
2292
+ default: B(() => [
2293
+ (C(), L("div", {
2294
+ class: ye(["vuecal__scrollable", s.value]),
2295
+ key: b(z).id + b(z).start.getTime()
2144
2296
  }, [
2145
- Y.value ? (C(), Se(Kt, { key: 0 }, je({ _: 2 }, [
2297
+ y.value ? (C(), Se(wa, { key: 0 }, Ce({ _: 2 }, [
2146
2298
  e.$slots["time-cell"] ? {
2147
2299
  name: "time-cell",
2148
- fn: J((c) => [
2149
- P(e.$slots, "time-cell", te(ae(c)))
2300
+ fn: B((i) => [
2301
+ j(e.$slots, "time-cell", te(ne(i)))
2150
2302
  ]),
2151
2303
  key: "0"
2152
2304
  } : void 0
2153
- ]), 1024)) : q("", !0),
2154
- V(f).weekNumbers && V(F).isMonth ? (C(), O("div", wa, [
2155
- (C(!0), O(oe, null, ke(A.value, (c) => (C(), O("div", _a, [
2156
- P(e.$slots, "week-number", {}, () => [
2157
- ve("small", null, ie(c), 1)
2305
+ ]), 1024)) : U("", !0),
2306
+ b(d).weekNumbers && b(z).isMonth ? (C(), L("div", ba, [
2307
+ (C(!0), L(ue, null, pe(F.value, (i) => (C(), L("div", Ta, [
2308
+ j(e.$slots, "week-number", {}, () => [
2309
+ ve("small", null, ce(i), 1)
2158
2310
  ])
2159
2311
  ]))), 256))
2160
- ])) : q("", !0),
2161
- ve("div", ka, [
2162
- Oe(qt, null, je({ _: 2 }, [
2312
+ ])) : U("", !0),
2313
+ ve("div", Ma, [
2314
+ je(ha, null, Ce({ _: 2 }, [
2163
2315
  e.$slots["weekday-heading"] ? {
2164
2316
  name: "weekday-heading",
2165
- fn: J((c) => [
2166
- P(e.$slots, "weekday-heading", te(ae(c)))
2317
+ fn: B((i) => [
2318
+ j(e.$slots, "weekday-heading", te(ne(i)))
2167
2319
  ]),
2168
2320
  key: "0"
2169
2321
  } : void 0,
2170
2322
  e.$slots["schedule-heading"] ? {
2171
2323
  name: "schedule-heading",
2172
- fn: J((c) => [
2173
- P(e.$slots, "schedule-heading", te(ae(c)))
2324
+ fn: B((i) => [
2325
+ j(e.$slots, "schedule-heading", te(ne(i)))
2174
2326
  ]),
2175
2327
  key: "1"
2328
+ } : void 0,
2329
+ e.$slots["event.all-day"] ? {
2330
+ name: "event.all-day",
2331
+ fn: B((i) => [
2332
+ j(e.$slots, "event.all-day", te(ne(i)))
2333
+ ]),
2334
+ key: "2"
2335
+ } : void 0,
2336
+ e.$slots.event ? {
2337
+ name: "event",
2338
+ fn: B((i) => [
2339
+ j(e.$slots, "event", te(ne(i)))
2340
+ ]),
2341
+ key: "3"
2176
2342
  } : void 0
2177
2343
  ]), 1024),
2178
- Oe(ya, null, je({ _: 2 }, [
2344
+ je(ka, null, Ce({ _: 2 }, [
2179
2345
  e.$slots.cell ? {
2180
2346
  name: "cell",
2181
- fn: J((c) => [
2182
- P(e.$slots, "cell", te(ae(c)))
2347
+ fn: B((i) => [
2348
+ j(e.$slots, "cell", te(ne(i)))
2183
2349
  ]),
2184
2350
  key: "0"
2185
2351
  } : void 0,
2186
2352
  !e.$slots.cell && e.$slots["cell-date"] ? {
2187
2353
  name: "cell-date",
2188
- fn: J((c) => [
2189
- P(e.$slots, "cell-date", te(ae(c)))
2354
+ fn: B((i) => [
2355
+ j(e.$slots, "cell-date", te(ne(i)))
2190
2356
  ]),
2191
2357
  key: "1"
2192
2358
  } : void 0,
2193
2359
  !e.$slots.cell && e.$slots["cell-content"] ? {
2194
2360
  name: "cell-content",
2195
- fn: J((c) => [
2196
- P(e.$slots, "cell-content", te(ae(c)))
2361
+ fn: B((i) => [
2362
+ j(e.$slots, "cell-content", te(ne(i)))
2197
2363
  ]),
2198
2364
  key: "2"
2199
2365
  } : void 0,
2200
2366
  !e.$slots.cell && e.$slots["cell-events"] ? {
2201
2367
  name: "cell-events",
2202
- fn: J((c) => [
2203
- P(e.$slots, "cell-events", te(ae(c)))
2368
+ fn: B((i) => [
2369
+ j(e.$slots, "cell-events", te(ne(i)))
2204
2370
  ]),
2205
2371
  key: "3"
2206
2372
  } : void 0,
2207
- !e.$slots.cell && e.$slots.event ? {
2208
- name: "event",
2209
- fn: J((c) => [
2210
- P(e.$slots, "event", te(ae(c)))
2373
+ !e.$slots.cell && !e.$slots["cell-events"] && e.$slots["event.all-day"] ? {
2374
+ name: "event.all-day",
2375
+ fn: B((i) => [
2376
+ j(e.$slots, "event.all-day", te(ne(i)))
2211
2377
  ]),
2212
2378
  key: "4"
2213
2379
  } : void 0,
2380
+ !e.$slots.cell && !e.$slots["cell-events"] && e.$slots[`event.${b(z).id}`] ? {
2381
+ name: `event.${b(z).id}`,
2382
+ fn: B((i) => [
2383
+ j(e.$slots, `event.${b(z).id}`, te(ne(i)))
2384
+ ]),
2385
+ key: "5"
2386
+ } : void 0,
2387
+ !e.$slots.cell && !e.$slots["cell-events"] && e.$slots.event ? {
2388
+ name: "event",
2389
+ fn: B((i) => [
2390
+ j(e.$slots, "event", te(ne(i)))
2391
+ ]),
2392
+ key: "6"
2393
+ } : void 0,
2214
2394
  !e.$slots.cell && e.$slots["event-count"] ? {
2215
2395
  name: "event-count",
2216
- fn: J((c) => [
2217
- P(e.$slots, "event-count", te(ae(c)))
2396
+ fn: B((i) => [
2397
+ j(e.$slots, "event-count", te(ne(i)))
2218
2398
  ]),
2219
- key: "5"
2399
+ key: "7"
2220
2400
  } : void 0
2221
2401
  ]), 1024)
2222
2402
  ])
@@ -2226,63 +2406,63 @@ const st = (y, s) => {
2226
2406
  }, 8, ["name"])
2227
2407
  ])
2228
2408
  ], 64))
2229
- ], 14, Da));
2409
+ ], 14, $a));
2230
2410
  }
2231
- }, Ta = (y) => {
2232
- ze.texts = { ...ge.texts, ...y }, ze.dateUtils.updateTexts(ze.texts);
2411
+ }, Sa = (p) => {
2412
+ Ne.texts = { ...ge.texts, ...p }, Ne.dateUtils.updateTexts(Ne.texts);
2233
2413
  }, {
2234
- addDatePrototypes: Ma,
2235
- removeDatePrototypes: Ya,
2236
- updateTexts: Ea,
2237
- addDays: Sa,
2238
- subtractDays: Ca,
2239
- addHours: Va,
2240
- subtractHours: Oa,
2241
- addMinutes: ja,
2242
- subtractMinutes: Fa,
2243
- getWeek: Pa,
2244
- isToday: La,
2245
- isSameDate: Ha,
2246
- isInRange: za,
2247
- isLeapYear: Na,
2248
- getPreviousFirstDayOfWeek: Wa,
2249
- stringToDate: Aa,
2250
- dateToMinutes: Ia,
2251
- countDays: Ba,
2252
- datesInSameTimeStep: Ra,
2253
- isValid: Xa,
2254
- formatDate: Ga,
2255
- formatDateLite: Ja,
2256
- formatTime: Ua,
2257
- formatTimeLite: qa,
2258
- formatMinutes: Za
2259
- } = ze.dateUtils;
2414
+ addDatePrototypes: Ca,
2415
+ removeDatePrototypes: Va,
2416
+ updateTexts: Oa,
2417
+ addDays: ja,
2418
+ subtractDays: La,
2419
+ addHours: Ha,
2420
+ subtractHours: za,
2421
+ addMinutes: Fa,
2422
+ subtractMinutes: Pa,
2423
+ getWeek: Na,
2424
+ isToday: Aa,
2425
+ isSameDate: Ba,
2426
+ isInRange: Wa,
2427
+ isLeapYear: Ia,
2428
+ getPreviousFirstDayOfWeek: Ra,
2429
+ stringToDate: Xa,
2430
+ dateToMinutes: Ga,
2431
+ countDays: qa,
2432
+ datesInSameTimeStep: Ja,
2433
+ isValid: Ua,
2434
+ formatDate: Za,
2435
+ formatDateLite: Ka,
2436
+ formatTime: Qa,
2437
+ formatTimeLite: xa,
2438
+ formatMinutes: en
2439
+ } = Ne.dateUtils;
2260
2440
  export {
2261
- $a as VueCal,
2262
- Ma as addDatePrototypes,
2263
- Sa as addDays,
2264
- Va as addHours,
2265
- ja as addMinutes,
2266
- Ba as countDays,
2267
- Ia as dateToMinutes,
2268
- Ra as datesInSameTimeStep,
2269
- Ga as formatDate,
2270
- Ja as formatDateLite,
2271
- Za as formatMinutes,
2272
- Ua as formatTime,
2273
- qa as formatTimeLite,
2274
- Wa as getPreviousFirstDayOfWeek,
2275
- Pa as getWeek,
2276
- za as isInRange,
2277
- Na as isLeapYear,
2278
- Ha as isSameDate,
2279
- La as isToday,
2280
- Xa as isValidDate,
2281
- Ya as removeDatePrototypes,
2282
- Aa as stringToDate,
2283
- Ca as subtractDays,
2284
- Oa as subtractHours,
2285
- Fa as subtractMinutes,
2286
- Ea as updateTexts,
2287
- Ta as useLocale
2441
+ Ea as VueCal,
2442
+ Ca as addDatePrototypes,
2443
+ ja as addDays,
2444
+ Ha as addHours,
2445
+ Fa as addMinutes,
2446
+ qa as countDays,
2447
+ Ga as dateToMinutes,
2448
+ Ja as datesInSameTimeStep,
2449
+ Za as formatDate,
2450
+ Ka as formatDateLite,
2451
+ en as formatMinutes,
2452
+ Qa as formatTime,
2453
+ xa as formatTimeLite,
2454
+ Ra as getPreviousFirstDayOfWeek,
2455
+ Na as getWeek,
2456
+ Wa as isInRange,
2457
+ Ia as isLeapYear,
2458
+ Ba as isSameDate,
2459
+ Aa as isToday,
2460
+ Ua as isValidDate,
2461
+ Va as removeDatePrototypes,
2462
+ Xa as stringToDate,
2463
+ La as subtractDays,
2464
+ za as subtractHours,
2465
+ Pa as subtractMinutes,
2466
+ Oa as updateTexts,
2467
+ Sa as useLocale
2288
2468
  };