vue-cal 5.0.1-rc.6 → 5.0.1-rc.8

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