@isma91/react-scheduler 4.0.4 → 4.0.6

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.
package/index.js CHANGED
@@ -37,16 +37,16 @@ const Wn = (e) => {
37
37
  const o = ((a = e.config) == null ? void 0 : a.multiple) && !Array.isArray((n == null ? void 0 : n[e.name]) || e.default), i = o ? t ? [t] : [] : t, s = o ? i.length : i;
38
38
  return { value: i, validity: s };
39
39
  }, Te = (e, t, n, o) => {
40
- var f;
41
- const i = n.idField, s = o.find((u) => u.name === i), a = !!((f = s == null ? void 0 : s.config) != null && f.multiple), c = [];
40
+ var g;
41
+ const i = n.idField, s = o.find((u) => u.name === i), a = !!((g = s == null ? void 0 : s.config) != null && g.multiple), d = [];
42
42
  for (const u of e) {
43
- const _ = a && !Array.isArray(u[i]) ? [u[i]] : u[i];
44
- (a || Array.isArray(_) ? _.includes(t[i]) : _ === t[i]) && c.push({
43
+ const v = a && !Array.isArray(u[i]) ? [u[i]] : u[i];
44
+ (a || Array.isArray(v) ? v.includes(t[i]) : v === t[i]) && d.push({
45
45
  ...u,
46
46
  color: u.color || t[n.colorField || ""]
47
47
  });
48
48
  }
49
- return c;
49
+ return d;
50
50
  }, zn = (e, t) => e.filter(
51
51
  (n) => n.event_id !== t.event_id && (j(de(t.start, 1), {
52
52
  start: n.start,
@@ -71,12 +71,12 @@ const Wn = (e) => {
71
71
  var i;
72
72
  const o = Xt(e.end, e.start);
73
73
  return e.recurring ? (i = e.recurring) == null ? void 0 : i.between(Q(t, -1), Q(t, 1), !0).map((s, a) => {
74
- const c = Bn(s);
74
+ const d = Bn(s);
75
75
  return {
76
76
  ...e,
77
77
  recurrenceId: a,
78
- start: c,
79
- end: Yt(c, o)
78
+ start: d,
79
+ end: Yt(d, o)
80
80
  };
81
81
  }).map((s) => Fe(s, n)) : [Fe(e, n)];
82
82
  }, Ot = (e, t, n, o) => {
@@ -88,16 +88,16 @@ const Wn = (e) => {
88
88
  continue;
89
89
  }
90
90
  if (o && !a.allDay && se(a.start, a.end) > 0) {
91
- const f = X(t), u = q(t);
92
- if (j(t, { start: X(a.start), end: q(a.end) }) || j(a.start, { start: f, end: u }) || j(a.end, { start: f, end: u })) {
93
- const _ = me(a.start, f) ? f : a.start, g = Me(a.end, u) ? u : a.end;
91
+ const g = X(t), u = q(t);
92
+ if (j(t, { start: X(a.start), end: q(a.end) }) || j(a.start, { start: g, end: u }) || j(a.end, { start: g, end: u })) {
93
+ const v = me(a.start, g) ? g : a.start, p = Me(a.end, u) ? u : a.end;
94
94
  i.push({
95
95
  ...a,
96
- start: _,
97
- end: g,
96
+ start: v,
97
+ end: p,
98
98
  _originalStart: a.start,
99
99
  _originalEnd: a.end,
100
- _hasPrev: me(a.start, f),
100
+ _hasPrev: me(a.start, g),
101
101
  _hasNext: Me(a.end, u)
102
102
  });
103
103
  }
@@ -116,13 +116,13 @@ const Wn = (e) => {
116
116
  const o = t.end.getTime() - t.start.getTime();
117
117
  return n.end.getTime() - n.start.getTime() - o;
118
118
  }), Ae = (e) => e.sort((t, n) => t.allDay || se(t.start, t.end) > 0 ? -1 : t.start.getTime() - n.start.getTime()), Oe = (e, t, n, o, i) => {
119
- var f;
120
- const s = Array.isArray(t), a = [], c = {};
119
+ var g;
120
+ const s = Array.isArray(t), a = [], d = {};
121
121
  for (let u = 0; u < e.length; u++) {
122
- const h = Fe(e[u], n), _ = se(h.start, h.end) > 0, g = i && !h.allDay && _;
123
- let w = h.allDay || _ && !g;
122
+ const h = Fe(e[u], n), v = se(h.start, h.end) > 0, p = i && !h.allDay && v;
123
+ let w = h.allDay || v && !p;
124
124
  if (w && (s ? w = t.some(
125
- (d) => j(d, {
125
+ (l) => j(l, {
126
126
  start: X(h.start),
127
127
  end: q(h.end)
128
128
  })
@@ -131,16 +131,16 @@ const Wn = (e) => {
131
131
  end: q(h.end)
132
132
  }), w))
133
133
  if (a.push(h), s)
134
- for (const d of t) {
135
- const p = N(d, "yyyy-MM-dd");
136
- j(d, { start: X(h.start), end: q(h.end) }) && (c[p] = (c[p] || []).concat(h));
134
+ for (const l of t) {
135
+ const y = N(l, "yyyy-MM-dd");
136
+ j(l, { start: X(h.start), end: q(h.end) }) && (d[y] = (d[y] || []).concat(h));
137
137
  }
138
138
  else {
139
- const d = N(h.start, "yyyy-MM-dd");
140
- c[d] = (c[d] || []).concat(h);
139
+ const l = N(h.start, "yyyy-MM-dd");
140
+ d[l] = (d[l] || []).concat(h);
141
141
  }
142
142
  }
143
- return s && o ? ((f = Object.values(c).sort((u, h) => h.length - u.length)) == null ? void 0 : f[0]) || [] : a;
143
+ return s && o ? ((g = Object.values(d).sort((u, h) => h.length - u.length)) == null ? void 0 : g[0]) || [] : a;
144
144
  }, Fe = (e, t) => ({
145
145
  ...e,
146
146
  start: ue(e.start, t),
@@ -244,13 +244,13 @@ const Vn = {
244
244
  agenda: i,
245
245
  selectedDate: s,
246
246
  resourceViewMode: a,
247
- direction: c,
248
- dialogMaxWidth: f,
247
+ direction: d,
248
+ dialogMaxWidth: g,
249
249
  hourFormat: u,
250
250
  ...h
251
- } = e, _ = qn(e), g = o || "week", w = _[g] ? g : Wn(_);
251
+ } = e, v = qn(e), p = o || "week", w = v[p] ? p : Wn(v);
252
252
  return {
253
- ..._,
253
+ ...v,
254
254
  translations: Zn(t),
255
255
  resourceFields: Object.assign(Un, n),
256
256
  view: w,
@@ -268,8 +268,8 @@ const Vn = {
268
268
  resources: [],
269
269
  resourceHeaderComponent: void 0,
270
270
  resourceViewMode: a || "default",
271
- direction: c || "ltr",
272
- dialogMaxWidth: f || "md",
271
+ direction: d || "ltr",
272
+ dialogMaxWidth: g || "md",
273
273
  locale: kn,
274
274
  deletable: !0,
275
275
  editable: !0,
@@ -310,7 +310,7 @@ const Vn = {
310
310
  refetch: () => {
311
311
  }
312
312
  }, At = yt(Rt), O = () => mt(At), Ue = ({ resource: e }) => {
313
- const { resourceHeaderComponent: t, resourceFields: n, direction: o, resourceViewMode: i } = O(), s = ee(), a = e[n.textField], c = e[n.subTextField || ""], f = e[n.avatarField || ""], u = e[n.colorField || ""];
313
+ const { resourceHeaderComponent: t, resourceFields: n, direction: o, resourceViewMode: i } = O(), s = ee(), a = e[n.textField], d = e[n.subTextField || ""], g = e[n.avatarField || ""], u = e[n.colorField || ""];
314
314
  return t instanceof Function ? t(e) : /* @__PURE__ */ E(
315
315
  rn,
316
316
  {
@@ -330,7 +330,7 @@ const Vn = {
330
330
  },
331
331
  component: "div",
332
332
  children: [
333
- /* @__PURE__ */ r(kt, { children: /* @__PURE__ */ r(Xe, { sx: { background: u, margin: "auto" }, alt: a, src: f }) }),
333
+ /* @__PURE__ */ r(kt, { children: /* @__PURE__ */ r(Xe, { sx: { background: u, margin: "auto" }, alt: a, src: g }) }),
334
334
  /* @__PURE__ */ r(
335
335
  Tt,
336
336
  {
@@ -341,7 +341,7 @@ const Vn = {
341
341
  variant: "caption",
342
342
  color: "textSecondary",
343
343
  noWrap: i !== "vertical",
344
- children: c
344
+ children: d
345
345
  }
346
346
  )
347
347
  }
@@ -415,7 +415,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
415
415
  scrollButtons: !0,
416
416
  className: "tabs",
417
417
  classes: { indicator: i },
418
- children: e.map((a, c) => /* @__PURE__ */ r(
418
+ children: e.map((a, d) => /* @__PURE__ */ r(
419
419
  an,
420
420
  {
421
421
  label: a.label,
@@ -425,12 +425,12 @@ const Qn = Tn("div")(({ theme: e }) => ({
425
425
  onClick: () => o(a.id),
426
426
  onDragEnter: () => o(a.id)
427
427
  },
428
- a.id || c
428
+ a.id || d
429
429
  ))
430
430
  }
431
431
  ),
432
432
  e.map(
433
- (a, c) => a.component && /* @__PURE__ */ r(Xn, { value: n, index: a.id, children: a.component }, c)
433
+ (a, d) => a.component && /* @__PURE__ */ r(Xn, { value: n, index: a.id, children: a.component }, d)
434
434
  )
435
435
  ] }), Qe = ({ renderChildren: e }) => {
436
436
  const { resources: t, resourceFields: n, resourceViewMode: o } = O(), i = ee();
@@ -464,16 +464,16 @@ const Qn = Tn("div")(({ theme: e }) => ({
464
464
  id: u[n.idField],
465
465
  label: /* @__PURE__ */ r(Ue, { resource: u }),
466
466
  component: /* @__PURE__ */ r(Y, { children: e(u) })
467
- })), c = (u) => {
467
+ })), d = (u) => {
468
468
  if (i(u, "selectedTab"), typeof s == "function") {
469
- const h = t.find((_) => _[n.idField] === u);
469
+ const h = t.find((v) => v[n.idField] === u);
470
470
  h && s(h);
471
471
  }
472
- }, f = U(() => {
472
+ }, g = U(() => {
473
473
  const u = t[0][n.idField];
474
- return !o || t.findIndex((_) => _[n.idField] === o) < 0 ? u : o;
474
+ return !o || t.findIndex((v) => v[n.idField] === o) < 0 ? u : o;
475
475
  }, [t, n.idField, o]);
476
- return /* @__PURE__ */ r(Jn, { tabs: a, tab: f, setTab: c, style: { display: "grid" } });
476
+ return /* @__PURE__ */ r(Jn, { tabs: a, tab: g, setTab: d, style: { display: "grid" } });
477
477
  }, er = le("div")(({ theme: e, dialog: t }) => ({
478
478
  position: "relative",
479
479
  "& .rs__table_loading": {
@@ -715,15 +715,15 @@ const Qn = Tn("div")(({ theme: e }) => ({
715
715
  canDrag: a
716
716
  };
717
717
  }, ar = ({ event: e, onDelete: t, onEdit: n }) => {
718
- const { translations: o, direction: i } = O(), [s, a] = L(!1), c = () => {
718
+ const { translations: o, direction: i } = O(), [s, a] = L(!1), d = () => {
719
719
  if (!s)
720
720
  return a(!0);
721
721
  t();
722
- }, { canEdit: f, canDelete: u } = Ht(e);
722
+ }, { canEdit: g, canDelete: u } = Ht(e);
723
723
  return /* @__PURE__ */ E(or, { children: [
724
724
  /* @__PURE__ */ r(sn, { in: !s, exit: !1, timeout: 400, unmountOnExit: !0, children: /* @__PURE__ */ E("div", { children: [
725
- f && /* @__PURE__ */ r(ve, { size: "small", onClick: n, children: /* @__PURE__ */ r(En, {}) }),
726
- u && /* @__PURE__ */ r(ve, { size: "small", onClick: c, children: /* @__PURE__ */ r(Cn, {}) })
725
+ g && /* @__PURE__ */ r(ve, { size: "small", onClick: n, children: /* @__PURE__ */ r(En, {}) }),
726
+ u && /* @__PURE__ */ r(ve, { size: "small", onClick: d, children: /* @__PURE__ */ r(Cn, {}) })
727
727
  ] }) }),
728
728
  /* @__PURE__ */ r(
729
729
  ln,
@@ -734,7 +734,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
734
734
  timeout: 400,
735
735
  exit: !1,
736
736
  children: /* @__PURE__ */ E("div", { children: [
737
- /* @__PURE__ */ r(J, { className: "delete", size: "small", onClick: c, children: o.form.delete.toUpperCase() }),
737
+ /* @__PURE__ */ r(J, { className: "delete", size: "small", onClick: d, children: o.form.delete.toUpperCase() }),
738
738
  /* @__PURE__ */ r(J, { className: "cancel", size: "small", onClick: () => a(!1), children: o.form.cancel.toUpperCase() })
739
739
  ] })
740
740
  }
@@ -746,23 +746,23 @@ const Qn = Tn("div")(({ theme: e }) => ({
746
746
  onDelete: i,
747
747
  events: s,
748
748
  handleState: a,
749
- triggerLoading: c,
750
- customViewer: f,
749
+ triggerLoading: d,
750
+ customViewer: g,
751
751
  viewerExtraComponent: u,
752
752
  fields: h,
753
- resources: _,
754
- resourceFields: g,
753
+ resources: v,
754
+ resourceFields: p,
755
755
  locale: w,
756
- viewerTitleComponent: d,
757
- viewerSubtitleComponent: p,
758
- hourFormat: y,
759
- translations: l,
760
- onEventEdit: m
761
- } = O(), k = ee(), C = De(y), D = t._originalStart || t.start, T = t._originalEnd || t.end, M = se(D, T) <= 0 && t.allDay, I = g.idField, v = _.filter(
756
+ viewerTitleComponent: l,
757
+ viewerSubtitleComponent: y,
758
+ hourFormat: m,
759
+ translations: c,
760
+ onEventEdit: f
761
+ } = O(), k = ee(), C = De(m), D = t._originalStart || t.start, T = t._originalEnd || t.end, M = se(D, T) <= 0 && t.allDay, I = p.idField, _ = v.filter(
762
762
  (S) => Array.isArray(t[I]) ? t[I].includes(S[I]) : S[I] === t[I]
763
763
  ), b = async () => {
764
764
  try {
765
- c(!0);
765
+ d(!0);
766
766
  let S = t.event_id;
767
767
  if (i) {
768
768
  const x = await i(S);
@@ -776,7 +776,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
776
776
  } catch (S) {
777
777
  console.error(S);
778
778
  } finally {
779
- c(!1);
779
+ d(!1);
780
780
  }
781
781
  };
782
782
  return /* @__PURE__ */ r(
@@ -798,7 +798,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
798
798
  onClick: (S) => {
799
799
  S.stopPropagation();
800
800
  },
801
- children: typeof f == "function" ? f(t, () => n()) : /* @__PURE__ */ E(rr, { children: [
801
+ children: typeof g == "function" ? g(t, () => n()) : /* @__PURE__ */ E(rr, { children: [
802
802
  /* @__PURE__ */ E(
803
803
  Se,
804
804
  {
@@ -824,12 +824,12 @@ const Qn = Tn("div")(({ theme: e }) => ({
824
824
  event: t,
825
825
  onDelete: b,
826
826
  onEdit: () => {
827
- n(), o(!0, t), m && typeof m == "function" && m(t);
827
+ n(), o(!0, t), f && typeof f == "function" && f(t);
828
828
  }
829
829
  }
830
830
  )
831
831
  ] }),
832
- d instanceof Function ? d(t) : /* @__PURE__ */ r($, { style: { padding: "5px 0" }, noWrap: !0, children: t.title })
832
+ l instanceof Function ? l(t) : /* @__PURE__ */ r($, { style: { padding: "5px 0" }, noWrap: !0, children: t.title })
833
833
  ]
834
834
  }
835
835
  ),
@@ -843,7 +843,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
843
843
  noWrap: !0,
844
844
  children: [
845
845
  /* @__PURE__ */ r(Sn, {}),
846
- M ? l.event.allDay : `${N(D, `dd MMMM yyyy ${C}`, {
846
+ M ? c.event.allDay : `${N(D, `dd MMMM yyyy ${C}`, {
847
847
  locale: w
848
848
  })} - ${N(T, `dd MMMM yyyy ${C}`, {
849
849
  locale: w
@@ -851,8 +851,8 @@ const Qn = Tn("div")(({ theme: e }) => ({
851
851
  ]
852
852
  }
853
853
  ),
854
- p instanceof Function ? p(t) : /* @__PURE__ */ r($, { variant: "body2", style: { padding: "5px 0" }, children: t.subtitle }),
855
- v.length > 0 && /* @__PURE__ */ E(
854
+ y instanceof Function ? y(t) : /* @__PURE__ */ r($, { variant: "body2", style: { padding: "5px 0" }, children: t.subtitle }),
855
+ _.length > 0 && /* @__PURE__ */ E(
856
856
  $,
857
857
  {
858
858
  style: { display: "flex", alignItems: "center", gap: 8 },
@@ -861,7 +861,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
861
861
  noWrap: !0,
862
862
  children: [
863
863
  /* @__PURE__ */ r(In, {}),
864
- v.map((S) => S[g.textField]).join(", ")
864
+ _.map((S) => S[p.textField]).join(", ")
865
865
  ]
866
866
  }
867
867
  ),
@@ -871,24 +871,32 @@ const Qn = Tn("div")(({ theme: e }) => ({
871
871
  }
872
872
  );
873
873
  }, Je = ({ day: e, events: t }) => {
874
- const [n, o] = L(null), [i, s] = L(), [a, c] = L(!1), { locale: f, hourFormat: u, eventRenderer: h, onEventClick: _, timeZone: g, disableViewer: w } = O(), d = ee(), p = De(u), y = (l) => {
875
- !(l != null && l.currentTarget) && a && c(!1), o((l == null ? void 0 : l.currentTarget) || null);
874
+ const [n, o] = L(null), [i, s] = L(), [a, d] = L(!1), {
875
+ locale: g,
876
+ hourFormat: u,
877
+ eventRenderer: h,
878
+ onEventClick: v,
879
+ timeZone: p,
880
+ disableViewer: w,
881
+ displayHourRange: l = !0
882
+ } = O(), y = ee(), m = De(u), c = (f) => {
883
+ !(f != null && f.currentTarget) && a && d(!1), o((f == null ? void 0 : f.currentTarget) || null);
876
884
  };
877
885
  return /* @__PURE__ */ E(ie, { children: [
878
- /* @__PURE__ */ r(dn, { children: t.map((l) => {
879
- const k = he({
880
- dateLeft: l.start,
886
+ /* @__PURE__ */ r(dn, { children: t.map((f) => {
887
+ const C = he({
888
+ dateLeft: f.start,
881
889
  dateRight: e,
882
- timeZone: g
883
- }) ? p : `MMM d, ${p}`, C = N(l.start, k, {
884
- locale: f
885
- }), T = he({ dateLeft: l.end, dateRight: e, timeZone: g }) ? p : `MMM d, ${p}`, M = N(l.end, T, {
886
- locale: f
890
+ timeZone: p
891
+ }) ? m : `MMM d, ${m}`, D = N(f.start, C, {
892
+ locale: g
893
+ }), M = he({ dateLeft: f.end, dateRight: e, timeZone: p }) ? m : `MMM d, ${m}`, I = N(f.end, M, {
894
+ locale: g
887
895
  });
888
896
  return typeof h == "function" ? h({
889
- event: l,
890
- onClick: (I) => {
891
- s(l), y(I);
897
+ event: f,
898
+ onClick: (_) => {
899
+ s(f), c(_);
892
900
  }
893
901
  }) : /* @__PURE__ */ E(
894
902
  cn,
@@ -896,25 +904,31 @@ const Qn = Tn("div")(({ theme: e }) => ({
896
904
  focusRipple: !0,
897
905
  disableRipple: w,
898
906
  tabIndex: w ? -1 : 0,
899
- disabled: l.disabled,
900
- onClick: (I) => {
901
- I.preventDefault(), I.stopPropagation(), w || y(I), s(l), typeof _ == "function" && _(l);
907
+ disabled: f.disabled,
908
+ onClick: (_) => {
909
+ _.preventDefault(), _.stopPropagation(), w || c(_), s(f), typeof v == "function" && v(f);
902
910
  },
903
911
  children: [
904
912
  /* @__PURE__ */ r(kt, { children: /* @__PURE__ */ r(
905
913
  Xe,
906
914
  {
907
915
  sx: {
908
- bgcolor: l.disabled ? "#d0d0d0" : l.color || d.palette.primary.main,
909
- color: l.disabled ? "#808080" : l.textColor || d.palette.primary.contrastText
916
+ bgcolor: f.disabled ? "#d0d0d0" : f.color || y.palette.primary.main,
917
+ color: f.disabled ? "#808080" : f.textColor || y.palette.primary.contrastText
910
918
  },
911
- children: l.agendaAvatar || " "
919
+ children: f.agendaAvatar || " "
912
920
  }
913
921
  ) }),
914
- /* @__PURE__ */ r(Tt, { primary: l.title, secondary: `${C} - ${M}` })
922
+ /* @__PURE__ */ r(
923
+ Tt,
924
+ {
925
+ primary: f.title,
926
+ secondary: l ? `${D} - ${I}` : void 0
927
+ }
928
+ )
915
929
  ]
916
930
  },
917
- `${l.start.getTime()}_${l.end.getTime()}_${l.event_id}`
931
+ `${f.start.getTime()}_${f.end.getTime()}_${f.event_id}`
918
932
  );
919
933
  }) }),
920
934
  i && /* @__PURE__ */ r(
@@ -922,7 +936,7 @@ const Qn = Tn("div")(({ theme: e }) => ({
922
936
  {
923
937
  anchorEl: n,
924
938
  event: i,
925
- onTriggerViewer: y
939
+ onTriggerViewer: c
926
940
  }
927
941
  )
928
942
  ] });
@@ -950,29 +964,29 @@ const Qn = Tn("div")(({ theme: e }) => ({
950
964
  handleGotoDay: i,
951
965
  locale: s,
952
966
  timeZone: a,
953
- translations: c,
954
- alwaysShowAgendaDays: f,
967
+ translations: d,
968
+ alwaysShowAgendaDays: g,
955
969
  stickyNavigationOffset: u,
956
970
  stickyNavigationHeight: h
957
- } = O(), { disableGoToDay: _, headRenderer: g } = o, w = U(() => e.some((d) => Ne(n, d).length > 0), [e, n]);
958
- return !f && !w ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: e.map((d, p) => {
959
- const y = he({ dateLeft: d, timeZone: a }), l = Ne(n, d);
960
- return !f && !l.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(d) ? "rs__today_cell" : ""}`, children: [
961
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof g == "function" ? /* @__PURE__ */ r("div", { children: g({ day: d, events: n, resource: t }) }) : /* @__PURE__ */ r(
971
+ } = O(), { disableGoToDay: v, headRenderer: p } = o, w = U(() => e.some((l) => Ne(n, l).length > 0), [e, n]);
972
+ return !g && !w ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: e.map((l, y) => {
973
+ const m = he({ dateLeft: l, timeZone: a }), c = Ne(n, l);
974
+ return !g && !c.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(l) ? "rs__today_cell" : ""}`, children: [
975
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof p == "function" ? /* @__PURE__ */ r("div", { children: p({ day: l, events: n, resource: t }) }) : /* @__PURE__ */ r(
962
976
  $,
963
977
  {
964
- sx: { fontWeight: y ? "bold" : "inherit" },
965
- color: y ? "primary" : "inherit",
978
+ sx: { fontWeight: m ? "bold" : "inherit" },
979
+ color: m ? "primary" : "inherit",
966
980
  variant: "body2",
967
- className: _ ? "" : "rs__hover__op",
968
- onClick: (m) => {
969
- m.stopPropagation(), _ || i(d);
981
+ className: v ? "" : "rs__hover__op",
982
+ onClick: (f) => {
983
+ f.stopPropagation(), v || i(l);
970
984
  },
971
- children: N(d, "dd E", { locale: s })
985
+ children: N(l, "dd E", { locale: s })
972
986
  }
973
987
  ) }),
974
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: l.length > 0 ? /* @__PURE__ */ r(Je, { day: d, events: l }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: c.noDataToDisplay }) })
975
- ] }, p);
988
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: c.length > 0 ? /* @__PURE__ */ r(Je, { day: l, events: c }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: d.noDataToDisplay }) })
989
+ ] }, y);
976
990
  }) });
977
991
  }, Ze = 1, pe = 28, ht = 27, lr = 23, Pt = () => {
978
992
  const e = rt(null), t = rt(null);
@@ -1036,25 +1050,25 @@ const Qn = Tn("div")(({ theme: e }) => ({
1036
1050
  }
1037
1051
  };
1038
1052
  }, We = ({ event: e, multiday: t, hasPrev: n, hasNext: o, showdate: i = !0 }) => {
1039
- const { direction: s, locale: a, hourFormat: c, eventRenderer: f, onEventClick: u, view: h, disableViewer: _ } = O(), g = dr(e), [w, d] = L(null), [p, y] = L(!1), l = ee(), m = De(c), k = s === "rtl" ? dt : lt, C = s === "rtl" ? lt : dt, D = se(e.start, e.end) <= 0 && e.allDay, { canDrag: T } = Ht(e), M = Z(
1040
- (v) => {
1041
- !(v != null && v.currentTarget) && p && y(!1), d((v == null ? void 0 : v.currentTarget) || null);
1053
+ const { direction: s, locale: a, hourFormat: d, eventRenderer: g, onEventClick: u, view: h, disableViewer: v } = O(), p = dr(e), [w, l] = L(null), [y, m] = L(!1), c = ee(), f = De(d), k = s === "rtl" ? dt : lt, C = s === "rtl" ? lt : dt, D = se(e.start, e.end) <= 0 && e.allDay, { canDrag: T } = Ht(e), M = Z(
1054
+ (_) => {
1055
+ !(_ != null && _.currentTarget) && y && m(!1), l((_ == null ? void 0 : _.currentTarget) || null);
1042
1056
  },
1043
- [p]
1057
+ [y]
1044
1058
  ), I = U(() => {
1045
- if (typeof f == "function" && !t && h !== "month") {
1046
- const b = f({ event: e, onClick: M, ...g });
1059
+ if (typeof g == "function" && !t && h !== "month") {
1060
+ const b = g({ event: e, onClick: M, ...p });
1047
1061
  if (b)
1048
1062
  return /* @__PURE__ */ r(ut, { children: b }, `${e.start.getTime()}_${e.end.getTime()}_${e.event_id}`);
1049
1063
  }
1050
- let v = /* @__PURE__ */ E("div", { style: { padding: "2px 6px" }, children: [
1064
+ let _ = /* @__PURE__ */ E("div", { style: { padding: "2px 6px" }, children: [
1051
1065
  /* @__PURE__ */ r($, { variant: "subtitle2", style: { fontSize: 12 }, noWrap: !0, children: e.title }),
1052
1066
  e.subtitle && /* @__PURE__ */ r($, { variant: "body2", style: { fontSize: 11 }, noWrap: !0, children: e.subtitle }),
1053
- i && /* @__PURE__ */ r($, { style: { fontSize: 11 }, noWrap: !0, children: `${N(e.start, m, {
1067
+ i && /* @__PURE__ */ r($, { style: { fontSize: 11 }, noWrap: !0, children: `${N(e.start, f, {
1054
1068
  locale: a
1055
- })} - ${N(e.end, m, { locale: a })}` })
1069
+ })} - ${N(e.end, f, { locale: a })}` })
1056
1070
  ] });
1057
- return t && (v = /* @__PURE__ */ E(
1071
+ return t && (_ = /* @__PURE__ */ E(
1058
1072
  "div",
1059
1073
  {
1060
1074
  style: {
@@ -1064,9 +1078,9 @@ const Qn = Tn("div")(({ theme: e }) => ({
1064
1078
  justifyContent: "space-between"
1065
1079
  },
1066
1080
  children: [
1067
- /* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: n ? /* @__PURE__ */ r(C, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.start, m, { locale: a }) }),
1081
+ /* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: n ? /* @__PURE__ */ r(C, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.start, f, { locale: a }) }),
1068
1082
  /* @__PURE__ */ r($, { variant: "subtitle2", align: "center", sx: { fontSize: 12 }, noWrap: !0, children: e.title }),
1069
- /* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: o ? /* @__PURE__ */ r(k, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.end, m, { locale: a }) })
1083
+ /* @__PURE__ */ r($, { sx: { fontSize: 11 }, noWrap: !0, children: o ? /* @__PURE__ */ r(k, { fontSize: "small", sx: { display: "flex" } }) : i && !D && N(e.end, f, { locale: a }) })
1070
1084
  ]
1071
1085
  }
1072
1086
  )), /* @__PURE__ */ r(
@@ -1074,40 +1088,40 @@ const Qn = Tn("div")(({ theme: e }) => ({
1074
1088
  {
1075
1089
  disabled: e.disabled,
1076
1090
  sx: {
1077
- bgcolor: e.disabled ? "#d0d0d0" : e.color || l.palette.primary.main,
1078
- color: e.disabled ? "#808080" : e.textColor || l.palette.primary.contrastText,
1079
- borderTop: e._hasPrev ? `3px dashed ${e.textColor || l.palette.primary.contrastText}` : void 0,
1080
- borderBottom: e._hasNext ? `3px dashed ${e.textColor || l.palette.primary.contrastText}` : void 0,
1091
+ bgcolor: e.disabled ? "#d0d0d0" : e.color || c.palette.primary.main,
1092
+ color: e.disabled ? "#808080" : e.textColor || c.palette.primary.contrastText,
1093
+ borderTop: e._hasPrev ? `3px dashed ${e.textColor || c.palette.primary.contrastText}` : void 0,
1094
+ borderBottom: e._hasNext ? `3px dashed ${e.textColor || c.palette.primary.contrastText}` : void 0,
1081
1095
  ...e.sx || {}
1082
1096
  },
1083
1097
  children: /* @__PURE__ */ r(
1084
1098
  un,
1085
1099
  {
1086
1100
  onClick: (b) => {
1087
- b.preventDefault(), b.stopPropagation(), _ || M(b), typeof u == "function" && u(e);
1101
+ b.preventDefault(), b.stopPropagation(), v || M(b), typeof u == "function" && u(e);
1088
1102
  },
1089
1103
  focusRipple: !0,
1090
- tabIndex: _ ? -1 : 0,
1091
- disableRipple: _,
1104
+ tabIndex: v ? -1 : 0,
1105
+ disableRipple: v,
1092
1106
  disabled: e.disabled,
1093
- children: /* @__PURE__ */ r("div", { ...g, draggable: T, children: v })
1107
+ children: /* @__PURE__ */ r("div", { ...p, draggable: T, children: _ })
1094
1108
  }
1095
1109
  )
1096
1110
  },
1097
1111
  `${e.start.getTime()}_${e.end.getTime()}_${e.event_id}`
1098
1112
  );
1099
1113
  }, [
1100
- f,
1114
+ g,
1101
1115
  t,
1102
1116
  h,
1103
1117
  e,
1104
1118
  i,
1105
- m,
1119
+ f,
1106
1120
  a,
1107
- l.palette.primary.main,
1108
- l.palette.primary.contrastText,
1109
- _,
1110
- g,
1121
+ c.palette.primary.main,
1122
+ c.palette.primary.contrastText,
1123
+ v,
1124
+ p,
1111
1125
  T,
1112
1126
  M,
1113
1127
  n,
@@ -1129,17 +1143,17 @@ function Le({
1129
1143
  timeZone: o,
1130
1144
  currentTime: i
1131
1145
  }) {
1132
- const s = ue(i || /* @__PURE__ */ new Date(), o), a = $e(s, xe(s, { hours: e, minutes: 0 })), c = a * n, u = a / t + Ze;
1133
- return c + u;
1146
+ const s = ue(i || /* @__PURE__ */ new Date(), o), a = $e(s, xe(s, { hours: e, minutes: 0 })), d = a * n, u = a / t + Ze;
1147
+ return d + u;
1134
1148
  }
1135
1149
  const cr = (e) => {
1136
- const [t, n] = L(Le(e)), { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: c, color: f } = e;
1150
+ const [t, n] = L(Le(e)), { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: d, color: g } = e;
1137
1151
  return K(() => {
1138
- const u = { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: c };
1152
+ const u = { startHour: o, step: i, minuteHeight: s, timeZone: a, currentTime: d };
1139
1153
  n(Le(u));
1140
1154
  const h = setInterval(() => n(Le(u)), 60 * 1e3);
1141
1155
  return () => clearInterval(h);
1142
- }, [o, i, s, a, c]), t < 0 ? null : /* @__PURE__ */ E(ir, { style: { top: t, zIndex: e.zIndex }, color: f, children: [
1156
+ }, [o, i, s, a, d]), t < 0 ? null : /* @__PURE__ */ E(ir, { style: { top: t, zIndex: e.zIndex }, color: g, children: [
1143
1157
  /* @__PURE__ */ r("div", {}),
1144
1158
  /* @__PURE__ */ r("div", {})
1145
1159
  ] });
@@ -1151,42 +1165,42 @@ const cr = (e) => {
1151
1165
  step: i,
1152
1166
  minuteHeight: s,
1153
1167
  direction: a,
1154
- timeZone: c,
1155
- currentTime: f,
1168
+ timeZone: d,
1169
+ currentTime: g,
1156
1170
  showCurrentTimeBar: u = !0,
1157
1171
  currentTimeBarColor: h
1158
1172
  }) => {
1159
- const _ = [];
1173
+ const v = [];
1160
1174
  return /* @__PURE__ */ E(ie, { children: [
1161
- u && he({ dateLeft: t, timeZone: c }) && /* @__PURE__ */ r(
1175
+ u && he({ dateLeft: t, timeZone: d }) && /* @__PURE__ */ r(
1162
1176
  cr,
1163
1177
  {
1164
1178
  startHour: n,
1165
1179
  step: i,
1166
1180
  minuteHeight: s,
1167
- timeZone: c,
1181
+ timeZone: d,
1168
1182
  zIndex: 2 * e.length + 1,
1169
- currentTime: f,
1183
+ currentTime: g,
1170
1184
  color: h
1171
1185
  }
1172
1186
  ),
1173
- e.map((g, w) => {
1174
- const d = (o * 60 - n * 60) * s, p = $e(g.end, g.start) * s, y = Math.min(p, d) - Ze, l = n * 60, m = g.start.getHours() * 60 + g.start.getMinutes(), k = Math.max(m - l, 0), C = k * s, T = y / 60 * Ze, M = k / i, I = C + M, v = zn(e, g), b = v.filter((S) => _.includes(S.event_id));
1175
- return _.push(g.event_id), /* @__PURE__ */ r(
1187
+ e.map((p, w) => {
1188
+ const l = (o * 60 - n * 60) * s, y = $e(p.end, p.start) * s, m = Math.min(y, l) - Ze, c = n * 60, f = p.start.getHours() * 60 + p.start.getMinutes(), k = Math.max(f - c, 0), C = k * s, T = m / 60 * Ze, M = k / i, I = C + M, _ = zn(e, p), b = _.filter((S) => v.includes(S.event_id));
1189
+ return v.push(p.event_id), /* @__PURE__ */ r(
1176
1190
  "div",
1177
1191
  {
1178
1192
  className: "rs__event__item",
1179
1193
  style: {
1180
- height: y + T,
1194
+ height: m + T,
1181
1195
  top: I,
1182
1196
  width: b.length > 0 ? `calc(100% - ${100 - 98 / (b.length + 1)}%)` : "98%",
1183
1197
  // Leave some space to click cell
1184
1198
  zIndex: e.length + w,
1185
- [a === "rtl" ? "right" : "left"]: b.length > 0 ? `${100 / (v.length + 1) * b.length}%` : ""
1199
+ [a === "rtl" ? "right" : "left"]: b.length > 0 ? `${100 / (_.length + 1) * b.length}%` : ""
1186
1200
  },
1187
- children: /* @__PURE__ */ r(We, { event: g })
1201
+ children: /* @__PURE__ */ r(We, { event: p })
1188
1202
  },
1189
- `${g.event_id}/${g.recurrenceId || ""}`
1203
+ `${p.event_id}/${p.recurrenceId || ""}`
1190
1204
  );
1191
1205
  })
1192
1206
  ] });
@@ -1195,11 +1209,11 @@ const cr = (e) => {
1195
1209
  triggerDialog: i,
1196
1210
  onCellClick: s,
1197
1211
  onDrop: a,
1198
- currentDragged: c,
1199
- setCurrentDragged: f,
1212
+ currentDragged: d,
1213
+ setCurrentDragged: g,
1200
1214
  editable: u,
1201
1215
  timeZone: h
1202
- } = O(), _ = ee();
1216
+ } = O(), v = ee();
1203
1217
  return {
1204
1218
  tabIndex: u ? 0 : -1,
1205
1219
  disableRipple: !u,
@@ -1210,20 +1224,20 @@ const cr = (e) => {
1210
1224
  [n]: o
1211
1225
  }), s && typeof s == "function" && s(e, t, n, o);
1212
1226
  },
1213
- onDragOver: (g) => {
1214
- g.preventDefault(), c && (g.currentTarget.style.backgroundColor = Ie(_.palette.secondary.main, 0.3));
1227
+ onDragOver: (p) => {
1228
+ p.preventDefault(), d && (p.currentTarget.style.backgroundColor = Ie(v.palette.secondary.main, 0.3));
1215
1229
  },
1216
- onDragEnter: (g) => {
1217
- c && (g.currentTarget.style.backgroundColor = Ie(_.palette.secondary.main, 0.3));
1230
+ onDragEnter: (p) => {
1231
+ d && (p.currentTarget.style.backgroundColor = Ie(v.palette.secondary.main, 0.3));
1218
1232
  },
1219
- onDragLeave: (g) => {
1220
- c && (g.currentTarget.style.backgroundColor = "");
1233
+ onDragLeave: (p) => {
1234
+ d && (p.currentTarget.style.backgroundColor = "");
1221
1235
  },
1222
- onDrop: (g) => {
1223
- if (c && c.event_id) {
1224
- g.preventDefault(), g.currentTarget.style.backgroundColor = "";
1236
+ onDrop: (p) => {
1237
+ if (d && d.event_id) {
1238
+ p.preventDefault(), p.currentTarget.style.backgroundColor = "";
1225
1239
  const w = je(e, h);
1226
- a(g, c.event_id.toString(), w, n, o), f();
1240
+ a(p, d.event_id.toString(), w, n, o), g();
1227
1241
  }
1228
1242
  },
1229
1243
  [n]: o
@@ -1236,15 +1250,15 @@ const cr = (e) => {
1236
1250
  resourceVal: i,
1237
1251
  cellRenderer: s,
1238
1252
  height: a,
1239
- children: c
1253
+ children: d
1240
1254
  }) => {
1241
- const f = ur({ start: t, end: n, resourceKey: o, resourceVal: i });
1255
+ const g = ur({ start: t, end: n, resourceKey: o, resourceVal: i });
1242
1256
  return s ? s({
1243
1257
  day: e,
1244
1258
  start: t,
1245
1259
  end: n,
1246
1260
  height: a,
1247
- ...f
1261
+ ...g
1248
1262
  }) : /* @__PURE__ */ r(
1249
1263
  J,
1250
1264
  {
@@ -1253,8 +1267,8 @@ const cr = (e) => {
1253
1267
  dateStyle: "full",
1254
1268
  timeStyle: "long"
1255
1269
  })} - ${n.toLocaleString("en", { dateStyle: "full", timeStyle: "long" })}`,
1256
- ...f,
1257
- children: c
1270
+ ...g,
1271
+ children: d
1258
1272
  }
1259
1273
  );
1260
1274
  }, hr = ({
@@ -1267,27 +1281,27 @@ const cr = (e) => {
1267
1281
  }) => {
1268
1282
  const {
1269
1283
  week: a,
1270
- events: c,
1271
- handleGotoDay: f,
1284
+ events: d,
1285
+ handleGotoDay: g,
1272
1286
  resources: u,
1273
1287
  resourceFields: h,
1274
- resourceViewMode: _,
1275
- direction: g,
1288
+ resourceViewMode: v,
1289
+ direction: p,
1276
1290
  locale: w,
1277
- hourFormat: d,
1278
- timeZone: p,
1279
- stickyNavigation: y,
1280
- stickyNavigationOffset: l,
1281
- stickyNavigationHeight: m,
1291
+ hourFormat: l,
1292
+ timeZone: y,
1293
+ stickyNavigation: m,
1294
+ stickyNavigationOffset: c,
1295
+ stickyNavigationHeight: f,
1282
1296
  currentTime: k,
1283
1297
  showCurrentTimeBar: C,
1284
1298
  currentTimeBarColor: D,
1285
1299
  forceInlineMultiDay: T
1286
- } = O(), { startHour: M, endHour: I, step: v, cellRenderer: b, disableGoToDay: S, headRenderer: x, hourRenderer: W } = a, { renderedSlots: R } = Lt(), { headersRef: V, bodyRef: te } = Pt(), G = pe, ae = X(e[0]), ne = q(e[e.length - 1]), P = De(d), fe = U(() => {
1287
- const F = u.length && _ === "default", A = Oe(
1288
- F ? c : i,
1300
+ } = O(), { startHour: M, endHour: I, step: _, cellRenderer: b, disableGoToDay: S, headRenderer: x, hourRenderer: W } = a, { renderedSlots: R } = Lt(), { headersRef: V, bodyRef: te } = Pt(), G = pe, ae = X(e[0]), ne = q(e[e.length - 1]), P = De(l), fe = U(() => {
1301
+ const F = u.length && v === "default", A = Oe(
1302
+ F ? d : i,
1289
1303
  e,
1290
- p,
1304
+ y,
1291
1305
  !0,
1292
1306
  T
1293
1307
  );
@@ -1295,17 +1309,17 @@ const cr = (e) => {
1295
1309
  }, [
1296
1310
  G,
1297
1311
  e,
1298
- c,
1299
- _,
1312
+ d,
1313
+ v,
1300
1314
  i,
1301
1315
  u.length,
1302
- p
1316
+ y
1303
1317
  ]), ge = (F, A, H) => {
1304
1318
  const re = ye(ae, A);
1305
1319
  return Oe(
1306
1320
  F,
1307
1321
  e,
1308
- p,
1322
+ y,
1309
1323
  void 0,
1310
1324
  T
1311
1325
  ).filter((B) => me(B.start, ae) ? re : ye(B.start, A)).sort((B, ce) => ce.end.getTime() - B.end.getTime()).map((B) => {
@@ -1333,9 +1347,9 @@ const cr = (e) => {
1333
1347
  days: e.length,
1334
1348
  ref: V,
1335
1349
  sticky: "1",
1336
- stickyNavigation: y,
1337
- stickyOffset: l,
1338
- stickyHeight: m,
1350
+ stickyNavigation: m,
1351
+ stickyOffset: c,
1352
+ stickyHeight: f,
1339
1353
  children: [
1340
1354
  /* @__PURE__ */ r("span", { className: "rs__cell rs__time" }),
1341
1355
  e.map((F, A) => /* @__PURE__ */ E(
@@ -1348,7 +1362,7 @@ const cr = (e) => {
1348
1362
  zt,
1349
1363
  {
1350
1364
  date: F,
1351
- onClick: S ? void 0 : f,
1365
+ onClick: S ? void 0 : g,
1352
1366
  locale: w
1353
1367
  }
1354
1368
  ),
@@ -1363,7 +1377,7 @@ const cr = (e) => {
1363
1377
  /* @__PURE__ */ r(be, { days: e.length, ref: te, children: t.map((F, A) => /* @__PURE__ */ E(ie, { children: [
1364
1378
  /* @__PURE__ */ r("span", { style: { height: n }, className: "rs__cell rs__header rs__time", children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(F, P, { locale: w })) }) : /* @__PURE__ */ r($, { variant: "caption", children: N(F, P, { locale: w }) }) }),
1365
1379
  e.map((H, re) => {
1366
- const z = /* @__PURE__ */ new Date(`${N(H, "yyyy/MM/dd")} ${N(F, P)}`), oe = de(z, v), B = h.idField;
1380
+ const z = /* @__PURE__ */ new Date(`${N(H, "yyyy/MM/dd")} ${N(F, P)}`), oe = de(z, _), B = h.idField;
1367
1381
  return /* @__PURE__ */ E("span", { className: `rs__cell ${_e(H) ? "rs__today_cell" : ""}`, children: [
1368
1382
  A === 0 && /* @__PURE__ */ r(
1369
1383
  Vt,
@@ -1371,16 +1385,16 @@ const cr = (e) => {
1371
1385
  todayEvents: Ot(
1372
1386
  i,
1373
1387
  H,
1374
- p,
1388
+ y,
1375
1389
  T
1376
1390
  ),
1377
1391
  today: H,
1378
1392
  minuteHeight: o,
1379
1393
  startHour: M,
1380
1394
  endHour: I,
1381
- step: v,
1382
- direction: g,
1383
- timeZone: p,
1395
+ step: _,
1396
+ direction: p,
1397
+ timeZone: y,
1384
1398
  currentTime: k,
1385
1399
  showCurrentTimeBar: C,
1386
1400
  currentTimeBarColor: D
@@ -1411,18 +1425,18 @@ const cr = (e) => {
1411
1425
  getRemoteEvents: i,
1412
1426
  triggerLoading: s,
1413
1427
  handleState: a,
1414
- resources: c,
1415
- resourceFields: f,
1428
+ resources: d,
1429
+ resourceFields: g,
1416
1430
  fields: u,
1417
1431
  agenda: h,
1418
- _refetchToken: _
1419
- } = O(), { weekStartOn: g, weekDays: w, startHour: d, endHour: p, step: y } = e, l = Re(t, { weekStartsOn: g }), m = w.map((x) => Q(l, x)), k = X(m[0]), C = q(m[m.length - 1]), D = xe(t, { hours: d, minutes: 0, seconds: 0 }), T = xe(t, { hours: p, minutes: -y, seconds: 0 }), M = bt(
1432
+ _refetchToken: v
1433
+ } = O(), { weekStartOn: p, weekDays: w, startHour: l, endHour: y, step: m } = e, c = Re(t, { weekStartsOn: p }), f = w.map((x) => Q(c, x)), k = X(f[0]), C = q(f[f.length - 1]), D = xe(t, { hours: l, minutes: 0, seconds: 0 }), T = xe(t, { hours: y, minutes: -m, seconds: 0 }), M = bt(
1420
1434
  {
1421
1435
  start: D,
1422
1436
  end: T
1423
1437
  },
1424
- { step: y }
1425
- ), I = It(n, M.length), v = Mt(I, y), b = Z(async () => {
1438
+ { step: m }
1439
+ ), I = It(n, M.length), _ = Mt(I, m), b = Z(async () => {
1426
1440
  try {
1427
1441
  s(!0);
1428
1442
  const x = await i({
@@ -1436,25 +1450,25 @@ const cr = (e) => {
1436
1450
  } finally {
1437
1451
  s(!1);
1438
1452
  }
1439
- }, [i, _, t]);
1453
+ }, [i, v, t]);
1440
1454
  K(() => {
1441
1455
  i instanceof Function && b();
1442
- }, [b, i, _]);
1456
+ }, [b, i, v]);
1443
1457
  const S = (x) => {
1444
1458
  let W = o;
1445
- return x && (W = Te(o, x, f, u)), h ? /* @__PURE__ */ r(sr, { daysList: m, resource: x, events: W }) : /* @__PURE__ */ r(
1459
+ return x && (W = Te(o, x, g, u)), h ? /* @__PURE__ */ r(sr, { daysList: f, resource: x, events: W }) : /* @__PURE__ */ r(
1446
1460
  hr,
1447
1461
  {
1448
1462
  resourcedEvents: W,
1449
1463
  resource: x,
1450
1464
  hours: M,
1451
1465
  cellHeight: I,
1452
- minutesHeight: v,
1453
- daysList: m
1466
+ minutesHeight: _,
1467
+ daysList: f
1454
1468
  }
1455
1469
  );
1456
1470
  };
1457
- return c.length ? /* @__PURE__ */ r(Qe, { renderChildren: S }) : S();
1471
+ return d.length ? /* @__PURE__ */ r(Qe, { renderChildren: S }) : S();
1458
1472
  }, Pe = ({ children: e }) => {
1459
1473
  const { locale: t } = O();
1460
1474
  return /* @__PURE__ */ r(Nn, { dateAdapter: On, adapterLocale: t, children: e });
@@ -1474,33 +1488,33 @@ const cr = (e) => {
1474
1488
  }
1475
1489
  );
1476
1490
  }, tt = () => {
1477
- const { selectedDate: e, week: t, navigationPickerProps: n, view: o } = O(), i = n == null ? void 0 : n.minDate, s = n == null ? void 0 : n.maxDate, a = o === "month" ? wt(e) : o === "week" ? Dt(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, c = o === "month" ? qe(e) : o === "week" ? Re(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, f = i ? c <= i : !1, u = s ? a >= s : !1;
1478
- return { prevDisabled: f, nextDisabled: u };
1491
+ const { selectedDate: e, week: t, navigationPickerProps: n, view: o } = O(), i = n == null ? void 0 : n.minDate, s = n == null ? void 0 : n.maxDate, a = o === "month" ? wt(e) : o === "week" ? Dt(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, d = o === "month" ? qe(e) : o === "week" ? Re(e, { weekStartsOn: t == null ? void 0 : t.weekStartOn }) : e, g = i ? d <= i : !1, u = s ? a >= s : !1;
1492
+ return { prevDisabled: g, nextDisabled: u };
1479
1493
  }, gr = ({ selectedDate: e, onChange: t, weekProps: n }) => {
1480
- const { locale: o, navigationPickerProps: i } = O(), [s, a] = L(null), { weekStartOn: c } = n, f = Re(e, { weekStartsOn: c }), u = Dt(e, { weekStartsOn: c }), { prevDisabled: h, nextDisabled: _ } = tt(), g = (l) => {
1481
- a(l.currentTarget);
1494
+ const { locale: o, navigationPickerProps: i } = O(), [s, a] = L(null), { weekStartOn: d } = n, g = Re(e, { weekStartsOn: d }), u = Dt(e, { weekStartsOn: d }), { prevDisabled: h, nextDisabled: v } = tt(), p = (c) => {
1495
+ a(c.currentTarget);
1482
1496
  }, w = () => {
1483
1497
  a(null);
1484
- }, d = (l) => {
1485
- t(l || /* @__PURE__ */ new Date()), w();
1486
- }, p = () => {
1487
- const l = Q(f, -1);
1488
- t(l);
1498
+ }, l = (c) => {
1499
+ t(c || /* @__PURE__ */ new Date()), w();
1489
1500
  }, y = () => {
1490
- const l = Q(u, 1);
1491
- t(l);
1501
+ const c = Q(g, -1);
1502
+ t(c);
1503
+ }, m = () => {
1504
+ const c = Q(u, 1);
1505
+ t(c);
1492
1506
  };
1493
1507
  return /* @__PURE__ */ E(Y, { children: [
1494
1508
  /* @__PURE__ */ r(
1495
1509
  we,
1496
1510
  {
1497
1511
  type: "prev",
1498
- onClick: p,
1512
+ onClick: y,
1499
1513
  disabled: h,
1500
1514
  "aria-label": "previous week"
1501
1515
  }
1502
1516
  ),
1503
- /* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: g, "aria-label": "selected week", children: `${N(f, "dd", { locale: o })} - ${N(u, "dd MMM yyyy", {
1517
+ /* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: p, "aria-label": "selected week", children: `${N(g, "dd", { locale: o })} - ${N(u, "dd MMM yyyy", {
1504
1518
  locale: o
1505
1519
  })}` }),
1506
1520
  /* @__PURE__ */ r(
@@ -1520,7 +1534,7 @@ const cr = (e) => {
1520
1534
  openTo: "day",
1521
1535
  views: ["month", "day"],
1522
1536
  value: e,
1523
- onChange: d
1537
+ onChange: l
1524
1538
  }
1525
1539
  ) })
1526
1540
  }
@@ -1529,23 +1543,23 @@ const cr = (e) => {
1529
1543
  we,
1530
1544
  {
1531
1545
  type: "next",
1532
- onClick: y,
1533
- disabled: _,
1546
+ onClick: m,
1547
+ disabled: v,
1534
1548
  "aria-label": "next week"
1535
1549
  }
1536
1550
  )
1537
1551
  ] });
1538
1552
  }, pr = ({ selectedDate: e, onChange: t }) => {
1539
- const { locale: n, navigationPickerProps: o } = O(), [i, s] = L(null), { prevDisabled: a, nextDisabled: c } = tt(), f = (w) => {
1553
+ const { locale: n, navigationPickerProps: o } = O(), [i, s] = L(null), { prevDisabled: a, nextDisabled: d } = tt(), g = (w) => {
1540
1554
  s(w.currentTarget);
1541
1555
  }, u = () => {
1542
1556
  s(null);
1543
1557
  }, h = (w) => {
1544
1558
  t(w || /* @__PURE__ */ new Date()), u();
1545
- }, _ = () => {
1559
+ }, v = () => {
1546
1560
  const w = Q(e, -1);
1547
1561
  t(w);
1548
- }, g = () => {
1562
+ }, p = () => {
1549
1563
  const w = Q(e, 1);
1550
1564
  t(w);
1551
1565
  };
@@ -1554,12 +1568,12 @@ const cr = (e) => {
1554
1568
  we,
1555
1569
  {
1556
1570
  type: "prev",
1557
- onClick: _,
1571
+ onClick: v,
1558
1572
  disabled: a,
1559
1573
  "aria-label": "previous day"
1560
1574
  }
1561
1575
  ),
1562
- /* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: f, "aria-label": "selected date", children: N(e, "dd MMMM yyyy", { locale: n }) }),
1576
+ /* @__PURE__ */ r(J, { style: { padding: 4 }, onClick: g, "aria-label": "selected date", children: N(e, "dd MMMM yyyy", { locale: n }) }),
1563
1577
  /* @__PURE__ */ r(
1564
1578
  ke,
1565
1579
  {
@@ -1582,29 +1596,29 @@ const cr = (e) => {
1582
1596
  ) })
1583
1597
  }
1584
1598
  ),
1585
- /* @__PURE__ */ r(we, { type: "next", onClick: g, disabled: c, "aria-label": "next day" })
1599
+ /* @__PURE__ */ r(we, { type: "next", onClick: p, disabled: d, "aria-label": "next day" })
1586
1600
  ] });
1587
1601
  }, yr = ({ selectedDate: e, onChange: t }) => {
1588
- const { locale: n, navigationPickerProps: o } = O(), i = Qt(e), [s, a] = L(null), { prevDisabled: c, nextDisabled: f } = tt(), u = (d) => {
1589
- a(d.currentTarget);
1602
+ const { locale: n, navigationPickerProps: o } = O(), i = Qt(e), [s, a] = L(null), { prevDisabled: d, nextDisabled: g } = tt(), u = (l) => {
1603
+ a(l.currentTarget);
1590
1604
  }, h = () => {
1591
1605
  a(null);
1592
- }, _ = (d) => {
1593
- t(d || /* @__PURE__ */ new Date()), h();
1594
- }, g = () => {
1595
- const d = i - 1;
1596
- t(ot(e, d));
1606
+ }, v = (l) => {
1607
+ t(l || /* @__PURE__ */ new Date()), h();
1608
+ }, p = () => {
1609
+ const l = i - 1;
1610
+ t(ot(e, l));
1597
1611
  }, w = () => {
1598
- const d = i + 1;
1599
- t(ot(e, d));
1612
+ const l = i + 1;
1613
+ t(ot(e, l));
1600
1614
  };
1601
1615
  return /* @__PURE__ */ E(Y, { children: [
1602
1616
  /* @__PURE__ */ r(
1603
1617
  we,
1604
1618
  {
1605
1619
  type: "prev",
1606
- onClick: g,
1607
- disabled: c,
1620
+ onClick: p,
1621
+ disabled: d,
1608
1622
  "aria-label": "previous month"
1609
1623
  }
1610
1624
  ),
@@ -1626,7 +1640,7 @@ const cr = (e) => {
1626
1640
  openTo: "month",
1627
1641
  views: ["year", "month"],
1628
1642
  value: e,
1629
- onChange: _
1643
+ onChange: v
1630
1644
  }
1631
1645
  ) })
1632
1646
  }
@@ -1636,7 +1650,7 @@ const cr = (e) => {
1636
1650
  {
1637
1651
  type: "next",
1638
1652
  onClick: w,
1639
- disabled: f,
1653
+ disabled: g,
1640
1654
  "aria-label": "next month"
1641
1655
  }
1642
1656
  )
@@ -1650,46 +1664,46 @@ const cr = (e) => {
1650
1664
  getViews: i,
1651
1665
  translations: s,
1652
1666
  navigation: a,
1653
- day: c,
1654
- month: f,
1667
+ day: d,
1668
+ month: g,
1655
1669
  disableViewNavigator: u,
1656
1670
  onSelectedDateChange: h,
1657
- onViewChange: _,
1658
- stickyNavigation: g,
1671
+ onViewChange: v,
1672
+ stickyNavigation: p,
1659
1673
  timeZone: w,
1660
- agenda: d,
1661
- toggleAgenda: p,
1662
- enableAgenda: y,
1663
- customHeaderContent: l,
1664
- stickyNavigationOffset: m
1674
+ agenda: l,
1675
+ toggleAgenda: y,
1676
+ enableAgenda: m,
1677
+ customHeaderContent: c,
1678
+ stickyNavigationOffset: f
1665
1679
  } = O(), [k, C] = L(null), D = ee(), T = Et(D.breakpoints.up("sm")), M = i(), I = (x) => {
1666
1680
  C(x || null);
1667
- }, v = (x) => {
1681
+ }, _ = (x) => {
1668
1682
  o(x, "selectedDate"), h && typeof h == "function" && h(x);
1669
1683
  }, b = (x) => {
1670
- o(x, "view"), _ && typeof _ == "function" && _(x, d);
1684
+ o(x, "view"), v && typeof v == "function" && v(x, l);
1671
1685
  }, S = () => {
1672
1686
  switch (t) {
1673
1687
  case "month":
1674
- return (f == null ? void 0 : f.navigation) && /* @__PURE__ */ r(yr, { selectedDate: e, onChange: v });
1688
+ return (g == null ? void 0 : g.navigation) && /* @__PURE__ */ r(yr, { selectedDate: e, onChange: _ });
1675
1689
  case "week":
1676
1690
  return (n == null ? void 0 : n.navigation) && /* @__PURE__ */ r(
1677
1691
  gr,
1678
1692
  {
1679
1693
  selectedDate: e,
1680
- onChange: v,
1694
+ onChange: _,
1681
1695
  weekProps: n
1682
1696
  }
1683
1697
  );
1684
1698
  case "day":
1685
- return (c == null ? void 0 : c.navigation) && /* @__PURE__ */ r(pr, { selectedDate: e, onChange: v });
1699
+ return (d == null ? void 0 : d.navigation) && /* @__PURE__ */ r(pr, { selectedDate: e, onChange: _ });
1686
1700
  default:
1687
1701
  return "";
1688
1702
  }
1689
1703
  };
1690
- return !a && u ? null : /* @__PURE__ */ E(nr, { sticky: g ? "1" : "0", offset: m, children: [
1704
+ return !a && u ? null : /* @__PURE__ */ E(nr, { sticky: p ? "1" : "0", offset: f, children: [
1691
1705
  /* @__PURE__ */ r("div", { "data-testid": "date-navigator", children: a && S() }),
1692
- l && /* @__PURE__ */ r("div", { className: "rs__custom_header_content", children: l() }),
1706
+ c && /* @__PURE__ */ r("div", { className: "rs__custom_header_content", children: c() }),
1693
1707
  /* @__PURE__ */ E(
1694
1708
  "div",
1695
1709
  {
@@ -1702,25 +1716,25 @@ const cr = (e) => {
1702
1716
  /* @__PURE__ */ r(
1703
1717
  J,
1704
1718
  {
1705
- onClick: () => v(ue(/* @__PURE__ */ new Date(), w)),
1719
+ onClick: () => _(ue(/* @__PURE__ */ new Date(), w)),
1706
1720
  "aria-label": s.navigation.today,
1707
1721
  children: s.navigation.today
1708
1722
  }
1709
1723
  ),
1710
- y && (T ? /* @__PURE__ */ r(
1724
+ m && (T ? /* @__PURE__ */ r(
1711
1725
  J,
1712
1726
  {
1713
- color: d ? "primary" : "inherit",
1714
- onClick: p,
1727
+ color: l ? "primary" : "inherit",
1728
+ onClick: y,
1715
1729
  "aria-label": s.navigation.agenda,
1716
1730
  children: s.navigation.agenda
1717
1731
  }
1718
1732
  ) : /* @__PURE__ */ r(
1719
1733
  ve,
1720
1734
  {
1721
- color: d ? "primary" : "default",
1735
+ color: l ? "primary" : "default",
1722
1736
  style: { padding: 5 },
1723
- onClick: p,
1737
+ onClick: y,
1724
1738
  children: /* @__PURE__ */ r($n, {})
1725
1739
  }
1726
1740
  )),
@@ -1788,40 +1802,40 @@ const cr = (e) => {
1788
1802
  onChange: i,
1789
1803
  variant: s = "outlined",
1790
1804
  error: a,
1791
- errMsg: c,
1792
- touched: f,
1805
+ errMsg: d,
1806
+ touched: g,
1793
1807
  required: u
1794
1808
  }) => {
1795
- var y, l;
1796
- const { translations: h } = O(), [_, g] = L({
1809
+ var m, c;
1810
+ const { translations: h } = O(), [v, p] = L({
1797
1811
  touched: !1,
1798
1812
  valid: !!t,
1799
- errorMsg: c || (u ? ((y = h == null ? void 0 : h.validation) == null ? void 0 : y.required) || "Required" : void 0)
1800
- }), w = e === "date" ? Rn : An, d = _.touched && (a || !_.valid), p = Z(
1801
- (m) => {
1813
+ errorMsg: d || (u ? ((m = h == null ? void 0 : h.validation) == null ? void 0 : m.required) || "Required" : void 0)
1814
+ }), w = e === "date" ? Rn : An, l = v.touched && (a || !v.valid), y = Z(
1815
+ (f) => {
1802
1816
  var M;
1803
- const k = !isNaN(Date.parse(m)), C = typeof m == "string" && k ? new Date(m) : m;
1804
- let D = !0, T = c;
1805
- u && !C && (D = !1, T = c || ((M = h == null ? void 0 : h.validation) == null ? void 0 : M.required) || "Required"), g((I) => ({ ...I, touched: !0, valid: D, errorMsg: T })), i(o, C);
1817
+ const k = !isNaN(Date.parse(f)), C = typeof f == "string" && k ? new Date(f) : f;
1818
+ let D = !0, T = d;
1819
+ u && !C && (D = !1, T = d || ((M = h == null ? void 0 : h.validation) == null ? void 0 : M.required) || "Required"), p((I) => ({ ...I, touched: !0, valid: D, errorMsg: T })), i(o, C);
1806
1820
  },
1807
- [c, o, i, u, (l = h == null ? void 0 : h.validation) == null ? void 0 : l.required]
1821
+ [d, o, i, u, (c = h == null ? void 0 : h.validation) == null ? void 0 : c.required]
1808
1822
  );
1809
1823
  return K(() => {
1810
- f && p(t);
1811
- }, [p, f, t]), /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
1824
+ g && y(t);
1825
+ }, [y, g, t]), /* @__PURE__ */ r(Pe, { children: /* @__PURE__ */ r(
1812
1826
  w,
1813
1827
  {
1814
1828
  value: t instanceof Date ? t : new Date(t),
1815
1829
  label: n,
1816
- onChange: (m) => {
1817
- p(m);
1830
+ onChange: (f) => {
1831
+ y(f);
1818
1832
  },
1819
1833
  minutesStep: 5,
1820
1834
  slotProps: {
1821
1835
  textField: {
1822
1836
  variant: s,
1823
- helperText: d && _.errorMsg,
1824
- error: d,
1837
+ helperText: l && v.errorMsg,
1838
+ error: l,
1825
1839
  fullWidth: !0
1826
1840
  }
1827
1841
  }
@@ -1835,42 +1849,42 @@ const cr = (e) => {
1835
1849
  name: i,
1836
1850
  required: s,
1837
1851
  min: a,
1838
- max: c,
1839
- email: f,
1852
+ max: d,
1853
+ email: g,
1840
1854
  decimal: u,
1841
1855
  onChange: h,
1842
- disabled: _,
1843
- multiline: g,
1856
+ disabled: v,
1857
+ multiline: p,
1844
1858
  rows: w,
1845
- touched: d
1859
+ touched: l
1846
1860
  }) => {
1847
- const [p, y] = L({
1861
+ const [y, m] = L({
1848
1862
  touched: !1,
1849
1863
  valid: !1,
1850
1864
  errorMsg: ""
1851
- }), { translations: l } = O(), m = Z(
1865
+ }), { translations: c } = O(), f = Z(
1852
1866
  (k) => {
1853
- var M, I, v, b, S, x, W, R, V;
1867
+ var M, I, _, b, S, x, W, R, V;
1854
1868
  const C = k;
1855
1869
  let D = !0, T = "";
1856
- f && (D = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(C) && D, T = ((M = l == null ? void 0 : l.validation) == null ? void 0 : M.invalidEmail) || "Invalid Email"), u && (D = /^[0-9]+(\.[0-9]*)?$/.test(C) && D, T = ((I = l == null ? void 0 : l.validation) == null ? void 0 : I.onlyNumbers) || "Only Numbers Allowed"), a && `${C}`.trim().length < a && (D = !1, T = typeof ((v = l == null ? void 0 : l.validation) == null ? void 0 : v.min) == "function" ? (b = l == null ? void 0 : l.validation) == null ? void 0 : b.min(a) : ((S = l == null ? void 0 : l.validation) == null ? void 0 : S.min) || `Minimum ${a} letters`), c && `${C}`.trim().length > c && (D = !1, T = typeof ((x = l == null ? void 0 : l.validation) == null ? void 0 : x.max) == "function" ? (W = l == null ? void 0 : l.validation) == null ? void 0 : W.max(c) : ((R = l == null ? void 0 : l.validation) == null ? void 0 : R.max) || `Maximum ${c} letters`), s && `${C}`.trim().length <= 0 && (D = !1, T = ((V = l == null ? void 0 : l.validation) == null ? void 0 : V.required) || "Required"), y({ touched: !0, valid: D, errorMsg: T }), h(i, C, D);
1870
+ g && (D = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(C) && D, T = ((M = c == null ? void 0 : c.validation) == null ? void 0 : M.invalidEmail) || "Invalid Email"), u && (D = /^[0-9]+(\.[0-9]*)?$/.test(C) && D, T = ((I = c == null ? void 0 : c.validation) == null ? void 0 : I.onlyNumbers) || "Only Numbers Allowed"), a && `${C}`.trim().length < a && (D = !1, T = typeof ((_ = c == null ? void 0 : c.validation) == null ? void 0 : _.min) == "function" ? (b = c == null ? void 0 : c.validation) == null ? void 0 : b.min(a) : ((S = c == null ? void 0 : c.validation) == null ? void 0 : S.min) || `Minimum ${a} letters`), d && `${C}`.trim().length > d && (D = !1, T = typeof ((x = c == null ? void 0 : c.validation) == null ? void 0 : x.max) == "function" ? (W = c == null ? void 0 : c.validation) == null ? void 0 : W.max(d) : ((R = c == null ? void 0 : c.validation) == null ? void 0 : R.max) || `Maximum ${d} letters`), s && `${C}`.trim().length <= 0 && (D = !1, T = ((V = c == null ? void 0 : c.validation) == null ? void 0 : V.required) || "Required"), m({ touched: !0, valid: D, errorMsg: T }), h(i, C, D);
1857
1871
  },
1858
- [u, f, c, a, i, h, s, l == null ? void 0 : l.validation]
1872
+ [u, g, d, a, i, h, s, c == null ? void 0 : c.validation]
1859
1873
  );
1860
1874
  return K(() => {
1861
- d && m(o);
1862
- }, [m, d, o]), /* @__PURE__ */ r(
1875
+ l && f(o);
1876
+ }, [f, l, o]), /* @__PURE__ */ r(
1863
1877
  fn,
1864
1878
  {
1865
1879
  variant: e,
1866
1880
  label: t && /* @__PURE__ */ r($, { variant: "body2", children: `${t} ${s ? "*" : ""}` }),
1867
1881
  value: o,
1868
1882
  name: i,
1869
- onChange: (k) => m(k.target.value),
1870
- disabled: _,
1871
- error: p.touched && !p.valid,
1872
- helperText: p.touched && !p.valid && p.errorMsg,
1873
- multiline: g,
1883
+ onChange: (k) => f(k.target.value),
1884
+ disabled: v,
1885
+ error: y.touched && !y.valid,
1886
+ helperText: y.touched && !y.valid && y.errorMsg,
1887
+ multiline: p,
1874
1888
  rows: w,
1875
1889
  style: { width: "100%" },
1876
1890
  InputProps: {
@@ -1886,38 +1900,38 @@ const cr = (e) => {
1886
1900
  onChange: i,
1887
1901
  label: s,
1888
1902
  disabled: a,
1889
- touched: c,
1890
- variant: f = "outlined",
1903
+ touched: d,
1904
+ variant: g = "outlined",
1891
1905
  loading: u,
1892
1906
  multiple: h,
1893
- placeholder: _,
1894
- errMsg: g
1907
+ placeholder: v,
1908
+ errMsg: p
1895
1909
  }) => {
1896
1910
  var k, C;
1897
- const w = ee(), { translations: d } = O(), [p, y] = L({
1911
+ const w = ee(), { translations: l } = O(), [y, m] = L({
1898
1912
  touched: !1,
1899
1913
  valid: !!t,
1900
- errorMsg: g || (o ? ((k = d == null ? void 0 : d.validation) == null ? void 0 : k.required) || "Required" : void 0)
1901
- }), l = Z(() => {
1902
- p.touched || y((D) => ({ ...D, touched: !0, errorMsg: g || D.errorMsg }));
1903
- }, [g, p.touched]), m = Z(
1914
+ errorMsg: p || (o ? ((k = l == null ? void 0 : l.validation) == null ? void 0 : k.required) || "Required" : void 0)
1915
+ }), c = Z(() => {
1916
+ y.touched || m((D) => ({ ...D, touched: !0, errorMsg: p || D.errorMsg }));
1917
+ }, [p, y.touched]), f = Z(
1904
1918
  (D) => {
1905
- var v;
1919
+ var _;
1906
1920
  const T = D;
1907
- let M = !0, I = g;
1908
- o && (h ? !T.length : !T) && (M = !1, I = g || ((v = d == null ? void 0 : d.validation) == null ? void 0 : v.required) || "Required"), y((b) => ({ ...b, touched: !0, valid: M, errorMsg: I })), i(n, T, M);
1921
+ let M = !0, I = p;
1922
+ o && (h ? !T.length : !T) && (M = !1, I = p || ((_ = l == null ? void 0 : l.validation) == null ? void 0 : _.required) || "Required"), m((b) => ({ ...b, touched: !0, valid: M, errorMsg: I })), i(n, T, M);
1909
1923
  },
1910
- [g, h, n, i, o, (C = d == null ? void 0 : d.validation) == null ? void 0 : C.required]
1924
+ [p, h, n, i, o, (C = l == null ? void 0 : l.validation) == null ? void 0 : C.required]
1911
1925
  );
1912
1926
  return K(() => {
1913
- c && m(t);
1914
- }, [m, c, t]), /* @__PURE__ */ E(Y, { children: [
1927
+ d && f(t);
1928
+ }, [f, d, t]), /* @__PURE__ */ E(Y, { children: [
1915
1929
  /* @__PURE__ */ E(
1916
1930
  gn,
1917
1931
  {
1918
- variant: f || "outlined",
1932
+ variant: g || "outlined",
1919
1933
  fullWidth: !0,
1920
- error: o && p.touched && !p.valid,
1934
+ error: o && y.touched && !y.valid,
1921
1935
  disabled: a,
1922
1936
  children: [
1923
1937
  s && /* @__PURE__ */ r(pn, { id: `input_${n}`, children: /* @__PURE__ */ r($, { variant: "body2", children: `${s} ${o ? "*" : ""}` }) }),
@@ -1927,8 +1941,8 @@ const cr = (e) => {
1927
1941
  label: s,
1928
1942
  labelId: `input_${n}`,
1929
1943
  value: t,
1930
- onBlur: l,
1931
- onChange: (D) => m(D.target.value),
1944
+ onBlur: c,
1945
+ onChange: (D) => f(D.target.value),
1932
1946
  IconComponent: u ? () => /* @__PURE__ */ r(St, { size: 5 }) : Hn,
1933
1947
  multiple: !!h,
1934
1948
  classes: {
@@ -1949,7 +1963,7 @@ const cr = (e) => {
1949
1963
  }
1950
1964
  },
1951
1965
  children: [
1952
- _ && /* @__PURE__ */ r(Ve, { value: "", children: /* @__PURE__ */ r("em", { children: _ }) }),
1966
+ v && /* @__PURE__ */ r(Ve, { value: "", children: /* @__PURE__ */ r("em", { children: v }) }),
1953
1967
  e.map((D) => /* @__PURE__ */ E(Ve, { value: D.value, children: [
1954
1968
  h && /* @__PURE__ */ r(mn, { checked: t.indexOf(D.value) > -1, color: "primary" }),
1955
1969
  D.text
@@ -1960,7 +1974,7 @@ const cr = (e) => {
1960
1974
  ]
1961
1975
  }
1962
1976
  ),
1963
- /* @__PURE__ */ r(vn, { style: { color: w.palette.error.main }, children: p.touched && !p.valid && p.errorMsg })
1977
+ /* @__PURE__ */ r(vn, { style: { color: w.palette.error.main }, children: y.touched && !y.valid && y.errorMsg })
1964
1978
  ] });
1965
1979
  }, ft = (e, t) => {
1966
1980
  var o;
@@ -2015,48 +2029,48 @@ const cr = (e) => {
2015
2029
  selectedEvent: i,
2016
2030
  resourceFields: s,
2017
2031
  selectedResource: a,
2018
- triggerLoading: c,
2019
- onConfirm: f,
2032
+ triggerLoading: d,
2033
+ onConfirm: g,
2020
2034
  customEditor: u,
2021
2035
  confirmEvent: h,
2022
- dialogMaxWidth: _,
2023
- translations: g,
2036
+ dialogMaxWidth: v,
2037
+ translations: p,
2024
2038
  timeZone: w
2025
- } = O(), [d, p] = L(ft(e, i || o)), [y, l] = L(!1), m = ee(), k = Et(m.breakpoints.down("sm")), C = (v, b, S) => {
2026
- p((x) => ({
2039
+ } = O(), [l, y] = L(ft(e, i || o)), [m, c] = L(!1), f = ee(), k = Et(f.breakpoints.down("sm")), C = (_, b, S) => {
2040
+ y((x) => ({
2027
2041
  ...x,
2028
- [v]: { ...x[v], value: b, validity: S }
2042
+ [_]: { ...x[_], value: b, validity: S }
2029
2043
  }));
2030
- }, D = (v) => {
2031
- v && p(ft(e)), n(!1);
2044
+ }, D = (_) => {
2045
+ _ && y(ft(e)), n(!1);
2032
2046
  }, T = async () => {
2033
- let v = {};
2034
- for (const b in d)
2035
- if (v[b] = d[b].value, !u && !d[b].validity)
2036
- return l(!0);
2047
+ let _ = {};
2048
+ for (const b in l)
2049
+ if (_[b] = l[b].value, !u && !l[b].validity)
2050
+ return c(!0);
2037
2051
  try {
2038
- c(!0), v.end = v.start >= v.end ? de(v.start, $e(o == null ? void 0 : o.end, o == null ? void 0 : o.start)) : v.end;
2052
+ d(!0), _.end = _.start >= _.end ? de(_.start, $e(o == null ? void 0 : o.end, o == null ? void 0 : o.start)) : _.end;
2039
2053
  const b = i != null && i.event_id ? "edit" : "create";
2040
- f ? v = await f(v, b) : v.event_id = (i == null ? void 0 : i.event_id) || Date.now().toString(36) + Math.random().toString(36).slice(2), v.start = je(v.start, w), v.end = je(v.end, w), h(v, b), D(!0);
2054
+ g ? _ = await g(_, b) : _.event_id = (i == null ? void 0 : i.event_id) || Date.now().toString(36) + Math.random().toString(36).slice(2), _.start = je(_.start, w), _.end = je(_.end, w), h(_, b), D(!0);
2041
2055
  } catch (b) {
2042
2056
  console.error(b);
2043
2057
  } finally {
2044
- c(!1);
2058
+ d(!1);
2045
2059
  }
2046
- }, M = (v) => {
2060
+ }, M = (_) => {
2047
2061
  var S, x, W;
2048
- const b = d[v];
2062
+ const b = l[_];
2049
2063
  switch (b.type) {
2050
2064
  case "input":
2051
2065
  return /* @__PURE__ */ r(
2052
2066
  vr,
2053
2067
  {
2054
2068
  value: b.value,
2055
- name: v,
2069
+ name: _,
2056
2070
  onChange: C,
2057
- touched: y,
2071
+ touched: m,
2058
2072
  ...b.config,
2059
- label: g.event[v] || ((S = b.config) == null ? void 0 : S.label)
2073
+ label: p.event[_] || ((S = b.config) == null ? void 0 : S.label)
2060
2074
  }
2061
2075
  );
2062
2076
  case "date":
@@ -2064,25 +2078,25 @@ const cr = (e) => {
2064
2078
  _r,
2065
2079
  {
2066
2080
  value: b.value,
2067
- name: v,
2081
+ name: _,
2068
2082
  onChange: (...V) => C(...V, !0),
2069
- touched: y,
2083
+ touched: m,
2070
2084
  ...b.config,
2071
- label: g.event[v] || ((x = b.config) == null ? void 0 : x.label)
2085
+ label: p.event[_] || ((x = b.config) == null ? void 0 : x.label)
2072
2086
  }
2073
2087
  );
2074
2088
  case "select":
2075
- const R = e.find((V) => V.name === v);
2089
+ const R = e.find((V) => V.name === _);
2076
2090
  return /* @__PURE__ */ r(
2077
2091
  br,
2078
2092
  {
2079
2093
  value: b.value,
2080
- name: v,
2094
+ name: _,
2081
2095
  options: (R == null ? void 0 : R.options) || [],
2082
2096
  onChange: C,
2083
- touched: y,
2097
+ touched: m,
2084
2098
  ...b.config,
2085
- label: g.event[v] || ((W = b.config) == null ? void 0 : W.label)
2099
+ label: p.event[_] || ((W = b.config) == null ? void 0 : W.label)
2086
2100
  }
2087
2101
  );
2088
2102
  default:
@@ -2094,32 +2108,32 @@ const cr = (e) => {
2094
2108
  {
2095
2109
  open: t,
2096
2110
  fullScreen: k,
2097
- maxWidth: _,
2111
+ maxWidth: v,
2098
2112
  onClose: () => {
2099
2113
  n(!1);
2100
2114
  },
2101
2115
  children: (() => {
2102
2116
  if (u) {
2103
- const v = {
2104
- state: d,
2117
+ const _ = {
2118
+ state: l,
2105
2119
  close: () => n(!1),
2106
- loading: (b) => c(b),
2120
+ loading: (b) => d(b),
2107
2121
  edited: i,
2108
2122
  onConfirm: h,
2109
2123
  [s.idField]: a
2110
2124
  };
2111
- return u(v);
2125
+ return u(_);
2112
2126
  }
2113
2127
  return /* @__PURE__ */ E(ie, { children: [
2114
- /* @__PURE__ */ r(wn, { children: i ? g.form.editTitle : g.form.addTitle }),
2115
- /* @__PURE__ */ r(Dn, { style: { overflowX: "hidden" }, children: /* @__PURE__ */ r(st, { container: !0, spacing: 2, children: Object.keys(d).map((v) => {
2128
+ /* @__PURE__ */ r(wn, { children: i ? p.form.editTitle : p.form.addTitle }),
2129
+ /* @__PURE__ */ r(Dn, { style: { overflowX: "hidden" }, children: /* @__PURE__ */ r(st, { container: !0, spacing: 2, children: Object.keys(l).map((_) => {
2116
2130
  var S;
2117
- const b = d[v];
2118
- return /* @__PURE__ */ r(st, { size: { sm: (S = b.config) == null ? void 0 : S.sm, xs: 12 }, children: M(v) }, v);
2131
+ const b = l[_];
2132
+ return /* @__PURE__ */ r(st, { size: { sm: (S = b.config) == null ? void 0 : S.sm, xs: 12 }, children: M(_) }, _);
2119
2133
  }) }) }),
2120
2134
  /* @__PURE__ */ E(xn, { children: [
2121
- /* @__PURE__ */ r(J, { color: "inherit", fullWidth: !0, onClick: () => D(), children: g.form.cancel }),
2122
- /* @__PURE__ */ r(J, { color: "primary", fullWidth: !0, onClick: T, children: g.form.confirm })
2135
+ /* @__PURE__ */ r(J, { color: "inherit", fullWidth: !0, onClick: () => D(), children: p.form.cancel }),
2136
+ /* @__PURE__ */ r(J, { color: "primary", fullWidth: !0, onClick: T, children: p.form.confirm })
2123
2137
  ] })
2124
2138
  ] });
2125
2139
  })()
@@ -2132,29 +2146,29 @@ const cr = (e) => {
2132
2146
  locale: i,
2133
2147
  timeZone: s,
2134
2148
  selectedDate: a,
2135
- translations: c,
2136
- alwaysShowAgendaDays: f,
2149
+ translations: d,
2150
+ alwaysShowAgendaDays: g,
2137
2151
  stickyNavigationOffset: u,
2138
2152
  stickyNavigationHeight: h
2139
- } = O(), { disableGoToDay: _, headRenderer: g } = n, w = Jt(a), d = Array.from({ length: w }, (y, l) => l + 1), p = U(() => e.filter((y) => xt(y.start, a)), [e, a]);
2140
- return !f && !p.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: d.map((y) => {
2141
- const l = new Date(a.getFullYear(), a.getMonth(), y), m = he({ dateLeft: l, timeZone: s }), k = Ne(e, l);
2142
- return !f && !k.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(l) ? "rs__today_cell" : ""}`, children: [
2143
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof g == "function" ? /* @__PURE__ */ r("div", { children: g({ day: l, events: e, resource: t }) }) : /* @__PURE__ */ r(
2153
+ } = O(), { disableGoToDay: v, headRenderer: p } = n, w = Jt(a), l = Array.from({ length: w }, (m, c) => c + 1), y = U(() => e.filter((m) => xt(m.start, a)), [e, a]);
2154
+ return !g && !y.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: u, stickyHeight: h, children: l.map((m) => {
2155
+ const c = new Date(a.getFullYear(), a.getMonth(), m), f = he({ dateLeft: c, timeZone: s }), k = Ne(e, c);
2156
+ return !g && !k.length ? null : /* @__PURE__ */ E("div", { className: `rs__agenda_row ${_e(c) ? "rs__today_cell" : ""}`, children: [
2157
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof p == "function" ? /* @__PURE__ */ r("div", { children: p({ day: c, events: e, resource: t }) }) : /* @__PURE__ */ r(
2144
2158
  $,
2145
2159
  {
2146
- sx: { fontWeight: m ? "bold" : "inherit" },
2147
- color: m ? "primary" : "inherit",
2160
+ sx: { fontWeight: f ? "bold" : "inherit" },
2161
+ color: f ? "primary" : "inherit",
2148
2162
  variant: "body2",
2149
- className: _ ? "" : "rs__hover__op",
2163
+ className: v ? "" : "rs__hover__op",
2150
2164
  onClick: (C) => {
2151
- C.stopPropagation(), _ || o(l);
2165
+ C.stopPropagation(), v || o(c);
2152
2166
  },
2153
- children: N(l, "dd E", { locale: i })
2167
+ children: N(c, "dd E", { locale: i })
2154
2168
  }
2155
2169
  ) }),
2156
- /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: k.length > 0 ? /* @__PURE__ */ r(Je, { day: l, events: k }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: c.noDataToDisplay }) })
2157
- ] }, y);
2170
+ /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: k.length > 0 ? /* @__PURE__ */ r(Je, { day: c, events: k }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: d.noDataToDisplay }) })
2171
+ ] }, m);
2158
2172
  }) });
2159
2173
  }, xr = ({
2160
2174
  events: e,
@@ -2164,28 +2178,28 @@ const cr = (e) => {
2164
2178
  eachFirstDayInCalcRow: i,
2165
2179
  daysList: s,
2166
2180
  onViewMore: a,
2167
- cellHeight: c
2181
+ cellHeight: d
2168
2182
  }) => {
2169
- const f = Math.round((c - ht) / pe - 1), { translations: u, month: h, locale: _, timeZone: g } = O(), { renderedSlots: w } = Lt(), d = U(() => {
2170
- var y;
2171
- const p = [];
2172
- for (let l = 0; l < Math.min(e.length, f + 1); l++) {
2173
- const m = Fe(e[l], g), k = !!i && me(m.start, i), C = k && i ? i : m.start;
2174
- let D = se(C, m.end) + 1;
2175
- const T = Kt(m.end, C, {
2183
+ const g = Math.round((d - ht) / pe - 1), { translations: u, month: h, locale: v, timeZone: p } = O(), { renderedSlots: w } = Lt(), l = U(() => {
2184
+ var m;
2185
+ const y = [];
2186
+ for (let c = 0; c < Math.min(e.length, g + 1); c++) {
2187
+ const f = Fe(e[c], p), k = !!i && me(f.start, i), C = k && i ? i : f.start;
2188
+ let D = se(C, f.end) + 1;
2189
+ const T = Kt(f.end, C, {
2176
2190
  weekStartsOn: h == null ? void 0 : h.weekStartOn,
2177
- locale: _
2191
+ locale: v
2178
2192
  }) > 0;
2179
2193
  if (T) {
2180
- const S = Re(m.start, {
2194
+ const S = Re(f.start, {
2181
2195
  weekStartsOn: h == null ? void 0 : h.weekStartOn,
2182
- locale: _
2196
+ locale: v
2183
2197
  }), x = en(S, o);
2184
- x && (D = s.length - (i ? 0 : vt(m.start, x)));
2198
+ x && (D = s.length - (i ? 0 : vt(f.start, x)));
2185
2199
  }
2186
- const M = N(n, "yyyy-MM-dd"), I = (y = w == null ? void 0 : w[t || "all"]) == null ? void 0 : y[M], v = (I == null ? void 0 : I[m.event_id]) || 0, b = Math.min(v, f) * pe + ht;
2187
- if (v >= f) {
2188
- p.push(
2200
+ const M = N(n, "yyyy-MM-dd"), I = (m = w == null ? void 0 : w[t || "all"]) == null ? void 0 : m[M], _ = (I == null ? void 0 : I[f.event_id]) || 0, b = Math.min(_, g) * pe + ht;
2201
+ if (_ >= g) {
2202
+ y.push(
2189
2203
  /* @__PURE__ */ r(
2190
2204
  $,
2191
2205
  {
@@ -2195,14 +2209,14 @@ const cr = (e) => {
2195
2209
  onClick: (S) => {
2196
2210
  S.stopPropagation(), a(n);
2197
2211
  },
2198
- children: `${Math.abs(e.length - l)} ${u.moreEvents}`
2212
+ children: `${Math.abs(e.length - c)} ${u.moreEvents}`
2199
2213
  },
2200
- l
2214
+ c
2201
2215
  )
2202
2216
  );
2203
2217
  break;
2204
2218
  }
2205
- p.push(
2219
+ y.push(
2206
2220
  /* @__PURE__ */ r(
2207
2221
  "div",
2208
2222
  {
@@ -2215,59 +2229,59 @@ const cr = (e) => {
2215
2229
  children: /* @__PURE__ */ r(
2216
2230
  We,
2217
2231
  {
2218
- event: m,
2232
+ event: f,
2219
2233
  showdate: !1,
2220
- multiday: se(m.start, m.end) > 0,
2234
+ multiday: se(f.start, f.end) > 0,
2221
2235
  hasPrev: k,
2222
2236
  hasNext: T
2223
2237
  }
2224
2238
  )
2225
2239
  },
2226
- `${m.event_id}_${l}`
2240
+ `${f.event_id}_${c}`
2227
2241
  )
2228
2242
  );
2229
2243
  }
2230
- return p;
2244
+ return y;
2231
2245
  }, [
2232
2246
  t,
2233
2247
  w,
2234
2248
  e,
2235
- f,
2249
+ g,
2236
2250
  i,
2237
2251
  h == null ? void 0 : h.weekStartOn,
2238
- _,
2252
+ v,
2239
2253
  n,
2240
2254
  o,
2241
2255
  s.length,
2242
2256
  u.moreEvents,
2243
2257
  a,
2244
- g
2258
+ p
2245
2259
  ]);
2246
- return /* @__PURE__ */ r(ie, { children: d });
2260
+ return /* @__PURE__ */ r(ie, { children: l });
2247
2261
  }, kr = ({ daysList: e, resource: t, eachWeekStart: n }) => {
2248
2262
  const {
2249
2263
  height: o,
2250
2264
  month: i,
2251
2265
  selectedDate: s,
2252
2266
  events: a,
2253
- handleGotoDay: c,
2254
- resourceFields: f,
2267
+ handleGotoDay: d,
2268
+ resourceFields: g,
2255
2269
  fields: u,
2256
2270
  locale: h,
2257
- hourFormat: _,
2258
- stickyNavigation: g,
2271
+ hourFormat: v,
2272
+ stickyNavigation: p,
2259
2273
  timeZone: w,
2260
- onClickMore: d,
2261
- stickyNavigationOffset: p,
2262
- stickyNavigationHeight: y
2263
- } = O(), { weekDays: l, startHour: m, endHour: k, cellRenderer: C, headRenderer: D, disableGoToDay: T } = i, { headersRef: M, bodyRef: I } = Pt(), v = ee(), b = qe(s), S = De(_), x = o / n.length, W = Z(
2274
+ onClickMore: l,
2275
+ stickyNavigationOffset: y,
2276
+ stickyNavigationHeight: m
2277
+ } = O(), { weekDays: c, startHour: f, endHour: k, cellRenderer: C, headRenderer: D, disableGoToDay: T } = i, { headersRef: M, bodyRef: I } = Pt(), _ = ee(), b = qe(s), S = De(v), x = o / n.length, W = Z(
2264
2278
  (R) => {
2265
2279
  let V = Ae(a);
2266
- R && (V = Te(a, R, f, u));
2280
+ R && (V = Te(a, R, g, u));
2267
2281
  const te = [];
2268
2282
  for (const G of n) {
2269
- const ae = l.map((ne) => {
2270
- const P = Q(G, ne), fe = /* @__PURE__ */ new Date(`${N(it(P, m), `yyyy/MM/dd ${S}`)}`), ge = /* @__PURE__ */ new Date(`${N(it(P, k), `yyyy/MM/dd ${S}`)}`), F = f.idField, A = ye(G, P) ? P : null, H = V.flatMap((z) => Nt(z, P)).filter((z) => {
2283
+ const ae = c.map((ne) => {
2284
+ const P = Q(G, ne), fe = /* @__PURE__ */ new Date(`${N(it(P, f), `yyyy/MM/dd ${S}`)}`), ge = /* @__PURE__ */ new Date(`${N(it(P, k), `yyyy/MM/dd ${S}`)}`), F = g.idField, A = ye(G, P) ? P : null, H = V.flatMap((z) => Nt(z, P)).filter((z) => {
2271
2285
  if (ye(z.start, P)) return !0;
2272
2286
  const oe = { start: X(z.start), end: q(z.end) };
2273
2287
  return !!(A && j(A, oe));
@@ -2294,8 +2308,8 @@ const cr = (e) => {
2294
2308
  height: 27,
2295
2309
  position: "absolute",
2296
2310
  top: 0,
2297
- background: re ? v.palette.secondary.main : "transparent",
2298
- color: re ? v.palette.secondary.contrastText : "",
2311
+ background: re ? _.palette.secondary.main : "transparent",
2312
+ color: re ? _.palette.secondary.contrastText : "",
2299
2313
  marginBottom: 2
2300
2314
  },
2301
2315
  children: /* @__PURE__ */ r(
@@ -2304,7 +2318,7 @@ const cr = (e) => {
2304
2318
  color: xt(P, b) ? "textPrimary" : "#ccc",
2305
2319
  className: T ? "" : "rs__hover__op",
2306
2320
  onClick: (z) => {
2307
- z.stopPropagation(), T || c(P);
2321
+ z.stopPropagation(), T || d(P);
2308
2322
  },
2309
2323
  children: N(P, "dd")
2310
2324
  }
@@ -2321,7 +2335,7 @@ const cr = (e) => {
2321
2335
  eachFirstDayInCalcRow: A,
2322
2336
  daysList: e,
2323
2337
  onViewMore: (z) => {
2324
- d && typeof d == "function" ? d(z, c) : c(z);
2338
+ l && typeof l == "function" ? l(z, d) : d(z);
2325
2339
  },
2326
2340
  cellHeight: x
2327
2341
  }
@@ -2343,17 +2357,17 @@ const cr = (e) => {
2343
2357
  a,
2344
2358
  u,
2345
2359
  S,
2346
- c,
2360
+ d,
2347
2361
  D,
2348
2362
  b,
2349
- d,
2350
- f,
2363
+ l,
2364
+ g,
2351
2365
  s,
2352
- m,
2353
- v.palette.secondary.contrastText,
2354
- v.palette.secondary.main,
2366
+ f,
2367
+ _.palette.secondary.contrastText,
2368
+ _.palette.secondary.main,
2355
2369
  w,
2356
- l
2370
+ c
2357
2371
  ]
2358
2372
  );
2359
2373
  return /* @__PURE__ */ E(Y, { children: [
@@ -2364,9 +2378,9 @@ const cr = (e) => {
2364
2378
  ref: M,
2365
2379
  indent: "0",
2366
2380
  sticky: "1",
2367
- stickyNavigation: g,
2368
- stickyOffset: p,
2369
- stickyHeight: y,
2381
+ stickyNavigation: p,
2382
+ stickyOffset: y,
2383
+ stickyHeight: m,
2370
2384
  children: e.map((R, V) => /* @__PURE__ */ r(
2371
2385
  $,
2372
2386
  {
@@ -2390,44 +2404,44 @@ const cr = (e) => {
2390
2404
  triggerLoading: i,
2391
2405
  handleState: s,
2392
2406
  resources: a,
2393
- resourceFields: c,
2394
- fields: f,
2407
+ resourceFields: d,
2408
+ fields: g,
2395
2409
  agenda: u
2396
- } = O(), { weekStartOn: h, weekDays: _ } = e, g = qe(t), w = wt(t), d = tn(
2410
+ } = O(), { weekStartOn: h, weekDays: v } = e, p = qe(t), w = wt(t), l = tn(
2397
2411
  {
2398
- start: g,
2412
+ start: p,
2399
2413
  end: w
2400
2414
  },
2401
2415
  { weekStartsOn: h }
2402
- ), p = _.map((m) => Q(d[0], m)), y = Z(async () => {
2416
+ ), y = v.map((f) => Q(l[0], f)), m = Z(async () => {
2403
2417
  try {
2404
2418
  i(!0);
2405
- const m = d[0], k = Q(d[d.length - 1], p.length), C = await o({
2406
- start: m,
2419
+ const f = l[0], k = Q(l[l.length - 1], y.length), C = await o({
2420
+ start: f,
2407
2421
  end: k,
2408
2422
  view: "month"
2409
2423
  });
2410
2424
  C && (C != null && C.length) && s(C, "events");
2411
- } catch (m) {
2412
- throw m;
2425
+ } catch (f) {
2426
+ throw f;
2413
2427
  } finally {
2414
2428
  i(!1);
2415
2429
  }
2416
- }, [p.length, o]);
2430
+ }, [y.length, o]);
2417
2431
  K(() => {
2418
- o instanceof Function && y();
2419
- }, [y, o]);
2420
- const l = Z(
2421
- (m) => {
2432
+ o instanceof Function && m();
2433
+ }, [m, o]);
2434
+ const c = Z(
2435
+ (f) => {
2422
2436
  if (u) {
2423
2437
  let k = Ae(n);
2424
- return m && (k = Te(n, m, c, f)), /* @__PURE__ */ r(Dr, { resource: m, events: k });
2438
+ return f && (k = Te(n, f, d, g)), /* @__PURE__ */ r(Dr, { resource: f, events: k });
2425
2439
  }
2426
- return /* @__PURE__ */ r(kr, { daysList: p, eachWeekStart: d, resource: m });
2440
+ return /* @__PURE__ */ r(kr, { daysList: y, eachWeekStart: l, resource: f });
2427
2441
  },
2428
- [u, p, d, n, f, c]
2442
+ [u, y, l, n, g, d]
2429
2443
  );
2430
- return a.length ? /* @__PURE__ */ r(Qe, { renderChildren: l }) : l();
2444
+ return a.length ? /* @__PURE__ */ r(Qe, { renderChildren: c }) : c();
2431
2445
  }, Cr = ({ events: e, resource: t }) => {
2432
2446
  const {
2433
2447
  day: n,
@@ -2435,10 +2449,10 @@ const cr = (e) => {
2435
2449
  selectedDate: i,
2436
2450
  translations: s,
2437
2451
  alwaysShowAgendaDays: a,
2438
- stickyNavigationOffset: c,
2439
- stickyNavigationHeight: f
2452
+ stickyNavigationOffset: d,
2453
+ stickyNavigationHeight: g
2440
2454
  } = O(), { headRenderer: u } = n, h = U(() => Ne(e, i), [e, i]);
2441
- return !a && !h.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: c, stickyHeight: f, children: /* @__PURE__ */ E("div", { className: "rs__agenda_row rs__today_cell", children: [
2455
+ return !a && !h.length ? /* @__PURE__ */ r(Ke, {}) : /* @__PURE__ */ r(He, { stickyOffset: d, stickyHeight: g, children: /* @__PURE__ */ E("div", { className: "rs__agenda_row rs__today_cell", children: [
2442
2456
  /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda__cell", children: typeof u == "function" ? /* @__PURE__ */ r("div", { children: u({ day: i, events: e, resource: t }) }) : /* @__PURE__ */ r($, { variant: "body2", children: N(i, "dd E", { locale: o }) }) }),
2443
2457
  /* @__PURE__ */ r("div", { className: "rs__cell rs__agenda_items", children: h.length > 0 ? /* @__PURE__ */ r(Je, { day: i, events: h }) : /* @__PURE__ */ r($, { sx: { padding: 1 }, children: s.noDataToDisplay }) })
2444
2458
  ] }) });
@@ -2451,24 +2465,24 @@ const cr = (e) => {
2451
2465
  getRemoteEvents: i,
2452
2466
  triggerLoading: s,
2453
2467
  handleState: a,
2454
- resources: c,
2455
- resourceFields: f,
2468
+ resources: d,
2469
+ resourceFields: g,
2456
2470
  resourceViewMode: u,
2457
2471
  fields: h,
2458
- direction: _,
2459
- locale: g,
2472
+ direction: v,
2473
+ locale: p,
2460
2474
  hourFormat: w,
2461
- timeZone: d,
2462
- stickyNavigation: p,
2463
- agenda: y,
2464
- stickyNavigationOffset: l,
2465
- stickyNavigationHeight: m,
2475
+ timeZone: l,
2476
+ stickyNavigation: y,
2477
+ agenda: m,
2478
+ stickyNavigationOffset: c,
2479
+ stickyNavigationHeight: f,
2466
2480
  currentTime: k,
2467
2481
  showCurrentTimeBar: C,
2468
2482
  currentTimeBarColor: D,
2469
2483
  forceInlineMultiDay: T,
2470
2484
  _refetchToken: M
2471
- } = O(), { startHour: I, endHour: v, step: b, cellRenderer: S, headRenderer: x, hourRenderer: W } = e, R = xe(t, { hours: I, minutes: 0, seconds: 0 }), V = xe(t, { hours: v, minutes: -b, seconds: 0 }), te = bt(
2485
+ } = O(), { startHour: I, endHour: _, step: b, cellRenderer: S, headRenderer: x, hourRenderer: W } = e, R = xe(t, { hours: I, minutes: 0, seconds: 0 }), V = xe(t, { hours: _, minutes: -b, seconds: 0 }), te = bt(
2472
2486
  {
2473
2487
  start: R,
2474
2488
  end: V
@@ -2497,7 +2511,7 @@ const cr = (e) => {
2497
2511
  const A = Oe(
2498
2512
  F,
2499
2513
  t,
2500
- d,
2514
+ l,
2501
2515
  void 0,
2502
2516
  T
2503
2517
  );
@@ -2525,16 +2539,16 @@ const cr = (e) => {
2525
2539
  }
2526
2540
  );
2527
2541
  },
2528
- [t, d]
2542
+ [t, l]
2529
2543
  ), ge = Z(
2530
2544
  (F) => {
2531
2545
  let A = n;
2532
- if (F && (A = Te(n, F, f, h)), y)
2546
+ if (F && (A = Te(n, F, g, h)), m)
2533
2547
  return /* @__PURE__ */ r(Cr, { resource: F, events: A });
2534
- const H = c.length && u === "default", re = Oe(
2548
+ const H = d.length && u === "default", re = Oe(
2535
2549
  H ? n : A,
2536
2550
  t,
2537
- d,
2551
+ l,
2538
2552
  void 0,
2539
2553
  T
2540
2554
  ), z = pe * re.length + 45;
@@ -2544,9 +2558,9 @@ const cr = (e) => {
2544
2558
  {
2545
2559
  days: 1,
2546
2560
  sticky: "1",
2547
- stickyNavigation: p,
2548
- stickyOffset: l,
2549
- stickyHeight: m,
2561
+ stickyNavigation: y,
2562
+ stickyOffset: c,
2563
+ stickyHeight: f,
2550
2564
  children: [
2551
2565
  /* @__PURE__ */ r("span", { className: "rs__cell" }),
2552
2566
  /* @__PURE__ */ E(
@@ -2555,7 +2569,7 @@ const cr = (e) => {
2555
2569
  className: `rs__cell rs__header ${_e(t) ? "rs__today_cell" : ""}`,
2556
2570
  style: { height: z },
2557
2571
  children: [
2558
- typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: t, events: A, resource: F }) }) : /* @__PURE__ */ r(zt, { date: t, locale: g }),
2572
+ typeof x == "function" ? /* @__PURE__ */ r("div", { children: x({ day: t, events: A, resource: F }) }) : /* @__PURE__ */ r(zt, { date: t, locale: p }),
2559
2573
  fe(A)
2560
2574
  ]
2561
2575
  }
@@ -2564,9 +2578,9 @@ const cr = (e) => {
2564
2578
  }
2565
2579
  ),
2566
2580
  /* @__PURE__ */ r(be, { days: 1, children: te.map((oe, B) => {
2567
- const ce = /* @__PURE__ */ new Date(`${N(t, "yyyy/MM/dd")} ${N(oe, ne)}`), Ce = de(ce, b), Ee = f.idField;
2581
+ const ce = /* @__PURE__ */ new Date(`${N(t, "yyyy/MM/dd")} ${N(oe, ne)}`), Ce = de(ce, b), Ee = g.idField;
2568
2582
  return /* @__PURE__ */ E(ie, { children: [
2569
- /* @__PURE__ */ r("span", { className: "rs__cell rs__header rs__time", style: { height: G }, children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(oe, ne, { locale: g })) }) : /* @__PURE__ */ r($, { variant: "caption", children: N(oe, ne, { locale: g }) }) }),
2583
+ /* @__PURE__ */ r("span", { className: "rs__cell rs__header rs__time", style: { height: G }, children: typeof W == "function" ? /* @__PURE__ */ r("div", { children: W(N(oe, ne, { locale: p })) }) : /* @__PURE__ */ r($, { variant: "caption", children: N(oe, ne, { locale: p }) }) }),
2570
2584
  /* @__PURE__ */ E("span", { className: `rs__cell ${_e(t) ? "rs__today_cell" : ""}`, children: [
2571
2585
  B === 0 && /* @__PURE__ */ r(
2572
2586
  Vt,
@@ -2574,16 +2588,16 @@ const cr = (e) => {
2574
2588
  todayEvents: Ot(
2575
2589
  A,
2576
2590
  t,
2577
- d,
2591
+ l,
2578
2592
  T
2579
2593
  ),
2580
2594
  today: R,
2581
2595
  minuteHeight: ae,
2582
2596
  startHour: I,
2583
- endHour: v,
2597
+ endHour: _,
2584
2598
  step: b,
2585
- direction: _,
2586
- timeZone: d,
2599
+ direction: v,
2600
+ timeZone: l,
2587
2601
  currentTime: k,
2588
2602
  showCurrentTimeBar: C,
2589
2603
  currentTimeBarColor: D
@@ -2610,46 +2624,46 @@ const cr = (e) => {
2610
2624
  G,
2611
2625
  ae,
2612
2626
  R,
2613
- y,
2627
+ m,
2614
2628
  S,
2615
- _,
2616
2629
  v,
2630
+ _,
2617
2631
  n,
2618
2632
  h,
2619
2633
  ne,
2620
2634
  x,
2621
2635
  W,
2622
2636
  te,
2623
- g,
2637
+ p,
2624
2638
  fe,
2625
- f,
2639
+ g,
2626
2640
  u,
2627
- c.length,
2641
+ d.length,
2628
2642
  t,
2629
2643
  I,
2630
2644
  b,
2631
- p,
2632
- d,
2645
+ y,
2646
+ l,
2633
2647
  k,
2634
2648
  C,
2635
2649
  D
2636
2650
  ]
2637
2651
  );
2638
- return c.length ? /* @__PURE__ */ r(Qe, { renderChildren: ge }) : ge();
2652
+ return d.length ? /* @__PURE__ */ r(Qe, { renderChildren: ge }) : ge();
2639
2653
  }, gt = (e) => {
2640
2654
  const t = {};
2641
2655
  let n = 0;
2642
2656
  for (let o = 0; o < e.length; o++) {
2643
2657
  const i = e[o], s = nn({ start: i.start, end: i.end });
2644
2658
  for (let a = 0; a < s.length; a++) {
2645
- const c = N(s[a], "yyyy-MM-dd");
2646
- if (t[c]) {
2647
- const f = Object.values(t[c]);
2648
- for (; f.includes(n); )
2659
+ const d = N(s[a], "yyyy-MM-dd");
2660
+ if (t[d]) {
2661
+ const g = Object.values(t[d]);
2662
+ for (; g.includes(n); )
2649
2663
  n += 1;
2650
- t[c][i.event_id] = n;
2664
+ t[d][i.event_id] = n;
2651
2665
  } else
2652
- t[c] = { [i.event_id]: n };
2666
+ t[d] = { [i.event_id]: n };
2653
2667
  }
2654
2668
  n = 0;
2655
2669
  }
@@ -2657,19 +2671,19 @@ const cr = (e) => {
2657
2671
  }, pt = (e, t, n, o, i) => {
2658
2672
  const s = i === "month" ? Ft(e) : Ae(e), a = {};
2659
2673
  if (t.length)
2660
- for (const c of t) {
2661
- const f = Te(s, c, n, o), u = gt(f);
2662
- a[c[n.idField]] = u;
2674
+ for (const d of t) {
2675
+ const g = Te(s, d, n, o), u = gt(g);
2676
+ a[d[n.idField]] = u;
2663
2677
  }
2664
2678
  else
2665
2679
  a.all = gt(s);
2666
2680
  return a;
2667
2681
  }, Sr = ({ children: e }) => {
2668
- const { events: t, resources: n, resourceFields: o, fields: i, view: s } = O(), [a, c] = L({
2682
+ const { events: t, resources: n, resourceFields: o, fields: i, view: s } = O(), [a, d] = L({
2669
2683
  renderedSlots: pt(t, n, o, i, s)
2670
2684
  });
2671
2685
  K(() => {
2672
- c((u) => ({
2686
+ d((u) => ({
2673
2687
  ...u,
2674
2688
  renderedSlots: pt(
2675
2689
  t,
@@ -2680,19 +2694,19 @@ const cr = (e) => {
2680
2694
  )
2681
2695
  }));
2682
2696
  }, [t, i, o, n, s]);
2683
- const f = (u, h, _, g) => {
2684
- c((w) => {
2685
- var d, p, y, l, m;
2697
+ const g = (u, h, v, p) => {
2698
+ d((w) => {
2699
+ var l, y, m, c, f;
2686
2700
  return {
2687
2701
  ...w,
2688
2702
  renderedSlots: {
2689
2703
  ...w.renderedSlots,
2690
- [g || "all"]: {
2691
- ...(d = w.renderedSlots) == null ? void 0 : d[g || "all"],
2692
- [u]: (y = (p = w.renderedSlots) == null ? void 0 : p[g || "all"]) != null && y[u] ? {
2693
- ...(m = (l = w.renderedSlots) == null ? void 0 : l[g || "all"]) == null ? void 0 : m[u],
2694
- [h]: _
2695
- } : { [h]: _ }
2704
+ [p || "all"]: {
2705
+ ...(l = w.renderedSlots) == null ? void 0 : l[p || "all"],
2706
+ [u]: (m = (y = w.renderedSlots) == null ? void 0 : y[p || "all"]) != null && m[u] ? {
2707
+ ...(f = (c = w.renderedSlots) == null ? void 0 : c[p || "all"]) == null ? void 0 : f[u],
2708
+ [h]: v
2709
+ } : { [h]: v }
2696
2710
  }
2697
2711
  }
2698
2712
  };
@@ -2703,13 +2717,13 @@ const cr = (e) => {
2703
2717
  {
2704
2718
  value: {
2705
2719
  ...a,
2706
- setRenderedSlot: f
2720
+ setRenderedSlot: g
2707
2721
  },
2708
2722
  children: e
2709
2723
  }
2710
2724
  );
2711
2725
  }, Mr = _t(function(t, n) {
2712
- const o = O(), { view: i, dialog: s, loading: a, loadingComponent: c, resourceViewMode: f, resources: u, translations: h } = o, _ = U(() => {
2726
+ const o = O(), { view: i, dialog: s, loading: a, loadingComponent: d, resourceViewMode: g, resources: u, translations: h } = o, v = U(() => {
2713
2727
  switch (i) {
2714
2728
  case "month":
2715
2729
  return /* @__PURE__ */ r(Tr, {});
@@ -2720,35 +2734,35 @@ const cr = (e) => {
2720
2734
  default:
2721
2735
  return "";
2722
2736
  }
2723
- }, [i]), g = U(() => /* @__PURE__ */ r("div", { className: "rs__table_loading", children: c || /* @__PURE__ */ r("div", { className: "rs__table_loading_internal", children: /* @__PURE__ */ E("span", { children: [
2737
+ }, [i]), p = U(() => /* @__PURE__ */ r("div", { className: "rs__table_loading", children: d || /* @__PURE__ */ r("div", { className: "rs__table_loading_internal", children: /* @__PURE__ */ E("span", { children: [
2724
2738
  /* @__PURE__ */ r(St, { size: 50 }),
2725
2739
  /* @__PURE__ */ r($, { align: "center", children: h.loading })
2726
- ] }) }) }), [c, h.loading]);
2740
+ ] }) }) }), [d, h.loading]);
2727
2741
  return /* @__PURE__ */ E(
2728
2742
  er,
2729
2743
  {
2730
2744
  dialog: s ? 1 : 0,
2731
2745
  "data-testid": "rs-wrapper",
2732
2746
  ref: (w) => {
2733
- const d = n;
2734
- d && (d.current = {
2747
+ const l = n;
2748
+ l && (l.current = {
2735
2749
  el: w,
2736
2750
  scheduler: o
2737
2751
  });
2738
2752
  },
2739
2753
  children: [
2740
- a ? g : null,
2754
+ a ? p : null,
2741
2755
  /* @__PURE__ */ r(mr, {}),
2742
2756
  /* @__PURE__ */ r(
2743
2757
  tr,
2744
2758
  {
2745
- resource_count: f === "default" ? u.length : 1,
2759
+ resource_count: g === "default" ? u.length : 1,
2746
2760
  sx: {
2747
- overflowX: f === "default" && u.length > 1 ? "auto" : void 0,
2748
- flexDirection: f === "vertical" ? "column" : void 0
2761
+ overflowX: g === "default" && u.length > 1 ? "auto" : void 0,
2762
+ flexDirection: g === "vertical" ? "column" : void 0
2749
2763
  },
2750
2764
  "data-testid": "grid",
2751
- children: /* @__PURE__ */ r(Sr, { children: _ })
2765
+ children: /* @__PURE__ */ r(Sr, { children: v })
2752
2766
  }
2753
2767
  ),
2754
2768
  s && /* @__PURE__ */ r(wr, {})
@@ -2758,8 +2772,8 @@ const cr = (e) => {
2758
2772
  }), Ir = ({ children: e, initial: t }) => {
2759
2773
  const [n, o] = L({ ...Rt, ...$t(t) });
2760
2774
  K(() => {
2761
- o((d) => ({
2762
- ...d,
2775
+ o((l) => ({
2776
+ ...l,
2763
2777
  onEventDrop: t.onEventDrop,
2764
2778
  customEditor: t.customEditor,
2765
2779
  customHeaderContent: t.customHeaderContent,
@@ -2774,80 +2788,80 @@ const cr = (e) => {
2774
2788
  t.customHeaderContent,
2775
2789
  t.getRemoteEvents
2776
2790
  ]), K(() => {
2777
- typeof t.loading < "u" && o((d) => ({ ...d, loading: t.loading }));
2791
+ typeof t.loading < "u" && o((l) => ({ ...l, loading: t.loading }));
2778
2792
  }, [t.loading]);
2779
- const i = (d, p) => {
2780
- o((y) => ({ ...y, [p]: d }));
2793
+ const i = (l, y) => {
2794
+ o((m) => ({ ...m, [y]: l }));
2781
2795
  }, s = () => Pn(n), a = () => {
2782
- o((d) => {
2783
- const p = !d.agenda;
2784
- return n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(n.view, p), { ...d, agenda: p };
2785
- });
2786
- }, c = (d, p) => {
2787
- const y = p;
2788
2796
  o((l) => {
2789
- var m;
2797
+ const y = !l.agenda;
2798
+ return n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(n.view, y), { ...l, agenda: y };
2799
+ });
2800
+ }, d = (l, y) => {
2801
+ const m = y;
2802
+ o((c) => {
2803
+ var f;
2790
2804
  return {
2791
- ...l,
2792
- dialog: d,
2793
- selectedRange: y != null && y.event_id ? void 0 : y || {
2805
+ ...c,
2806
+ dialog: l,
2807
+ selectedRange: m != null && m.event_id ? void 0 : m || {
2794
2808
  start: /* @__PURE__ */ new Date(),
2795
2809
  end: new Date(Date.now() + 3600 * 1e3)
2796
2810
  },
2797
- selectedEvent: y != null && y.event_id ? y : void 0,
2798
- selectedResource: y == null ? void 0 : y[(m = n.resourceFields) == null ? void 0 : m.idField]
2811
+ selectedEvent: m != null && m.event_id ? m : void 0,
2812
+ selectedResource: m == null ? void 0 : m[(f = n.resourceFields) == null ? void 0 : f.idField]
2799
2813
  };
2800
2814
  });
2801
- }, f = (d) => {
2802
- typeof t.loading > "u" && o((p) => ({ ...p, loading: d }));
2803
- }, u = (d) => {
2804
- const p = s();
2805
- let y;
2806
- p.includes("day") ? (y = "day", o((l) => ({ ...l, view: "day", selectedDate: d }))) : p.includes("week") ? (y = "week", o((l) => ({ ...l, view: "week", selectedDate: d }))) : console.warn("No Day/Week views available"), y && n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(y, n.agenda), y && n.onSelectedDateChange && typeof n.onSelectedDateChange == "function" && n.onSelectedDateChange(d);
2807
- }, h = (d, p) => {
2808
- let y;
2809
- p === "edit" ? Array.isArray(d) ? y = n.events.map((l) => {
2810
- const m = d.find((k) => k.event_id === l.event_id);
2811
- return m ? { ...l, ...m } : l;
2812
- }) : y = n.events.map(
2813
- (l) => l.event_id === d.event_id ? { ...l, ...d } : l
2814
- ) : y = n.events.concat(d), o((l) => ({ ...l, events: y }));
2815
- }, _ = (d) => {
2816
- o((p) => ({ ...p, currentDragged: d }));
2817
- }, g = async (d, p, y, l, m) => {
2818
- var v;
2819
- const k = n.events.find((b) => typeof b.event_id == "number" ? b.event_id === +p : b.event_id === p), C = n.fields.find((b) => b.name === l), D = !!((v = C == null ? void 0 : C.config) != null && v.multiple);
2820
- let T = m;
2815
+ }, g = (l) => {
2816
+ typeof t.loading > "u" && o((y) => ({ ...y, loading: l }));
2817
+ }, u = (l) => {
2818
+ const y = s();
2819
+ let m;
2820
+ y.includes("day") ? (m = "day", o((c) => ({ ...c, view: "day", selectedDate: l }))) : y.includes("week") ? (m = "week", o((c) => ({ ...c, view: "week", selectedDate: l }))) : console.warn("No Day/Week views available"), m && n.onViewChange && typeof n.onViewChange == "function" && n.onViewChange(m, n.agenda), m && n.onSelectedDateChange && typeof n.onSelectedDateChange == "function" && n.onSelectedDateChange(l);
2821
+ }, h = (l, y) => {
2822
+ let m;
2823
+ y === "edit" ? Array.isArray(l) ? m = n.events.map((c) => {
2824
+ const f = l.find((k) => k.event_id === c.event_id);
2825
+ return f ? { ...c, ...f } : c;
2826
+ }) : m = n.events.map(
2827
+ (c) => c.event_id === l.event_id ? { ...c, ...l } : c
2828
+ ) : m = n.events.concat(l), o((c) => ({ ...c, events: m }));
2829
+ }, v = (l) => {
2830
+ o((y) => ({ ...y, currentDragged: l }));
2831
+ }, p = async (l, y, m, c, f) => {
2832
+ var _;
2833
+ const k = n.events.find((b) => typeof b.event_id == "number" ? b.event_id === +y : b.event_id === y), C = n.fields.find((b) => b.name === c), D = !!((_ = C == null ? void 0 : C.config) != null && _.multiple);
2834
+ let T = f;
2821
2835
  if (C) {
2822
- const b = k[l], S = Ge(C, b, k).value;
2836
+ const b = k[c], S = Ge(C, b, k).value;
2823
2837
  if (D)
2824
- if (S.includes(m)) {
2825
- if (at(k.start, y))
2838
+ if (S.includes(f)) {
2839
+ if (at(k.start, m))
2826
2840
  return;
2827
2841
  T = S;
2828
2842
  } else
2829
- T = S.length > 1 ? [...S, m] : [m];
2843
+ T = S.length > 1 ? [...S, f] : [f];
2830
2844
  }
2831
- if (at(k.start, y) && (!T || !D && T === k[l]))
2845
+ if (at(k.start, m) && (!T || !D && T === k[c]))
2832
2846
  return;
2833
2847
  const M = $e(k.end, k.start), I = {
2834
2848
  ...k,
2835
- start: y,
2836
- end: de(y, M),
2849
+ start: m,
2850
+ end: de(m, M),
2837
2851
  recurring: void 0,
2838
- [l]: T || ""
2852
+ [c]: T || ""
2839
2853
  };
2840
2854
  if (!n.onEventDrop || typeof n.onEventDrop != "function")
2841
2855
  return h(I, "edit");
2842
2856
  try {
2843
- f(!0);
2844
- const b = await n.onEventDrop(d, y, I, k);
2857
+ g(!0);
2858
+ const b = await n.onEventDrop(l, m, I, k);
2845
2859
  b && h(b, "edit");
2846
2860
  } finally {
2847
- f(!1);
2861
+ g(!1);
2848
2862
  }
2849
2863
  }, w = () => {
2850
- t.getRemoteEvents && o((d) => ({ ...d, _refetchToken: d._refetchToken + 1 }));
2864
+ t.getRemoteEvents && o((l) => ({ ...l, _refetchToken: l._refetchToken + 1 }));
2851
2865
  };
2852
2866
  return /* @__PURE__ */ r(
2853
2867
  At.Provider,
@@ -2857,12 +2871,12 @@ const cr = (e) => {
2857
2871
  handleState: i,
2858
2872
  getViews: s,
2859
2873
  toggleAgenda: a,
2860
- triggerDialog: c,
2861
- triggerLoading: f,
2874
+ triggerDialog: d,
2875
+ triggerLoading: g,
2862
2876
  handleGotoDay: u,
2863
2877
  confirmEvent: h,
2864
- setCurrentDragged: _,
2865
- onDrop: g,
2878
+ setCurrentDragged: v,
2879
+ onDrop: p,
2866
2880
  refetch: w
2867
2881
  },
2868
2882
  children: e